Skip to content

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

@FunnyIceCube

Description

@FunnyIceCube

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions