Uploaded image for project: 'OpenShift Monitoring'
  1. OpenShift Monitoring
  2. MON-1695

Expose tenancy-aware /api/v1/labels and /api/v1/label/<name>/values endpoints for Thanos query


    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • openshift-4.10
    • None
    • Thanos
    • 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].


      • /api/v1/labels and /api/v1/label/<name>/values endpoints are accessible from
      • 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

            hasun@redhat.com Haoyu Sun
            spasquie@redhat.com Simon Pasquier
            Junqi Zhao Junqi Zhao
            1 Vote for this issue
            7 Start watching this issue