apache / dubbo-samples

samples for Apache Dubbo
Apache License 2.0
2.23k stars 1.91k forks source link

skywalking接入例子错误,且尝试修复后也没采集到信息 #999

Open FunnyIceCube opened 1 year ago

FunnyIceCube commented 1 year ago

image 会找不到ObservationRegistry observationRegistry这个bean,然后我声明了一个之后服务能运行了,但是也采集不到dubbo的信息

我的代码:

@Configuration
public class ObservationConfiguration {

    @Bean
    ObservationRegistry observationRegistry() {
        // Here we create the Observation Registry with attached handlers
        ObservationRegistry registry = ObservationRegistry.create();
// Here we add a meter handler
        registry.observationConfig()
                .observationHandler(new ObservationHandler.FirstMatchingCompositeObservationHandler(
                        (ObservationHandler<? extends Observation.Context>) new SkywalkingMeterHandler(new SkywalkingMeterRegistry())
                ));
        return registry;
    }

    @Bean
    ApplicationModel applicationModel(ObservationRegistry observationRegistry) {
        ApplicationModel applicationModel = ApplicationModel.defaultModel();
        observationRegistry.observationConfig()
                .observationHandler(new ObservationHandler.FirstMatchingCompositeObservationHandler(
                        new SkywalkingSenderTracingHandler(), new SkywalkingReceiverTracingHandler(),
                        new SkywalkingDefaultTracingHandler()
                ));
        applicationModel.getBeanFactory().registerBean(observationRegistry);
        return applicationModel;
    }
}

pom

       <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <version>2.7.10</version>
        </dependency>
        <dependency>
            <groupId>org.apache.dubbo</groupId>
            <artifactId>dubbo-metrics-api</artifactId>
            <version>3.1.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.skywalking</groupId>
            <artifactId>apm-toolkit-micrometer-1.10</artifactId>
            <version>9.0.0</version>
        </dependency>
AlbumenJ commented 1 year ago

你是期望接入 skywalking 的 tracing 还是 metrics

FunnyIceCube commented 1 year ago

你是期望接入 skywalking 的 tracing 还是 metrics

都想接

FunnyIceCube commented 1 year ago

我现在skywalking里endpoint里能看到dubbo的接口,但是其中没有任何数据 我尝试清理了agent里的plugin,之后就什么dubbo信息也采集不到了

AlbumenJ commented 1 year ago

我现在skywalking里endpoint里能看到dubbo的接口,但是其中没有任何数据 我尝试清理了agent里的plugin,之后就什么dubbo信息也采集不到了

目前 skywalking 接入只需要 agent 配置即可,不需要通过 SDK 的。 你所提到的 SDK 的方式是接 ot 的