Skywalking

This article demonstrates how to integrate Dubbo with the Skywalking full-link monitoring system.

This article demonstrates how to integrate Dubbo with the Skywalking full-link monitoring system. For complete examples, please refer to dubbo-samples-tracing-skywalking. The required Skywalking Agent version is skywalking micrometer-1.10 api.

1. Add Micrometer Observation dependency to your project

To add Micrometer and related Metrics dependencies to the classpath, you need to include the dubbo-metrics-api dependency as follows:

  1. <dependency>
  2. <groupId>org.apache.dubbo</groupId>
  3. <artifactId>dubbo-metrics-api</artifactId>
  4. </dependency>

2. Add Skywalking Micrometer-1.10 Api to the project

To integrate Dubbo Micrometer tracing data into Skywalking, add the following dependency.

  1. <dependency>
  2. <groupId>org.apache.skywalking</groupId>
  3. <artifactId>apm-toolkit-micrometer-1.10</artifactId>
  4. </dependency>

3. Configure ObservationRegistry

  1. @Configuration
  2. public class ObservationConfiguration {
  3. @Bean
  4. ApplicationModel applicationModel(ObservationRegistry observationRegistry) {
  5. ApplicationModel applicationModel = ApplicationModel.defaultModel();
  6. observationRegistry.observationConfig()
  7. .observationHandler(new ObservationHandler.FirstMatchingCompositeObservationHandler(
  8. new SkywalkingSenderTracingHandler(), new SkywalkingReceiverTracingHandler(),
  9. new SkywalkingDefaultTracingHandler()
  10. ));
  11. applicationModel.getBeanFactory().registerBean(observationRegistry);
  12. return applicationModel;
  13. }
  14. }

4. Start Skywalking OAP

Please refer here for how to set up Skywalking OAP

  1. bash startup.sh

5. Start Example Demo (skywalking-agent)

First, we assume you already have a registry to coordinate address discovery, details can be found in the registry configuration pointed to in the example.

Then, start the Provider and Consumer and ensure that the skywalking-agent parameters are correctly set, as skywalking-agent ensures data can be correctly reported to the backend system.

  • Given that the skywalking-agent itself also has built-in Dubbo interceptors, to ensure the example can use Dubbo’s Micrometer integration, we need you to remove the interceptors that come with skywalking-agent by simply deleting the plugins directory.
  • Configure the Skywalking OAP server address in the following file by setting the OAP address /path/to/skywalking-agent/agent.config, the corresponding parameter item is collector.backend_service.
  1. java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar dubbo-samples-spring-boot-tracing-skwalking-provider-1.0-SNAPSHOT.jar
  1. java -javaagent:/path/to/skywalking-agent/skywalking-agent.jar -jar dubbo-samples-spring-boot-tracing-skwalking-consumer-1.0-SNAPSHOT.jar

6. Example Effect

Open [skywalking-webapp](http://localhost:8080/) in your browser to see the effect

skywalking-trace-result-1 skywalking-trace-result-2 skywalking-trace-result-2

Feedback

Was this page helpful?

Yes No

Last modified September 30, 2024: Update & Translate Overview Docs (#3040) (d37ebceaea7)