diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-09 14:23:44 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-09 14:23:44 +0000 |
| commit | 208ea60836cfc98857cf3359a73d8874ed5d935a (patch) | |
| tree | e653189912f8e749170ef6645a85f9d6c907b3e6 /src/sync/metrics.rs | |
| parent | 93a1684f068603b354ba3c05957a25459c73de05 (diff) | |
refactor(sync): rename ConnectedDegraded to ConnectedHistoricSyncFailures
Resolves naming conflict with RelayHealthState::Degraded by using a more
explicit name that clearly indicates the connection status relates to
historic sync failures, not connection health degradation.
Changes:
- ConnectionStatus::ConnectedDegraded → ConnectedHistoricSyncFailures
- Updated all documentation and comments
- Updated Prometheus metric descriptions
- Metric value remains 4 for backward compatibility
This makes it clear that:
- ConnectedHistoricSyncFailures = connection lifecycle (missing historic data)
- RelayHealthState::Degraded = connection health (reliability issues)
These are orthogonal concerns - a relay can be ConnectedHistoricSyncFailures
but Healthy, or Connected but Degraded.
Diffstat (limited to 'src/sync/metrics.rs')
| -rw-r--r-- | src/sync/metrics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sync/metrics.rs b/src/sync/metrics.rs index 0f56911..7907d8e 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, 4=connected_degraded)", | 56 | "Relay connection status (0=disconnected, 1=connecting, 2=syncing, 3=connected, 4=connected_historic_sync_failures)", |
| 57 | ), | 57 | ), |
| 58 | &["relay"], | 58 | &["relay"], |
| 59 | )?; | 59 | )?; |
| @@ -208,7 +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 | /// - ConnectedHistoricSyncFailures = 4 (connected, historic sync had failures but live sync active) |
| 212 | /// | 212 | /// |
| 213 | /// 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. |
| 214 | /// | 214 | /// |
| @@ -223,7 +223,7 @@ impl SyncMetrics { | |||
| 223 | ConnectionStatus::Connecting => 1, | 223 | ConnectionStatus::Connecting => 1, |
| 224 | ConnectionStatus::Syncing => 2, | 224 | ConnectionStatus::Syncing => 2, |
| 225 | ConnectionStatus::Connected => 3, | 225 | ConnectionStatus::Connected => 3, |
| 226 | ConnectionStatus::ConnectedDegraded => 4, | 226 | ConnectionStatus::ConnectedHistoricSyncFailures => 4, |
| 227 | }; | 227 | }; |
| 228 | self.relay_connected | 228 | self.relay_connected |
| 229 | .with_label_values(&[relay]) | 229 | .with_label_values(&[relay]) |