I have pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</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>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-sender-kafka</artifactId>
</dependency>
So, micrometer create traceId, send it to kafka topic and zipkin get it from kafka topic.
But in prometheus I have an error: metric name http_server_requests_seconds_count does not support exemplars
It worked in spring-boot 2.x. And work if exclude zipkin and brave dependencies.
Fist of all, please do not define versions that are defined by Boot, also micrometer-tracing
is pulled in by micrometer-tracing-bridge-brave
so you can delete the micrometer-tracing
dependency from your POM.
It seems you are using an unsupported version of Prometheus server. Exemplars support for all time series was added in #11982. It was released in Prometheus 2.43.0, please upgrade.
If you want to hack this (please don't and use a supported version of Prometheus instead), If you create a SpanContextSupplier
@Bean
that always says isSampled
false
and it returns null
for the spanId
and traceId
, you will not see those exemplars.
In Spring Boot 3.3.0 and Micrometer 1.13.0, we added support to the Prometheus 1.x Java Client which supports conditionally enabling exemplars on all time series (i.e.: _count
), see PrometheusConfig
in Micrometer so that you can disable this.