Skip to content

Commit 1d67fc9

Browse files
committed
start readmes
1 parent 1c1f93a commit 1d67fc9

File tree

3 files changed

+164
-0
lines changed

3 files changed

+164
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Library Instrumentation for Ratpack version 1.7 and higher
2+
3+
Provides OpenTelemetry instrumentation for [Ratpack](https://ratpack.io/), enabling CLIENT and SERVER spans.
4+
5+
## Quickstart
6+
7+
### Add these dependencies to your project
8+
9+
Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-ratpack-1.7).
10+
11+
For Maven, add to your `pom.xml` dependencies:
12+
13+
```xml
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.opentelemetry.instrumentation</groupId>
17+
<artifactId>opentelemetry-ratpack-1.7</artifactId>
18+
<version>OPENTELEMETRY_VERSION</version>
19+
</dependency>
20+
</dependencies>
21+
```
22+
23+
For Gradle, add to your dependencies:
24+
25+
```kotlin
26+
implementation("io.opentelemetry.instrumentation:opentelemetry-ratpack-1.7:OPENTELEMETRY_VERSION")
27+
```
28+
29+
### Usage
30+
31+
```java
32+
import io.opentelemetry.api.OpenTelemetry;
33+
import io.opentelemetry.instrumentation.ratpack.v1_7.RatpackServerTelemetry;
34+
import io.opentelemetry.instrumentation.ratpack.v1_7.RatpackClientTelemetry;
35+
import ratpack.server.RatpackServer;
36+
import ratpack.http.client.HttpClient;
37+
38+
public class RatpackExample {
39+
public static void main(String[] args) throws Exception {
40+
OpenTelemetry openTelemetry = OpenTelemetry.noop();
41+
42+
// Server instrumentation
43+
RatpackServerTelemetry serverTelemetry = RatpackServerTelemetry.create(openTelemetry);
44+
RatpackServer.start(server -> {
45+
server.registryOf(serverTelemetry::configureRegistry);
46+
server.handlers(chain ->
47+
chain.get(ctx -> ctx.render("Hello, World!"))
48+
);
49+
});
50+
51+
// Client instrumentation
52+
RatpackClientTelemetry clientTelemetry = RatpackClientTelemetry.create(openTelemetry);
53+
HttpClient instrumentedHttpClient = clientTelemetry.instrument(HttpClient.of(spec -> {}));
54+
}
55+
}
56+
```
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Library Instrumentation for Project Reactor version 3.1 and higher
2+
3+
Provides OpenTelemetry instrumentation for [Project Reactor](https://projectreactor.io/).
4+
5+
This instrumentation generates spans for each reactive operation.
6+
7+
## Quickstart
8+
9+
### Add these dependencies to your project
10+
11+
Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-reactor-3.1).
12+
13+
For Maven, add to your `pom.xml` dependencies:
14+
15+
```xml
16+
<dependencies>
17+
<dependency>
18+
<groupId>io.opentelemetry.instrumentation</groupId>
19+
<artifactId>opentelemetry-reactor-3.1</artifactId>
20+
<version>OPENTELEMETRY_VERSION</version>
21+
</dependency>
22+
</dependencies>
23+
```
24+
25+
For Gradle, add to your dependencies:
26+
27+
```kotlin
28+
implementation("io.opentelemetry.instrumentation:opentelemetry-reactor-3.1:OPENTELEMETRY_VERSION")
29+
```
30+
31+
### Usage
32+
33+
```java
34+
import io.opentelemetry.api.OpenTelemetry;
35+
import io.opentelemetry.instrumentation.reactor.v3_1.ContextPropagationOperator;
36+
import reactor.core.publisher.Mono;
37+
import reactor.core.publisher.Flux;
38+
39+
public class ReactorExample {
40+
public static void main(String[] args) {
41+
OpenTelemetry openTelemetry = OpenTelemetry.noop();
42+
43+
ContextPropagationOperator contextPropagationOperator = ContextPropagationOperator.create();
44+
contextPropagationOperator.registerOnEachOperator();
45+
46+
Mono<String> mono = Mono.just("Hello, World!");
47+
Flux<String> flux = Flux.just("Hello", "World");
48+
49+
mono.subscribe(System.out::println);
50+
flux.subscribe(System.out::println);
51+
}
52+
}
53+
```
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Library Instrumentation for Restlet version 1.1 and higher
2+
3+
Provides OpenTelemetry instrumentation for [Restlet](https://restlet.talend.com/).
4+
5+
This instrumentation generates SERVER spans for each HTTP request.
6+
7+
## Quickstart
8+
9+
### Add these dependencies to your project
10+
11+
Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-restlet-1.1).
12+
13+
For Maven, add to your `pom.xml` dependencies:
14+
15+
```xml
16+
<dependencies>
17+
<dependency>
18+
<groupId>io.opentelemetry.instrumentation</groupId>
19+
<artifactId>opentelemetry-restlet-1.1</artifactId>
20+
<version>OPENTELEMETRY_VERSION</version>
21+
</dependency>
22+
</dependencies>
23+
```
24+
25+
For Gradle, add to your dependencies:
26+
27+
```kotlin
28+
implementation("io.opentelemetry.instrumentation:opentelemetry-restlet-1.1:OPENTELEMETRY_VERSION")
29+
```
30+
31+
### Usage
32+
33+
```java
34+
import io.opentelemetry.api.OpenTelemetry;
35+
import io.opentelemetry.instrumentation.restlet.v1_1.RestletTelemetry;
36+
import org.restlet.Filter;
37+
import org.restlet.Application;
38+
import org.restlet.Restlet;
39+
40+
public class RestletExample {
41+
public static void main(String[] args) throws Exception {
42+
OpenTelemetry openTelemetry = OpenTelemetry.noop();
43+
44+
RestletTelemetry restletTelemetry = RestletTelemetry.create(openTelemetry);
45+
Filter tracingFilter = restletTelemetry.newFilter("/api");
46+
47+
Application application = new Application() {
48+
@Override
49+
public Restlet createInboundRoot() {
50+
return tracingFilter;
51+
}
52+
};
53+
}
54+
}
55+
```

0 commit comments

Comments
 (0)