Skip to content

Commit f6cbed4

Browse files
committed
Update Tracing section for Spring Boot 4's modularity
Closes gh-48576
1 parent e1b16c2 commit f6cbed4

File tree

1 file changed

+22
-27
lines changed
  • documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator

1 file changed

+22
-27
lines changed

documentation/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/tracing.adoc

Lines changed: 22 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,17 @@ Spring Boot ships auto-configuration for the following tracers:
2222

2323
We need an example application that we can use to get started with tracing.
2424
For our purposes, the simple "`Hello World!`" web application that's covered in the xref:tutorial:first-application/index.adoc[] section will suffice.
25-
We're going to use the OpenTelemetry tracer with Zipkin as trace backend.
25+
We're going to use the Brave tracer with Zipkin as trace backend.
2626

2727
To recap, our main application code looks like this:
2828

2929
include-code::MyApplication[]
3030

3131
NOTE: There's an added logger statement in the `home()` method, which will be important later.
3232

33-
Now we have to add the following dependencies:
33+
Now we have to add the `org.springframework.boot:spring-boot-starter-zipkin` dependency.
3434

35-
* `org.springframework.boot:spring-boot-starter-actuator`
36-
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
37-
* `io.opentelemetry:opentelemetry-exporter-zipkin` - reports {url-micrometer-tracing-docs}/glossary[traces] to Zipkin.
38-
39-
Add the following application properties:
35+
Then add the following application properties:
4036

4137
[configprops,yaml]
4238
----
@@ -62,7 +58,7 @@ If you open a web browser to `http://localhost:8080`, you should see the followi
6258
Hello World!
6359
----
6460

65-
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.
61+
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.
6662

6763
Now open the Zipkin UI at `http://localhost:9411` and press the "Run Query" button to list all collected traces.
6864
You should see one trace.
@@ -111,30 +107,15 @@ WARNING: If you create the javadoc:org.springframework.web.client.RestTemplate[]
111107
== Tracer Implementations
112108

113109
As Micrometer Tracer supports multiple tracer implementations, there are multiple dependency combinations possible with Spring Boot.
114-
115-
All tracer implementations need the `org.springframework.boot:spring-boot-starter-actuator` dependency.
116-
117-
118-
119-
[[actuator.micrometer-tracing.tracer-implementations.otel-zipkin]]
120-
=== OpenTelemetry With Zipkin
121-
122-
Tracing with OpenTelemetry and reporting to Zipkin requires the following dependencies:
123-
124-
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
125-
* `io.opentelemetry:opentelemetry-exporter-zipkin` - reports traces to Zipkin.
126-
127-
Use the `management.tracing.export.zipkin.*` configuration properties to configure reporting to Zipkin.
128-
110+
The combinations OpenTelemetry with OTLP and Brave with Zipkin are common and have dedicated starters.
129111

130112

131113
[[actuator.micrometer-tracing.tracer-implementations.otel-otlp]]
132114
=== OpenTelemetry With OTLP
133115

134116
Tracing with OpenTelemetry and reporting using OTLP requires the following dependencies:
135117

136-
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
137-
* `io.opentelemetry:opentelemetry-exporter-otlp` - reports traces to a collector that can accept OTLP.
118+
* `org.springframework.boot:spring-boot-starter-opentelemetry`
138119

139120
Use the `management.opentelemetry.tracing.export.otlp.*` configuration properties to configure reporting using OTLP.
140121

@@ -144,13 +125,27 @@ The customizers take precedence over anything applied by the auto-configuration.
144125

145126

146127

128+
[[actuator.micrometer-tracing.tracer-implementations.otel-zipkin]]
129+
=== OpenTelemetry With Zipkin
130+
131+
Tracing with OpenTelemetry and reporting to Zipkin requires the following dependencies:
132+
133+
* `org.springframework.boot:spring-boot-opentelemetry` - Spring Boot's OpenTelemetry support.
134+
* `org.springframework.boot:spring-boot-micrometer-tracing-opentelemetry` - Spring Boot's support for Micrometer Tracing over OpenTelemetry.
135+
* `io.micrometer:micrometer-tracing-bridge-otel` - bridges the Micrometer Observation API to OpenTelemetry.
136+
* `org.springframework.boot:spring-boot-zipkin` - Spring Boot's support for Zipkin.
137+
* `io.opentelemetry:opentelemetry-exporter-zipkin` - OpenTelemetry exporter that reports traces to Zipkin.
138+
139+
Use the `management.tracing.export.zipkin.*` configuration properties to configure reporting to Zipkin.
140+
141+
142+
147143
[[actuator.micrometer-tracing.tracer-implementations.brave-zipkin]]
148144
=== OpenZipkin Brave With Zipkin
149145

150146
Tracing with OpenZipkin Brave and reporting to Zipkin requires the following dependencies:
151147

152-
* `io.micrometer:micrometer-tracing-bridge-brave` - bridges the Micrometer Observation API to Brave.
153-
* `io.zipkin.reporter2:zipkin-reporter-brave` - reports traces to Zipkin.
148+
* `org.springframework.boot:spring-boot-starter-zipkin`
154149

155150
Use the `management.tracing.export.zipkin.*` configuration properties to configure reporting to Zipkin.
156151

0 commit comments

Comments
 (0)