Skip to content

Commit

Permalink
Fix doc
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Aleksandrov <dmitry.aleksandrov@oracle.com>
  • Loading branch information
dalexandrov committed Oct 25, 2023
1 parent 0d5cb62 commit 10019e3
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 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

0 comments on commit 10019e3

Please sign in to comment.