From d7ec6a96faa340b6ade5d8f962300c0368d3a3a9 Mon Sep 17 00:00:00 2001 From: Mikhail Aksenov Date: Thu, 9 Nov 2023 16:20:04 +0100 Subject: [PATCH] docs: add a tenant example to prometheus.remote_write.md (#5737) * Add a tenant example to prometheus.remote_write.md This commit adds an example for pushing the metrics to a multi-tenant Mimir instance with non-default tenant. It could be useful for people who have less experience with multi-tenant Mimir, but would like to have a clear example how to use recommended way for ingestion there. * Update docs/sources/flow/reference/components/prometheus.remote_write.md Add a missing article. Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> * formatting + more generic Mimir url in the snippet * A minor nit Co-authored-by: Mischa Thompson --------- Co-authored-by: Clayton Cornell <131809008+clayton-cornell@users.noreply.github.com> Co-authored-by: Mischa Thompson (cherry picked from commit 1caf600fbf7349ba7ae4b248d852896182029bb4) --- .../components/prometheus.remote_write.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/sources/flow/reference/components/prometheus.remote_write.md b/docs/sources/flow/reference/components/prometheus.remote_write.md index 1b8243304d07..2687456a06e8 100644 --- a/docs/sources/flow/reference/components/prometheus.remote_write.md +++ b/docs/sources/flow/reference/components/prometheus.remote_write.md @@ -341,6 +341,24 @@ prometheus.scrape "demo" { } ``` + +### Send metrics to a Mimir instance with a tenant specified + +You can create a `prometheus.remote_write` component that sends your metrics to a specific tenant within the Mimir instance. This is useful when your Mimir instance is using more than one tenant: + +```river +prometheus.remote_write "staging" { + // Send metrics to a Mimir instance + endpoint { + url = "http://mimir:9009/api/v1/push" + + headers = { + "X-Scope-OrgID" = "staging" + } + } +} +``` + ### Send metrics to a managed service You can create a `prometheus.remote_write` component that sends your metrics to a managed service, for example, Grafana Cloud. The Prometheus username and the Grafana Cloud API Key are injected in this example through environment variables.