My Quarkus application is using Micrometer and Smallrye Fault Tolarance extensions, and I appreciate the fact that using the @CircuitBreaker annotation automatically adds metrics. However, the format and labels are kind of ugly and would make maintaining and operational dashboards and monitoring a pain as they seem to be autogenerated based on the package and class. Example: refactoring or moving them would basically break Prometheus query.
Is it possible to configure this with Quarkus?
This is what the metrics look like out of the box
ft_some_really_long_package_name_ClassName_methodName_circuitbreaker_halfOpen_total{} 0
What I would like to have is something like this
circuitbreaker_halfOpen_total{package="com.somepackage", class="SomeClass", method="SomeMethod"} 0
hmmm. You should be able to do this with a MeterFilter, I think, but getting the string munging right (to split package/classname/methodName)
https://quarkus.io/guides/micrometer#using-meterfilter-to-configure-metrics
An example is here: https://github.com/quarkusio/quarkus/blob/main/integration-tests/micrometer-mp-metrics/src/main/java/io/quarkus/it/micrometer/mpmetrics/RenameMeterFilterProducer.java