Skip to content

Commit 12e289d

Browse files
committed
add README.md for library
1 parent 527b244 commit 12e289d

File tree

1 file changed

+39
-0
lines changed
  • instrumentation/jsonrpc4j-1.3/library

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Library Instrumentation for jsonrpc4j 1.3.3+
2+
3+
Provides OpenTelemetry instrumentation for [jsonrpc4j](https://github.com/briandilley/jsonrpc4j) server.
4+
5+
## Quickstart
6+
7+
### Add the following dependencies to your project
8+
9+
Replace `OPENTELEMETRY_VERSION` with the [latest release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20AND%20a:opentelemetry-jsonrpc4j-1.3).
10+
11+
For Maven, add the following to your `pom.xml` dependencies:
12+
13+
```xml
14+
<dependencies>
15+
<dependency>
16+
<groupId>io.opentelemetry.instrumentation</groupId>
17+
<artifactId>opentelemetry-jsonrpc4j-1.3</artifactId>
18+
<version>OPENTELEMETRY_VERSION</version>
19+
</dependency>
20+
</dependencies>
21+
```
22+
23+
For Gradle, add the following to your dependencies:
24+
25+
```groovy
26+
implementation("io.opentelemetry.instrumentation:opentelemetry-jsonrpc4j-1.3:OPENTELEMETRY_VERSION")
27+
```
28+
29+
### Usage
30+
31+
The instrumentation library provides the implementation of `InvocationListener` to provide OpenTelemetry-based spans and context propagation.
32+
33+
```java
34+
// For server-side, attatch the invocation listener to your service.
35+
JsonRpcBasicServer configureServer(OpenTelemetry openTelemetry, JsonRpcBasicServer server) {
36+
JsonRpcTelemetry jsonrpcTelemetry = JsonRpcTelemetry.create(openTelemetry);
37+
return server.setInvocationListener(jsonrpcTelemetry.newServerInvocationListener());
38+
}
39+
```

0 commit comments

Comments
 (0)