Skip to content

Support metric export maximum batch sizes - #8053

Merged
martincostello merged 19 commits into
open-telemetry:mainfrom
martincostello:support-periodic-metric-export-max-batch-size
Nov 9, 2026
Merged

martincostello merged 19 commits into
open-telemetry:mainfrom
martincostello:support-periodic-metric-export-max-batch-size

Conversation

@martincostello

Copy link
Copy Markdown
Member

Implements open-telemetry/opentelemetry-specification#5291 and open-telemetry/opentelemetry-specification#5359.

Changes

Add support for the maxExportBatchSize argument for the Periodic exporting MetricReader.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, successful build/tests, etc.)
  • Tests added/updated
  • CHANGELOG.md file(s) updated for non-trivial changes
  • Changes in public API reviewed (if applicable)
  • AI usage disclosure:
    • No AI used
    • AI-assisted
    • Bulk AI-generated
  • I have the experience and knowledge necessary to understand, review, and validate all content in this PR1

Footnotes

  1. Yes, I can answer maintainer questions about the content of this PR without using AI. ↩

Add support for the `maxExportBatchSize` argument for the Periodic exporting `MetricReader`.

Implements open-telemetry/opentelemetry-specification#5291 and open-telemetry/opentelemetry-specification#5359.
@github-actions github-actions Bot added pkg:OpenTelemetry.Exporter.Console Issues related to OpenTelemetry.Exporter.Console NuGet package pkg:OpenTelemetry.Exporter.InMemory Issues related to OpenTelemetry.Exporter.InMemory NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package labels Oct 28, 2026
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-11-09 08:46 UTC

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

Comment thread src/OpenTelemetry/CHANGELOG.md Resolved
Comment thread src/OpenTelemetry/CHANGELOG.md Resolved
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.04762% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.90%. Comparing base (025ead7) to head (f4bd5cd).
⚠️ Report is 3 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ernal/PeriodicExportingMetricReaderThreadWorker.cs 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8053      +/-   ##
==========================================
+ Coverage   92.82%   92.90%   +0.08%     
==========================================
  Files         396      396              
  Lines       23274    23366      +92     
  Branches     4348     4370      +22     
==========================================
+ Hits        21604    21709     +105     
+ Misses       1136     1127       -9     
+ Partials      534      530       -4     
Flag Coverage Δ
unittests-Project-Experimental 93.01% <99.04%> (+0.09%) ⬆️
unittests-Project-Stable 92.96% <99.04%> (+0.04%) ⬆️
unittests-Solution 92.97% <99.04%> (+0.09%) ⬆️
unittests-UnstableCoreLibraries-Experimental 44.41% <30.47%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...penTelemetry.Exporter.InMemory/InMemoryExporter.cs 91.30% <100.00%> (+0.39%) ⬆️
...ostics/SelfDiagnosticsEnvironmentVariablePolicy.cs 98.59% <100.00%> (+<0.01%) ⬆️
...nternal/PeriodicExportingMetricReaderTaskWorker.cs 75.75% <100.00%> (+7.57%) ⬆️
...ry/Internal/PeriodicExportingMetricReaderWorker.cs 88.23% <100.00%> (+2.52%) ⬆️
src/OpenTelemetry/Metrics/AggregatorStore.cs 90.90% <100.00%> (+0.21%) ⬆️
...emetry/Metrics/MetricPoint/MetricPointsAccessor.cs 100.00% <100.00%> (ø)
...ry/Metrics/Reader/PeriodicExportingMetricReader.cs 97.14% <100.00%> (+5.71%) ⬆️
...ics/Reader/PeriodicExportingMetricReaderOptions.cs 100.00% <100.00%> (ø)
...ernal/PeriodicExportingMetricReaderThreadWorker.cs 78.43% <66.66%> (ø)

... and 3 files with indirect coverage changes

@martincostello martincostello changed the title Support metric export batching Support metric export maximum export batch sizes Oct 28, 2026
Add PR number.

Co-authored-by: Martin Costello <martin@martincostello.com>
@martincostello
martincostello marked this pull request as ready for review October 28, 2026 12:19
Copilot AI balanced review requested due to automatic review settings October 28, 2026 12:19
@martincostello
martincostello requested a review from a team as a code owner October 28, 2026 12:19

This comment was marked as resolved.

@martincostello martincostello changed the title Support metric export maximum export batch sizes Support metric export maximum batch sizes Oct 29, 2026

Copilot AI left a comment

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.

🟡 Changes recommended

A critical race allows ForceFlush to invoke an already-shut-down exporter because export admission is not synchronized with exporter shutdown.

3 open issues

Review effort: Balanced

This was referenced Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry.Exporter.Console Issues related to OpenTelemetry.Exporter.Console NuGet package pkg:OpenTelemetry.Exporter.InMemory Issues related to OpenTelemetry.Exporter.InMemory NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package spec-compliance Issues related to compliance with the OpenTelemetry Specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants