Global Tracer resolution

Library to obtain a Tracer reference from anywhere in your application

Лицензия

Лицензия

Группа

Группа

io.opentracing.contrib
Идентификатор

Идентификатор

opentracing-globaltracer
Последняя версия

Последняя версия

0.1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Global Tracer resolution
Library to obtain a Tracer reference from anywhere in your application
Ссылка на сайт

Ссылка на сайт

https://github.com/opentracing-contrib/java-globaltracer
Система контроля версий

Система контроля версий

https://github.com/opentracing-contrib/java-globaltracer

Скачать opentracing-globaltracer

Как подключить последнюю версию

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

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
io.opentracing : opentracing-api jar 0.22.0
io.opentracing : opentracing-noop jar 0.22.0
io.opentracing : opentracing-util jar 0.22.0
io.opentracing.contrib : opentracing-tracerresolver jar 0.1.0

test (4)

Идентификатор библиотеки Тип Версия
io.opentracing : opentracing-mock jar 0.22.0
junit : junit jar 4.12
org.hamcrest : hamcrest-library jar 1.3
org.mockito : mockito-all jar 1.10.19

Модули Проекта

Данный проект не имеет модулей.

Build Status Released Version

deprecated Global tracer resolution for Java

Global Tracer forwarding to another Tracer implementation.

Note: GlobalTracer has been included in core OpenTracing Java since opentracing-java version 0.21.0.
This contrib project is now deprecated.

GlobalTracer

Provides the GlobalTracer.get() method that returns the singleton global tracer.

When the tracer is needed it is lazily looked up using the following rules:

  1. The tracer from the last register(tracer) call always takes precedence.
  2. If no tracer was registered, one is resolved by the TracerResolver.
  3. If no Tracer is resolved, the NoopTracer will be used.

How to use this library

Some examples on how this library can be used:

Application intialization

Initialize a new tracer from the application configuration and let it to become the GlobalTracer for the application:

    Tracer configuredTracer = applicationConfiguration.buildConfiguredTracer();
    GlobalTracer.register(configuredTracer);

Using the global tracer

Once initialized, all application code can instrument tracing by starting new spans like:

    try (Span span = GlobalTracer.get().buildSpan("someOperation").start()) {
        // ... Traced block of code ...
    }

If no GlobalTracer is configured, this code will not throw any exceptions. Tracing is simply delegated to the NoopTracer instead.

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.**

Версии библиотеки

Версия
0.1.2
0.1.1
0.1.0