-
Notifications
You must be signed in to change notification settings - Fork 870
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
HTTP server duration metrics per connection instead of accumulative #4525
Comments
hi @harel-e! the You should be able to customize the captured metric attributes by implementing a javaagent extension and using |
hey @harel-e, we discussed this today in Java SIG meeting, and agree that the |
After another discussion, there does seem to be value (and less harm) in capturing |
@trask Thank you for the update. I understand that in the next release the http.server.duration histogram would not include the net.peer.* |
cc: @jsuereth |
PTAL at #4556 and weight in |
|
Describe the bug
http.server.duration metrics contains net.peer.* attributes
This leads to histogram per connection, instead of accumulative one (or one per host)
Beyond the fact that such histogram is not useful, the metrics exporter kept adding histogram for every client connection that the application made. I quickly got to hundreds of histograms in a sample application.
Steps to reproduce
auto-Instrument java code that makes http requests (I used RestTemplate)
What did you expect to see?
I expect to see one histogram http_server_duration_count for all client connections (or optionally one per http_host destination)
What did you see instead?
I saw histogram buckets per connection
metrics.txt
Prometheus exporter example
http_server_duration_count{http_flavor="1.0",http_host="localhost:8080",http_method="GET",http_scheme="http",http_
server_name="localhost",http_status_code="200",net_peer_ip="0:0:0:0:0:0:0:1",net_peer_name="localhost",net_peer_port="54566",} 1.0
http_server_duration_sum{http_flavor="1.0",http_host="localhost:8080",http_method="GET",http_scheme="http",http_server_name="localhost",http_status_code="200",net_peer_ip="0:0:0:0:0:0:0:1",net_peer_name="localhost",net_peer_port="54566",} 1145.918858
http_server_duration_bucket{http_flavor="1.0",http_host="localhost:8080",http_method="GET",http_scheme="http",http_server_name="localhost",http_status_code="200",net_peer_ip="0:0:0:0:0:0:0:1",net_peer_name="localhost",net_peer_port="54566",le="5.0",} 0.0
... more buckets
http_server_duration_count{http_flavor="1.0",http_host="localhost:8080",http_method="GET",http_scheme="http",http_server_name="localhost",http_status_code="200",net_peer_ip="0:0:0:0:0:0:0:1",net_peer_name="localhost",net_peer_port="54582",} 1.0
... more buckets
http_server_duration_count{http_flavor="1.0",http_host="localhost:8080",http_method="GET",http_scheme="http",http_server_name="localhost",http_status_code="200",net_peer_ip="0:0:0:0:0:0:0:1",net_peer_name="localhost",net_peer_port="54567",} 1.0
What version are you using?
1.7.0
Environment
JDK : OpenJDK 64-Bit Server VM Temurin-11.0.12+7
OS: MacOS 11.6
Additional context
I understand the value of these attributes with tracing, but not with metrics.
The text was updated successfully, but these errors were encountered: