I have a Spring Boot 3 project with Camel. I am using org.apache.camel.springboot:camel-observation-starter for tracing.
I have setup the project using autoconfig instructions and this blog from the camel-observation team.
My tracing is working, and metrics are being produced (using prometheus). My problem is that the default metrics produced by camel-observation-starter are crazy, every request and response is stored as its own metric, so essentially every request/response is stored in full on the prometheus endpoint.

I would like to use camel-observation-starter for tracing, but stop it producing any metrics. I cannot find a way to do this. Any suggestions?
Some versions of my components:
org.springframework.cloud:spring-cloud-dependencies 2023.0.0
org.springframework.boot:spring-boot-starter-parent 3.2.2
org.apache.camel.springboot:camel-spring-boot-dependencies 4.4.1
org.apache.camel.springboot:camel-observation-starter
io.micrometer:micrometer-registry-prometheus
I'm posting a second answer as I found a much better way to filter out these metrics based on a tag.
@Bean
public MeterFilter meterFilter() {
return new MeterFilter() {
@Override
public MeterFilterReply accept(final Meter.Id id) {
if ("camel-direct".equals(id.getTag("component"))) {
return MeterFilterReply.DENY;
}
return MeterFilterReply.NEUTRAL;
}
};
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With