Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(logging): OpenTelemetry trace/span ID integration for Java logging library #1596
feat(logging): OpenTelemetry trace/span ID integration for Java logging library #1596
Changes from 9 commits
da8bd86
ab65496
246c1f5
107144b
b4d3ee7
4808c99
8416b66
7ca6f19
72aa518
db7f163
e67c907
42a49e1
e4c3f06
9f09a85
cefcd73
c600f0d
1d48166
0e61c7d
9cf24ab
e59fd6b
4ff6738
d560806
c8e4eca
ae60311
43d69d0
2d8345e
a8bba3c
e035733
4270847
e4b8de1
fe58cd8
ba86d25
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
currentPriority
gets initialized toNO_INPUT
, is it possible for it to ever benull
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added
priority
parameter null check and removecurrentPriority
null check, now I don't thinkcurrentPriority
will benull
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you set the
ContextPriority
for the other modes as well? I only seeOTEL_EXTRACTED
being set in this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike other logging libraries, java-logging library doesn't call other setCurrentContext() within the library itself. It's usually delegated to customers or integration library. An example is mentioned here (2nd approach to set trace for log entries):
RequestContextFilter in java-logging-servlet-initializer repository will call setCurrentContext () and load tracing context from cloud tracing or W3C headers.
And we do have a plan mentioned here to switch to the new setCurrentContext(Context context, ContextPriority priority) in java-logging-servlet-initializer after the change in this repository is released.
I have also added some unit tests here for
setCurrentContext(Context context, ContextPriority priority)
: https://github.com/googleapis/java-logging/pull/1596/files#diff-cca9976e4f3cf85575f1f366cb06f8047e56f4888f16340facf158dfa7ec6721