From 34a7cdbf98bbe86aa63e4e4740dff873437dc029 Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Thu, 21 Mar 2024 18:12:04 +0100 Subject: [PATCH] Include the RRDP serial number and session ID in metrics on Not Modified- (#942) This PR adds the current RRDP serial number and session ID to the RRDP server metrics when a Not Modified response is received from the server. This makes Prometheus have a constant value for this metrics. --- src/collector/rrdp/base.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/collector/rrdp/base.rs b/src/collector/rrdp/base.rs index b732ba96..ce5f240a 100644 --- a/src/collector/rrdp/base.rs +++ b/src/collector/rrdp/base.rs @@ -829,6 +829,10 @@ impl<'a> RepositoryUpdate<'a> { ) -> Result<(), RunFailed> { info!("RRDP {}: Not modified.", self.rpki_notify); if let Some((mut archive, mut state)) = current { + // Copy serial and session to the metrics so they will still be + // present. + self.metrics.serial = Some(state.serial); + self.metrics.session = Some(state.session); state.touch(self.collector.config().fallback_time); archive.update_state(&state)?; }