upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sync/metrics.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/metrics.rs')
-rw-r--r--src/sync/metrics.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sync/metrics.rs b/src/sync/metrics.rs
index db7dd20..0f56911 100644
--- a/src/sync/metrics.rs
+++ b/src/sync/metrics.rs
@@ -53,7 +53,7 @@ impl SyncMetrics {
53 let relay_connected = IntGaugeVec::new( 53 let relay_connected = IntGaugeVec::new(
54 Opts::new( 54 Opts::new(
55 "ngit_sync_relay_connected", 55 "ngit_sync_relay_connected",
56 "Relay connection status (0=disconnected, 1=connecting, 2=syncing, 3=connected)", 56 "Relay connection status (0=disconnected, 1=connecting, 2=syncing, 3=connected, 4=connected_degraded)",
57 ), 57 ),
58 &["relay"], 58 &["relay"],
59 )?; 59 )?;
@@ -208,6 +208,7 @@ impl SyncMetrics {
208 /// - Connecting = 1 (connection attempt in progress) 208 /// - Connecting = 1 (connection attempt in progress)
209 /// - Syncing = 2 (connected, historic sync in progress) 209 /// - Syncing = 2 (connected, historic sync in progress)
210 /// - Connected = 3 (connected, historic sync complete) 210 /// - Connected = 3 (connected, historic sync complete)
211 /// - ConnectedDegraded = 4 (connected, historic sync failed but live sync active)
211 /// 212 ///
212 /// This is separate from health state and provides more granular connection lifecycle tracking. 213 /// This is separate from health state and provides more granular connection lifecycle tracking.
213 /// 214 ///
@@ -222,6 +223,7 @@ impl SyncMetrics {
222 ConnectionStatus::Connecting => 1, 223 ConnectionStatus::Connecting => 1,
223 ConnectionStatus::Syncing => 2, 224 ConnectionStatus::Syncing => 2,
224 ConnectionStatus::Connected => 3, 225 ConnectionStatus::Connected => 3,
226 ConnectionStatus::ConnectedDegraded => 4,
225 }; 227 };
226 self.relay_connected 228 self.relay_connected
227 .with_label_values(&[relay]) 229 .with_label_values(&[relay])