Grafana: List Metrics
AvailabilitySee the Incident Workflow Actions Overview table for the plans this workflow is available on.
Description
List available Prometheus metric names from a Grafana datasource, optionally scoped by a series selector and lookback window. This action enables incident responders to discover relevant metrics during an active incident without leaving the workflow, making it easier to identify which metrics to query next.
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 ReferencesFields 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 Prometheus datasource UID to discover metrics from. |
| Match (Optional) | PromQL series selector to scope results. Example: {job="api"} or {namespace="prod"}. |
| Time Window (Optional) | Lookback window for discovery; metric names are scoped to series active within it. |
Outputs
| Name | Description |
|---|---|
| Metric Names | Array of metric name strings. |
| Metric Count | Number of metric names returned. |
| 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. |
Scoping discoveryUse Match with a PromQL series selector, for example,
{job="api"}or{namespace="prod"}, to narrow results to a specific service or environment, and Time Window to avoid returning stale or inactive metric names.
