Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions instrumentation/ratpack/ratpack-1.7/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Library Instrumentation for Ratpack version 1.7 and higher

Provides OpenTelemetry instrumentation for [Ratpack](https://ratpack.io/), enabling HTTP client and server spans and
metrics.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-ratpack-1.7).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-ratpack-1.7</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add to your dependencies:

```kotlin
implementation("io.opentelemetry.instrumentation:opentelemetry-ratpack-1.7:OPENTELEMETRY_VERSION")
```

### Usage

```java
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.ratpack.v1_7.RatpackServerTelemetry;
import io.opentelemetry.instrumentation.ratpack.v1_7.RatpackClientTelemetry;
import ratpack.server.RatpackServer;
import ratpack.http.client.HttpClient;

public class RatpackExample {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like the okhttp code snippet more where we have a method that accepts opentelemety instance and returns instrumented client.

public static void main(String[] args) throws Exception {
// Get an OpenTelemetry instance
OpenTelemetry openTelemetry = ...;

// Server instrumentation
RatpackServerTelemetry serverTelemetry = RatpackServerTelemetry.create(openTelemetry);
RatpackServer.start(server -> {
server.registryOf(serverTelemetry::configureRegistry);
server.handlers(chain ->
chain.get(ctx -> ctx.render("Hello, World!"))
);
});

// Client instrumentation
RatpackClientTelemetry clientTelemetry = RatpackClientTelemetry.create(openTelemetry);
HttpClient instrumentedHttpClient = clientTelemetry.instrument(HttpClient.of(spec -> {}));
}
}
```
50 changes: 50 additions & 0 deletions instrumentation/reactor/reactor-3.1/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Library Instrumentation for Project Reactor version 3.1 and higher

Provides OpenTelemetry instrumentation for [Project Reactor](https://projectreactor.io/), enabling
context propagation through Reactor's execution model.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-reactor-3.1).

For Maven, add to your `pom.xml` dependencies:

```xml
<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:

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

### Usage

```java
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");

mono.subscribe(System.out::println);
flux.subscribe(System.out::println);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really useful as the instrumentation won't change the outcome of this

}
}
```
55 changes: 55 additions & 0 deletions instrumentation/restlet/restlet-1.1/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Library Instrumentation for Restlet version 1.1 and higher

Provides OpenTelemetry instrumentation for [Restlet](https://restlet.talend.com/), enabling HTTP
server spans.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-restlet-1.1).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-restlet-1.1</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add to your dependencies:

```kotlin
implementation("io.opentelemetry.instrumentation:opentelemetry-restlet-1.1:OPENTELEMETRY_VERSION")
```

### Usage

```java
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.restlet.v1_1.RestletTelemetry;
import org.restlet.Filter;
import org.restlet.Application;
import org.restlet.Restlet;

public class RestletExample {
public static void main(String[] args) throws Exception {
// Get an OpenTelemetry instance
OpenTelemetry openTelemetry = ...;

RestletTelemetry restletTelemetry = RestletTelemetry.create(openTelemetry);
Filter tracingFilter = restletTelemetry.newFilter("/api");

Application application = new Application() {
@Override
public Restlet createInboundRoot() {
return tracingFilter;
}
};
}
}
```
55 changes: 55 additions & 0 deletions instrumentation/restlet/restlet-2.0/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Library Instrumentation for Restlet version 2.0 and higher

Provides OpenTelemetry instrumentation for [Restlet](https://restlet.talend.com/), enabling HTTP
server spans.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-restlet-2.0).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-restlet-2.0</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add to your dependencies:

```kotlin
implementation("io.opentelemetry.instrumentation:opentelemetry-restlet-2.0:OPENTELEMETRY_VERSION")
```

### Usage

```java
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.restlet.v2_0.RestletTelemetry;
import org.restlet.Application;
import org.restlet.Restlet;
import org.restlet.routing.Filter;

public class RestletExample {
public static void main(String[] args) throws Exception {
// Get an OpenTelemetry instance
OpenTelemetry openTelemetry = ...;

RestletTelemetry restletTelemetry = RestletTelemetry.create(openTelemetry);
Filter tracingFilter = restletTelemetry.newFilter("/api");

Application application = new Application() {
@Override
public Restlet createInboundRoot() {
return tracingFilter;
}
};
}
}
```
67 changes: 67 additions & 0 deletions instrumentation/rxjava/rxjava-1.0/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Library Instrumentation for RxJava version 1.0 and higher

Provides OpenTelemetry instrumentation utilities for [RxJava](https://github.com/ReactiveX/RxJava/tree/1.x),
enabling context propagation through RxJava's execution model.

**Note**: This library is primarily designed for use by other OpenTelemetry instrumentation
libraries and framework integrations, not for direct end-user application usage.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-rxjava-1.0).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-rxjava-1.0</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add to your dependencies:

```kotlin
implementation("io.opentelemetry.instrumentation:opentelemetry-rxjava-1.0:OPENTELEMETRY_VERSION")
```

### Usage

This library provides the `TracedOnSubscribe` class for instrumenting RxJava Observables with
OpenTelemetry spans:

```java
import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.instrumentation.rxjava.v1_0.TracedOnSubscribe;
import rx.Observable;

public class RxJavaExample {
public static void main(String[] args) {
// Get an OpenTelemetry instance
OpenTelemetry openTelemetry = ...;

// Create an instrumenter for your specific request type
Instrumenter<String, Void> instrumenter = Instrumenter.<String, Void>builder(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the feeling that this ins't a proper library instrumentation but rather a tool used in other instrumentations.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, i'll switch to considering this an "internal" instrumentation and remove this readme entirely

openTelemetry,
"instrumentation-name",
request -> "operation-name")
.buildInstrumenter();

// Create a regular Observable
Observable<String> originalObservable = Observable.just("Hello", "World");

// Wrap it with tracing
Observable<String> tracedObservable = Observable.create(
new TracedOnSubscribe<>(originalObservable, instrumenter, "request-context"));

// Subscribe to the traced observable
tracedObservable.subscribe(System.out::println);
}
}
```
54 changes: 54 additions & 0 deletions instrumentation/rxjava/rxjava-2.0/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Library Instrumentation for RxJava version 2.0 and higher

Provides OpenTelemetry instrumentation for [RxJava](https://github.com/ReactiveX/RxJava), enabling
context propagation through RxJava's execution model.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-rxjava-2.0).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-rxjava-2.0</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add to your dependencies:

```kotlin
implementation("io.opentelemetry.instrumentation:opentelemetry-rxjava-2.0:OPENTELEMETRY_VERSION")
```

### Usage

Enable RxJava instrumentation by calling `TracingAssembly.enable()` once during application startup.
This will automatically instrument all RxJava operations in your application:

```java
import io.opentelemetry.instrumentation.rxjava.v2_0.TracingAssembly;
import io.reactivex.Observable;
import io.reactivex.Flowable;

public class RxJavaExample {
public static void main(String[] args) {
// Enable RxJava instrumentation globally
TracingAssembly tracingAssembly = TracingAssembly.create();
tracingAssembly.enable();

// All RxJava operations will now be automatically instrumented
Observable<String> observable = Observable.just("Hello", "World");
Flowable<String> flowable = Flowable.just("Hello", "World");

observable.subscribe(System.out::println);
flowable.subscribe(System.out::println);
}
}
```
54 changes: 54 additions & 0 deletions instrumentation/rxjava/rxjava-3.1.1/library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Library Instrumentation for RxJava version 3.1.1 and higher

Provides OpenTelemetry instrumentation for [RxJava](https://github.com/ReactiveX/RxJava), enabling
context propagation through RxJava's execution model.

## Quickstart

### Add these dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-rxjava-3.1.1).

For Maven, add to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-rxjava-3.1.1</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add to your dependencies:

```kotlin
implementation("io.opentelemetry.instrumentation:opentelemetry-rxjava-3.1.1:OPENTELEMETRY_VERSION")
```

### Usage

Enable RxJava instrumentation by calling `TracingAssembly.enable()` once during application startup.
This will automatically instrument all RxJava operations in your application:

```java
import io.opentelemetry.instrumentation.rxjava.v3_1_1.TracingAssembly;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.core.Flowable;

public class RxJavaExample {
public static void main(String[] args) {
// Enable RxJava instrumentation globally
TracingAssembly tracingAssembly = TracingAssembly.create();
tracingAssembly.enable();

// All RxJava operations will now be automatically instrumented
Observable<String> observable = Observable.just("Hello", "World");
Flowable<String> flowable = Flowable.just("Hello", "World");

observable.subscribe(System.out::println);
flowable.subscribe(System.out::println);
}
}
```