As part of a Swarm application, I have a simple application metric such as
The intent is for the method to take roughly between 1 and 100 millis, and have the duration reported in millis as well.
However, when I run that -swarm.jar uberjar, trigger the timed method several times and then issue request to localhost:8080/metrics, I see:
Clearly the times are in nanoseconds, which is the default for the @Timed annotation.
Yet the metric metadata say the unit is millis, like specified in the annotation:
I believe this itself is a blocking issue, though I can't find a single place in the MP Metrics spec that would conclusively confirm or refute.
I have another argument, though, that makes it clear that there's definitely something wrong: if I request the metrics in the Prometheus format, I see:
This is very clearly wrong – the invocations don't take thousands of seconds!
I believe that, when converting the values to seconds as MP Metrics spec requires, WildFly Swarm acted as if the metric was in millis (per the metadata!). Problem is that the values are actually in nanos!
To conclude, I think these 2 wrong outputs are actually caused by a single problem.