Repository navigation
Support PeriodicMetricReader export timeout in autoconfigure and declarative config - #9090
Open
adityad171 wants to merge 1 commit into
Open
adityad171 wants to merge 1 commit into
adityad171 wants to merge 1 commit into
Conversation
…arative config PeriodicMetricReaderBuilder#setExporterTimeout was added in open-telemetry#8827, but no config path calls it. Declarative config parses periodic.timeout and drops it, and autoconfigure does not read the spec-defined otel.metric.export.timeout (OTEL_METRIC_EXPORT_TIMEOUT). Apply the timeout in both paths when it is set. When it is not set, the reader keeps the open-telemetry#8827 default (the export interval). Also print exporterTimeoutNanos in PeriodicMetricReader#toString, as the batch processors do, so the toString-based factory test can see it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9090 +/- ##
============================================
- Coverage 90.54% 90.53% -0.01%
- Complexity 11254 11256 +2
============================================
Files 1040 1040
Lines 30703 30708 +5
Branches 4015 4017 +2
============================================
+ Hits 27799 27803 +4
Misses 1928 1928
- Partials 976 977 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pull request dashboard statusWaiting on reviewers · refreshed 2026-12-02 15:10 UTC Review the latest changes. Status above doesn't look right?
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9089
PeriodicMetricReaderBuilder#setExporterTimeout(#8827) could not be set from config. This applies it in both config paths:otel.metric.export.timeout/OTEL_METRIC_EXPORT_TIMEOUTmeter_provider.readers[].periodic.timeoutBoth work like
otel.bsp.export.timeoutand the batch processors'export_timeout: the value is used only when it is set, and0means no limit. When it is not set, the reader keeps the export interval as its timeout, so nothing changes for users who don't set it.PeriodicMetricReader#toStringnow includesexporterTimeoutNanos, likeBatchSpanProcessor.MetricReaderFactoryTestcompares readers bytoString, which is why the dropped value was not caught.Things to note:
OTEL_METRIC_EXPORT_TIMEOUT(for example for other SDKs), orperiodic.timeoutin a declarative config file, will now get that timeout. Today Java ignores both.otel.bsp.export.timeoutdoes. The spec says it MUST be ignored with a warning; I kept the existing Java behaviour to stay consistent.Testing: with the config changes reverted,
MetricExporterConfigurationTest(_configured,_zeroExporterTimeout) andMetricReaderFactoryTest("periodic configured") fail.Parts of this change were written with an AI coding assistant; I reviewed and tested all of it.