This project represents a library packaged as a Spring Boot Starter. It contains the following functionality, implemented for BOTH the servlet & reactive stacks. All of the auto-configuration is driven from the TracingAutoConfiguration class.
- Distributed Tracing via Zipkin / Spring Cloud Sleuth / P6Spy
- Offer a configuration property
mycompany.myframework.tracing.enable-response-headers
- If
true
, send backtraceId
&spanExportable
headers to the caller with the trace id for the trace, as well as whether or not the span was exported to Zipkin - For servlet implementation, see TracingResponseBodyAdvice
- For reactive implementation, see TracingResponseBodyResultHandler
- If
- For each span, add a tag with the key
spring.profiles.active
and the value is a comma-separated list of the current active profiles, as reported by thespring.profiles.active
property - Default the
spring.sleuth.trace-id128
property totrue
if it has not explicitly been set - Default the
spring.sleuth.sampler.probability
property to0.5
if it has not explicitly been set - Configure the
p6spy.config.modulelist
system property to control which P6Spy modules are activatedcom.p6spy.engine.spy.P6SpyFactory
com.p6spy.engine.logging.P6LogFactory
brave.p6spy.TracingP6Factory
- See TracingConfigurerApplicationListener
- Configure the default logging pattern to include the following information
- Trace id
- Span id
- Parent span id (if applicable)
- Whether or not the span will be exported (spanExportable)
- See logback-spring.xml
- This could have easily been re-written as code rather than having a Logback-specific configuration file.
- By default no
spring.zipkin.baseUrl
property is specified. An application would have to configure this property manually to specify the Zipkin server location.- This would be trivial to do by default by the library if a known Zipkin location existed within an environment
- Offer a configuration property