Grafana: List Labels
grafana_list_labelsList label names or values for Prometheus and Loki datasources, filtered by selector and time window, to discover what metrics or streams you can query.
Instructions
Discover what to query, for a Prometheus or Loki datasource: with no label, the label names in use; with label, the values it takes (label=name lists Prometheus metric names). Restrict with selector to the series or streams that matter, e.g. the pods of one namespace. Looks at the last hour unless start is given — the datasource default is its whole retention, which returns everything that ever existed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Window end: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds/ms. Defaults to now. | |
| label | No | A label name, e.g. "namespace", or "__name__" for Prometheus metric names. Omit to list label names. | |
| limit | No | Maximum values (1-10000). Defaults to 500. | |
| start | No | Window start: now, now-1h, -30m, an RFC3339 timestamp (2026-01-31T12:00:00Z) or unix seconds/ms. Defaults to now-1h. | |
| search | No | Case-insensitive substring to filter by, e.g. `nginx`. | |
| selector | No | A series or stream selector to restrict to, e.g. `{namespace="monitoring"}` or, for Prometheus, a metric name like `kube_pod_info`. A selector only, no functions. | |
| datasource | No | Datasource uid or name, e.g. "prometheus" or "Loki". Defaults to the default datasource. grafana_list_datasources lists them. |