Changeset

6142:fc521fb5ffa0

mod_report_forward: Measure number of forwarded reports
author Kim Alvefur <zash@zash.se>
date Wed, 08 Jan 2025 09:21:25 +0100
parents 6141:83adef4f7d2e
children 6143:61422d3c60fb
files mod_report_forward/mod_report_forward.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_report_forward/mod_report_forward.lua	Wed Jan 08 09:20:56 2025 +0100
+++ b/mod_report_forward/mod_report_forward.lua	Wed Jan 08 09:21:25 2025 +0100
@@ -6,6 +6,8 @@
 local new_id = require "util.id".short;
 local render = require"util.interpolation".new("%b{}", function (s) return s; end);
 
+local count_report = module:metric("counter", "forwarded", "reports", "Number of spam and abuse reports forwarded to remote receivers.");
+
 module:depends("spam_reporting");
 
 local destinations = module:get_option_set("report_forward_to", {});
@@ -141,6 +143,7 @@
 	end
 
 	for destination in destinations do
+		count_report:with_labels():add(1);
 		send_report(destination, message);
 	end