fix(openfeature): use delta temporality for OTLP metrics export#11426
Open
sameerank wants to merge 1 commit into
Open
fix(openfeature): use delta temporality for OTLP metrics export#11426sameerank wants to merge 1 commit into
sameerank wants to merge 1 commit into
Conversation
Contributor
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
This comment has been minimized.
This comment has been minimized.
4f318d6 to
4880dbe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
Changes the OTLP metrics exporter from
alwaysCumulative()todeltaPreferred()for feature flag evaluation metrics.Motivation
OTLP receivers (like the Datadog Agent) expect delta temporality for counter metrics. With cumulative temporality, each export sends the total count since start (5, 10, 15...), and receivers that sum these values produce overcounted results (5, 15, 30...).
With delta temporality, each export sends only the increment since the last export (5, 5, 5...), which receivers correctly sum to the actual total.
Testing in https://github.com/DataDog/ffe-dogfooding I saw Java was overcounting with OTLP, compared to the other SDKs.
This aligns with Datadog's OTLP documentation which recommends delta temporality for metrics.
Additional Notes
deltaPreferred()uses DELTA for Counter/Histogram and CUMULATIVE for UpDownCounter (per OTel spec)FlagEvalMetricsis the only direct OTLP exporter in dd-trace-java; other OTel metrics go through the DogStatsD shimContributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issue