Adds a filter.

        :param methods: The HTTP methods to be filtered.
        :param endpoints: The endpoints to be filtered.
        :return Filter: The filter added.

def add_filter(self, methods=None, endpoints=None):
        """
        Adds a filter.

        :param methods: The HTTP methods to be filtered.
        :param endpoints: The endpoints to be filtered.
        :return Filter: The filter added.
        """
        if not methods and not endpoints:
            raise ValueError('Filter cannot be added with no criteria.')

        filter = TraceFilter(methods, endpoints)
        self.filters.append(filter)
        return filter