Open sithmein opened 2 months ago
/cc @brunobat (micrometer), @ebullient (micrometer)
Does the Forget about that I see it throws an exception.@Gauge
nevertheless work as expected?
This check is rather sketchy... Is it really needed @brunobat, @ebullient?
Just a bug. I was trying to be clear about limitations using the MP Metrics Gauge annotation as it does not work the same in the Micrometer extension as it did with SmallRye Metrics.
Describe the bug
Consider the following abstract class:
When the Quarkus application starts, the GaugeAnnotationHandler complains about C uses a @Gauge annotation, but is not @ApplicationScoped, a @Singleton, or a REST endpoint. This doesn't make sense because abstract class can never be instantiated and therefore never report any metrics. Only concrete subclasses can and there the check make sense.
Expected behavior
Abstract classes are not checked by the annotation handlers.
Actual behavior
Abstract classes are checked for annotations when it doesn't make sense.
How to Reproduce?
See description.
Output of
uname -a
orver
-
Output of
java -version
17.0.11
Quarkus version or git rev
Tested with 3.2.12.Final but the code hasn't change since then
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.9.2
Additional information
No response