Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/streamnative/pulsar-tracing
Tracing instrumentation for Apache Pulsar clients.
https://github.com/streamnative/pulsar-tracing
apache-pulsar jaeger messaging opentelemetry opentracing pubsub
Last synced: about 2 months ago
JSON representation
Tracing instrumentation for Apache Pulsar clients.
- Host: GitHub
- URL: https://github.com/streamnative/pulsar-tracing
- Owner: streamnative
- License: apache-2.0
- Created: 2020-04-11T11:57:06.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-09T18:28:33.000Z (over 1 year ago)
- Last Synced: 2024-11-14T20:54:49.058Z (2 months ago)
- Topics: apache-pulsar, jaeger, messaging, opentelemetry, opentracing, pubsub
- Language: Java
- Homepage:
- Size: 33.2 KB
- Stars: 21
- Watchers: 32
- Forks: 10
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Apache Pulsar Client Tracing Instrumentation
Tracing instrumentation for Apache Pulsar client.## OpenTracing Instrumentation
### Requirements- Java 8
- Pulsar client >= 2.5.0### Installation
Add Pulsar client and OpenTracing instrumentation for the Pulsar client.
```xml
org.apache.pulsar
pulsar-client
VERSION```
```xmlio.streamnative
opentracing-pulsar-client
VERSION```
### Usage
#### Interceptors based solution
```java
// Instantiate tracer
Tracer tracer = ...// Optionally register tracer with GlobalTracer
GlobalTracer.register(tracer);
```**Producer**
```java
// Instantiate Producer with tracing interceptor.
Producer producer = client
.newProducer(Schema.STRING)
.intercept(new TracingProducerInterceptor())
.topic("your-topic")
.create();// Send messages.
producer.send("Hello OpenTracing!");
```**Consumer**
```java
// Instantiate Consumer with tracing interceptor.
Consumer consumer = client.newConsumer(Schema.STRING)
.topic("your-topic")
.intercept(new TracingConsumerInterceptor<>())
.subscriptionName("your-sub")
.subscribe();// Receive messages.
Message message = consumer.receive();// To retrieve SpanContext from the message(Consumer side).
SpanContext spanContext = TracingPulsarUtils.extractSpanContext(message, tracer);
```## License
[Apache 2.0 License](./LICENSE).