Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This Gauge has been already registered "http.server.active.requests" #46539

Closed
thibaultmeyer opened this issue Feb 27, 2025 · 9 comments · Fixed by #46553
Closed

This Gauge has been already registered "http.server.active.requests" #46539

thibaultmeyer opened this issue Feb 27, 2025 · 9 comments · Fixed by #46553
Labels
area/metrics kind/bug Something isn't working
Milestone

Comments

@thibaultmeyer
Copy link
Contributor

thibaultmeyer commented Feb 27, 2025

Describe the bug

When you start a server listening on http and https, you get a warning that the http.server.active.requests metric is already in use.

HTTP only

2025-02-27 16:11:09,977 INFO  [io.quarkus] (Quarkus Main Thread) MY_APP 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.19.1) started in 5.833s. Listening on: http://localhost:8080
2025-02-27 16:11:09,979 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2025-02-27 16:11:09,979 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, micrometer, rest, rest-jackson, smallrye-context-propagation, smallrye-health, vertx]

HTTP + HTTPS

2025-02-27 16:13:12,331 WARN  [io.mic.cor.ins.MeterRegistry] (vert.x-acceptor-thread-0) This Gauge has been already registered (MeterId{name='http.server.active.requests', tags=[]}), the Gauge registration will be ignored. Note that subsequent logs will be logged at debug level.
2025-02-27 16:13:12,336 INFO  [io.quarkus] (Quarkus Main Thread) MY_APP 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.19.1) started in 6.761s. Listening on: http://localhost:8080 and https://localhost:8081
2025-02-27 16:13:12,337 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2025-02-27 16:13:12,337 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, micrometer, rest, rest-jackson, smallrye-context-propagation, smallrye-health, vertx]

Expected behavior

No warnings. Maybe a tag to differentiate between HTTP and HTTPS?

Output of java -version

mandrel-java21-windows-amd64-23.1.5.0-Final

Quarkus version or git rev

3.19.1

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

Maven 3.9.9

@thibaultmeyer thibaultmeyer added the kind/bug Something isn't working label Feb 27, 2025
@quarkus-bot quarkus-bot bot added env/windows Impacts Windows machines triage/needs-triage labels Feb 27, 2025
@geoand
Copy link
Contributor

geoand commented Feb 27, 2025

I can't reproduce this, so we'll have to have a reproducer for this.

Thanks

Never mind, I was able to reproduce this after all

@geoand geoand added triage/needs-reproducer We are waiting for a reproducer. and removed env/windows Impacts Windows machines triage/needs-reproducer We are waiting for a reproducer. labels Feb 27, 2025
@geoand
Copy link
Contributor

geoand commented Feb 27, 2025

@cescoffier @brunobat it seems like the entire io.quarkus.micrometer.runtime.binder.vertx.VertxHttpServerMetrics is run for both HTTP and HTTPS servers (and without providing any information on which server is being created).

How do you want to handle this?

@brunobat
Copy link
Contributor

brunobat commented Feb 27, 2025

It the metric is already created we should reuse it.
I'm afraid we need to add a Tag and a new dimension to accomodate for http and https.
We should probably use the OTel semantic convention for this attribute: url.scheme

@geoand
Copy link
Contributor

geoand commented Feb 28, 2025

I'm afraid we need to add a Tag and a new dimension to accomodate for http and https.

Makes sense

brunobat added a commit that referenced this issue Feb 28, 2025
Introduce `url.scheme` tag into `http.server.active.requests` metric
@quarkus-bot quarkus-bot bot added this to the 3.21 - main milestone Feb 28, 2025
@thibaultmeyer
Copy link
Contributor Author

@geoand

Thanks for patch. Any chance to get it backported into 3.19.x for the next LTS ?

@geoand
Copy link
Contributor

geoand commented Feb 28, 2025

Yes, it will be included

@gsmet gsmet modified the milestones: 3.21 - main, 3.19.2 Mar 4, 2025
@seseso908
Copy link

With 3.19.2 (and previous), I get this same error when my service only exposes the management interface, port 9000.
My service only uses kafka-streams and REST Client, using the management interface to expose metrics.

@amaechler
Copy link
Contributor

Like @seseso908, I can observe the same when the management interface runs on a different port.

2025-03-06 11:04:46,314 DEBUG [io.qua.mic.run.bin.ver.VertxMeterBinderAdapter] (vert.x-acceptor-thread-0) Create HttpServerMetrics with options io.vertx.core.http.HttpServerOptions@53c2f477 and address localhost:8080
2025-03-06 11:04:46,341 DEBUG [io.qua.mic.run.bin.ver.VertxMeterBinderAdapter] (vert.x-acceptor-thread-0) Create HttpServerMetrics with options io.vertx.core.http.HttpServerOptions@762dd742 and address localhost:9000
2025-03-06 11:04:46,342 WARN  [io.mic.cor.ins.MeterRegistry] (vert.x-acceptor-thread-0) This Gauge has been already registered (MeterId{name='http.server.active.requests', tags=[tag(url.scheme=http)]}), the Gauge registration will be ignored. Note that subsequent logs will be logged at debug level.

@geoand
Copy link
Contributor

geoand commented Mar 6, 2025

We should probably disable the metrics for the management interface.

WDYT @cescoffier ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics kind/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants