-
Notifications
You must be signed in to change notification settings - Fork 873
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs for library instrumentation of RocketMQ remoting-based client
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Manual Instrumentation for Apache RocketMQ Remoting-based Client version 4.0.0+ | ||
|
||
Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.apache.org/) Remoting-based Client. | ||
|
||
## Quickstart | ||
|
||
### Add these dependencies to your project: | ||
|
||
Replace `OPENTELEMETRY_VERSION` with the latest stable | ||
[release](https://mvnrepository.com/artifact/io.opentelemetry). `Minimum version: 1.1.0` | ||
|
||
For Maven, add 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 to your dependencies: | ||
|
||
```groovy | ||
implementation("io.opentelemetry.instrumentation:opentelemetry-rocketmq-client-4.8:OPENTELEMETRY_VERSION") | ||
``` | ||
|
||
### Usage | ||
|
||
Remoting-based Client of RocketMQ provides the native interceptor to register the message hook in the instrumentation library. | ||
|
||
```java | ||
RocketMqTelemetry rocketMqTelemetry; | ||
|
||
void configure(OpenTelemetry openTelemetry, DefaultMQProducerImpl producer, DefaultMQPushConsumerImpl pushConsumer) { | ||
rocketMqTelemetry = RocketMqTelemetry.create(openTelemetry); | ||
// For producer. | ||
SendMessageHook sendMessageHook = rocketMqTelemetry.newTracingSendMessageHook(); | ||
producer.registerSendMessageHook(sendMessageHook); | ||
// For push consumer. | ||
ConsumeMessageHook consumeMessageHook = rocketMqTelemetry.newTracingConsumeMessageHook(); | ||
pushConsumer.registerConsumeMessageHook(consumeMessageHook); | ||
} | ||
``` |