From 71f7a444398275923246e1bc8283938a63a8267a Mon Sep 17 00:00:00 2001 From: bndw Date: Sun, 15 Feb 2026 08:22:03 -0800 Subject: feat: add metrics for blocked events Track and display blocked event counts with per-kind breakdown. - Add events_blocked_total counter with kind label - Add RecordBlockedEvent method to metrics - Display blocked count in dashboard Storage section - Call metric when rejecting non-core protocol kinds Allows monitoring spam patterns and verifying kind filter effectiveness. Raw metrics show breakdown by kind (e.g., kind=20001, kind=30311). --- internal/metrics/dashboard.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/metrics/dashboard.html') diff --git a/internal/metrics/dashboard.html b/internal/metrics/dashboard.html index 9538ac6..1fa1ddf 100644 --- a/internal/metrics/dashboard.html +++ b/internal/metrics/dashboard.html @@ -199,6 +199,10 @@ Deletions 0 +
+ Blocked + 0 +
@@ -317,6 +321,9 @@ document.getElementById('event_deletions').textContent = sumMetric(metrics, `${prefix}_relay_event_deletions_total`); + document.getElementById('events_blocked').textContent = + sumMetric(metrics, `${prefix}_relay_events_blocked_total`); + const durationSum = sumMetric(metrics, `${prefix}_relay_request_duration_seconds_sum`); const durationCount = sumMetric(metrics, `${prefix}_relay_request_duration_seconds_count`); const avgLatencyMs = durationCount > 0 ? (durationSum / durationCount * 1000) : 0; -- cgit v1.2.3