prometheus_list_metrics
List all Prometheus metric names, filtered by an optional substring, to discover valid metrics before running PromQL queries.
Instructions
List all metric names known to Prometheus, with optional substring filter.
Wraps GET /api/v1/label/__name__/values. Prometheus returns all metric
names at once — no pagination. Output is capped at 500 metrics after filtering,
with a truncation hint when more exist.
Use this first to discover valid metric names before writing PromQL
expressions for prometheus_query or prometheus_query_range.
Examples:
- Use when: "What metrics does Prometheus have about HTTP requests?"
→ pattern='http'; read the metrics list.
- Use when: "List all node_exporter metrics"
→ pattern='node_'.
- Use when: Starting a monitoring investigation — list metrics first
to discover what's instrumented, then query specific ones.
- Don't use when: You already know the exact metric name and want to
query its value (call prometheus_query directly — one fewer round trip).
- Don't use when: You want to see current alert state
(call prometheus_list_alerts).
Returns:
dict with total_count / returned_count / truncated /
pattern / metrics (sorted list).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | No | Optional substring filter applied case-insensitively to metric names. Example: 'http' returns all metrics containing 'http' in their name. Leave empty to list all metrics (capped at 500). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total_count | Yes | ||
| returned_count | Yes | ||
| truncated | Yes | ||
| pattern | Yes | ||
| metrics | Yes |