Skip to content

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

Open
goutamadwant wants to merge 3 commits into
open-telemetry:mainfrom
goutamadwant:fix-metric-point-count
Open

goutamadwant wants to merge 3 commits into
open-telemetry:mainfrom
goutamadwant:fix-metric-point-count

Conversation

@goutamadwant

Copy link
Copy Markdown

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

Waiting on the author · refreshed 2026-11-10 09:33 UTC

Investigate required status check failures.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? 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.46%. Comparing base (fecfb6d) to head (19ca75d).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9016      +/-   ##
============================================
+ Coverage     90.37%   90.46%   +0.09%     
- Complexity    11018    11024       +6     
============================================
  Files          1021     1021              
  Lines         30124    30128       +4     
  Branches       3933     3935       +2     
============================================
+ Hits          27225    27256      +31     
+ Misses         1941     1915      -26     
+ Partials        958      957       -1     

☔ 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.

This branch has not been deployed

No deployments
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}

1 participant