Skip to content

Stabilize OTLP->Prometheus: Gauges and Sums#5034

Open
ArthurSens wants to merge 2 commits intoopen-telemetry:mainfrom
ArthurSens:otlptoprom-gauge-sum
Open

Stabilize OTLP->Prometheus: Gauges and Sums#5034
ArthurSens wants to merge 2 commits intoopen-telemetry:mainfrom
ArthurSens:otlptoprom-gauge-sum

Conversation

@ArthurSens
Copy link
Copy Markdown
Member

Fixes #4919
Fixes #4920

Changes

Stabilizes the converstion of OTLP Gauges and Sums to their Prometheus counterparts.

For non-trivial changes, follow the change proposal process.

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
@ArthurSens ArthurSens requested review from a team as code owners April 17, 2026 15:12
Comment on lines 486 to 489
- If the aggregation temporality is delta and the sum is monotonic, it SHOULD be converted to a cumulative temporality and become a Prometheus Counter. The following behaviors are expected:
- The new data point type must be the same as the accumulated data point type.
- The new data point's start time must match the time of the accumulated data point. If not, see [detecting alignment issues](../metrics/data-model.md#sums-detecting-alignment-issues).
- Otherwise, it MUST be dropped.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@open-telemetry/prometheus-interoperability, I'm a bit unsure about this one.

In the collector, there's a component that transforms deltas into cumulative, and as far as I know, using this is the recommended way for folks trying to consume Delta and expose Prometheus.

I'm a bit inclined to adjust the wording to say that Deltas MUST be dropped, and recommend that this transformation should happen outside of the Prometheus domain

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Lets drop this language

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out we do support delta -> Cumulative in the prometheusexporter: open-telemetry/opentelemetry-collector-contrib#47721. We should discuss whether we want to remove that support.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the downsides of using deltatocumulativeprocessor instead? If there isn't any, or if they are very minimal, I'd prefer that we drop this 😬

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably mostly memory usage. Both deltatocumulativeprocessor and prometheusexporter have an internal state of all metrics that they accumulate. It would be twice as expensive.

WDYT about just changing this to MAY convert delta to cumulative instead of SHOULD?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm following. If folks use deltatocumulative, then deltatocumulative will retain state, and everything will be cumulative when it reaches the Prometheus exporter. We're just moving the same operation from one place to another.

Comment thread specification/compatibility/prometheus_and_openmetrics.md Outdated
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[prometheus] Stabilize OTLP->Prometheus: Sums [prometheus] Stabilize OTLP->Prometheus: Gauges

2 participants