-
Notifications
You must be signed in to change notification settings - Fork 252
Description
Should SemConv define guidance on how to define info metrics?
If yes, what should that guidance be?
Info metrics are a well established metric type in Prometheus and OpenMetrics for a time series that has a constant value and whose main value lies in its existence or its attributes.
By convention the name of the metric ends in an _info
suffix:
https://prometheus.io/docs/practices/naming/#metric-names:~:text=count%20with%20unit)-,foobar_build_info,-(for%20a%20pseudo
https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#info
https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#suffixes
The Otel Specs's page on compatibility with Prometheus / OpenMetrics also includes Info metrics: https://opentelemetry.io/docs/specs/otel/compatibility/prometheus_and_openmetrics/#info
When exporting to prometheus this already specifies that resources should be exported as an info metric.
This article explains the advantage of an info metric as opposed to including its attributes on other time series as well as ways to use an info metrics in conjunction with other time series in Prometheus queries:
https://www.robustperception.io/exposing-the-software-version-to-prometheus/
Guidance on how to define info metrics could be defined as part of https://github.com/open-telemetry/semantic-conventions/blob/main/docs/how-to-write-conventions/README.md#defining-metrics
Examples of info metrics
target_info
metric exposed by the otel-collector prometheus exporter https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/145942706622aba5c276ca47f48df438228bfea4/exporter/prometheusexporter/collector.go#L335otel_scope_info
in the otel-collector https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/145942706622aba5c276ca47f48df438228bfea4/pkg/translator/prometheus/constants.go#L22node_uname_info
in the node-exporter to expose the uname information https://github.com/prometheus/node_exporter/blob/f2ec547b49af53815038a50265aa2adcd1275959/collector/uname.go#L67go_info
to expose the go version of a go binary https://github.com/prometheus/client_golang/blob/e4b2208dd8cb6d1425f00250db842ec3c1e8749e/prometheus/go_collector.go#L228
Here a screenshot of some info metrics available on a prometheus scraping my k8s state and app metrics:

Related metrics types
A metric type that is related to info metrics are state metrics.
These are gauge metrics where the gauge value corresponds to the values of an enum or boolean.
For example: the up
metric from prometheus.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status