Skip to content

feat(sdk-metrics): align PeriodicMetricReader export timeout semantics - #8684

Open
Rajkaran-122 wants to merge 4 commits into
open-telemetry:mainfrom
Rajkaran-122:issue-8311-periodic-metric-reader-timeout
Open

feat(sdk-metrics): align PeriodicMetricReader export timeout semantics#8684
Rajkaran-122 wants to merge 4 commits into
open-telemetry:mainfrom
Rajkaran-122:issue-8311-periodic-metric-reader-timeout

Conversation

@Rajkaran-122

Copy link
Copy Markdown

Fixes #8311

Summary

Align PeriodicMetricReader export timeout behavior with the Metrics specification by enforcing an exporter timeout for each export batch.

Changes

  • Added configurable exporter timeout support to PeriodicMetricReaderBuilder
  • Added a default exporter timeout of 30s
  • Enforced the configured timeout for each export batch in PeriodicMetricReader
  • Preserved existing batching behavior while ensuring timed-out exports are reported as failures

Testing

  • Ran the relevant Gradle build and tests
  • Verified the updated timeout behavior

Notes

This change updates export timeout behavior without affecting metric collection or scheduling semantics.

@Rajkaran-122
Rajkaran-122 requested a review from a team as a code owner August 2, 2026 12:19
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 2, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-08-02 14:35 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.

…cheduler

Replace scheduler-based withTimeout() with CompletableResultCode.join(),
matching the established pattern in BatchSpanProcessor and
BatchLogRecordProcessor. The previous approach used scheduler.schedule()
which throws RejectedExecutionException during shutdown because the
scheduler is intentionally shut down before the final export flush.
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.

Metrics: clarify and align PeriodicMetricReader export timeout semantics with batching spec

1 participant