OpenTelemetry Tracer Bridge

April 2, 2020 ยท View on GitHub

OpenTracing Bridge for OpenTelemetry Tracers

Build Status Coverage Status Javadocs Released Version

The OpenTelemetry Tracer Bridge is a Trace Exporter that uses the OpenTelemetry OpenTracing Shim to provide a TracerFactory implementation (specified by the OpenTracing TracerResolver).

Tracer parameters can be configured via the system properties:

Parameters

OpenTelemetry Tracer Bridge parameters use the prefix ot.otel.:

ParameterUseDescription
ot.otel.exporterOptionalName of the OpenTelemetry exporter:
jaeger, inmemory, or logging.
ot.otel.exporter.reportOnlySampledOptionalWhether only sampled spans should be reported.

If ot.otel.exporter=jaeger, the following parameters apply to the Jaeger exporter:

ParameterUseDescription
ot.otel.exporter.jaeger.serviceNameRequiredThe service name.
ot.otel.exporter.jaeger.addressRequiredTarget address (<HOST:PORT>) of the Jaeger gRPC endpoint.
ot.otel.exporter.jaeger.deadlineOptionalThe max waiting time for the collector to process each span batch.

Usage with SpecialAgent

The OpenTracing SpecialAgent automatically instruments 3rd-party libraries in Java applications. Starting with SpecialAgent v1.5.2 (usage updated to spec of SpecialAgent v1.7.0), the OpenTelemetry Tracer Bridge is included as a Trace Exporter, which allows traces to be sent to OpenTelemetry tracers. The OpenTelemetry Tracer Bridge can be enabled with the -Dsa.exporter=otel property:

java -javaagent:opentracing-specialagent-1.7.0.jar \
     -Dsa.exporter=otel \
     -Dot.otel.exporter=jaeger \
     -Dot.otel.exporter.jaeger.serviceName=myService \
     -Dot.otel.exporter.jaeger.address=127.0.0.1:1234 \
     -jar MyService.jar

License

This project is licensed under the Apache 2 License - see the LICENSE.txt file for details.