diff --git a/instrumentation/ratpack/ratpack-1.7/library/README.md b/instrumentation/ratpack/ratpack-1.7/library/README.md new file mode 100644 index 000000000000..179cc9c8a9a2 --- /dev/null +++ b/instrumentation/ratpack/ratpack-1.7/library/README.md @@ -0,0 +1,66 @@ +# 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 + + + io.opentelemetry.instrumentation + opentelemetry-ratpack-1.7 + OPENTELEMETRY_VERSION + + +``` + +For Gradle, add to your dependencies: + +```kotlin +implementation("io.opentelemetry.instrumentation:opentelemetry-ratpack-1.7:OPENTELEMETRY_VERSION") +``` + +### Usage + +The instrumentation library provides implementations for both server and client instrumentation +that wrap Ratpack components. + +```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 RatpackConfiguration { + + // Create a server with OpenTelemetry instrumentation + public RatpackServer createTracedServer(OpenTelemetry openTelemetry) throws Exception { + RatpackServerTelemetry serverTelemetry = RatpackServerTelemetry.create(openTelemetry); + return RatpackServer.start(server -> { + server.registryOf(serverTelemetry::configureRegistry); + server.handlers(chain -> + chain.get(ctx -> ctx.render("Hello, World!")) + ); + }); + } + + // Create an instrumented HttpClient + public HttpClient createTracedClient(OpenTelemetry openTelemetry) { + RatpackClientTelemetry clientTelemetry = RatpackClientTelemetry.create(openTelemetry); + return clientTelemetry.instrument(createClient()); + } + + // Configuration of the HttpClient goes here + private HttpClient createClient() { + return HttpClient.of(spec -> {}); + } +} +``` diff --git a/instrumentation/reactor/reactor-3.1/library/README.md b/instrumentation/reactor/reactor-3.1/library/README.md new file mode 100644 index 000000000000..200a2164286e --- /dev/null +++ b/instrumentation/reactor/reactor-3.1/library/README.md @@ -0,0 +1,48 @@ +# 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 + + + io.opentelemetry.instrumentation + opentelemetry-reactor-3.1 + OPENTELEMETRY_VERSION + + +``` + +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 mono = Mono.just("Hello, World!"); + Flux flux = Flux.just("Hello", "World"); + ... + } +} +``` diff --git a/instrumentation/restlet/restlet-1.1/library/README.md b/instrumentation/restlet/restlet-1.1/library/README.md new file mode 100644 index 000000000000..b3e161dd8a91 --- /dev/null +++ b/instrumentation/restlet/restlet-1.1/library/README.md @@ -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 + + + io.opentelemetry.instrumentation + opentelemetry-restlet-1.1 + OPENTELEMETRY_VERSION + + +``` + +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; + } + }; + } +} +``` diff --git a/instrumentation/restlet/restlet-2.0/library/README.md b/instrumentation/restlet/restlet-2.0/library/README.md new file mode 100644 index 000000000000..128a44aac142 --- /dev/null +++ b/instrumentation/restlet/restlet-2.0/library/README.md @@ -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 + + + io.opentelemetry.instrumentation + opentelemetry-restlet-2.0 + OPENTELEMETRY_VERSION + + +``` + +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; + } + }; + } +} +``` diff --git a/instrumentation/rxjava/rxjava-1.0/metadata.yaml b/instrumentation/rxjava/rxjava-1.0/metadata.yaml new file mode 100644 index 000000000000..5a03ece2f748 --- /dev/null +++ b/instrumentation/rxjava/rxjava-1.0/metadata.yaml @@ -0,0 +1 @@ +classification: internal diff --git a/instrumentation/rxjava/rxjava-2.0/library/README.md b/instrumentation/rxjava/rxjava-2.0/library/README.md new file mode 100644 index 000000000000..c5be4ad69339 --- /dev/null +++ b/instrumentation/rxjava/rxjava-2.0/library/README.md @@ -0,0 +1,52 @@ +# 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 + + + io.opentelemetry.instrumentation + opentelemetry-rxjava-2.0 + OPENTELEMETRY_VERSION + + +``` + +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 observable = Observable.just("Hello", "World"); + Flowable flowable = Flowable.just("Hello", "World"); + ... + } +} +``` diff --git a/instrumentation/rxjava/rxjava-3.1.1/library/README.md b/instrumentation/rxjava/rxjava-3.1.1/library/README.md new file mode 100644 index 000000000000..0a9ad5e7210a --- /dev/null +++ b/instrumentation/rxjava/rxjava-3.1.1/library/README.md @@ -0,0 +1,52 @@ +# 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 + + + io.opentelemetry.instrumentation + opentelemetry-rxjava-3.1.1 + OPENTELEMETRY_VERSION + + +``` + +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 observable = Observable.just("Hello", "World"); + Flowable flowable = Flowable.just("Hello", "World"); + ... + } +} +```