mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-17 12:09:16 +00:00
Merge branch '4.0.x'
Closes gh-48582
This commit is contained in:
+22
-27
@@ -22,7 +22,7 @@ Spring Boot ships auto-configuration for the following tracers:
|
||||
|
||||
We need an example application that we can use to get started with tracing.
|
||||
For our purposes, the simple "`Hello World!`" web application that's covered in the xref:tutorial:first-application/index.adoc[] section will suffice.
|
||||
We're going to use the OpenTelemetry tracer with Zipkin as trace backend.
|
||||
We're going to use the Brave tracer with Zipkin as trace backend.
|
||||
|
||||
To recap, our main application code looks like this:
|
||||
|
||||
@@ -30,13 +30,9 @@ include-code::MyApplication[]
|
||||
|
||||
NOTE: There's an added logger statement in the `home()` method, which will be important later.
|
||||
|
||||
Now we have to add the following dependencies:
|
||||
Now we have to add the `org.springframework.boot:spring-boot-starter-zipkin` dependency.
|
||||
|
||||
* `org.springframework.boot:spring-boot-starter-actuator`
|
||||
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
|
||||
* `io.opentelemetry:opentelemetry-exporter-zipkin` - reports {url-micrometer-tracing-docs}/glossary[traces] to Zipkin.
|
||||
|
||||
Add the following application properties:
|
||||
Then add the following application properties:
|
||||
|
||||
[configprops,yaml]
|
||||
----
|
||||
@@ -62,7 +58,7 @@ If you open a web browser to `http://localhost:8080`, you should see the followi
|
||||
Hello World!
|
||||
----
|
||||
|
||||
Behind the scenes, an observation has been created for the HTTP request, which in turn gets bridged to OpenTelemetry, which reports a new trace to Zipkin.
|
||||
Behind the scenes, an observation has been created for the HTTP request, which in turn gets bridged to Brave, which reports a new trace to Zipkin.
|
||||
|
||||
Now open the Zipkin UI at `http://localhost:9411` and press the "Run Query" button to list all collected traces.
|
||||
You should see one trace.
|
||||
@@ -111,21 +107,7 @@ WARNING: If you create the javadoc:org.springframework.web.client.RestTemplate[]
|
||||
== Tracer Implementations
|
||||
|
||||
As Micrometer Tracer supports multiple tracer implementations, there are multiple dependency combinations possible with Spring Boot.
|
||||
|
||||
All tracer implementations need the `org.springframework.boot:spring-boot-starter-actuator` dependency.
|
||||
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.tracer-implementations.otel-zipkin]]
|
||||
=== OpenTelemetry With Zipkin
|
||||
|
||||
Tracing with OpenTelemetry and reporting to Zipkin requires the following dependencies:
|
||||
|
||||
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
|
||||
* `io.opentelemetry:opentelemetry-exporter-zipkin` - reports traces to Zipkin.
|
||||
|
||||
Use the `management.tracing.export.zipkin.*` configuration properties to configure reporting to Zipkin.
|
||||
|
||||
The combinations OpenTelemetry with OTLP and Brave with Zipkin are common and have dedicated starters.
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.tracer-implementations.otel-otlp]]
|
||||
@@ -133,8 +115,7 @@ Use the `management.tracing.export.zipkin.*` configuration properties to configu
|
||||
|
||||
Tracing with OpenTelemetry and reporting using OTLP requires the following dependencies:
|
||||
|
||||
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
|
||||
* `io.opentelemetry:opentelemetry-exporter-otlp` - reports traces to a collector that can accept OTLP.
|
||||
* `org.springframework.boot:spring-boot-starter-opentelemetry`
|
||||
|
||||
Use the `management.opentelemetry.tracing.export.otlp.*` configuration properties to configure reporting using OTLP.
|
||||
|
||||
@@ -144,13 +125,27 @@ The customizers take precedence over anything applied by the auto-configuration.
|
||||
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.tracer-implementations.otel-zipkin]]
|
||||
=== OpenTelemetry With Zipkin
|
||||
|
||||
Tracing with OpenTelemetry and reporting to Zipkin requires the following dependencies:
|
||||
|
||||
* `org.springframework.boot:spring-boot-opentelemetry` - Spring Boot's OpenTelemetry support.
|
||||
* `org.springframework.boot:spring-boot-micrometer-tracing-opentelemetry` - Spring Boot's support for Micrometer Tracing over OpenTelemetry.
|
||||
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
|
||||
* `org.springframework.boot:spring-boot-zipkin` - Spring Boot's support for Zipkin.
|
||||
* `io.opentelemetry:opentelemetry-exporter-zipkin` - OpenTelemetry exporter that reports traces to Zipkin.
|
||||
|
||||
Use the `management.tracing.export.zipkin.*` configuration properties to configure reporting to Zipkin.
|
||||
|
||||
|
||||
|
||||
[[actuator.micrometer-tracing.tracer-implementations.brave-zipkin]]
|
||||
=== OpenZipkin Brave With Zipkin
|
||||
|
||||
Tracing with OpenZipkin Brave and reporting to Zipkin requires the following dependencies:
|
||||
|
||||
* `io.micrometer:micrometer-tracing-bridge-brave` - bridges the Micrometer Observation API to Brave.
|
||||
* `io.zipkin.reporter2:zipkin-reporter-brave` - reports traces to Zipkin.
|
||||
* `org.springframework.boot:spring-boot-starter-zipkin`
|
||||
|
||||
Use the `management.tracing.export.zipkin.*` configuration properties to configure reporting to Zipkin.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user