From 685693888c17d356fcc5675e86c7cfbc84c7cacc Mon Sep 17 00:00:00 2001 From: Matthias Haeussler Date: Wed, 24 Jul 2024 18:48:21 +0000 Subject: [PATCH] docs update --- .../instrumentation/manual_java/traces/index.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tutorial/content/exercises/instrumentation/manual_java/traces/index.md b/tutorial/content/exercises/instrumentation/manual_java/traces/index.md index b722dd4..5628bec 100644 --- a/tutorial/content/exercises/instrumentation/manual_java/traces/index.md +++ b/tutorial/content/exercises/instrumentation/manual_java/traces/index.md @@ -507,7 +507,7 @@ We need to use the OpenTelemetry context scope. Embed the call to the child meth } ``` -Also add the following import: +Also make sure the following import exists: ```java { title="TodobackendApplication.java" } import io.opentelemetry.context.Scope; @@ -591,7 +591,7 @@ This time we want to export in OTLP format to a gRPC receiving endpoint. The `Ot Modify the beginning of the class to the code shown below: -```java { title="TodobackendApplication.java" } +```java { title="OpenTelemetryConfiguration.java" } public OpenTelemetry openTelemetry(){ Resource resource = Resource.getDefault().toBuilder().put(ResourceAttributes.SERVICE_NAME, "todobackend").put(ResourceAttributes.SERVICE_VERSION, "0.1.0").build(); @@ -609,6 +609,14 @@ Modify the beginning of the class to the code shown below: .build(); ``` +Also make sure the following import exists: + +```java { title="OpenTelemetryConfiguration.java" } +import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; +``` + + + As you can see we created an instance of `OtlpGrpcSpanExporter` called `jaegerOtlpExporter` and configured it to send the data to `http://localhost:4317`. In the Tracer Provider we just added another `addSpanProcessor` call to the already existing one. OpenTelemetry is able to handle mulitple different and parallel processors. @@ -644,6 +652,9 @@ docker run -d --name jaeger \ After this container has started, execute a couple of traces and investigate the details in the Jaeger web console `http://localhost:16686` + +# Metrics +