fasthttp icon indicating copy to clipboard operation
fasthttp copied to clipboard

How to monitor requests dropped by fasthttp.Server{Concurrency}?

Open seminmw opened this issue 2 years ago • 3 comments
trafficstars

Hello!

We want to monitor requests that are dropped by the http.Server{Concurrency} setting and to count the number of rejected requests and write it to prometheus.

Could you make a handler so that something can be done when the request is rejected by ConcurrentLimit here https://github.com/valyala/fasthttp/blob/master/server.go#L1834 ?

seminmw avatar May 25 '23 13:05 seminmw

I don't have time to add this but a pull request is always welcome!

erikdubbelboer avatar May 25 '23 18:05 erikdubbelboer

I don't have time to add this but a pull request is always welcome!

ok, thanks. I'll make a pull request with revision. You also have GetOpenConnectionsCount and GetCurrentConcurrency methods for monitoring, maybe even better add a rejected request method like GetRejectedRequestCount?

seminmw avatar May 26 '23 08:05 seminmw

Sounds like a good idea.

erikdubbelboer avatar May 26 '23 10:05 erikdubbelboer