Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

camel-observation-starter creates metrics with full request data

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.

enter image description here

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

like image 974
F_SO_K Avatar asked Dec 06 '25 16:12

F_SO_K


1 Answers

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;
        }
    };
}
like image 184
F_SO_K Avatar answered Dec 09 '25 13:12

F_SO_K



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!