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 support for capturing logback mdc attributes #4968

Merged
merged 2 commits into from
Jan 3, 2022

Conversation

trask
Copy link
Member

@trask trask commented Dec 22, 2021

Following convention from #4959 (log4j)

Split out the mapper class into library instrumentation to enable unit testing of it, and we will want logback appender (library) shortly anyways (#4947)


public static final LoggingEventMapper INSTANCE = new LoggingEventMapper();

private static final Cache<String, AttributeKey<String>> mdcAttributeKeys = Cache.bounded(100);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you think there'd be a benefit in having a shared cache in an .internal. class in instrumentation-api?

Copy link
Member Author

Choose a reason for hiding this comment

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

Created #5003 to discuss/track

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Looks good. Adding an appender is really trivial at this point. Will open a PR once this is merged.

@jack-berg jack-berg mentioned this pull request Dec 28, 2021
@trask trask merged commit 1a9b375 into open-telemetry:main Jan 3, 2022
@trask trask deleted the logback-mdc branch January 3, 2022 18:32
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Add support for capturing logback mdc attributes

* Spotless
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