On Thu, 6 Aug 2020 at 22:29, Alvin Lin <[email protected]> wrote:

> Hello
>
> In https://prometheus.io/docs/instrumenting/writing_clientlibs/ under the
> section "Labels" it says
>
> "Client libraries MUST NOT under any circumstances allow users to have
> different label names for the same metric for
> Gauge/Counter/Summary/Histogram or any other Collector offered by the
> library."
>
> Does anyone know the background behind this rule? My understanding is that
> Prometheus' data model is that a metrics is uniquely identified by metric
> name and set of labels, so technically it should be possible to
> have metrics that has the same name but different set of label names. Is
> the rule to enforce best practice?
>

The set of label names a given metric has should be static, and it's going
to be very difficult to write correct PromQL if that's not the case.
Generally if someone is asking for this for direct instrumentation they're
trying to do event logging rather than metrics, as with metrics you should
always know your label names a-priori.

-- 
Brian Brazil
www.robustperception.io

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAHJKeLra27vWKbgmPnVG7HrvPtFBboVzD3HMSZ6H3F%3DZa1LkXg%40mail.gmail.com.

Reply via email to