Skip to content

Commit

Permalink
Additional info
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Aleksandrov <[email protected]>
  • Loading branch information
dalexandrov committed Nov 8, 2023
1 parent 666caae commit 62073cd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 deletions.
40 changes: 19 additions & 21 deletions docs/se/guides/tracing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ include::{rootdir}/includes/prerequisites.adoc[tag=prerequisites]
Distributed tracing is a critical feature of microservice-based applications, since it traces workflow both
within a service and across multiple services. This provides insight to sequence and timing data for specific blocks of work,
which helps you identify performance and operational issues. Helidon SE includes support for distributed tracing
through the https://opentracing.io[OpenTracing API] and the https://opentelemetry.io[OpenTelemety API]. Tracing is integrated with WebServer
and Security using either the https://zipkin.io[Zipkin] or https://www.jaegertracing.io[Jaeger] tracers.
which helps you identify performance and operational issues. Helidon includes support for distributed tracing through its own API, backed by either
through the https://opentelemetry.io/docs/instrumentation/js/api/tracing/[OpenTelemetry API], or by
https://opentracing.io[OpenTracing API].
=== Tracing Concepts
Expand All @@ -59,7 +59,7 @@ Spans are automatically created by Helidon as needed during execution of the RES
The examples in this guide demonstrate how to integrate tracing with Helidon, how to view traces, how to trace
across multiple services, and how to integrate with tracing with Kubernetes. All examples use Jaeger and traces
will be viewed using both the Jaeger UI.
will be viewed using the Jaeger UI.
=== Create a Sample Helidon SE Project
Expand Down Expand Up @@ -173,7 +173,7 @@ WebServer server = WebServer.builder(createRouting(config))
<2> Add an observability feature using the created `Tracer`.
[source,java]
.Update the `GreetService` class; 1) Add a new import and 2) Replace the `getDefaultMessageHandler` method:
.Update the `GreetService` class: replace the `getDefaultMessageHandler` method:
----
private void getDefaultMessageHandler(ServerRequest request,
ServerResponse response) {
Expand Down Expand Up @@ -252,7 +252,7 @@ image::guides/12_tracing_span_detail.png[Span Details]
Helidon automatically traces across services if the services use the same tracer, for example, the same instance of Jaeger.
This means a single trace can include spans from multiple services and hosts. Helidon uses a `Span.context()` to
propagate tracing information across process boundaries. When you make client API calls, Helidon will
internally call OpenTracing APIs to propagate the Span Context. There is nothing you need to do in your application to make this work.
internally call OpenTelemetry APIs to propagate the Span Context. There is nothing you need to do in your application to make this work.
To demonstrate distributed tracing, you will need to create a second project, where the server listens on port 8081.
Create a new root directory to hold this new project, then do the following steps, similar to
Expand Down Expand Up @@ -342,22 +342,20 @@ WebServer server = WebServer.builder(createRouting(config))
[source,java]
.Update the `GreetService` class. Replace the `getDefaultMessageHandler` method:
----
import io.opentracing.Span;
//...
private void getDefaultMessageHandler(ServerRequest request,
ServerResponse response) {
var spanBuilder = request.tracer()
.buildSpan("getDefaultMessageHandler");
request.spanContext().ifPresent(spanBuilder::asChildOf);
Span span = spanBuilder.start();
try {
sendResponse(response, "World");
} finally {
span.finish();
}
private void getDefaultMessageHandler(ServerRequest request,
ServerResponse response) {
var spanBuilder = request.tracer()
.buildSpan("getDefaultMessageHandler");
request.spanContext().ifPresent(spanBuilder::asChildOf);
Span span = spanBuilder.start();
try {
sendResponse(response, "World");
} finally {
span.finish();
}
}
----
[source,bash]
Expand Down
7 changes: 4 additions & 3 deletions docs/se/tracing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -233,12 +233,12 @@ server.addFeature(ObserveFeature.builder()
==== Path-based Configuration in Helidon WebServer
For WebServer we have path-based support for configuring tracing, in addition
For Web Server we have path-based support for configuring tracing, in addition
to the configuration described above.
Configuration of path can use any path string supported by the
WebServer. The configuration itself has the same possibilities
as traced configuration described above. The path specific configuration
as traced configuration described above. The path-specific configuration
will be merged with global configuration (path is the "newer" configuration, global is the "older")
[source,yaml]
Expand Down Expand Up @@ -311,7 +311,7 @@ Parameters provided:
== Additional Information
=== Span Propagation
=== WebClient Span Propagation
Span propagation is supported with Helidon WebClient.
Tracing propagation is automatic as long as the current span context is available in Helidon Context
Expand Down Expand Up @@ -362,3 +362,4 @@ include::{rootdir}/includes/tracing/tracer-zipkin.adoc[tag=zipkin-configuration]
* link:https://opentracing.io/[Opentracing Project]
* link:https://opentelemetry.io/docs/instrumentation/js/api/tracing/[OpenTelemetry API]
* link:https://opentelemetry.io/docs/instrumentation/js/api/tracing/[OpenTelemetry API]

0 comments on commit 62073cd

Please sign in to comment.