OpenCensus Shim

This example shows how to use the opentelemetry-opencensus-shim package to interact with libraries instrumented with opencensus-python.

The source files required to run this example are available here.



Start Jaeger

docker run --rm \
    -p 6831:6831/udp \
    -p 6832:6832/udp \
    -p 16686:16686 \
    jaegertracing/all-in-one:1.13 \

Python Dependencies

Install the Python dependencies in requirements.txt

pip install -r requirements.txt

Alternatively, you can install the Python dependencies separately:

pip install \
    opentelemetry-api \
    opentelemetry-sdk \
    opentelemetry-exporter-jaeger \

Run the Application

Jaeger UI

Open the Jaeger UI in your browser at http://localhost:16686 and view traces for the “OpenCensus Shim Example” service.

Note that tags and logs (OpenCensus) and attributes and events (OpenTelemetry) from both tracing systems appear in the exported trace.