diff --git a/include/types/counters.h b/include/types/counters.h index e3e051ff1..391915acd 100644 --- a/include/types/counters.h +++ b/include/types/counters.h @@ -48,6 +48,7 @@ struct pxcounters { long long srv_aborts; /* aborted responses during DATA phase caused by the server */ long long retries; /* retried and redispatched connections (BE only) */ long long redispatches; /* retried and redispatched connections (BE only) */ + long long intercepted_req; /* number of monitoring or stats requests intercepted by the frontend */ union { struct { diff --git a/src/dumpstats.c b/src/dumpstats.c index 814a90cad..d976e07ac 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -2286,7 +2286,8 @@ static int stats_dump_proxy(struct stream_interface *si, struct proxy *px, struc for (i = 1; i < 6; i++) chunk_printf(&msg, " %dxx=%lld,", i, px->fe_counters.p.http.rsp[i]); - chunk_printf(&msg, " other=%lld\"", px->fe_counters.p.http.rsp[0]); + chunk_printf(&msg, " other=%lld,", px->fe_counters.p.http.rsp[0]); + chunk_printf(&msg, " intercepted=%lld\"", px->fe_counters.intercepted_req); } chunk_printf(&msg, diff --git a/src/proto_http.c b/src/proto_http.c index 26b8f73ca..bf21ca9c8 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2670,6 +2670,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit) struct acl_cond *cond; s->flags |= SN_MONITOR; + s->fe->fe_counters.intercepted_req++; /* Check if we want to fail this monitor request or not */ list_for_each_entry(cond, &s->fe->mon_fail_cond, list) { @@ -3275,6 +3276,8 @@ int http_process_req_common(struct session *s, struct buffer *req, int an_bit, s s->rep->prod->applet.private = s; s->rep->prod->applet.st0 = s->rep->prod->applet.st1 = 0; req->analysers = 0; + if (s->fe == s->be) /* report it if the request was intercepted by the frontend */ + s->fe->fe_counters.intercepted_req++; return 0;