From d7e6055a47f31010c0410df2e8bc1d3f309819c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Strausmann?= Date: Sun, 14 Jun 2026 12:58:34 +0000 Subject: [PATCH] =?UTF-8?q?docs(metrics):=20pr=C3=A4zisiere=20sse=5Fevents?= =?UTF-8?q?=5Fpublished=5Ftotal=20Beschreibung=20(Audit=20#67)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Der Counter wird im Subscriber-Loop pro publish()-Event pro aktivem Subscriber inkrementiert — semantisch also "delivered to subscriber", nicht "published once" wie der Name vermuten lässt. Audit #67 hatte das als irreführend markiert. Name bleibt aus Gründen der Grafana-Dashboard-Kompatibilität, Description+Code-Comment klären die Semantik nun. Refs #67 Audit-Punkt: "PR #65 — events.py:208 — sse_events_published_total inflation" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) --- backend/app/api/routes/events.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/app/api/routes/events.py b/backend/app/api/routes/events.py index a85cd5e0..c61894e1 100644 --- a/backend/app/api/routes/events.py +++ b/backend/app/api/routes/events.py @@ -56,7 +56,12 @@ sse_events_published_total = Counter( "printer_hub_sse_events_published_total", - "Total events published to the SSE stream", + # Inkrementiert pro SSE-Subscriber, nicht pro publish()-Call: ein + # publish() mit N aktiven Clients erhoeht den Counter um N. Der + # Metric-Name ist aus historischen Gruenden behalten (Grafana- + # Dashboards) — semantisch ist es "delivered to subscriber", + # nicht "published once" (siehe Audit #67 Hinweis). + "Total SSE events delivered to subscribers (one increment per subscriber per publish)", ["channel"], )