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

support for adding baggage to log4j 2 ContextData #8810

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

lu-xiaoshuang
Copy link
Contributor

No description provided.

Copy link
Member

@mateuszrzeszutek mateuszrzeszutek left a comment

Choose a reason for hiding this comment

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

Thanks for contributing @lu-xiaoshuang !
I left a couple comments.

@lu-xiaoshuang
Copy link
Contributor Author

@mateuszrzeszutek update completed.

docs/logger-mdc-instrumentation.md Outdated Show resolved Hide resolved
@@ -43,6 +54,14 @@ public StringMap injectContextData(List<Property> list, StringMap stringMap) {
newContextData.putValue(TRACE_ID, currentContext.getTraceId());
newContextData.putValue(SPAN_ID, currentContext.getSpanId());
newContextData.putValue(TRACE_FLAGS, currentContext.getTraceFlags().asHex());

if (BAGGAGE_ENABLED) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add tests for the new feature? You can take a look at the logback implementation and do it in a similar way

val addBaggageTest by registering(JvmTestSuite::class) {
targets {
all {
testTask.configure {
jvmArgs("-Dotel.instrumentation.logback-mdc.add-baggage=true")
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry. I am not familiar with the unit testing modules of this project. It would be great if some volunteers could provide testing cases in future. By the way, my private built agent with this feature works well for me.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I'll create a follow-up task for that instead.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure ~

@@ -43,6 +54,14 @@ public StringMap injectContextData(List<Property> list, StringMap stringMap) {
newContextData.putValue(TRACE_ID, currentContext.getTraceId());
newContextData.putValue(SPAN_ID, currentContext.getSpanId());
newContextData.putValue(TRACE_FLAGS, currentContext.getTraceFlags().asHex());

if (BAGGAGE_ENABLED) {
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I'll create a follow-up task for that instead.

@mateuszrzeszutek
Copy link
Member

Thanks @lu-xiaoshuang !

@mateuszrzeszutek mateuszrzeszutek merged commit a410cde into open-telemetry:main Jul 4, 2023
45 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.

None yet

2 participants