Trace Metrics
Trace metrics are metrics, such as request counts, error counts, and latency distributions, that Datadog APM calculates from spans. They start being collected when you enable trace collection, and they underlie the graphs on the service page, monitors, and SLOs.
Overview
Trace metrics are APM-specific metrics created by counting the spans sent by instrumented applications and summarizing their durations. Their names begin with trace., and they hold counts, errors, latency distributions, and Apdex values. This is the concept to keep in mind when questions arise such as where the numbers on the service page come from, whether counts also drop if you sample traces, and whether you can split the numbers by tags attached to spans. Knowing the underlying names and tags before building APM monitors and SLOs reduces confusion.
The numbers on the service page are created from spans
When you enable trace collection and instrument an application, Datadog calculates request counts, error counts, and latency distributions from spans and turns them into metrics (as of October 2026; Source: Trace Metrics). These are trace metrics, and like ordinary metrics they can be used as material for dashboards, monitors, and SLOs. Their role is to let you notice rising errors and growing latency at the level of a service or endpoint without opening individual traces one by one. The structure of the underlying Span and how to read a single trace are left to the explanation of spans.
The name contains the operation name, not the service name
The name takes the form trace.<SPAN_NAME>.<SUFFIX>, and SPAN_NAME is the operation name of the span (span.name). Examples in the official documentation are rails.request and mysql.query, and the service name is carried not in the name but in the service tag. They are created from the entry spans of a service and from certain operations determined by each language integration. In the Django integration, in addition to the root span of the request, they are also created from the span for each middleware and the span for the view (as of October 2026; Source: Trace Metrics). Suffixes include hits for counts, errors for errors, and apdex for web services, and how the score is determined is summarized in Apdex.
Only a fixed set of tags can be used to split them
There is a limit to the kinds of tags that can be attached to trace metrics. What can be used includes env, service, version, resource, the HTTP status code, host tags attached by the Agent, and additional primary tags. The gRPC status code tag is attached with Agent v7.65.0 or later. Other tags attached to spans cannot be used as tags on trace metrics (as of October 2026; Source: Trace Metrics). Even if you attach customer or feature names to span tags, you cannot split trace metrics by those values. The mechanism for finding and reading individual spans by conditions belongs to the side of Indexed Spans.
Read latency from the distribution name without a suffix
The premise that counts do not thin out even when sampling is applied, and the configurations in which that premise breaks, are summarized in the explanation of Sampling. When sampling with the OpenTelemetry Collector, the official example places the span_metrics connector before sampling processing such as tail_sampling. In an existing configuration, the Datadog Connector gives the same result. The name to use for latency graphs is trace.<SPAN_NAME> without a suffix (as of October 2026; Source: Trace Metrics).
| Metric name | What it represents | Type |
|---|---|---|
trace.<SPAN_NAME>.hits | The number of spans with that name | COUNT |
trace.<SPAN_NAME>.errors | The number of spans that resulted in errors | COUNT |
trace.<SPAN_NAME> | The latency distribution | DISTRIBUTION |
trace.<SPAN_NAME>.apdex | The Apdex value of a web service | GAUGE |
trace.<SPAN_NAME>.duration | The legacy duration (kept for compatibility) | GAUGE |
.by_http_status broken down by HTTP status code)Datadog strongly recommends the distribution type over the legacy duration because it can calculate percentiles more accurately, and duration does not support percentile aggregation. Duration is the total duration of spans within a given time, and it also includes the time of child spans seen in that service. For average latency filtered by host tags, the official documentation gives a formula that divides the sum of duration by the sum of hits.
Settle on one entry span name and look at it
When one service emits multiple operation names, as in the Django example, the spans being counted change depending on which name you look at. As one way to proceed, for a service instrumented with APM, you can list the names of metrics beginning with trace. filtered by the service tag. Once you know the operation name that corresponds to the entry point of requests, you can cross-check whether the count graphs and monitors are looking at the same name.