|docs
Start Trial

For AI agents and assistants: visit https://docs.pagerduty.com/llms.txt for the index.

Workflow Actions

Grafana: Query Trace Metrics

Runs a TraceQL metrics query against a Grafana Tempo datasource, either as an instant evaluation or a range query over a time window.

View as Markdown

Availability

See the Incident Workflow Actions Overview table for the plans this workflow is available on.

Description

Execute a TraceQL metrics query, such as rate(), count_over_time(), or quantile_over_time(), against a Grafana Tempo datasource. Use this action to compute request rates, error rates, or latency percentiles from trace data during incident response.

Instructions

  1. If you have not done so, follow the instructions to Create an Incident Workflow.
  2. When the instructions prompt you to add actions, select this action.
  3. Enter the following Inputs and click Save.
  4. Continue following instructions to Publish the Workflow.
  5. When the action runs, you will see the Outputs listed below.

Inputs

Field References

Fields with the {+} icon accept Field References, which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click {+}, or enter {{, and select relevant fields. Refer to the Field References article for more information.

NameDescription
Connection InputThe Grafana Connection to use.
DatasourceThe Tempo datasource UID to query.
QueryThe TraceQL metrics query. For example, { resource.service.name = "checkout" } | rate() by (span.http.route).
Query Type
(Optional)
Instant (Single Value) returns one value per series for the whole window; Range (Time Series) returns a time series across it. Defaults to Range (Time Series).
Start Time
(Optional)
The start of the query window, as a listed relative choice (5m to 1d) or an ISO 8601 date. Defaults to 1h (Past 1 Hour).
End Time
(Optional)
The end of the query window, as Now, a listed relative choice (5m to 12h), or an ISO 8601 date. Defaults to Now.
Step
(Optional)
Resolution step for Range queries, for example 30s, 1m, or 5m. Leave empty to let Tempo choose. Ignored for Instant queries.
Max Series
(Optional)
Maximum number of series to return, from 1 to 1000. Defaults to 100.

Outputs

NameDescription
ResultsArray of series, each with labels and either an array of {timestamp, value} data points (Range) or a single value (Instant).
Series CountTotal number of series Tempo returned.
Total Data PointsNumber of data points across the returned series.
TruncatedWhether Tempo returned more series than Max Series.
Query UsedThe TraceQL metrics query that was sent to Tempo.
Query Type Usedinstant or range.
Time Range StartThe start of the query window, in ISO 8601 format.
Time Range EndThe end of the query window, in ISO 8601 format.
ResultValue that shows if the action was successful or not. Either Success or Failed.
Result SummaryBrief description of what the action did or if it failed.
ErrorBrief description that is populated if the action failed.