From ea3fd773dfd39c81f08c1ae225e3f04bf6107507 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@private.storage>
Date: Thu, 8 Sep 2022 18:17:27 +0000
Subject: [PATCH] Also publish number of Tahoe Incident Reports

Fixes privatestorageops#287
---
 nixos/modules/monitoring/exporters/tahoe.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/nixos/modules/monitoring/exporters/tahoe.nix b/nixos/modules/monitoring/exporters/tahoe.nix
index a537600c..6a2cf6a4 100644
--- a/nixos/modules/monitoring/exporters/tahoe.nix
+++ b/nixos/modules/monitoring/exporters/tahoe.nix
@@ -67,6 +67,9 @@ in {
           NUM_CORRUPTION_ADVISORIES=$(find /storage/corruption-advisories/ -type f | wc -l)
           echo "tahoe_corruption_advisories_total $NUM_CORRUPTION_ADVISORIES" > "${cfg.outFile}.tmp"
 
+          NUM_INCIDENT_REPORTS=$(find /var/db/tahoe-lafs/storage/logs/incidents/ -type f | wc -l)
+          echo "tahoe_incident_reports_total $NUM_INCIDENT_REPORTS" >> "${cfg.outFile}.tmp"
+
           curl --silent --show-error --fail-with-body "${cfg.scrapeEndpoint}" >> "${cfg.outFile}.tmp"
           mv "${cfg.outFile}.tmp" "${cfg.outFile}"
         '';
-- 
GitLab