1

I am using Zipkin server to aggregate the logs, and my project uses Spring Boot 3.0.2 and want to push logs to RabbitMQ with micrometer. The pom.xml contains:

    <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-micrometer</artifactId>
    </dependency>
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-registry-prometheus</artifactId>
    </dependency>
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-tracing-bridge-otel</artifactId>
    </dependency>
    <dependency>
        <groupId>io.opentelemetry</groupId>
        <artifactId>opentelemetry-exporter-zipkin</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.amqp</groupId>
        <artifactId>spring-rabbit</artifactId>
    </dependency>

and the properties file contains:

management.tracing.sampling.probability=1.0
management.zipkin.tracing.endpoint=http://localhost:9411/api/v2/spans
management.metrics.distribution.percentiles-histogram.http.server.requests=true
logging.pattern.level=%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]

spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=guest
spring.rabbitmq.password=guest

But I cannot see any message in the queue when I call any endpoint.

1 Answers1

2

I think there are some misconceptions here:

  1. Zipkin does not ingest logs
  2. Micrometer does not push logs anywhere
  3. SLF4J and Logback are the libraries you can use to push your logs to somewhere

If you want to see messages in your queue, you need to send them to an exchange that is bound to that queue. If you want to push your logs to RabbitMQ, you can use the AmqpAppender for Logback.

Jonatan Ivanov
  • 4,895
  • 2
  • 15
  • 30