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

Simplify the thread-safe handling of the globalLogEmitterProvider #4936

Merged
merged 2 commits into from
Dec 21, 2021

Conversation

breedx-splk
Copy link
Contributor

Follow-up on some comments in #4917

@trask This should show what I was getting at with my comments before. There are two slight semantic differences with this approach: 1) calling get() before set() is ok, you just get the NoOp impl. 2) calling set() multiple times with the NoOp impl is fine. I think this is acceptable, but others could differ.

I completely understand if we don't want to do this because it's inconsistent with the others.

@trask
Copy link
Member

trask commented Dec 20, 2021

oh, yes, this is much simpler!

  1. calling get() before set() is ok, you just get the NoOp impl.

this behavior could be better, e.g. in cases where you aren't able to set the global early enough, though I'm not sure how it will work with autoconfiguration (though to be honest I don't know how any of this will work with autoconfiguration yet)

  1. calling set() multiple times with the NoOp impl is fine. I think this is acceptable, but others could differ.

the NoOp impl is package-private, so I don't think this is an issue

…strumentation/api/appender/GlobalLogEmitterProviderTest.java

Co-authored-by: Mateusz Rzeszutek <[email protected]>
Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

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

thx!

@trask trask merged commit 48dcfcb into open-telemetry:main Dec 21, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
…en-telemetry#4936)

* Simplify the thread-safe handling of the globalLogEmitterProvider

* Update instrumentation-api-appender/src/test/java/io/opentelemetry/instrumentation/api/appender/GlobalLogEmitterProviderTest.java

Co-authored-by: Mateusz Rzeszutek <[email protected]>

Co-authored-by: Mateusz Rzeszutek <[email protected]>
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.

None yet

3 participants