Skip to content

Prometheus metrics for HTTP requests

Igor Drozdov requested to merge id-prometheus-metrics-for-http into main

A RoundTripper for tracking the duration of an HTTP request is introduced. Now the Prometheus metrics look like:

# HELP gitlab_shell_http_request_seconds A histogram of latencies for gitlab-shell http requests
# TYPE gitlab_shell_http_request_seconds histogram
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="0.005"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="0.025"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="0.1"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="0.5"} 1
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="1"} 1
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="10"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="30"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="60"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="300"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="get",le="+Inf"} 2
gitlab_shell_http_request_seconds_sum{code="200",method="get"} 4.3731822000000005
gitlab_shell_http_request_seconds_count{code="200",method="get"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="0.005"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="0.025"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="0.1"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="0.5"} 0
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="1"} 1
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="10"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="30"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="60"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="300"} 2
gitlab_shell_http_request_seconds_bucket{code="200",method="post",le="+Inf"} 2
gitlab_shell_http_request_seconds_sum{code="200",method="post"} 2.084604423
gitlab_shell_http_request_seconds_count{code="200",method="post"} 2

Related issue: #121 (closed)

Edited by Igor Drozdov

Merge request reports