Guide to drop metrics

The filter processor in OpenTelemetry allows you to drop metrics based on their name, label values, or other attributes. This is useful if you want to exclude certain metrics from being sent to SigNoz.

The filter processor is configured in the processors::filter section of the otel-collector-config.yaml file.

📝 Note

The processor needs to be added to the metrics pipeline to take effect.

metrics:
  receivers: [otlp]
  processors: [filter/drop_metrics_by_name, batch]
  exporters: [otlp]
  1. Drop metrics by name
processors:
  filter/drop_metrics_by_name:
    metrics:
      exclude:
        match_type: strict
        metric_names:
          - http.client.request.body.size
          - http.client.response.body.size
  1. Drop metrics by name regex
processors:
  filter/drop_metrics_by_name_regex:
    metrics:
      exclude:
        match_type: regexp
        metric_names:
          - http.client.*
  1. Drop metrics by resource attributes (like service.name, host.name, k8s.pod.name, etc.)
processors:
  filter/drop_metrics_by_label_values:
    metrics:
      metric:
        - resource.attributes["k8s.pod.name"] == "test-pod"
  1. Drop metrics by resource attributes regex
processors:
  filter/drop_metrics_by_label_values_regex:
    metrics:
      metric:
        - IsMatch(resource.attributes["k8s.pod.name"], "test-pod-.*")
  1. Drop metrics by metric attributes (like http.method, message.operation, etc.)
processors:
  filter/drop_metrics_by_label_values:
    metrics:
      datapoint:
        - attributes["http.method"] == "GET"
  1. Drop metrics by metric attributes regex
processors:
  filter/drop_metrics_by_label_values_regex:
    metrics:
      datapoint:
        - IsMatch(attributes["http.method"], "GET|POST")

Refer to the OpenTelemetry documentation for more details on how to configure the filter processor.

Get Help

If you need help with the steps in this topic, please reach out to us on SigNoz Community Slack.

If you are a SigNoz Cloud user, please use in product chat support located at the bottom right corner of your SigNoz instance or contact us at cloud-support@signoz.io.

Was this page helpful?

On this page