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

Add reminder to shutdown exporter instances if replacing #5688

Closed
wants to merge 1 commit into from

Conversation

jack-berg
Copy link
Member

Improving docs now that #5680 and #5652 allow you to easily replace exporters with additional customizations not available via environment variables.

@jack-berg jack-berg requested a review from a team August 7, 2023 22:09
@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (d4a3b3b) 91.34% compared to head (93c12fb) 91.34%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5688      +/-   ##
============================================
- Coverage     91.34%   91.34%   -0.01%     
  Complexity     4997     4997              
============================================
  Files           554      554              
  Lines         14793    14793              
  Branches       1379     1379              
============================================
- Hits          13513    13512       -1     
  Misses          883      883              
- Partials        397      398       +1     
Files Changed Coverage Δ
...autoconfigure/spi/AutoConfigurationCustomizer.java 0.00% <ø> (ø)

... and 1 file with indirect coverage changes

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

Comment on lines +59 to +60
* <p>NOTE: If returning a different exporter instance, be sure to call {@link
* SpanExporter#shutdown()} on the instance passed as an argument to release resources.
Copy link
Member

@trask trask Aug 7, 2023

Choose a reason for hiding this comment

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

I think it's common to use this method to decorate the original

what do you think of putting this warning on toBuilder() instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is delegation a common pattern for this as well, in which case calling shutdown() would break the inner/underlying implementation right?

Copy link
Member

@trask trask Aug 9, 2023

Choose a reason for hiding this comment

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

Is delegation a common pattern for this as well

for toBuilder()? I think that makes a copy instead of using delegation

Copy link
Member Author

Choose a reason for hiding this comment

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

The toBuilder() methods already have this warning, e.g. OtlpGrpcSpanExporter#toBuilder.

Was trying the belt and suspenders approach, but maybe unnecessary. How about I close this and re-open it if we get issues with resources not being cleaned up?

@jack-berg jack-berg closed this Sep 5, 2023
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.

4 participants