-
Notifications
You must be signed in to change notification settings - Fork 719
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
Adds MDCCurrentTraceContext for log correlation #389
Conversation
@ryangardner I know you asked for this a year ago, but everything's coming together now |
fa72226
to
eac8a4d
Compare
This adds trace and span IDs to the SLF4J Mapped Diagnostic Context (MDC) so that you can search or aggregate logs accordingly. To enable this, configure `brave.Tracing` with `MDCCurrentTraceContext` like so: ```java tracing = Tracing.newBuilder() .currentTraceContext(MDCCurrentTraceContext.create()) ... .build(); ``` Then, in your log configuration, you can use `traceId` and or `spanId`.
eac8a4d
to
40399d9
Compare
nice! |
Looks good to me. Whats up with the circle-ci failure? |
Unrelated flake but will have a look
…On 3 May 2017 04:02, "Brian Devins" ***@***.***> wrote:
Looks good to me. Whats up with the circle-ci failure?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#389 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD613KYN8YoOnsd5AklOtQW4bbRYyG_ks5r14vFgaJpZM4NOUva>
.
|
next release won't be until this weekend, so feel free to provide feedback after the fact. merged so people can play with snapshots |
bumped version to 4.3.0-SNAPSHOT |
Can this be extended to Log4j2 thread context? |
Can this be extended to Log4j2 thread context?
yes.. I already have an impl, just was waiting for someone to ask
|
Awesome! |
This adds trace and span IDs to the Log4J 2 Thread Context so that you can search or aggregate logs accordingly. To enable this, configure `brave.Tracing` with `ThreadContextCurrentTraceContext` like so: ```java tracing = Tracing.newBuilder() .currentTraceContext(ThreadContextCurrentTraceContext.create()) ... .build(); ``` See #389
This adds trace and span IDs to the Log4J 2 Thread Context so that you can search or aggregate logs accordingly. To enable this, configure `brave.Tracing` with `ThreadContextCurrentTraceContext` like so: ```java tracing = Tracing.newBuilder() .currentTraceContext(ThreadContextCurrentTraceContext.create()) ... .build(); ``` See #389
Currently trying to add the traceID into my logging for any HTTP request.. What is this logback configuration that is referenced(the only xml files I have are my pom.xml)? Also, because the decorator's create() methods are all deprecrated, should I be using the get() method instead? |
This adds trace and span IDs to the SLF4J Mapped Diagnostic Context (MDC)
so that you can search or aggregate logs accordingly.
To enable this, configure
brave.Tracing
withMDCCurrentTraceContext
like so:
Then, in your log configuration, you can use
traceId
and orspanId
.Here's an example logback configuration:
When a trace is in progress, it would log statements like this:
Users could then copy/paste the trace ID into the zipkin UI, or use log
correlation to further debug a problem.
Fixes #150
See #369