code: def add_filter(self, methods=None, endpoints=None):
          
          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
docs: Adds a filter.
  
          :param methods: The HTTP methods to be filtered.
          :param endpoints: The endpoints to be filtered.
          :return Filter: The filter added.