Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small change to return error from periodic exporter #1857

Merged
merged 7 commits into from
Jun 4, 2024

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Jun 3, 2024

Changes

The collect_and_export() drops the error in case of failure during export, and always return success. Fixing that. Testing using end-to-end test for OTLP metrics exporter, with no collector running. Not adding the unit-test for now - can be done by creating a failing MockExporter (if required).

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@lalitb lalitb requested a review from a team June 3, 2024 23:13
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (main@406cc31). Learn more about missing BASE report.

Current head 6aa5e3c differs from pull request most recent head a6d5d1f

Please upload reports for the commit a6d5d1f to get more accurate results.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #1857   +/-   ##
======================================
  Coverage        ?   74.5%           
======================================
  Files           ?     122           
  Lines           ?   19809           
  Branches        ?       0           
======================================
  Hits            ?   14761           
  Misses          ?    5048           
  Partials        ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@TommyCpp TommyCpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@@ -45,6 +45,8 @@

- **Breaking** [1850] (https://github.com/open-telemetry/opentelemetry-rust/pull/1850) `LoggerProvider::log_processors()` and `LoggerProvider::resource()` are not public methods anymore. They are only used within the `opentelemetry-sdk` crate.

- [1857](https://github.com/open-telemetry/opentelemetry-rust/pull/1857) Fixed an issue in the `collect_and_export()` method of the periodic exporter where errors during export were dropped, ensuring proper error handling and reporting.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collect_and_export() is not a public method. I'd suggest to phrase this in a way applicable to end users.

something like:
Fixed an issue in Metrics SDK which prevented export errors from being send to global error handler. With the fix, errors occurring during export like OTLP Endpoint unresponsive shows up in stderr by default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes true. Updated.

@cijothomas cijothomas merged commit f488006 into open-telemetry:main Jun 4, 2024
19 of 20 checks passed
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.

3 participants