How to implement Zipkin in Spring Boot 3?

426 views Asked by At

I'm using Java 17, Spring Boot 3, Spring Cloud version 2022.0.4 and Zipkin, but when I configure the properties, it's giving this:

application.properties:

spring.zipkin.base-url=http://localhost:9411/
spring.sleuth.sampler.probability=1.0
Cannot resolve configuration property 'spring.zipkin.base-url' 
Cannot resolve configuration property 'spring.sleuth.sampler.probability'

pom.xml:

        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
            <version>${micrometer.version}</version>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-tracing-bridge-brave</artifactId>
        </dependency>
        <dependency>
            <groupId>io.zipkin.reporter2</groupId>
            <artifactId>zipkin-reporter-brave</artifactId>
        </dependency>

Am I importing the correct dependencies?

1

There are 1 answers

0
Corvo On

I just added these dependencies on pom.xml and it worked:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-tracing-bridge-brave</artifactId>
            <version>1.1.4</version>
        </dependency>
        <dependency>
            <groupId>io.zipkin.reporter2</groupId>
            <artifactId>zipkin-reporter-brave</artifactId>
        </dependency>

application.properties:

management.zipkin.tracing.endpoint=http://localhost:9411
management.tracing.sampling.probability=1.0