Document multi-tenant queries. (#5994)

* Document multi-tenant queries.

* Update docs/sources/operations/multi-tenancy.md

Co-authored-by: Aleksey <a.alexey.lazarev@gmail.com>

* Update docs/sources/operations/multi-tenancy.md

Co-authored-by: JordanRushing <rushing.jordan@gmail.com>

* Update docs/sources/operations/multi-tenancy.md

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

* Update docs/sources/operations/multi-tenancy.md

Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>

Co-authored-by: Aleksey <a.alexey.lazarev@gmail.com>
Co-authored-by: JordanRushing <rushing.jordan@gmail.com>
Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com>
pull/6294/head
Karsten Jeschkies 4 years ago committed by GitHub
parent 4c3e276679
commit ff5ce4e129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      docs/sources/operations/multi-tenancy.md

@ -17,3 +17,19 @@ To run in multi-tenant mode, Loki should be started with `auth_enabled: true`.
Loki can be run in "single-tenant" mode where the `X-Scope-OrgID` header is not
required. In single-tenant mode, the tenant ID defaults to `fake`.
## Multi-tenant Queries
If run in multi-tenant mode, queries that gather results from multiple tenants can be enabled with
the `multi_tenant_queries_enabled: true` configuration option in the querier. Once enabled, multiple
tenant IDs can be defined in the HTTP header `X-Scope-OrgID` by concatenating them
with `|`. For instance a query for tenant A and B can set `X-Scope-OrgID: A|B`.
Only query endpoints support multi-tenant calls. Calls to `GET /loki/api/v1/tail`
and `POST /loki/api/v1/push` will return an HTTP 400 error if more than one tenant
is defined in the HTTP header.
Instant and range queries support label filtering on the tenant IDs. For example
`{app="foo", __tenant_id__=~"a.+"} | logfmt` will return results for all tenants
whose ID start with `a`. Tenant ID filtering in stages is not supported; `{app="foo"} | __tenant_id__="1" | logfmt` will not work.
In case the label `__tenant_id__` is already present in a log stream it is prepended with `original_`.

Loading…
Cancel
Save