Tracer resolver

Resolver API for OpenTracing Tracer implementations.

License

License

GroupId

GroupId

io.opentracing.contrib
ArtifactId

ArtifactId

opentracing-tracerresolver
Last Version

Last Version

0.1.8
Release Date

Release Date

Type

Type

jar
Description

Description

Tracer resolver
Resolver API for OpenTracing Tracer implementations.

Download opentracing-tracerresolver

How to add to project

<!-- https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-tracerresolver/ -->
<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-tracerresolver</artifactId>
    <version>0.1.8</version>
</dependency>
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-tracerresolver/
implementation 'io.opentracing.contrib:opentracing-tracerresolver:0.1.8'
// https://jarcasting.com/artifacts/io.opentracing.contrib/opentracing-tracerresolver/
implementation ("io.opentracing.contrib:opentracing-tracerresolver:0.1.8")
'io.opentracing.contrib:opentracing-tracerresolver:jar:0.1.8'
<dependency org="io.opentracing.contrib" name="opentracing-tracerresolver" rev="0.1.8">
  <artifact name="opentracing-tracerresolver" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.opentracing.contrib', module='opentracing-tracerresolver', version='0.1.8')
)
libraryDependencies += "io.opentracing.contrib" % "opentracing-tracerresolver" % "0.1.8"
[io.opentracing.contrib/opentracing-tracerresolver "0.1.8"]

Dependencies

compile (1)

Group / Artifact Type Version
io.opentracing : opentracing-api jar 0.33.0

provided (2)

Group / Artifact Type Version
io.opentracing : opentracing-util Optional jar 0.33.0
javax.annotation : javax.annotation-api Optional jar 1.3.2

test (5)

Group / Artifact Type Version
io.opentracing : opentracing-mock jar 0.33.0
io.opentracing : opentracing-util test-jar 0.33.0
junit : junit jar 4.12
org.hamcrest : hamcrest-library jar 1.3
org.mockito : mockito-all jar 1.10.19

Project Modules

There are no modules declared in this project.

Build Status Released Version

java-tracerresolver

Resolver API for OpenTracing Tracer implementations.

NOTE: The Tracer Resolver mechanism is only intended to be used at application startup/initialization time. This responsibility should be handled by the application, possibly using some runtime specific support (e.g. providing a Tracer @Bean in Spring Boot, or a CDI producer). Framework integrations used to instrument specific technologies should not use this library, but should allow a Tracer to be injected instead, with fallback to the GlobalTracer.

Tracer resolver

This is a utility class providing a static resolveTracer() method using the JDK ServiceLoader to find declared TracerFactory implementations providing a Tracer.

Tracer factory

A tracer factory implements a getTracer() method and is used by the TracerResolver to look up tracer implementations via a JDK ServiceLoader.

Fallback lookup

If no TracerFactory is found or no Tracer is returned, a ServiceLoader lookup for a declared concrete TracerResolver class is used. This supports the 'legacy' lookup for TracerResolver subclasses providing a resolve() implementation. Finally, if this also fails, the Tracer class is used as last-resort lookup.

Tracer converters

A resolved tracer is passed to all TracerConverter instances that were found.

Tracer converters can be useful for automatically wrapping the resolved Tracer:

public final class FooWrapperConverter implements TracerConverter {
    public Tracer convert(Tracer existingTracer) {
        return new FooTracerWrapper(existingTracer);
    }
}

Priority

If multiple TracerResolver, TracerConverter or Tracer implementations are found, they are checked for presence of the @Priority annotation on their class or superclasses. The priority is applied as follows:

  1. First, non-negative priority is applied in natural order (e.g. 0, 1, 2, ...).
  2. Next, objects without @Priority annotation are applied by assigning a default priority of Integer.MAX_VALUE.
  3. Finally, negative priority is applied in reverse-natural order (e.g. -1, -2, -3, ...).

The order of objects with equal (implicit) priority is undefined.

GlobalTracer

If the opentracing-util library is detected and a GlobalTracer is already-registered, the resolving mechanism will be disabled. In this case the GlobalTracer is always returned as-is, without applying any converters.

io.opentracing.contrib

3rd-Party OpenTracing API Contributions

3rd-party contributions that use OpenTracing. **The repositories in this org are *not* affiliated with the CNCF.**

Versions

Version
0.1.8
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.3