@@ -37,8 +37,6 @@ include::{rootdir}/includes/mp.adoc[]
37
37
38
38
== Overview
39
39
40
-
41
-
42
40
include::{rootdir}/includes/dependencies.adoc[]
43
41
44
42
[source,xml]
@@ -100,7 +98,7 @@ class HelidonBean {
100
98
}
101
99
}
102
100
----
103
- <1> Simple `@WithSpan` annotation usage;
101
+ <1> Simple `@WithSpan` annotation usage.
104
102
<2> Additional attributes can be set to the annotation.
105
103
106
104
You can also inject OpenTelemetry `Tracer` using the regular `@Inject` annotation and use `SpanBuilder` to manually create, star, and stop Spans.
@@ -128,10 +126,10 @@ public class HelidonEndpoint {
128
126
}
129
127
}
130
128
----
131
- <1> Inject `Tracer`;
132
- <2> Use `Tracer.spanBuilder` to create and start new `Span`;
129
+ <1> Inject `Tracer`.
130
+ <2> Use `Tracer.spanBuilder` to create and start new `Span`.
133
131
134
- To obtain the current span, it can be injected with CDI. The current span can also be obtained using the static method `Span.current()`.
132
+ To obtain the current span, it can be injected by CDI. The current span can also be obtained using the static method `Span.current()`.
135
133
136
134
.Inject the current span
137
135
[source, java]
@@ -155,9 +153,9 @@ public class HelidonEndpoint {
155
153
}
156
154
}
157
155
----
158
- <1> Inject the current span;
159
- <2> Use the injected span;
160
- <3> Use `Span.current()` to access the current span;
156
+ <1> Inject the current span.
157
+ <2> Use the injected span.
158
+ <3> Use `Span.current()` to access the current span.
161
159
162
160
The same functionality is available for the `Baggage` API:
163
161
@@ -183,9 +181,9 @@ public class HelidonEndpoint {
183
181
}
184
182
}
185
183
----
186
- <1> Inject the current baggage;
187
- <2> Use the injected baggage;
188
- <3> Use `Baggage.current()` to access the current baggage;
184
+ <1> Inject the current baggage.
185
+ <2> Use the injected baggage.
186
+ <3> Use `Baggage.current()` to access the current baggage.
189
187
190
188
191
189
== Configuration
@@ -254,8 +252,8 @@ Together with Helidon Telemetry dependency, an OpenTelemetry Exporter dependency
254
252
<artifactId>opentelemetry-exporter-jaeger</artifactId> <2>
255
253
</dependency>
256
254
----
257
- <1> Helidon Telemetry dependency
258
- <2> OpenTelemetry Jaeger exporter
255
+ <1> Helidon Telemetry dependency.
256
+ <2> OpenTelemetry Jaeger exporter.
259
257
260
258
Add these lines to `META-INF/microprofile-config.properties`:
261
259
@@ -266,9 +264,9 @@ otel.sdk.disabled=false <1>
266
264
otel.traces.exporter=jaeger <2>
267
265
otel.exporter.name=greeting-service <3>
268
266
----
269
- <1> Enable MicroProfile Telemetry
270
- <2> Set exporter to Jaeger
271
- <3> Name of our service
267
+ <1> Enable MicroProfile Telemetry.
268
+ <2> Set exporter to Jaeger.
269
+ <3> Name of our service.
272
270
273
271
Here we enable MicroProfile Telemetry, set tracer to "jaeger" and give a name, which will be used to identify our service in the tracer.
274
272
@@ -286,7 +284,7 @@ for our example we use Jaeger managing the tracing data. If you prefer to use Zi
286
284
287
285
=== Tracing at Method Level
288
286
289
- Let us create simple services and use `@WithSpan` and `Tracer` to create span and let MicroProfile Opentelemetry handle them
287
+ Let us create simple services and use `@WithSpan` and `Tracer` to create span and let MicroProfile OpenTelemetry handle them
290
288
291
289
[source, java]
292
290
----
@@ -336,10 +334,10 @@ public JsonObject useCustomSpan(){
336
334
.build();
337
335
}
338
336
----
339
- <1> Inject Opentelemetry `Tracer`
340
- <2> Create Span around the method `useCustomSpan()`
341
- <3> Create a custom `INTERNAL` span and start it
342
- <4> End the custom span
337
+ <1> Inject Opentelemetry `Tracer`.
338
+ <2> Create Span around the method `useCustomSpan()`.
339
+ <3> Create a custom `INTERNAL` span and start it.
340
+ <4> End the custom span.
343
341
344
342
Let us call the custom endpoint:
345
343
@@ -367,9 +365,9 @@ public String outbound() {
367
365
return target.request().accept(MediaType.TEXT_PLAIN).get(String.class); <3>
368
366
}
369
367
----
370
- <1> Inject `WebTarget` pointing to Secondary service
371
- <2> Wrap method using `WithSpan`
372
- <3> Call the secondary service;
368
+ <1> Inject `WebTarget` pointing to Secondary service.
369
+ <2> Wrap method using `WithSpan`.
370
+ <3> Call the secondary service.
373
371
374
372
The secondary service is very simple, it has only one method, which is also annotated with `@WithSpan`.
375
373
@@ -382,8 +380,8 @@ public String getSecondaryMessage() {
382
380
return "Secondary"; <2>
383
381
}
384
382
----
385
- <1> Wrap method in a span
386
- <2> Return a string
383
+ <1> Wrap method in a span.
384
+ <2> Return a string.
387
385
388
386
Let us call the _Outbound_ endpoint:
389
387
0 commit comments