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.
Availability
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
- If you have not done so, follow the instructions to Create an Incident Workflow.
- When the instructions prompt you to add actions, select this action.
- Enter the following Inputs and click Save.
- Continue following instructions to Publish the Workflow.
- 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.
| Name | Description |
|---|---|
| Connection Input | The Grafana Connection to use. |
| Datasource | The Tempo datasource UID to query. |
| Query | The 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
| Name | Description |
|---|---|
| Results | Array of series, each with labels and either an array of {timestamp, value} data points (Range) or a single value (Instant). |
| Series Count | Total number of series Tempo returned. |
| Total Data Points | Number of data points across the returned series. |
| Truncated | Whether Tempo returned more series than Max Series. |
| Query Used | The TraceQL metrics query that was sent to Tempo. |
| Query Type Used | instant or range. |
| Time Range Start | The start of the query window, in ISO 8601 format. |
| Time Range End | The end of the query window, in ISO 8601 format. |
| Result | Value that shows if the action was successful or not. Either Success or Failed. |
| Result Summary | Brief description of what the action did or if it failed. |
| Error | Brief description that is populated if the action failed. |