From 18ada3cf5f95274496a82d88bba0e527e15a727f Mon Sep 17 00:00:00 2001 From: Paolo Patierno Date: Tue, 8 Nov 2022 18:12:03 +0100 Subject: [PATCH] Moving from Jaeger exporter to OTLP exporter usage by default Signed-off-by: Paolo Patierno --- CHANGELOG.md | 4 ++++ bin/kafka_bridge_run.sh | 4 ++-- .../proc-configuring-kafka-bridge-tracing.adoc | 15 +++++++++------ pom.xml | 4 ++-- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea2eaace..f7434fd12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.23.0 + +* Moved from using the Jaeger exporter to OTLP exporter by default + ## 0.22.3 * Strimzi OAuth updated to 0.11.0 bringing support for password grants and OAuth metrics diff --git a/bin/kafka_bridge_run.sh b/bin/kafka_bridge_run.sh index e010ac016..9236c691d 100755 --- a/bin/kafka_bridge_run.sh +++ b/bin/kafka_bridge_run.sh @@ -13,9 +13,9 @@ fi # Make sure that we use /dev/urandom JAVA_OPTS="${JAVA_OPTS} -Dvertx.cacheDirBase=/tmp/vertx-cache -Djava.security.egd=file:/dev/./urandom" -# enabling OpenTelemetry with Jaeger by default +# enabling OpenTelemetry with OTLP by default if [ -n "$OTEL_SERVICE_NAME" ] && [ -z "$OTEL_TRACES_EXPORTER" ]; then - export OTEL_TRACES_EXPORTER="jaeger" + export OTEL_TRACES_EXPORTER="otlp" fi exec java $JAVA_OPTS $KAFKA_BRIDGE_LOG4J_OPTS -classpath "${MYPATH}/../libs/*" io.strimzi.kafka.bridge.Application "$@" \ No newline at end of file diff --git a/documentation/modules/proc-configuring-kafka-bridge-tracing.adoc b/documentation/modules/proc-configuring-kafka-bridge-tracing.adoc index 6733e3e44..27129792f 100644 --- a/documentation/modules/proc-configuring-kafka-bridge-tracing.adoc +++ b/documentation/modules/proc-configuring-kafka-bridge-tracing.adoc @@ -14,7 +14,10 @@ To enable distributed tracing, do the following: * Set the `bridge.tracing` property value to enable the tracing you want to use. Possible values are `jaeger` and `opentelemetry`. * Set environment variables for tracing. -With the default configuration, you can implement a Jaeger tracing system based on OpenTelemetry or OpenTracing. +With the default configuration, the OpenTelemetry tracing uses OTLP as exporter protocol. +You can still use your Jaeger backend instance to get the traces, by configuring the OTLP endpoint properly. + +NOTE: Jaeger added the support for OTLP protocol since 1.35 release. Older releases cannot get traces via OLTP protocol. OpenTelemetry and OpenTracing are API specifications for collecting tracing data as _spans_ of metrics data. Spans represent a specific operation. @@ -59,10 +62,10 @@ With tracing enabled, you initialize tracing when you run the Kafka Bridge scrip [source,env] ---- OTEL_SERVICE_NAME=my-tracing-service # <1> -OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14250 # <2> +OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 # <2> ---- <1> The name of the OpenTelemetry tracer service. -<2> The gRPC-based Jaeger collector endpoint that listens for spans on port 14250. +<2> The gRPC-based OTLP endpoint that listens for spans on port 4317. + .Environment variables for OpenTracing [source,env] @@ -77,7 +80,7 @@ JAEGER_AGENT_PORT=6831 # <3> . Run the Kafka Bridge script with the property enabled for tracing: + -.Running the Kafka Bridge with OpenTelementry enabled +.Running the Kafka Bridge with OpenTelemetry enabled [source,shell,subs="+quotes,attributes"] ---- ./bin/kafka_bridge_run.sh --config-file=__/application.properties @@ -87,14 +90,14 @@ The internal consumers and producers of the Kafka Bridge are now enabled for tra == Specifying tracing systems with OpenTelemetry -Instead of the default Jaeger system, you can specify other tracing systems that are supported by OpenTelemetry. +Instead of the default OTLP tracing system, you can specify other tracing systems that are supported by OpenTelemetry. If you want to use another tracing system with OpenTelemetry, do the following: . Add the library of the tracing system to the Kafka classpath. . Add the name of the tracing system as an additional exporter environment variable. + -.Additional environment variable when not using Jaeger +.Additional environment variable when not using OTLP [source,env] ---- OTEL_SERVICE_NAME=my-tracing-service diff --git a/pom.xml b/pom.xml index cd1635eb3..bf3f91c3d 100644 --- a/pom.xml +++ b/pom.xml @@ -301,7 +301,7 @@ io.opentelemetry - opentelemetry-exporter-jaeger + opentelemetry-exporter-otlp ${opentelemetry.version} org.apache.tomcat.embed:tomcat-embed-core - io.opentelemetry:opentelemetry-exporter-jaeger + io.opentelemetry:opentelemetry-exporter-otlp net.java.dev.jna:jna