wildflymicrometerwildfly-28

Using micrometer annotations in WildFly 28


I'm working on upgrading our application to WildFly 28 and then microprofile metrics has been replaced by micrometer. I tried to add the micrometer @Counted-annotation like this to a method. This is very similar to how we're using microprofile metrics today:

    @Counted(value = "xxxxx_api_ping", description = "Hvor mange ping-kall gjennom api.")
    @GET
    public Response ping() {
      ...
    }

This however does not seem to be discovered; however doing it programatically works:

    @Inject
    private MeterRegistry registry;

    @GET
    public Response ping() {
      registry.counter("dummy").increment();
      ...
    }

The first example should work, right?


Solution

  • The micrometer integration in WildFly does not support annotation-driven metrics, providing support only for the programmatic use of Micrometer APIs (https://docs.wildfly.org/30/Admin_Guide.html#use-in-applications). If you would like to see support added, please file an RFE at https://issues.redhat.com against the WildFly project.