Skip to content

fix(openfeature): use delta temporality for OTLP metrics export#11426

Open
sameerank wants to merge 1 commit into
masterfrom
sameerank/fix-flag-eval-metrics-delta-temporality
Open

fix(openfeature): use delta temporality for OTLP metrics export#11426
sameerank wants to merge 1 commit into
masterfrom
sameerank/fix-flag-eval-metrics-delta-temporality

Conversation

@sameerank
Copy link
Copy Markdown

@sameerank sameerank commented May 20, 2026

What Does This Do

Changes the OTLP metrics exporter from alwaysCumulative() to deltaPreferred() 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.

Datadog works best with delta aggregation temporality for monotonic sums, histograms, and exponential histograms.

Additional Notes

  • deltaPreferred() uses DELTA for Counter/Histogram and CUMULATIVE for UpDownCounter (per OTel spec)
  • Updated test to use delta temporality to match production configuration
  • FlagEvalMetrics is the only direct OTLP exporter in dd-trace-java; other OTel metrics go through the DogStatsD shim

Contributor Checklist

@sameerank sameerank added the type: bug Bug report and fix label May 20, 2026
@sameerank sameerank marked this pull request as ready for review May 20, 2026 05:25
@sameerank sameerank requested a review from a team as a code owner May 20, 2026 05:26
@sameerank sameerank requested review from leoromanovsky and typotter and removed request for a team May 20, 2026 05:26
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 20, 2026

Hi! 👋 Thanks for your pull request! 🎉

To help us review it, please make sure to:

  • Add at least one type, and one component or instrumentation label to the pull request

If you need help, please check our contributing guidelines.

@datadog-datadog-prod-us1

This comment has been minimized.

@sameerank sameerank added the comp: metrics Metrics label May 20, 2026
@sameerank sameerank force-pushed the sameerank/fix-flag-eval-metrics-delta-temporality branch from 4f318d6 to 4880dbe Compare May 20, 2026 06:07
@sameerank sameerank requested a review from dd-oleksii May 20, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: metrics Metrics type: bug Bug report and fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant