opentelemetry-java/opentracing_shim
Anuraag Agrawal ecdfc391f2
Add a ContextValue interface to allow Context.withValue(value) withou… (#1827)
* Add a ContextValue interface to allow Context.withValue(value) without a key.

* Assertions

* Renames
2020-10-20 19:26:54 -07:00
..
src Add a ContextValue interface to allow Context.withValue(value) withou… (#1827) 2020-10-20 19:26:54 -07:00
README.md add OpenTracing Shim usage (#1697) 2020-09-24 11:19:36 -07:00
build.gradle Use awaitility / higher timeout to reduce flakiness. (#1729) 2020-09-30 08:21:24 -07:00

README.md

Javadocs

OpenTelemetry - OpenTracing Shim

The OpenTracing shim is a bridge layer from OpenTelemetry to the OpenTracing API. It takes OpenTelemetry Tracer and exposes it as an implementation of an OpenTracing Tracer.

Usage

There are 2 ways to expose an OpenTracing tracer:

  1. From the global OpenTelemetry configuration:
    Tracer tracer = TraceShim.createTracerShim();
    
  2. From the provided TracerProvider and CorrelationContextManager:
    Tracer tracer = TraceShim.createTracerShim(tracerProvider, contextManager);
    

Optionally register the tracer as the OpenTracing GlobalTracer:

GlobalTracer.registerIfAbsent(tracer);