Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

feat: per HTTP handler metrics #132

Merged
merged 2 commits into from
May 29, 2023
Merged

feat: per HTTP handler metrics #132

merged 2 commits into from
May 29, 2023

Conversation

lidel
Copy link
Collaborator

@lidel lidel commented May 25, 2023

This adds generic HTTP metrics

Per handler (ipfs, ipns, legacyKuboRpc)

Per handler/method/code:

Demo

cc @cameronwood @gmasgras (fyi)

Click to expand
# HELP ipfs_http_request_duration_seconds The HTTP request latencies in seconds.
# TYPE ipfs_http_request_duration_seconds summary
ipfs_http_request_duration_seconds{code="200",handler="ipfs",method="get",quantile="0.5"} 0.000620535
ipfs_http_request_duration_seconds{code="200",handler="ipfs",method="get",quantile="0.9"} 0.00075842
ipfs_http_request_duration_seconds{code="200",handler="ipfs",method="get",quantile="0.99"} 0.522976382
ipfs_http_request_duration_seconds_sum{code="200",handler="ipfs",method="get"} 0.5885777660000001
ipfs_http_request_duration_seconds_count{code="200",handler="ipfs",method="get"} 99
ipfs_http_request_duration_seconds{code="200",handler="ipns",method="get",quantile="0.5"} 0.407661731
ipfs_http_request_duration_seconds{code="200",handler="ipns",method="get",quantile="0.9"} 1.519944324
ipfs_http_request_duration_seconds{code="200",handler="ipns",method="get",quantile="0.99"} 1.694205379
ipfs_http_request_duration_seconds_sum{code="200",handler="ipns",method="get"} 10.605908031
ipfs_http_request_duration_seconds_count{code="200",handler="ipns",method="get"} 19
# HELP ipfs_http_request_size_bytes The HTTP request sizes in bytes.
# TYPE ipfs_http_request_size_bytes summary
ipfs_http_request_size_bytes{code="200",handler="ipfs",method="get",quantile="0.5"} 119
ipfs_http_request_size_bytes{code="200",handler="ipfs",method="get",quantile="0.9"} 119
ipfs_http_request_size_bytes{code="200",handler="ipfs",method="get",quantile="0.99"} 525
ipfs_http_request_size_bytes_sum{code="200",handler="ipfs",method="get"} 12187
ipfs_http_request_size_bytes_count{code="200",handler="ipfs",method="get"} 99
ipfs_http_request_size_bytes{code="200",handler="ipns",method="get",quantile="0.5"} 485
ipfs_http_request_size_bytes{code="200",handler="ipns",method="get",quantile="0.9"} 548
ipfs_http_request_size_bytes{code="200",handler="ipns",method="get",quantile="0.99"} 670
ipfs_http_request_size_bytes_sum{code="200",handler="ipns",method="get"} 9661
ipfs_http_request_size_bytes_count{code="200",handler="ipns",method="get"} 19
# HELP ipfs_http_requests_inflight Tracks the number of HTTP client requests currently in progress.
# TYPE ipfs_http_requests_inflight gauge
ipfs_http_requests_inflight{handler="ipfs"} 0
ipfs_http_requests_inflight{handler="ipns"} 1
ipfs_http_requests_inflight{handler="kuboRpc"} 0
# HELP ipfs_http_requests_total Total number of HTTP requests made.
# TYPE ipfs_http_requests_total counter
ipfs_http_requests_total{code="200",handler="ipfs",method="get"} 99
ipfs_http_requests_total{code="200",handler="ipns",method="get"} 19
# HELP ipfs_http_response_size_bytes The HTTP response sizes in bytes.
# TYPE ipfs_http_response_size_bytes summary
ipfs_http_response_size_bytes{code="200",handler="ipfs",method="get",quantile="0.5"} 119762
ipfs_http_response_size_bytes{code="200",handler="ipfs",method="get",quantile="0.9"} 119762
ipfs_http_response_size_bytes{code="200",handler="ipfs",method="get",quantile="0.99"} 119762
ipfs_http_response_size_bytes_sum{code="200",handler="ipfs",method="get"} 1.1856438e+07
ipfs_http_response_size_bytes_count{code="200",handler="ipfs",method="get"} 99
ipfs_http_response_size_bytes{code="200",handler="ipns",method="get",quantile="0.5"} 6398
ipfs_http_response_size_bytes{code="200",handler="ipns",method="get",quantile="0.9"} 153909
ipfs_http_response_size_bytes{code="200",handler="ipns",method="get",quantile="0.99"} 328521
ipfs_http_response_size_bytes_sum{code="200",handler="ipns",method="get"} 784726
ipfs_http_response_size_bytes_count{code="200",handler="ipns",method="get"} 19

This adds generic HTTP metrics per handler/method/code:
- ipfs_http_requests_inflight (gauge)
  - partially addresses #112 (outgoing tracked in caboose)
- ipfs_http_requests_total (counter)
- ipfs_http_request_duration_seconds (summary)
  - partially addresses #120
- ipfs_http_request_size_bytes (summary)
- ipfs_http_response_size_bytes (summary)
@lidel lidel marked this pull request as ready for review May 25, 2023 19:33
@gmasgras
Copy link
Collaborator

This is great! Could we also get quantile="0.95" ? It's the most used quantile in our dashboards 🙇‍♂️

@lidel
Copy link
Collaborator Author

lidel commented May 29, 2023

Added P75 and P95. Merging :)

@lidel lidel merged commit ce73242 into main May 29, 2023
@lidel lidel deleted the feat/new-http-metrics branch May 29, 2023 11:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

More Metrics on TTLB Add metric with number of incoming/outgoing connections
3 participants