Previously, RestTemplateBuilder and WebClient.Builder beans were used
to create the HTTP client for sending out spans. Those same beans are
also instrumented for observability which results in a cycle.
This commit breaks the cycle by not using the application-web
builders to create the RestTemplate and WebClient's used by the Zipkin
senders. Instead, builders are created inline, with new callbacks
being introduced to allow the user to customize these Zipkin-specific
builders.
See gh-32528
Previously, a Webclient-based sender was only for reactive web
applications, falling back to a RestTemplate-based sender in all
other cases.
With this commit we now prefer to use WebClient if it is available,
irrespective of the web application type. The assumption is that
if the user has WebClient on the classpath, it's either a reactive
web application, or it's a servlet web application or non-web
application but WebClient is preferred.
See gh-32529
Prior to this commit, Spring Boot would auto-configure a customizer that
instruments `RestTemplate` through a `RestTemplateBuilder`. This would
install a request interceptor that instrumented client exchanges for
producing metrics.
As of spring-projects/spring-framework#28341, the instrumentation is
done at the `RestTemplate` level directly using the `Observation` API.
The `Tag` (now `KeyValue`) extraction, observation name and
instrumentation behavior now lives in the Spring Framework project.
This commit updates the auto-configuration to switch from Boot-specific
Metrics instrumentation to a generic Observation instrumentation.
As a migration path, some configuration properties are deprecated in
favor of the new `management.observations.*` namespace.
Closes gh-32484
* gh-32480:
Polish "Add support for MDC, Context Propagation (via B3 and W3C), and Baggage"
Add support for MDC, Context Propagation (via B3 and W3C), and Baggage
Closes gh-32480