简体   繁体   中英

PromQL query to show the number of incoming requests accurately

I'm having this problem with grafana to query the number of requests incoming to my service. Using Prometheus.net on my do.net core Service, I have the "http_requests_received_total" which is a counter metric.

I run a 100 requests to Postman, ideally what I'd like to see is that at 12:20, a 100 requests came in (which is visible from seeing the counter go from 0 requests to 100 requests). However, when using rate() or increase(), or sum(rate/increase), I keep getting approximate results and it's never an exact 100 requests.

Can anyone point me into a direction on how I can achieve this or read up upon it?

Thanks!

Prometheus may return fractional results from increase function because of extrapolation. See this issue for details. If you need exact integer results from increase() function, then try VictoriaMetrics - this is a Prometheus-like monitoring solution I work on. It returns the expected integer results from the increase() function.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM