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

When calling /q/metrics once, http_server_bytes_written_count increases by 2 #41884

Closed
gian1200 opened this issue Jul 14, 2024 · 3 comments
Closed
Labels
area/metrics area/vertx kind/bug Something isn't working triage/invalid This doesn't seem right

Comments

@gian1200
Copy link
Contributor

gian1200 commented Jul 14, 2024

Describe the bug

http_server_bytes_written_count increases by 2 per single /q/metrics invocation,

Expected behavior

http_server_bytes_written_count should increase once when /q/metrics is invoked

Actual behavior

When /q/metrics is invoked, http_server_bytes_written_count increases by 2

Also, even if there is no content-length (body) in GET requests, shouldn't http_server_bytes_read_count increase by 1 per each GET request?

How to Reproduce?

  1. Basic Quarkus project with a REST API (1 POST and 1 GET), and quarkus-micrometer-registry-prometheus, quarkus-smallrye-health extensions.
  2. Call /q/metrics, /q/health or any user GET API.

Output of uname -a or ver

No response

Output of java -version

openjdk version "17.0.11" 2024-04-16

Quarkus version or git rev

3.12.2

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

Apache Maven 3.9.7

Additional information

No response

@gian1200 gian1200 added the kind/bug Something isn't working label Jul 14, 2024
@gian1200 gian1200 changed the title When calling '' When calling /q/metrics once, http_server_bytes_written_count increases by 2 Jul 14, 2024
Copy link

quarkus-bot bot commented Jul 15, 2024

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

@cescoffier
Copy link
Member

I reproduced it.
It only happens for /metrics (and not the other framework routes or business routes)

@cescoffier
Copy link
Member

It's not a bug.

It could happen with any response larger than the max "chunk". Let me explain.
The Prometheus response is large enough to exceed this limit. This means that there is not a single write at the TCP level but two (one at capacity and then the remaining). So, we increment the counter twice.

@cescoffier cescoffier closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
@cescoffier cescoffier added the triage/invalid This doesn't seem right label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics area/vertx kind/bug Something isn't working triage/invalid This doesn't seem right
Projects
Status: Done
Development

No branches or pull requests

3 participants