From 4783ac410944713b0e11d130bdc0e1b4c836bb8b Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 23 Jan 2024 21:45:38 -0500 Subject: [PATCH] fix: 3xx codes are not errors --- src/prometheus/tiny_httpd_prometheus.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prometheus/tiny_httpd_prometheus.ml b/src/prometheus/tiny_httpd_prometheus.ml index dcc19a8b..b1731d5b 100644 --- a/src/prometheus/tiny_httpd_prometheus.ml +++ b/src/prometheus/tiny_httpd_prometheus.ml @@ -200,7 +200,7 @@ let http_middleware (reg : Registry.t) : H.Middleware.t = let elapsed_s = elapsed_us /. 1e6 in Histogram.add h_latency elapsed_s; - if code < 200 || code >= 300 then Counter.incr c_err; + if code < 200 || code >= 400 then Counter.incr c_err; resp response) let add_route_to_server (server : H.t) (reg : registry) : unit =