There are several dimensions available to scope an entire Datadog APM application. These include aggregate statistics (such as requests/second, latency, error rate, Apdex score) and visible traces. These dimensions are set up through primary tags that allow you to get an even finer view of your application’s behavior. Use cases for primary tags include environment, availability zone, datacenter, etc.
Primary tags must follow a different set of rules from those of conventional Datadog tags.
The default and mandatory primary tag is the environment your traces are collected from. Its tag key is
env, and its default value for un-tagged data is
There are several ways to specify an environment when reporting data:
Use a host tag with the format
env:<ENVIRONMENT> to tag all traces from that Agent accordingly.
Agent configuration: Override the default tag used by the Agent in the Agent configuration file. This tags all traces coming through the Agent, overriding the host tag value.
apm_config: env: <ENVIRONMENT>
When submitting a single trace, specify an environment by tagging one of its spans with the metadata key
env. This overrides the Agent configuration and the host tag’s value (if any). Consult the trace tagging documentation to learn how to assign a tag to your traces.
Environments appear at the top of APM pages. Use the dropdown to scope the data displayed on the current page.
If you added a host tag other than
env:<ENVIRONMENT> to your traces, it can be set as a primary tag along with the environment tag. Go to the APM Settings page to define, change, or remove your primary tags.
If you change a previously set primary tag, be aware of the following:
Primary tags appear at the top of APM pages. Use these selectors to slice the data displayed on the current page. To view all data independent of a primary tag, choose
<TAG_NAME>:* from the dropdown (as in the image below).
Additional helpful documentation, links, and articles: