Skip to content

Count data points in OTLP metric exporter health metrics - #9016

Merged
jack-berg merged 4 commits into
open-telemetry:mainfrom
goutamadwant:fix-metric-point-count
Nov 23, 2026
Merged

jack-berg merged 4 commits into
open-telemetry:mainfrom
goutamadwant:fix-metric-point-count

Conversation

@goutamadwant

Copy link
Copy Markdown
Contributor

Fixes #9011.

Count the data points across the exported metrics when recording exporter health metrics. Previously, a batch containing three instruments with 3, 2, and 0 points reported 3 items instead of 5. Both reusable and immutable memory modes now pass the point count to the exporter instrumentation.

The regression test checks inflight and exported counts before and after asynchronous success or failure, including empty metrics, empty batches, and subsequent exports.

Validation:

  • ./gradlew :exporters:otlp:common:check :exporters:common:check
  • ./gradlew :exporters:otlp:all:testOkHttpVersionLATEST --tests '*MetricExporter*'

@goutamadwant
goutamadwant requested a review from a team as a code owner November 7, 2026 18:54
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-11-23 17:33 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Give the HTTP and gRPC metric exporter builder fixtures one data point
so their meter-provider tests retain meaningful nonzero assertions.

Cover legacy and latest exporter instrumentation in both memory modes,
including multi-point and empty exports, asynchronous success and failure,
and subsequent exports. Assert that legacy seen/exported counters count
data points and preserve their type and success attributes, with exported
counts updated only after completion.
@codecov

codecov Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.53%. Comparing base (fecfb6d) to head (826e0aa).
⚠️ Report is 14 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9016      +/-   ##
============================================
+ Coverage     90.37%   90.53%   +0.15%     
- Complexity    11018    11186     +168     
============================================
  Files          1021     1032      +11     
  Lines         30124    30511     +387     
  Branches       3933     3994      +61     
============================================
+ Hits          27225    27623     +398     
+ Misses         1941     1913      -28     
- Partials        958      975      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@opentelemetry-pr-dashboard

This comment has been minimized.

Signed-off-by: goutamadwant <workwithgoutam@gmail.com>
@goutamadwant

Copy link
Copy Markdown
Contributor Author

I narrowed the test in 826e0aa to the count passed to doExport for each MemoryMode. It covers mixed and empty batches, then reuses the marshaler to check the count resets. Both modes and the HTTP/gRPC exporter-builder tests passed locally.

@jack-berg
jack-berg merged commit 8f1b84b into open-telemetry:main Nov 23, 2026
34 checks passed
@otelbot

otelbot Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution @goutamadwant! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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.

MetricReusableDataMarshaler passes MetricData count instead of data point count to otel.sdk.exporter.metric_data_point.{inflight,exported}

2 participants