Grafana Loki
Official documentation: Grafana Loki API docs
Authentication
Grafana Loki uses API key authentication.
- Go to the Connections page and create a New Connection
- Select Grafana Loki API from the Connector dropdown
- Enter a Connection name
- Fill in the following credentials:
| Field | Required |
|---|---|
| Base Url | ✅ |
| User Name | ✅ |
| Password | ✅ |
Endpoints
Query Range (API docs)
Execute a LogQL query over a time range to retrieve log entries from Grafana Loki.
| Parameter | Description | Required |
|---|---|---|
query |
A LogQL query expression (e.g. {app="myapp"} | = "error"). |
start |
Start of the time range (RFC3339 or Unix timestamp) (format: RFC 3339 or Unix timestamp (e.g. 2024-01-01T00:00:00Z)). |
✅ |
end |
End of the time range (RFC3339 or Unix timestamp). Defaults to now (format: RFC 3339 or Unix timestamp). |
— |
step |
Query resolution step width in seconds or duration format (e.g. 5m). | — |
direction |
Sort order of log entries. Values: forward, backward |
— |
Returned Data
Schema depends on the query. All fields from the API response are flattened into columns.
| Column | Type |
|---|---|
metric |
json |
value |
json |