label_values
List distinct values for a label in Loki over a specified time window, helping you build exact selectors for log queries. Returns raw JSON and is read-only.
Instructions
List the values a single label takes in Loki over a time window.
Use it after labels to fill in a selector: labels says "app" exists, label_values with label="app" says which apps are actually logging, and one of those goes into {app="..."} for query_range. Only values seen inside the window are returned, so widening start/end surfaces more.
Returns the raw Loki JSON response: {"status","data":["value","list"]}. An unknown label name is not an error; it comes back as an empty list. Read-only: it never writes to or mutates Loki.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | End of the time range, RFC3339 or Unix nanoseconds. Defaults to now. | |
| label | Yes | Label name to look up, as returned by the labels tool (e.g. app, namespace, level). Must match ^[a-zA-Z_][a-zA-Z0-9_]*$. | |
| start | No | Start of the time range, RFC3339 (2026-03-25T10:00:00Z) or Unix nanoseconds. Defaults to 6 hours ago. |