Skip to content

Commit

Permalink
Include the RRDP serial number and session ID in metrics on Not Modif…
Browse files Browse the repository at this point in the history
…ied- (#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.
  • Loading branch information
partim committed Mar 21, 2024
1 parent 7774129 commit 34a7cdb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collector/rrdp/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
Expand Down

0 comments on commit 34a7cdb

Please sign in to comment.