projectcapsule / capsule-proxy

Reverse proxy for Capsule Operator.
https://github.com/projectcapsule/capsule
Apache License 2.0
42 stars 37 forks source link

Filter requests for metrics #48

Open bsctl opened 3 years ago

bsctl commented 3 years ago

Investigate if the capsule-proxy can enforce the tenant label in a given PromQL query, in Prometheus API responses, and in Alert Manager API requests as prom-label-proxy does.

bsctl commented 3 years ago

@prometherion getting interest in this feature, we should prioritise it. Could you provide an impact analysis from architectural pov?

prometherion commented 3 years ago

I'm working on this, scouting some already existing projects to understand if we can plugin them or not.

prometherion commented 3 years ago

Plugging the prom-label-proxy handlers doesn't sound so smooth, at least from a DX perspective.

In fact, the end-users would be required to add always a label to their metrics, and this could be annoying: for Namespace filtering, we decided to go for kubectl get namespaces without the need to add -l capsule.clastix.io/teanant=oil and I think the same should apply also for metrics.

WDYT @bsctl ?

bsctl commented 3 years ago

@prometherion it makes sense

bsctl commented 3 years ago

Here a list of Prometheus endpoints that should be handled by the proxy: