Metrics summary API and the Aggregate by feature are deprecated in Grafana Cloud and Grafana 11.3 and later.
It will be removed in a future release.
This document explains how to use the metrics summary API in Grafana Cloud Traces.
This API returns RED metrics (span count, erroring span count, and latency information) for kind=server spans sent to Grafana Cloud Traces in the last hour, grouped by a user-specified attribute.
Activate metrics summary
The Metrics summary API is an experimental feature that is disabled by default.
To enable it, contact Grafana Support.
Request
To make a request to this API, use the following URL:
https://$URL/api/metrics/summary
Example:
GET https://tempo-dedicated-02-prod-us-central-0.grafana.net/tempo/api/metrics/summary
To get the value of $URL:
Go to grafana.com.
Select Details for your stack.
Select Details for your Tempo tracing service.
Use the value under URL in the Grafana Data Source settings.
Authentication
The API uses HTTP basic authentication.
For your username, use the User value in the Grafana Data Source settings.
For your password, use a Cloud Access Policy token.
Create an access policy with the traces:read scope and then create a token for that access policy. Use the token as your password.
For more information on how to do this, refer to Create a Cloud Access Policy.
Example:
GET -u "$USER:$PASSWORD" "$URL/api/metrics/summary"
Replace $USER, $PASSWORD, and $URL with the values for your username, password, and URL.
Query parameters
All query parameters must be URL-encoded to preserve non-URL-safe characters in the query such as &.
Number of spans with status=error. (This field will not be present if the value is 0.)
.series
The unique values for this group. A key/value pair will be returned for each entry in groupBy.
.key
Key name.
.value
Value with TraceQL underlying type.
.type
Data type enum defined here (This field will not be present if the value is 0.) 0 = nil 3 = integer 4 = float 5 = string 6 = bool 7 = duration 8 = span status 9 = span kind