Skip to content

Conversation

@cijothomas
Copy link
Member

Unsure why we need to duplicate this in PeriodicReader if the MeterProvider can take care of this.
PeriodicReader will still return Error when shutdown is invoked again, but won't be as descriptive. But not something to worry, as users should only be calling flush/shutdown on the Providers, not on reader/exporter directly.

@cijothomas cijothomas requested a review from a team as a code owner December 16, 2024 06:29
@codecov
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.4%. Comparing base (c726c4d) to head (d1b9c34).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2433     +/-   ##
=======================================
- Coverage   79.4%   79.4%   -0.1%     
=======================================
  Files        122     122             
  Lines      21708   21696     -12     
=======================================
- Hits       17255   17244     -11     
+ Misses      4453    4452      -1     

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


fn shutdown(&self) -> MetricResult<()> {
if self
.shutdown_invoked
Copy link
Member

Choose a reason for hiding this comment

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

Just thinking - we don't need any check in periodically executed collect_and_export to not do export if shutdown is invoked?

Copy link
Member Author

Choose a reason for hiding this comment

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

after shutdown is invoked, there is no way to invoke collect or export methods (they are not public).
I am still checking for ways to better architect this - reader is cloneable today, which I am not sure if we need to. but requires more refactoring/design..

@cijothomas cijothomas merged commit 967dc93 into open-telemetry:main Dec 16, 2024
21 checks passed
@cijothomas cijothomas deleted the cijothomas/periodic-reader-fix4 branch December 16, 2024 19:45
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.

2 participants