quarkus icon indicating copy to clipboard operation
quarkus copied to clipboard

/q/metrics is unavailable after Bump Micrometer to 1.13

Open rsvoboda opened this issue 1 year ago • 12 comments

Describe the bug

/q/metrics endpoint is unavailable after Bump Micrometer to 1.13 - https://github.com/quarkusio/quarkus/pull/42661

Noticed due to failure of daily https://github.com/quarkus-qe/beefy-scenarios/actions with the build over night, tests in 015-quarkus-micrometer module are getting 404 when requesting /q/metrics. The same can be faced in dev mode.

When I reverted the bump commit /q/metrics is available again.

See How to Reproduce? for reproducer steps.

Expected behavior

/q/metrics is available

Actual behavior

/q/metrics is unavailable

How to Reproduce?

git clone https://github.com/quarkus-qe/beefy-scenarios
mvn clean quarkus:dev -pl 015-quarkus-micrometer
curl http://localhost:8081/q/metrics  ## or open http://localhost:8081/q/metrics

Make sure to use the latest Quarkus main

Running with 3.14 ( mvn clean quarkus:dev -pl 015-quarkus-micrometer -Dquarkus.platform.version=3.14.0) has metrics available.

Output of uname -a or ver

macOS

Output of java -version

Java 21

Quarkus version or git rev

Quarkus main

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

rsvoboda avatar Aug 27 '24 13:08 rsvoboda

/cc @brunobat (micrometer), @ebullient (metrics,micrometer), @jmartisk (metrics)

quarkus-bot[bot] avatar Aug 27 '24 13:08 quarkus-bot[bot]

CC @gsmet as I think Micrometer bump was also considered for backport

rsvoboda avatar Aug 27 '24 13:08 rsvoboda

@rsvoboda you need to change the following dependency:

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

to:

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus-simpleclient</artifactId>
</dependency>

gastaldi avatar Aug 27 '24 14:08 gastaldi

PR created: https://github.com/quarkus-qe/beefy-scenarios/pull/502

gastaldi avatar Aug 27 '24 14:08 gastaldi

@rsvoboda you need to change the following dependency:

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus</artifactId>
</dependency>

to:

<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-prometheus-simpleclient</artifactId>
</dependency>

Updated the description of the bump PR to highlight this. However, this is not required inside a Quarkus app because the Prometheus registry uses this and exposes the classes to the users.

brunobat avatar Aug 27 '24 14:08 brunobat

Right.. I was going to ask why this is being specified directly (rather than relying on the dependency through the quarkus micrometer prometheus extension?

This is incorrect:

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-micrometer</artifactId>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
        </dependency>

It should be (as documented):

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
        </dependency>

ebullient avatar Aug 27 '24 15:08 ebullient

Just looking into the same, the scenario was added in January 2021, So probably early days of Micrometer integration on Quarkus side.

rsvoboda avatar Aug 27 '24 15:08 rsvoboda

But still strange that /q/metrics is unavailable. Could we get a warning?

FYI, I will switch the app to quarkus-micrometer-registry-prometheus.

rsvoboda avatar Aug 27 '24 15:08 rsvoboda

There are quarkus integration tests that rely on the prometheus metrics endpoint being present. I'm not sure what the setup difference is between those and this.

ebullient avatar Aug 27 '24 15:08 ebullient

But still strange that /q/metrics is unavailable. Could we get a warning?

Or maybe a hint in https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.16#micrometer about unavailable /q/metrics in case of direct io.micrometer:micrometer-registry-prometheus usage in the app.

rsvoboda avatar Aug 27 '24 15:08 rsvoboda

in case of direct io.micrometer:micrometer-registry-prometheus usage in the app.

Was that the issue?

ebullient avatar Aug 27 '24 15:08 ebullient

Seems to be fixed in https://github.com/quarkus-qe/beefy-scenarios/pull/503, requiring no changes if your project uses io.quarkus:quarkus-micrometer-registry-prometheus already.

gastaldi avatar Aug 27 '24 20:08 gastaldi

Can we close this one, @rsvoboda ?

brunobat avatar Sep 09 '24 08:09 brunobat

Yes, https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.14#micrometer mentions use-case with /q/metric

rsvoboda avatar Sep 09 '24 08:09 rsvoboda