alloy icon indicating copy to clipboard operation
alloy copied to clipboard

Prometheus / Mimir : Dynamic tenant id from metric label like Loki

Open Ronan-WeScale opened this issue 1 year ago • 1 comments

Background

Mimir support multi tenancy like Loki with header in the request, I suppose Loki.write read tenant label in the logs to replace default tenant_id in the endpoint (like Promtail does).
Today I use cortex-tenant as proxy between Prometheus and Mimir, I use writeRelabelConfig to regex the namespace label and create the tenant label. Cortex-tenant read the tenant label in metric and add the header to the request.
It could be better to implement this directly from Alloy instead use proxy only for doing that's job.

Proposal

This functionality can be implemented in prometheus.remote_write or with a specific mimir.remote_write.

Ronan-WeScale avatar Aug 14 '24 07:08 Ronan-WeScale

@Ronan-WeScale could this be a duplicate of #521 ?

wilfriedroset avatar Aug 14 '24 18:08 wilfriedroset

@wilfriedroset of course, sorry for duplicate, I tried to search before create this issue.
But https://github.com/grafana/alloy/issues/521 seem stuck from long time.

Ronan-WeScale avatar Sep 02 '24 08:09 Ronan-WeScale