Skip to content

Commit

Permalink
Add docs for multitenancy support in the metrics-generator (grafana#4481
Browse files Browse the repository at this point in the history
)

Signed-off-by: Mario <mariorvinas@gmail.com>
  • Loading branch information
mapno authored Jan 3, 2025
1 parent c34cf3a commit 1f40321
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/sources/tempo/metrics-generator/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,8 @@ If you want to enable metrics-generator for your Grafana Cloud account, refer to

Enabling metrics generation and remote writing them to Grafana Cloud Metrics produces extra active series that could impact your billing.
For more information on billing, refer to [Billing and usage](/docs/grafana-cloud/billing-and-usage/).

## Multitenancy

Tempo supports multitenancy in the metrics-generator through the use of environment variables and per-tenant overrides.
Refer to the [Multitenant Support for Metrics-Generator]({{< relref "multitenancy" >}}) documentation for more information.
48 changes: 48 additions & 0 deletions docs/sources/tempo/metrics-generator/multitenancy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
aliases:
- /docs/tempo/latest/metrics-generator/multitenancy
title: Multitenancy support
description: Learn about multitenancy support in the metrics-generator.
weight: 600
---

# Multitenancy support

Multitenancy is supported in the metrics-generator through the use of environment variables and per-tenant overrides.
This is useful when you want to propagate the multitenancy to the metrics backend,
keeping the data separated and secure.

## Requirements

- Tempo version 2.4.0 or later

## Usage

To use this feature, you need to define the `remote_write_headers` override for each tenant in your configuration.
You can also use environment variables in your configuration file, which will be expanded at runtime.
To make use of environment variables, you need to pass the `--config.expand-env` flag to Tempo.

Example:

```yaml
overrides:
team-traces-a:
metrics_generator:
processors: [ 'span-metrics' ]
remote_write_headers:
Authorization: ${PROM_A_BASIC_AUTH}
team-traces-b:
metrics_generator:
processors: [ 'span-metrics', 'service-graphs' ]
remote_write_headers:
Authorization: ${PROM_B_BEARER_AUTH}
```
```bash
export PROM_A_BASIC_AUTH="Basic $(echo "team-a:$(cat /token-prometheus-a)"|base64|tr -d '[:space:]')"
export PROM_B_BEARER_AUTH="Bearer $(cat /token-prometheus-b)"
```

In this example, `PROM_A_BASIC_AUTH` and `PROM_B_BEARER_AUTH` are environment variables that contain the respective tenants' authorization tokens.
The `remote_write_headers` override is used to specify the `Authorization` header for each tenant.
The `Authorization` header is used to authenticate the remote write request to the Prometheus remote write endpoint.

0 comments on commit 1f40321

Please sign in to comment.