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

Slf4JEventListener support custom key #160

Merged
merged 7 commits into from Feb 13, 2023

Conversation

ShenFeng312
Copy link
Contributor

@ShenFeng312 ShenFeng312 commented Feb 9, 2023

see #158

@@ -23,4 +23,5 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation 'ch.qos.logback:logback-classic'
Copy link
Member

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because we need StaticMDCBinder to init MDC

Copy link
Member

Choose a reason for hiding this comment

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

Where is it used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonatan-ivanov jonatan-ivanov linked an issue Feb 9, 2023 that may be closed by this pull request

private final String customSpanIdKey = "customSpanId";

Slf4JEventListener slf4JEventListenerCustom = new Slf4JEventListener(customTraceIdKey, customSpanIdKey);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we call this customSlf4JEventListener?
Also, is it possible to move these three lines to the new test method you created?

@ShenFeng312
Copy link
Contributor Author

Hello?
@jonatan-ivanov @marcingrzejszczak

@marcingrzejszczak
Copy link
Contributor

I'm still wondering about this - do you want to use this with Spring Boot? I'm wondering cause you can't modify these when using Brave and we would like to be pretty consistent I guess, WDYT @shakuzen @jonatan-ivanov ?

@marcingrzejszczak marcingrzejszczak merged commit 6088494 into micrometer-metrics:main Feb 13, 2023
@marcingrzejszczak
Copy link
Contributor

Hey we discussed it with the team and we will merge this, however we're not planning to add any additional support for this in Spring Boot. You will need to create a bean of this type and use the new constructor if you want to use different keys in MDC.

@marcingrzejszczak marcingrzejszczak added the enhancement New feature or request label Feb 13, 2023
@marcingrzejszczak marcingrzejszczak added this to the 1.1.0-M1 milestone Feb 13, 2023
@ShenFeng312
Copy link
Contributor Author

I'm still wondering about this - do you want to use this with Spring Boot? I'm wondering cause you can't modify these when using Brave and we would like to be pretty consistent I guess, WDYT @shakuzen @jonatan-ivanov ?

I am still new to the Brave. I think I can fix this , but not right now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support custom MDC key with otel.bridge.Slf4JEventListener
3 participants