0
votes

I am using spring-cloud-sleuth:2.0.1.RELEASE with Spring Webflux. The doc talks about logging trace, span, etc using MDC. It also talks about sending traces to Zipkin via HTTP.

I am interested in logging the trace information in more elaborate way. With every log statement, I want to emit the zipkin traces in the JSON format - very close to what's depicted here: https://zipkin.io/pages/data_model.html

What is the best way to accomplish this in sleuth?

1

1 Answers

0
votes

You can have s custom span reporter that before sending spans to zipkin will dump the span as a json structure to logs.

UPDATE:

With this PR merged https://github.com/spring-cloud/spring-cloud-sleuth/pull/1068, in 2.1.0 you'll have an easy way to implement your own MDC entries