Skip to content

Commit

Permalink
Add docs for library instrumentation of RocketMQ remoting-based client (
Browse files Browse the repository at this point in the history
open-telemetry#6960)

Fixes open-telemetry#6954

Co-authored-by: Fabrizio Ferri-Benedetti <[email protected]>
Co-authored-by: Trask Stalnaker <[email protected]>
  • Loading branch information
3 people authored and LironKS committed Oct 31, 2022
1 parent 1562a36 commit 0bf866e
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Settings for the Apache RocketMQ client instrumentation
# Settings for the Apache RocketMQ Remoting-based client instrumentation

| System property | Type | Default | Description |
|---|---|---|---|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Library Instrumentation for Apache RocketMQ Remoting-based Client 4.0.0+

Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.apache.org/) remoting-based client.

## Quickstart

### Add the following dependencies to your project:

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://search.maven.org/search?q=g:io.opentelemetry.instrumentation%20AND%20a:opentelemetry-rocketmq-client-4.8).

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

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-rocketmq-client-4.8</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add the following to your dependencies:

```groovy
implementation("io.opentelemetry.instrumentation:opentelemetry-rocketmq-client-4.8:OPENTELEMETRY_VERSION")
```

### Usage

The instrumentation library provides the implementation of `SendMessageHook` and `ConsumeMessageHook` to provide OpenTelemetry-based spans and context propagation.

```java
RocketMqTelemetry rocketMqTelemetry;

void configure(OpenTelemetry openTelemetry, DefaultMQProducerImpl producer, DefaultMQPushConsumerImpl pushConsumer) {
rocketMqTelemetry = RocketMqTelemetry.create(openTelemetry);
// For producer.
producer.registerSendMessageHook(rocketMqTelemetry.newTracingSendMessageHook());
// For push consumer.
pushConsumer.registerConsumeMessageHook(rocketMqTelemetry.newTracingConsumeMessageHook());
}
```

0 comments on commit 0bf866e

Please sign in to comment.