prom-label-proxy icon indicating copy to clipboard operation
prom-label-proxy copied to clipboard

Support proxying /api/v1/metadata endpoint

Open jmichalek132 opened this issue 10 months ago • 1 comments

Right no the proxy doesn't support /api/v1/metadata endpoint used by Grafana to show metrics metadata (unit, description). It would be nice to support this endpoint too.

jmichalek132 avatar May 27 '25 12:05 jmichalek132

I'm not a maintainer, but from what I understand, the upstream Prometheus endpoint for metadata (/api/v1/metadata) doesn’t support label-based filtering - only metric names are supported, as noted in the docs: https://prometheus.io/docs/prometheus/latest/querying/api/#querying-metric-metadata.

This means that simply proxying the endpoint isn't sufficient from a security perspective, since it could expose metric names or metric metadata from other tenants - especially relevant in a multi-tenant IoT setup. If you don't care about that you can just add the path to WithPassthroughPaths.

A workaround might involve fetching all metadata and then using a separate /api/v1/series query to identify which metrics are actually relevant for the tenant, but that feels like a brittle hack.

It might be worth opening a feature request upstream to support more secure or filterable metadata access.

Edit: Issue in prometheus repository: https://github.com/prometheus/prometheus/issues/16802

mutefiRe avatar May 27 '25 14:05 mutefiRe