Metrics filtering - combine namepass and tagpass

This is possible using processors, as long as you can define a set of selectors to pick the records you want to drop. Note also that removing all the fields from a metric will drop the entire metric, and you can use this to your advantage:

[[inputs.sqlserver]]

  {...plugin config...}

[[processors.override]] # placeholder for tag directives
  order = 1 # order is important for chaining processors

  # in processors selectors affect whether the processor considers the metric, 
  # not whether it drops or keeps the metric.
  
  # only consider this metric name for this rule
  namepass = ["sql_server_requests"] 
  
  fielddrop = ["*"] # remove all fields to drop the metric

  # tagpass must be last
  [processors.override.tagpass] 
    # consider only metrics that match this tag rule
    database_name = "Northwind"
1 Like