Search code examples
quarkusmetricsmicroprofile

Quarkus 2.11.x no longer includes org.eclipse.microprofile.metrics:microprofile-metrics-api:3.0.1


I am currently migrating from 2.10.x (bom) and when I tried 2.11.3 (bom) I found that org.eclipse.microprofile.metrics.annotation.Gauge no longer exists. This comes from the following jar:-

org.eclipse.microprofile.metrics:microprofile-metrics-api:3.0.1

I feel like I must have missed something in the migration notes but I am unclear what to do about it.

Any help would be much appreciated.


Solution

  • It seems that the transitive dependency to microprofile-metrics-api was removed from quarkus version 2.11.x onwards. Thus, if we want to use it, we have to add it.

    For gradle, we add the following line to our build.gradle:

    implementation("org.eclipse.microprofile.metrics:microprofile-metrics-api")
    

    For maven, we add the following line to our pom.xml:

    <dependency>
        <groupId>org.eclipse.microprofile.metrics</groupId>
        <artifactId>microprofile-metrics-api</artifactId>
    </dependency>
    

    (The snippets for the build.gradle and pom.xml were taken from the official quarkus guide)