labels
Discover which label names exist in a Loki time window when the log schema is unknown. Use them to build valid selectors for LogQL queries; only streams with data in the window contribute.
Instructions
List the label names Loki knows about in a time window.
Start here when the log schema is unknown: labels gives the names (app, namespace, level), then label_values gives the values for one of them, and together they let you write a valid selector for query_range. Only labels present on streams that received data inside the window are returned, so widening start/end surfaces more.
Returns the raw Loki JSON response: {"status","data":["label","names"]}. 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. | |
| start | No | Start of the time range, RFC3339 (2026-03-25T10:00:00Z) or Unix nanoseconds. Defaults to 6 hours ago. |