io.opentracing.contrib:opentracing-akka

OpenTracing Instrumentation for Akka

Лицензия

Лицензия

Категории

Категории

Akka Контейнер Микросервисы Reactive libraries
Группа

Группа

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

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

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

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

0.1.4
Дата

Дата

Тип

Тип

jar
Описание

Описание

io.opentracing.contrib:opentracing-akka
OpenTracing Instrumentation for Akka
Ссылка на сайт

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

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

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

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

Скачать opentracing-akka

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

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

Зависимости

compile (2)

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

provided (2)

Идентификатор библиотеки Тип Версия
com.typesafe.akka : akka-actor_2.12 jar 2.6.1
com.typesafe.akka : akka-cluster-sharding_2.12 Необязательный jar 2.6.1

test (4)

Идентификатор библиотеки Тип Версия
io.opentracing : opentracing-mock jar 0.33.0
io.opentracing : opentracing-util test-jar 0.33.0
junit : junit jar 4.12
org.awaitility : awaitility jar 4.0.1

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

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

Build Status Coverage Status Released Version Apache-2.0 license

OpenTracing Akka Instrumentation

OpenTracing instrumentation for Akka.

Installation

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-akka</artifactId>
    <version>VERSION</version>
</dependency>

Usage

Actor's Span propagation (experimental design)

There's an experimental design and support for propagating Spans between Actors (without any lifetime handling, which means the user is responsible for finishing the Spans). For this to work, classes must inherit from TracedAbstractActor instead of AbstractActor, and messages must be wrapped using TracedMessage.wrap():

class MyActor extends TracedAbstractActor {
   @Override
   public Receive createReceive() {
       return receiveBuilder()
           .match(String.class, msg -> {
                // the Span 'foo' will be active for this block,
                // and will NOT be finished upon deactivation.
                getSender().tell("ciao", getSelf());
            })
           .build();
    }
}

try (Scope scope = tracer.buildSpan("foo").startActive()) {
    // scope.span() will be captured as part of TracedMessage.wrap(),
    // and MyActor will receive the original 'myMessageObj` instance.
    Future<String> f = ask(myActorRef, TracedMessage.wrap("hello"), timeout);
    ...
}

By default, TracedAbstractActor/TracedMessage use io.opentracing.util.GlobalTracer to activate and fetch the Span respectively, but it's possible to manually specify both the Tracer used to activate and the captured Span:

class MyActor extends TracedAbstractActor {
   public Receive createReceive() {
       return receiveBuilder()
           .match(String.class, msg -> {
                // TracedAbstractActor.tracer() returns the Tracer being used,
                // either GlobalTracer or the explicit set one.
                if (tracer().activeSpan() != null) {
                   // Use the active Span, to set tags, create children, finish it, etc.
                   tracer().activeSpan.finish();
                }
                ...
            })
           .build();
   }
}

Span span = tracer.buildSpan("foo").start();
Future<String> f = ask(myActorRef, TracedMessage.wrap(span, "hello"), timeout);

License

Apache 2.0 License.

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.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.2
0.0.1