I can't speak to the original thinking but I can speculate. In text format
info metrics, we conflate two things into labels: the identification of the
thing we are informing about, and the information itself.

For example, an info metric about hard disks would have a label that
identifies the disk (with more target labels added later), and "labels"
that hold the string valued information like the firmware version.

It gets more extreme with e.g. kube_pod_labels, where the set of info
labels itself is dynamic. At least in the past, kube-state-metrics had to
hack open the Prometheus client library to subvert label consistency checks
so that it could do this, since the set of (info) label keys is unknowable
ex ante.

By splitting the labels from the info like this, you can make assertions
about consistency within the *label* set without constraining the *info*
set too much.

/MR

On Wed, 7 Dec 2022, 21:31 'Fabian Stäber' via Prometheus Developers, <
[email protected]> wrote:

> Hi,
>
> in OpenMetrics, all metrics (metric == time series) are modelled like this:
>
> message Metric {
>     repeated Label labels = 1;
>     repeated MetricPoint metric_points = 2;
> }
>
> However, Info metrics have another set of Labels as the value of their
> MetricPoint:
>
> message InfoValue {
>     repeated Label info = 1;
> }
>
> I first thought that might be a mistake, but then I found this cryptic
> statement in the spec:
>
> A MetricPoint of an Info Metric contains a LabelSet. An Info MetricPoint's
> LabelSet MUST NOT have a label name which is the same as the name of a
> label of the LabelSet of its Metric.
>
> I'm curious why Info metrics are modelled that way. Is that something we
> should simplify?
>
> Fabian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Developers" 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-developers/CAPX310hQLkeVEd5rNTtVkMuHJ11N4hqsyQwnAEeyterSPn3W0w%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-developers/CAPX310hQLkeVEd5rNTtVkMuHJ11N4hqsyQwnAEeyterSPn3W0w%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Developers" 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-developers/CAMV%3D_gbCv7npMr0CTzi%3Dch20xTH_R%2BUNV2O7ePy4pvEMfEW9XA%40mail.gmail.com.

Reply via email to