Skip to content

Commit

Permalink
[4.x] [Doc] Minor fixes in SE Tracing documentation (helidon-io#7887)
Browse files Browse the repository at this point in the history
* Fix doc

Signed-off-by: Dmitry Aleksandrov <[email protected]>

* Fix webclient block

Signed-off-by: Dmitry Aleksandrov <[email protected]>

---------

Signed-off-by: Dmitry Aleksandrov <[email protected]>
  • Loading branch information
dalexandrov authored Oct 25, 2023
1 parent 0d5cb62 commit 4108d2c
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions docs/se/tracing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,24 @@ ServerConfiguration.builder()
=== Creating Custom Spans
To create a custom span that is a child of the WebServer request:
To create a custom span from tracer:
[source,java]
----
Span span = request.tracer()
.spanBuilder("my-operation")
.update(spanBuilder -> request.spanContext().ifPresent(spanBuilder::parent))
.start();
try {
// Do some work and send a normal response.
span.end();
} catch (Throwable t) {
// Send an error response.
span.end(t);
}
Span span = tracer.spanBuilder("name") <1>
.tag("key", "value")
.start();
try (...){ <2>
//do some work
span.end();
} catch (Exception e) { <3>
span.end(e);
}
----
<1> Create span from tracer.
<2> Do some work and end span.
<3> End span with exception.
== Helidon Spans
Expand Down Expand Up @@ -287,7 +288,7 @@ WebClient client = WebClient.builder()
.addService(WebClientTracing.create())
.build();
Single<String> response = client.get()
String response = client.get()
.uri(uri)
.request(String.class);
----
Expand Down

0 comments on commit 4108d2c

Please sign in to comment.