opa icon indicating copy to clipboard operation
opa copied to clipboard

Explain the `http_request_duration` metric in the docs

Open tsandall opened this issue 2 years ago • 7 comments

Currently we mention the http_request_duration histogram in the Prometheus endpoint but we don't explain that the buckets go from 1us to 1s:

http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="1e-06"} 0 // <=1 microsecond
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="5e-06"} 0
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="1e-05"} 0
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="5e-05"} 0
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="0.0001"} 12
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="0.0005"} 13
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="0.001"} 13 // <= 1 millisecond
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="0.01"} 13
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="0.1"} 13
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="1"} 13 // <= 1 second
http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="+Inf"} 13 // > 1 second

We should improve the docs to explain the histogram bucketing. It would also be nice to include some guidance around how to configure dashboards in Grafana but that's outside the scope of this issue.

tsandall avatar Sep 28 '22 18:09 tsandall

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Oct 28 '22 20:10 stale[bot]

Hi, I would like to work on this issue.

mahi072 avatar Nov 14 '22 11:11 mahi072

@mahi072 sure thing! Go right ahead, and holler out if you need any help.

anderseknert avatar Nov 14 '22 11:11 anderseknert

Hi @anderseknert, can you please guide me in which file of the repository I have to make changes.

mahi072 avatar Nov 16 '22 03:11 mahi072

This is the page where it's mentioned: https://www.openpolicyagent.org/docs/latest/monitoring/#prometheus Which maps to this file in the repo: https://raw.githubusercontent.com/open-policy-agent/opa/main/docs/content/monitoring.md

anderseknert avatar Nov 16 '22 13:11 anderseknert

Hi @anderseknert, how you want this to be added in doc? Is it with reference to the histogram bucketing in Grafana?

Also how should I use this? (see below): http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="1e-06"} 0 // <=1 microsecond http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="5e-06"} 0 http_request_duration_seconds_bucket{code="200",handler="v1/data",method="get",le="1e-05"} 0

Can you please provide me any material to understand this issue more?

mahi072 avatar Nov 23 '22 13:11 mahi072

This issue has been automatically marked as inactive because it has not had any activity in the last 30 days.

stale[bot] avatar Dec 24 '22 05:12 stale[bot]