Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Library Instrumentation for Project Reactor version 3.1 and higher

Provides OpenTelemetry instrumentation for Project Reactor, enabling context propagation through Reactor's execution model.

Quickstart

Add these dependencies to your project

Replace OPENTELEMETRY_VERSION with the latest release.

For Maven, add to your pom.xml dependencies:

<dependencies>
  <dependency>
    <groupId>io.opentelemetry.instrumentation</groupId>
    <artifactId>opentelemetry-reactor-3.1</artifactId>
    <version>OPENTELEMETRY_VERSION</version>
  </dependency>
</dependencies>

For Gradle, add to your dependencies:

implementation("io.opentelemetry.instrumentation:opentelemetry-reactor-3.1:OPENTELEMETRY_VERSION")

Usage

import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.reactor.v3_1.ContextPropagationOperator;
import reactor.core.publisher.Mono;
import reactor.core.publisher.Flux;

public class ReactorExample {
  public static void main(String[] args) {
    ContextPropagationOperator contextPropagationOperator = ContextPropagationOperator.create();
    contextPropagationOperator.registerOnEachOperator();

    Mono<String> mono = Mono.just("Hello, World!");
    Flux<String> flux = Flux.just("Hello", "World");
    ...
  }
}