-
Task
-
Resolution: Done
-
Normal
-
None
-
False
-
False
-
NEW
-
NEW
-
Undefined
-
-
Monitoring - Sprint 204, Monitoring - Sprint 205, Monitoring - Sprint 206, Monitoring - Sprint 207
prom-label-proxy v0.3.0 has a new flag called --enable-labels-api [0] which allows to expose /api/v1/labels and /api/v1/label/<name>/values endpoints [1]. It would be useful to enable this flag for the prom-label-proxy instance which enforces namespace isolation in front of Thanos query. One use case is that people may want to use Grafana with the tenancy port of Thanos query and Grafana queries these endpoints for dashboard templating (see [2] for an example). The dev console might also leverage the endpoints instead of querying for all metrics names in a given namespace [3].
DoD
- /api/v1/labels and /api/v1/label/<name>/values endpoints are accessible from
thanos-querier.openshift-monitoring.svc:9092. - prom-label-proxy injects the namespace matcher in the API query and the returned data is scoped to the namespace value.
[0] https://github.com/prometheus-community/prom-label-proxy/#metadata-endpoints
[1] https://prometheus.io/docs/prometheus/latest/querying/api/#getting-label-names
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1969409
[3] https://github.com/openshift/console/blob/85086217feb35e64c36d68a8d315fe59275e510b/frontend/packages/dev-console/src/components/monitoring/metrics/MetricsQueryInput.tsx#L91-L97