Skip to content

Add timeout shutdown config to PeriodicMetricReader and its builder - #8756

Open
brunobat wants to merge 1 commit into
open-telemetry:mainfrom
brunobat:set-shutdown-timeout
Open

Add timeout shutdown config to PeriodicMetricReader and its builder#8756
brunobat wants to merge 1 commit into
open-telemetry:mainfrom
brunobat:set-shutdown-timeout

Conversation

@brunobat

@brunobat brunobat commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

When using native instrumentation with the autoconfigure and custom executors we notice there is always a fixed 5s penalty on shutdown.
This causes unecessary delays on all tests instantiating metrics with a real PeriodicMeterReader and also ignores any timeout defined on the server side.

This PR exposes the value as a builder option while preserving the existing default.
The API change is just 2 new methods.

@brunobat
brunobat requested a review from a team as a code owner August 28, 2026 10:30
@otelbot otelbot Bot added the api-change Changes to public API surface area label Aug 28, 2026
@otelbot

otelbot Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — additional maintainer review required

@jack-berg @jkwatson

This PR modifies the public API surface area of the following module(s):

  • opentelemetry-sdk-metrics

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

@brunobat
brunobat force-pushed the set-shutdown-timeout branch from dc74967 to 64f3e8b Compare August 28, 2026 10:34
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (e2efec5) to head (64f3e8b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8756      +/-   ##
============================================
- Coverage     91.29%   91.28%   -0.01%     
- Complexity    10498    10500       +2     
============================================
  Files          1006     1006              
  Lines         28338    28346       +8     
  Branches       3581     3582       +1     
============================================
+ Hits          25870    25877       +7     
  Misses         1675     1675              
- Partials        793      794       +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.

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 28, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-02 14:35 UTC

Review the latest changes.

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.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Changes to public API surface area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants