prometheus-community / prom-label-proxy

A proxy that enforces a given label in a given PromQL query.
Apache License 2.0
263 stars 95 forks source link

Support for Cortex endpoints ? #156

Open o11y16 opened 1 year ago

o11y16 commented 1 year ago

Hello,

In my use case I need to inject labels to given queries to be sent to Cortex. Prom-label-proxy has the solution for that but doesn't support Cortex endpoints, do you intend to do that ? what are please the things to consider in this case ?

simonpasquier commented 1 year ago

I've got no experience with Cortex and its API. This project aims at supporting any project which is compatible with the Prometheus and Alertmanager APIs (Thanos for instance).

What would be the differences for Cortex?

o11y16 commented 1 year ago

The paths of the endpoints are different is some cases, ex: /prometheus/api/v1/query /prometheus/api/v1/query_range /prometheus/api/v1/query_exemplars ...

Is it just a matter of modifying these paths ? because other than that Cortex is compatible with Prometheus.

simonpasquier commented 1 year ago

Ok so it would be more the ability to specify a path prefix to append to the request being forwarded to Cortex then?

I'm also curious to know why you'd need prom-label-proxy in front of the Cortex API since I believed that Cortex is already multi-tenant.

o11y16 commented 1 year ago

Yes that would be it, for the main endpoints. (some supported by the proxy are not by Cortex)

In my case the provider of the request is not aware of the tenant it is bound to. And we have a classification of tenants that relies on both Cortex tenant concept and labels.