From 4afa62452aca2e1375897ce38cd803cde1ac8cec Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Mon, 24 Oct 2022 16:19:57 +0800 Subject: [PATCH 1/9] Add docs for library instrumentation of RocketMQ remoting-based client --- .../rocketmq-client-4.8/README.md | 2 +- .../rocketmq-client-4.8/library/README.md | 47 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/README.md index 4ea97b1779fa..e86c2c042a18 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/README.md @@ -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 | |---|---|---|---| diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md new file mode 100644 index 000000000000..936bdae692e4 --- /dev/null +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -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 + + + + io.opentelemetry.instrumentation + opentelemetry-rocketmq-client-4.8 + OPENTELEMETRY_VERSION + + +``` + +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); +} +``` From 3900570c997b47cda3c5257ea9f3c365c387639a Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 09:50:13 +0800 Subject: [PATCH 2/9] Update instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md Co-authored-by: Fabrizio Ferri-Benedetti --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 936bdae692e4..6485fd21eb43 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -4,7 +4,7 @@ Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.ap ## Quickstart -### Add these dependencies to your project: +### Add the following dependencies to your project: Replace `OPENTELEMETRY_VERSION` with the latest stable [release](https://mvnrepository.com/artifact/io.opentelemetry). `Minimum version: 1.1.0` From 20552bf45720e08c742e78320e15106da85fe614 Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 09:50:23 +0800 Subject: [PATCH 3/9] Update instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md Co-authored-by: Fabrizio Ferri-Benedetti --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 6485fd21eb43..6699f27d6106 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -7,7 +7,7 @@ Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.ap ### Add the following dependencies to your project: Replace `OPENTELEMETRY_VERSION` with the latest stable -[release](https://mvnrepository.com/artifact/io.opentelemetry). `Minimum version: 1.1.0` +[release](https://mvnrepository.com/artifact/io.opentelemetry). Minimum version is 1.1.0. For Maven, add to your `pom.xml` dependencies: From 71bec198ce4625f1f3a75e5660d6e1d6555f888d Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 09:50:30 +0800 Subject: [PATCH 4/9] Update instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md Co-authored-by: Fabrizio Ferri-Benedetti --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 6699f27d6106..96ab1c748f2b 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -9,7 +9,7 @@ Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.ap Replace `OPENTELEMETRY_VERSION` with the latest stable [release](https://mvnrepository.com/artifact/io.opentelemetry). Minimum version is 1.1.0. -For Maven, add to your `pom.xml` dependencies: +For Maven, add the following to your `pom.xml` dependencies: ```xml From dede8ffa1f39f3c0518ceb30b1bd370a6f420cf1 Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 09:50:36 +0800 Subject: [PATCH 5/9] Update instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md Co-authored-by: Fabrizio Ferri-Benedetti --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 96ab1c748f2b..09478adf5144 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -22,7 +22,7 @@ For Maven, add the following to your `pom.xml` dependencies: ``` -For Gradle, add to your dependencies: +For Gradle, add the following to your dependencies: ```groovy implementation("io.opentelemetry.instrumentation:opentelemetry-rocketmq-client-4.8:OPENTELEMETRY_VERSION") From 7f14667e15403478ada1ab3197011efea9c9bf05 Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 13:11:26 +0800 Subject: [PATCH 6/9] Update instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md Co-authored-by: Trask Stalnaker --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 09478adf5144..836d3b7e2d15 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -1,4 +1,4 @@ -# Manual Instrumentation for Apache RocketMQ Remoting-based Client version 4.0.0+ +# Library Instrumentation for Apache RocketMQ Remoting-based Client version 4.0.0+ Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.apache.org/) Remoting-based Client. From bc45833cf8b39ad33aa0b9c28f2e59d4207c81e2 Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 13:12:35 +0800 Subject: [PATCH 7/9] Update instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md Co-authored-by: Trask Stalnaker --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 836d3b7e2d15..73761eab77c0 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -6,8 +6,8 @@ Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.ap ### Add the following dependencies to your project: -Replace `OPENTELEMETRY_VERSION` with the latest stable -[release](https://mvnrepository.com/artifact/io.opentelemetry). Minimum version is 1.1.0. +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: From 57a3928b39c637a23fa46880884c572258a8d1c0 Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 13:17:39 +0800 Subject: [PATCH 8/9] Polish the docs --- .../rocketmq-client-4.8/library/README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index 73761eab77c0..d45f46d5c8da 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -1,18 +1,16 @@ # Library Instrumentation for Apache RocketMQ Remoting-based Client version 4.0.0+ -Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.apache.org/) Remoting-based Client. +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). +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 - io.opentelemetry.instrumentation @@ -38,10 +36,8 @@ RocketMqTelemetry rocketMqTelemetry; void configure(OpenTelemetry openTelemetry, DefaultMQProducerImpl producer, DefaultMQPushConsumerImpl pushConsumer) { rocketMqTelemetry = RocketMqTelemetry.create(openTelemetry); // For producer. - SendMessageHook sendMessageHook = rocketMqTelemetry.newTracingSendMessageHook(); - producer.registerSendMessageHook(sendMessageHook); + producer.registerSendMessageHook(rocketMqTelemetry.newTracingSendMessageHook()); // For push consumer. - ConsumeMessageHook consumeMessageHook = rocketMqTelemetry.newTracingConsumeMessageHook(); - pushConsumer.registerConsumeMessageHook(consumeMessageHook); + pushConsumer.registerConsumeMessageHook(rocketMqTelemetry.newTracingConsumeMessageHook()); } ``` From 667f95a0f695a2bde802a726df406deebbcefc37 Mon Sep 17 00:00:00 2001 From: Aaron Ai Date: Tue, 25 Oct 2022 13:25:50 +0800 Subject: [PATCH 9/9] Make the usage section simplier --- .../rocketmq-client/rocketmq-client-4.8/library/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md index d45f46d5c8da..f87f6d89b3a2 100644 --- a/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md +++ b/instrumentation/rocketmq/rocketmq-client/rocketmq-client-4.8/library/README.md @@ -1,4 +1,4 @@ -# Library Instrumentation for Apache RocketMQ Remoting-based Client version 4.0.0+ +# Library Instrumentation for Apache RocketMQ Remoting-based Client 4.0.0+ Provides OpenTelemetry instrumentation for [Apache RocketMQ](https://rocketmq.apache.org/) remoting-based client. @@ -28,7 +28,7 @@ implementation("io.opentelemetry.instrumentation:opentelemetry-rocketmq-client-4 ### Usage -Remoting-based Client of RocketMQ provides the native interceptor to register the message hook in the instrumentation library. +The instrumentation library provides the implementation of `SendMessageHook` and `ConsumeMessageHook` to provide OpenTelemetry-based spans and context propagation. ```java RocketMqTelemetry rocketMqTelemetry;