From 086e993824434cbcfbaf1a718eed3d657e7ca0b0 Mon Sep 17 00:00:00 2001
From: Alexander Stephan <alexander.stephan@sap.com>
Date: Mon, 6 Jul 2026 09:26:58 +0000
Subject: [PATCH 5/5] DOC: management: document 'clear counters server'

Add a section for the new 'clear counters server <backend>/<server>' CLI
command in doc/management.txt, alongside 'clear counters' and 'clear
counters all'.

The entry documents the OPER/admin permission level and the fact that
both accumulated counters and max values are reset, along with the
clearable module-registered extra counters, while the server's runtime
state (address, weight, admin state) and health checks are left
untouched. It calls out the Kubernetes slot-recycle use case that
motivated the command (per-entity attribution after 'set server
<b>/<s> name').
---
 doc/management.txt | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/doc/management.txt b/doc/management.txt
index ab5b05ed4..fe3dfaaed 100644
--- a/doc/management.txt
+++ b/doc/management.txt
@@ -1913,6 +1913,23 @@ clear counters all
   server. This has the same effect as restarting. This command is restricted
   and can only be issued on sockets configured for level "admin".
 
+clear counters server <backend>/<server>
+  Reset the statistics counters of a single server. This command is useful when
+  a server slot is being reused to represent a different logical entity (e.g.
+  a different Kubernetes pod occupying the same slot after a rename via
+  "set server <b>/<s> name") and per-entity counter attribution is required.
+  It behaves like "clear counters" but scoped to one server rather than the
+  whole process.
+
+  The reset covers both accumulated counters (bytes, sessions, requests,
+  errors, response codes) and max values, as well as the extra counters
+  registered by modules (e.g. mux stats) for that server. As for the plain
+  "clear counters", only clearable modules are reset. It does not affect the
+  server's runtime state (address, weight, admin state) or health checks.
+
+  This command is restricted and can only be issued on sockets configured
+  for levels "operator" or "admin".
+
 clear acl [@<ver>] <acl>
   Remove all entries from the acl <acl>. <acl> is the #<id> or the <name>
   returned by "show acl". Note that if the reference <acl> is a name and is
-- 
2.43.7

