Implements auto-configurations for Micrometer Tracing
See gh-30156
So far this auto-configuration supports:
- Zipkin with a configurable URL, using JSON_V2 encoding and HTTP transport
- Wavefront with a configurable URL
- Configurable sampling probability (0% - 100%) for Brave and for OpenTelemetry
- Brave configured for Zipkin
- Brave propagation with B3 headers
- OpenTelemetry configured for Zipkin
- Micrometer tracing bridges for Brave and OpenTelemetry
- Micrometer observation handler for tracing
- Brave configured for Wavefront
- OpenTelemetry configured for Wavefront
Comment From: mhalbritter
These are the dependency combinations i have tested with and which produce spans in backends:
Zipkin & Brave (no spring-web)
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.zipkin.reporter2:zipkin-sender-urlconnection'
Zipkin & Brave (RestTemplate)
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'org.springframework.boot:spring-boot-starter-web'
Zipkin & Otel (no spring-web)
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.zipkin.reporter2:zipkin-sender-urlconnection'
implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'
Zipkin & Otel (RestTemplate)
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'io.opentelemetry:opentelemetry-exporter-zipkin'
Wavefront & Otel
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-otel'
implementation 'io.micrometer:micrometer-tracing-reporter-wavefront'
Wavefront & Brave
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-tracing-bridge-brave'
implementation 'io.micrometer:micrometer-tracing-reporter-wavefront'
For Wavefront, at least the management.wavefront.api-token must be set, otherwise startup fails:
Caused by: org.springframework.boot.context.properties.source.InvalidConfigurationPropertyValueException: Property management.wavefront.api-token with value 'null' is invalid: This property is mandatory whenever publishing directly to the Wavefront API
at org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties.getApiTokenOrThrow(WavefrontProperties.java:125) ~[classes/:na]
at org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontAutoConfiguration.wavefrontSender(WavefrontAutoConfiguration.java:51) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:130) ~[spring-beans-6.0.0-M3.jar:6.0.0-M3]
... 140 common frames omitted
Comment From: mhalbritter
Blocked on https://github.com/micrometer-metrics/tracing/issues/16
Comment From: mhalbritter
Rebased and put into main, see https://github.com/spring-projects/spring-boot/commit/3860eb211af1b429f325c05408ba2ebc82ae6698