I'm using Spring Cloud Sleuth to provide distributed tracing for my app.
The trace is logged with logback using logback-spring.xml.
This configuration specifies the following logging pattern:
{
"severity": "%level",
"service": "${springAppName:-}",
"trace": "%X{X-B3-TraceId:-}",
"span": "%X{X-B3-SpanId:-}",
"parent": "%X{X-B3-ParentSpanId:-}",
"exportable": "%X{X-Span-Export:-}",
"pid": "${PID:-}",
"thread": "%thread",
"class": "%logger{40}",
"rest": "%message"
}
Does Sleuth automatically calculates span duration and is it possible to add span duration to this logging pattern?