We’re running Axon 3.2.2 on SpringBoot 2.0.2 and it’s running fine.
Now we are starting to add metrics into the mix. But, since SpringBoot 2.x uses micrometer for the metrics, I’m stuck.
I cannot find any good examples on Axon Metrics (the codehale/dropwizard one on SpringBoot 1.x) and next to that, I’d like to add this to my micrometer metrics as well.
Does anyone have any experience with this already.
A working example of the metrics (codehale/dropwizard) would be nice, and if someone has figured out how to add this in SpringBoot 2.x, that would be great.
I’m not sure how much has changed in this respect between Boot 1 and 2, but if Spring Boot Actuator is enabled, you only need to add the metrics module and leave everything to defaults. You’ll get a lot of metrics reported in your actuator endpoints.
Alternatively, you can expose the MetricRegistry on an endpoint of your choice. This bean will be automatically provided if not already present in the application context.
When starting the application, I get this error/message
2018-07-13 16:31:20.422 [main] WARN o.s.c.a.ConfigurationClassPostProcessor - Cannot enhance @Configuration bean definition ‘org.axonframework.boot.autoconfig.MetricsAutoConfiguration’ since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as ‘static’.
I have spring-actuator enabled, and we have some mircometer settings in application.yml. My pom.xml contains dependencies for micrometer, micrometer-prometheus and axon-metrics.
That warning doesn’t matter to much, I believe, but it has been resolved in Axon 3.3(.2).
Someone in the team pointer out that Spring Boot 2 doesn’t provide the same support for metrics anymore. It might be that you need to explicly expose certain metrics to actuator. We’ll look into this for upcoming versions.