This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push: new 3c2ef69b0 updated (#1114) 3c2ef69b0 is described below commit 3c2ef69b0db8c50fd6e8fd1509ba19e2c6f73ea1 Author: yuuki <129849919+li-can-ch...@users.noreply.github.com> AuthorDate: Sun Mar 24 15:19:18 2024 +0800 updated (#1114) --- .../dubbo-samples-spring-boot3-tracing/README.md | 53 ++++++++++++++++--- .../pom.xml | 10 +++- .../src/main/resources/application.yml | 61 +++++++++++----------- .../pom.xml | 12 ++++- .../src/main/resources/application.yml | 12 +++-- .../dubbo-samples-spring-boot3-tracing/pom.xml | 14 +++-- 6 files changed, 111 insertions(+), 51 deletions(-) diff --git a/4-governance/dubbo-samples-spring-boot3-tracing/README.md b/4-governance/dubbo-samples-spring-boot3-tracing/README.md index 1dc43f728..c66ff5273 100644 --- a/4-governance/dubbo-samples-spring-boot3-tracing/README.md +++ b/4-governance/dubbo-samples-spring-boot3-tracing/README.md @@ -45,15 +45,14 @@ Open [http://localhost:9411/zipkin/](http://localhost:9411/zipkin/) in browser. ### 1. Adding `dubbo-spring-boot-observability-starter` To Your Project -For the Springboot project, you can use `dubbo-spring-boot-observability-starter` to easily have observability, Dubbo -provides two types of starters at present, select one to add to pom: +For the Springboot project, you can use `dubbo-spring-boot-observability-starter` to easily have observability, Dubbo provides two types of starters at present, select one to add to pom: ```xml <!-- Opentelemetry as Tracer, Zipkin as exporter --> <dependency> <groupId>org.apache.dubbo</groupId> - <artifactId>dubbo-spring-boot-tracing-otel-zipkin-starter</artifactId> + <artifactId>dubbo-tracing-otel-zipkin-spring-boot-starter</artifactId> </dependency> ``` @@ -62,10 +61,12 @@ provides two types of starters at present, select one to add to pom: <!-- Brave as Tracer, Zipkin as exporter --> <dependency> <groupId>org.apache.dubbo</groupId> - <artifactId>dubbo-spring-boot-tracing-brave-zipkin-starter</artifactId> + <artifactId>dubbo-tracing-brave-zipkin-spring-boot-starter</artifactId> </dependency> ``` +Please note that this Dubbo upgrade has changed the dependency name, which is quite tricky. We recommend visiting the Dubbo version release page to obtain the latest source code updates. For reference, visit https://cn.dubbo.apache.org/en/download/. + Dubbo will support more in the future, such as skywalking, Jagger. ### 2. Configuration Tracing @@ -73,7 +74,24 @@ Dubbo will support more in the future, such as skywalking, Jagger. #### application.yml: ```yaml +my-address: 127.0.0.1 + +spring: + application: + name: dubbo-springboot3-tracing-provider/consumer dubbo: + application: + name: ${spring.application.name} + protocol: + name: dubbo + port: -1 + registry: + id: nacos-registry + address: nacos://${my-address}:8848 + config-center: + address: nacos://${my-address}:8848 + metadata-report: + address: nacos://${my-address}:8848 tracing: enabled: true # default is false sampling: @@ -82,11 +100,10 @@ dubbo: type: W3C # W3C/B3 default is W3C tracing-exporter: zipkin-config: - endpoint: http://localhost:9411/api/v2/spans + endpoint: http://${my-address}:9411/api/v2/spans connect-timeout: 1s # connect timeout, default is 1s read-timeout: 10s # read timeout, default is 10s -# tracing info output to logging logging: level: root: info @@ -94,6 +111,8 @@ logging: console: '[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2} [%X{traceId:-}, %X{spanId:-}]: %m%n' ``` +Among these steps, we need to manually configure "my-address" to the addresses where we run Nacos and Zipkin. + ### 3. Customizing Observation Filters To customize the tags present in metrics (low cardinality tags) and in spans (low and high cardinality tags) you should @@ -107,9 +126,27 @@ side). An OpenZipkin URL sender dependency to send out spans to Zipkin via a URLConnectionSender ```xml - <dependency> <groupId>io.zipkin.reporter2</groupId> <artifactId>zipkin-sender-urlconnection</artifactId> + <version>3.3.0</version> +</dependency> +``` + +or use following code to solve it: + +```xml +<dependency> + <groupId>io.zipkin.reporter2</groupId> + <artifactId>zipkin-reporter</artifactId> + <version>3.3.0</version> +</dependency> +<dependency> + <groupId>io.zipkin.reporter2</groupId> + <artifactId>zipkin-sender-okhttp3</artifactId> + <version>3.3.0</version> </dependency> -``` \ No newline at end of file +``` + + + diff --git a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/pom.xml b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/pom.xml index a488576fb..4973eb51c 100644 --- a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/pom.xml +++ b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/pom.xml @@ -58,7 +58,13 @@ <!-- Observability --> <dependency> <groupId>org.apache.dubbo</groupId> - <artifactId>dubbo-spring-boot-tracing-otel-zipkin-starter</artifactId> + <artifactId>dubbo-tracing-otel-zipkin-spring-boot-starter</artifactId> + </dependency> + <!-- zipkin sender --> + <dependency> + <groupId>io.zipkin.reporter2</groupId> + <artifactId>zipkin-sender-urlconnection</artifactId> + <version>3.3.0</version> </dependency> </dependencies> @@ -67,7 +73,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>3.0.5</version> + <version>${spring-boot-maven-plugin.version}</version> <executions> <execution> <goals> diff --git a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/src/main/resources/application.yml b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/src/main/resources/application.yml index 90a670e7d..33aea7d9c 100644 --- a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/src/main/resources/application.yml +++ b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-consumer/src/main/resources/application.yml @@ -14,37 +14,38 @@ # See the License for the specific language governing permissions and # limitations under the License. -spring: - application: - name: dubbo-springboot3-tracing-consumer +my-address: 127.0.0.1 +spring: + application: + name: dubbo-springboot3-tracing-cunsumer dubbo: - application: - name: ${spring.application.name} - protocol: - name: dubbo - port: -1 - registry: - id: nacos-registry - address: nacos://127.0.0.1:8848 - config-center: - address: nacos://127.0.0.1:8848 - metadata-report: - address: nacos://127.0.0.1:8848 - tracing: - enabled: true # default is false - sampling: - probability: 0.5 # sampling rate, default is 0.1 - propagation: - type: W3C # W3C/B3 default is W3C - tracing-exporter: - zipkin-config: - endpoint: http://localhost:9411/api/v2/spans - connect-timeout: 1s # connect timeout, default is 1s - read-timeout: 10s # read timeout, default is 10s + application: + name: ${spring.application.name} + protocol: + name: dubbo + port: -1 + registry: + id: nacos-registry + address: nacos://${my-address}:8848 + config-center: + address: nacos://${my-address}:8848 + metadata-report: + address: nacos://${my-address}:8848 + tracing: + enabled: true # default is false + sampling: + probability: 0.5 # sampling rate, default is 0.1 + propagation: + type: W3C # W3C/B3 default is W3C + tracing-exporter: + zipkin-config: + endpoint: http://${my-address}:9411/api/v2/spans + connect-timeout: 1s # connect timeout, default is 1s + read-timeout: 10s # read timeout, default is 10s logging: - level: - root: info - pattern: - console: '[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2} [%X{traceId:-}, %X{spanId:-}]: %m%n' + level: + root: info + pattern: + console: '[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2} [%X{traceId:-}, %X{spanId:-}]: %m%n' diff --git a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/pom.xml b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/pom.xml index c6a71c2ce..f2e4df1e4 100644 --- a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/pom.xml +++ b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/pom.xml @@ -59,8 +59,16 @@ <!-- Observability --> <dependency> <groupId>org.apache.dubbo</groupId> - <artifactId>dubbo-spring-boot-tracing-otel-zipkin-starter</artifactId> + <artifactId>dubbo-tracing-otel-zipkin-spring-boot-starter</artifactId> </dependency> + + <!-- zipkin sender --> + <dependency> + <groupId>io.zipkin.reporter2</groupId> + <artifactId>zipkin-sender-urlconnection</artifactId> + <version>3.3.0</version> + </dependency> + </dependencies> <build> @@ -68,7 +76,7 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> - <version>3.0.5</version> + <version>${spring-boot-maven-plugin.version}</version> <executions> <execution> <goals> diff --git a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/src/main/resources/application.yml b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/src/main/resources/application.yml index bb617df81..564bd15b6 100644 --- a/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/src/main/resources/application.yml +++ b/4-governance/dubbo-samples-spring-boot3-tracing/dubbo-samples-spring-boot3-tracing-provider/src/main/resources/application.yml @@ -14,10 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +my-address: 127.0.0.1 + spring: application: name: dubbo-springboot3-tracing-provider - dubbo: application: name: ${spring.application.name} @@ -26,11 +27,11 @@ dubbo: port: -1 registry: id: nacos-registry - address: nacos://127.0.0.1:8848 + address: nacos://${my-address}:8848 config-center: - address: nacos://127.0.0.1:8848 + address: nacos://${my-address}:8848 metadata-report: - address: nacos://127.0.0.1:8848 + address: nacos://${my-address}:8848 tracing: enabled: true # default is false sampling: @@ -39,7 +40,7 @@ dubbo: type: W3C # W3C/B3 default is W3C tracing-exporter: zipkin-config: - endpoint: http://localhost:9411/api/v2/spans + endpoint: http://${my-address}:9411/api/v2/spans connect-timeout: 1s # connect timeout, default is 1s read-timeout: 10s # read timeout, default is 10s @@ -48,3 +49,4 @@ logging: root: info pattern: console: '[%d{dd/MM/yy HH:mm:ss:SSS z}] %t %5p %c{2} [%X{traceId:-}, %X{spanId:-}]: %m%n' + diff --git a/4-governance/dubbo-samples-spring-boot3-tracing/pom.xml b/4-governance/dubbo-samples-spring-boot3-tracing/pom.xml index 0dd89e329..0aa78c022 100644 --- a/4-governance/dubbo-samples-spring-boot3-tracing/pom.xml +++ b/4-governance/dubbo-samples-spring-boot3-tracing/pom.xml @@ -46,15 +46,15 @@ <maven.compiler.target>17</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <dubbo.version>3.2.6</dubbo.version> - <spring-boot.version>3.0.5</spring-boot.version> + <dubbo.version>3.3.0-beta.1</dubbo.version> + <spring-boot.version>3.2.3</spring-boot.version> <nacos.version>2.2.0</nacos.version> <micrometer.version>1.10.6</micrometer.version> <micrometer-tracing.version>1.0.5</micrometer-tracing.version> - <opentelemetry.version>1.19.0</opentelemetry.version> + <opentelemetry.version>1.36.0</opentelemetry.version> <junit.version>4.13.1</junit.version> - <spring-boot-maven-plugin.version>3.0.5</spring-boot-maven-plugin.version> + <spring-boot-maven-plugin.version>3.2.3</spring-boot-maven-plugin.version> </properties> <dependencyManagement> @@ -66,6 +66,11 @@ <type>pom</type> <scope>import</scope> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <version>${spring-boot-maven-plugin.version}</version> + </dependency> <dependency> <groupId>io.micrometer</groupId> @@ -133,5 +138,6 @@ <artifactId>junit</artifactId> <scope>test</scope> </dependency> + </dependencies> </project> --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org