loki
How to get these credentialsConnection to a Grafana Loki HTTP API (self-hosted Loki, Grafana Cloud Logs, or a Loki-compatible gateway).
CREATE SECRET loki (
TYPE loki,
base_url '<base_url>',
bearer_token '<BEARER_TOKEN>', -- secret
username '<username>',
password '<LOKI_PASSWORD>', -- secret
tenant_id '<tenant_id>',
extra_headers '<LOKI_EXTRA_HEADERS>' -- secret
);
| Key | Type | Required | Description |
|---|---|---|---|
| base_url | VARCHAR | — | Server root, e.g. 'http://loki:3100' or 'https://logs-prod-012.grafana.net'. /loki/api/v1/... is appended. |
| bearer_token secret | VARCHAR | — | Token sent as 'Authorization: Bearer <token>'. |
| username | VARCHAR | — | Basic-auth user name (Grafana Cloud Logs: the numeric instance id). |
| password secret | VARCHAR | — | Basic-auth password (Grafana Cloud: an access-policy token with logs:read). |
| tenant_id | VARCHAR | — | Tenant sent as the X-Scope-OrgID header (multi-tenant Loki). |
| extra_headers secret | VARCHAR | — | Additional request headers as a JSON object, e.g. '{"X-Custom": "v"}'. |
The worker doesn't mark which keys are required.
Needed by alertsbuild_infodetected_fieldsdetected_labelsformat_queryindex_statslabel_valueslabelslogspatternsqueryquery_range and 3 more functions