This product is not supported for your selected Datadog site. ().

Overview

Use this processor to include or exclude specific tags in your metrics. Tags that are excluded or not included are dropped and may reduce your outbound metrics tag volume.

The following tags can’t be dropped because they provide specific platform functionality:

  • host
  • service
  • ddsource
  • function_arn
  • datadog_
  • _dd.*

Setup

To set up the processor:

Click Add tag rule.

  • If you haven’t added any rules yet, enter the rule details as described in the Add a tag rule section to create a rule.
  • If you have already added rules, you can:
    • Click on a rule in the table to edit or delete it.
    • Use the search bar to find a specific rule by rule query, tag rule type, or tags applied and then select the metric to edit or delete it.
    • Click New Tag Rule to add a rule.

Add a tag rule

The tag control settings panel
  1. Define a filter query. Only matching metrics are processed by this processor, but all metrics continue to the next step in the pipeline. See Filter query syntax for more information.
  2. In the Configure tags section, choose whether to Include tags or Exclude tags.
  3. Optionally, input a sample tags object to help you select the tags you want to include or exclude in the next step.
    • The supported input formats are {"key1":"value1", "key2":"value2"}.
    • See Define Tags for more information about the key:value format.
  4. If you provided a tag array in the previous step, select the tag keys you want to configure in the dropdown menu. You can also manually add tag keys.
    • Note: You can select up to 15 tags.
  5. Click Save.

Filter query syntax

Each processor has a corresponding filter query in their fields. Processors only process metrics that match their filter query. And for all processors except the Filter processor, metrics that do not match the query are sent to the next step of the pipeline. For the Filter processor, metrics that do not match the query are dropped.

The following are metrics filter query examples:

  • NOT system.cpu.user: This filters for metrics that do not have the field name:system.cpu.user.
  • system.cpu.user OR system.cpu.user.total: This filter query only matches metrics that have either name:system.cpu.user or name:system.cpu.user.total.
  • tags:(env\:prod OR env\:test): This filters for metrics with env:prod or env:test in tags.

Learn more about writing metrics filter queries in Observability Pipelines Metrics Search Syntax.