Conversation
Pull request dashboard statusWaiting on the author · refreshed 2026-09-20 09:22 UTC Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):
Status above doesn't look right?
|
|
@lzchen This pr is ready for review |
herin049
left a comment
There was a problem hiding this comment.
Thanks for the PR, if you have future small changes like these, please group them into a single PR.
|
Thanks for the review and approval @herin049 I'll definitely group related small fixes into a single PR next time :)) |
Shriprasad-P
left a comment
There was a problem hiding this comment.
Nice focused PR. Please make sure docs/changelog stay aligned if the repo requires it for this kind of change.
7ab0768 to
3bdc868
Compare
|
All checks passed.... the pr is ready for review :)) |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The validation is correct and adequately tested; the remaining error-message spacing issue is minor.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds positive-value validation for metric export timeouts.
Changes:
- Rejects zero and negative export timeouts.
- Adds focused unit tests.
- Adds a changelog entry.
| File | Description |
|---|---|
.changelog/5656.fixed |
Records the fix. |
opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/export/__init__.py |
Validates export timeout values. |
opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py |
Tests zero and negative timeout rejection. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Description
Fixes #5655
Currently,
PeriodicExportingMetricReadervalidatesexport_interval_millisduring initialization and raises aValueErrorifexport_interval_millis <= 0. However,export_timeout_millislacked validation for values<= 0, allowing non-positive integers (0or negative values) to be passed without error.Since
_ticker()continuously callsself.collect(timeout_millis=self._export_timeout_millis), passing an unvalidated non-positive timeout causes collection timeout errors on every tick cycle.This PR adds validation for
export_timeout_millis <= 0inPeriodicExportingMetricReader.__init__().Type of change
How Has This Been Tested?
opentelemetry-sdk/tests/metrics/test_periodic_exporting_metric_reader.py(test_timeout_value_exception_on_zero,test_timeout_value_exception_on_negative).Does This PR Require a Contrib Repo Change?
Checklist: