You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a MDC machenism in this client?
For example,Spring Cloud Sleuth outputs logs like this:
If we outputting logs (probably using MDC) with the trace-id and span-id and parsing those when inserting into elasticsearch, it’s pretty easy to search elasticsearch for a given trace ID, and the Zipkin UI already has an integration that I can setup a link to your kibana with the search for the trace ID from the trace view
The text was updated successfully, but these errors were encountered:
Closest thing to MDC in Go would be a combination of structured logging for which I'd recommend Go kit's Logger package: /~https://github.com/go-kit/kit/tree/master/log and then using the Go standard library context package context. Go has no thread local storage so you'd be passing a context object holding your logger (holding upstream contextual key/pairs) to each function you call (Go idiom: first parameter should be context)
Zipkin-go allows you to place spans in and pull spans from context using zipkin.NewContext() and zipkin.SpanFromContext() so standard library context becomes your vehicle for propagating spans and loggers through your application.
If you've pulled a span from go context you can retrieve the trace identifiers using span.Context() which holds SpanContext (span identifiers and flags).
Hi @feyman2016, not sure what library for mdc in go you use but I have been working and using this library which supports a feature called providers that allows user to plug functions like this one that injects the traceID and spanID in the logs.
Is there a MDC machenism in this client?
For example,Spring Cloud Sleuth outputs logs like this:
If we outputting logs (probably using MDC) with the trace-id and span-id and parsing those when inserting into elasticsearch, it’s pretty easy to search elasticsearch for a given trace ID, and the Zipkin UI already has an integration that I can setup a link to your kibana with the search for the trace ID from the trace view
The text was updated successfully, but these errors were encountered: