PromQL query giving multiple data points within a week

58 views Asked by At

enter image description here

I want to calculate the average p95 for /my-api over the last week, say Mon - Sun, but when I am plotting below query it's giving me multiple data points even within a week.

I expect that this would give me 1 data point for 7 days.

Query

avg_over_time(histogram_quantile(0.95, sum(rate(http_server_requests_seconds_bucket{uri="/my-api",job="kubernetes-pods", service="service-name"}[1m])) by (le))[1w]) * 1000

I even tried to make min-internal to 1w and after doing this it's saying "No Data"

enter image description here

1

There are 1 answers

4
markalex On

It gives you a result of "previous week" in relation to each step in graph.

If you want a single point for whole week, you can set Min interval to 1w. Please notice, that this will enforce blocks to be at least 7 days "wide", but this doesn't ensure alignment with Mondays.