Skip to content

Commit

Permalink
reword and fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
electron0zero committed Dec 14, 2023
1 parent f498b11 commit 54644a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
35 changes: 5 additions & 30 deletions docs/sources/tempo/operations/cross_tenant_query.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,16 @@ You need to enable `multitenancy_enabled: true` in the cluster for multi-tenant
see [enable multi-tenancy]({{< relref "./multitenancy" >}}) for more details and implications of `multitenancy_enabled: true`.
{{% /admonition %}}

Tempo supports multi-tenant queries. where users can send list of tenants multiple tenants.
Tempo supports multi-tenant queries for search, search-tags and trace-by-id search operations.

The tenant IDs involved need to be specified separated by a '|' character in the 'X-Scope-OrgID' header.
To perform multi-tenant queries, send tenant IDs separated by a `|` character in the `X-Scope-OrgID` header, for e.g: `foo|bar`.

cross-tenant query is enabled by default, and can be controlled using `multi_tenant_queries_enabled` config.
By default, Cross-tenant query is enabled and can be controlled using `multi_tenant_queries_enabled` configuration setting.

```yaml
query_frontend:
multi_tenant_queries_enabled: true
```
### Use cross-tenant query federation
To submit a query across all tenants that your access policy has access rights to, you need to configure tempo datasource.
Update Tempo datasource to send `X-Scope-OrgID` header with values of tenants separated by `|` e.g. `test|test1`, and query the tempo like you already do.

<p align="center"><img src="../header_ds.png" alt="X-Scope-OrgID Headers in Datasource"></p>

If you are provisioning tempo datasource via Grafana Provisioning, you can configure `x-scope-orgid` header like this:

```yaml
jsonData:
httpHeaderName1: 'x-scope-orgid'
secureJsonData:
httpHeaderValue1: 'test|test1'
```

> NOTE: for streaming search, header `x-scope-orgid` needs to be lowercase.

Queries are performed using the cross-tenant configured data source in either **Explore** or inside of dashboards are performed across all the tenants that you specified in the **X-Scope-OrgID** header.

These queries are processed as if all the data were in a single tenant.

Tempo will inject `tenant` resource in the responses to show which tenant the trace came from:

<p align="center"><img src="../multi_tenant_trace.png" alt="tenant resource attribute in response trace"></p>

Queries performed using the cross-tenant configured data source, in either **Explore** or inside of dashboards,
are performed across all the tenants that you specified in the **X-Scope-OrgID** header.
Binary file removed docs/sources/tempo/operations/header_ds.png
Binary file not shown.
Binary file removed docs/sources/tempo/operations/multi_tenant_trace.png
Binary file not shown.

0 comments on commit 54644a9

Please sign in to comment.