…n-api-semconv We're already doing that for `SpanNameExtractor`, `OperationMetrics`, `ContextCustomizer`, etc., so I figured we should do the same for `AttributesExtractor` implementation. Also, none of the implementations have any additional public surface - aside from the builder/factory method users can just simply use the interface everywhere. |
||
|---|---|---|
| .. | ||
| src | ||
| README.md | ||
| build.gradle.kts | ||
README.md
Library Instrumentation for Apache RocketMQ remoting-based client 4.0.0+
Provides OpenTelemetry instrumentation for Apache RocketMQ remoting-based client.
Quickstart
Add the following dependencies to your project
Replace OPENTELEMETRY_VERSION with the latest release.
For Maven, add the following to your pom.xml dependencies:
<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:
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.
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());
}