{"repo":"blind-oracle/cortex-tenant","free":true,"listed":false,"github":"https://github.com/blind-oracle/cortex-tenant","clone":"git clone https://github.com/blind-oracle/cortex-tenant.git","description":"Prometheus remote write proxy that adds Cortex/Mimir tenant ID based on metric labels","language":"Go","stars":140,"topics":["cortex","tenant","proxy","prometheus","metrics","labels","timeseries","cortex-tenant","kubernetes","mimir"],"license":"MPL-2.0","category":"analytics","readme_excerpt":"cortex-tenant Prometheus/Loki remote write proxy which marks timeseries with a Cortex/Mimir/Loki tenant ID based on labels. Status The project is stable and (hopefully) almost bug-free. I will accept PRs, but probably will not do any active work on it for now since I don't work with Cortex/Mimir currently. Architecture Overview Cortex/Mimir/Loki tenants (separate namespaces where metrics are stored to and queried from) are identified by X-Scope-OrgID HTTP header on both writes and queries. Problem is that Prometheus can't be configured to send this header Actually in some recent version (year 2021 onwards) this functionality was added, but the tenant is the same for all jobs. This makes it impossible to use a single Prometheus (or an HA pair) to write to multiple tenants. This software solves the problem using the following logic: - Receive Prometheus remote write or Loki push - Search each timeseries/stream for a specific label name and extract a tenant ID from its value. For Loki the stream labels are preferred over structured metadata labels. If the label wasn't found then it can fall back to a configurable default ID. If none is configured then the write/push request will be rejected with HTTP code 400 - Optionally removes this label from the timeseries/stream - Groups timeseries/streams by tenant - Issues a number of parallel per-tenant HTTP requests to Cortex/Mimir/Loki with the relevant tenant HTTP header ( X-Scope-OrgID by default) Usage - Get rpm or deb for amd64 fro","default_branch":null,"files":null,"tree":[],"storefront":"/r/blind-oracle","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/blind-oracle/cortex-tenant/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}