Skip to content

Commit

Permalink
Convert OpenMetrics Info and StateSet metrics to non-monotonic sums (#…
Browse files Browse the repository at this point in the history
…2380)

* convert OpenMetrics Info and StateSet metrics to gauges

* describe info and statesets in terms of gauges

* address feedback

* note exception for target info

* use non-monotonic sums, rather than gauges

Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
dashpole and bogdandrutu committed Mar 16, 2022
1 parent b1ca0b3 commit 1eb20d7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions specification/metrics/datamodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
* [Prometheus Metric points to OTLP](#prometheus-metric-points-to-otlp)
+ [Counters](#counters)
+ [Gauges](#gauges)
+ [Info](#info)
+ [StateSet](#stateset)
+ [Unknown-typed](#unknown-typed)
+ [Histograms](#histograms)
+ [Summaries](#summaries)
Expand Down Expand Up @@ -1128,6 +1130,14 @@ A [Prometheus Counter](https://github.com/OpenObservability/OpenMetrics/blob/mai

A [Prometheus Gauge](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#gauge) MUST be converted to an OTLP Gauge.

#### Info

An [OpenMetrics Info](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#info) metric MUST be converted to an OTLP Non-Monotonic Sum unless it is the "target" info metric, which is used to populate [resource attributes](#resource-attributes). An OpenMetrics Info can be thought of as a special-case of the OpenMetrics Gauge which has a value of 1, and whose labels generally stays constant over the life of the process. It is converted to a Non-Monotonic Sum, rather than a Gauge, because the value of 1 is intended to be viewed as a count, which should be summed together when aggregating away labels.

#### StateSet

An [OpenMetrics StateSet](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset) metric MUST be converted to an OTLP Non-Monotonic Sum. An OpenMetrics StateSet can be thought of as a special-case of the OpenMetrics Gauge which has a 0 or 1 value, and has one metric point for every possible state. It is converted to a Non-Monotonic Sum, rather than a Gauge, because the value of 1 is intended to be viewed as a count, which should be summed together when aggregating away labels.

#### Unknown-typed

A [Prometheus Unknown](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unknown) MUST be converted to an OTLP Gauge.
Expand Down Expand Up @@ -1157,8 +1167,6 @@ Multiple Prometheus metrics are merged together into a single OTLP Summary:
The following Prometheus types MUST be dropped:

* [OpenMetrics GaugeHistogram](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#gaugehistogram)
* [OpenMetrics StateSet](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset)
* [OpenMetrics Info](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#info)

#### Start Time

Expand Down

0 comments on commit 1eb20d7

Please sign in to comment.