diff --git a/notification-server/Cargo.lock b/notification-server/Cargo.lock index b7a30f1f..12146a7f 100644 --- a/notification-server/Cargo.lock +++ b/notification-server/Cargo.lock @@ -2098,7 +2098,7 @@ dependencies = [ [[package]] name = "notification-server" -version = "0.3.2" +version = "0.3.3" dependencies = [ "anyhow", "async-trait", diff --git a/notification-server/Cargo.toml b/notification-server/Cargo.toml index e330c415..357c1c73 100644 --- a/notification-server/Cargo.toml +++ b/notification-server/Cargo.toml @@ -2,7 +2,7 @@ authors = ["Concordium AG developers@concordium.com"] edition = "2021" name = "notification-server" -version = "0.3.2" +version = "0.3.3" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/notification-server/src/bin/service.rs b/notification-server/src/bin/service.rs index 6619e38e..d07a5969 100644 --- a/notification-server/src/bin/service.rs +++ b/notification-server/src/bin/service.rs @@ -22,6 +22,8 @@ use std::{ path::PathBuf, time::{Duration, Instant}, }; +use std::time::{SystemTime, UNIX_EPOCH}; +use axum_prometheus::metrics::gauge; use tonic::{codegen::http, transport::ClientTlsConfig}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; @@ -329,6 +331,10 @@ async fn traverse_chain( processed_height = block_height; let delta = start.elapsed(); histogram!("block.process_successful_duration").record(delta); + if let Ok(duration_since_epoch) = SystemTime::now().duration_since(UNIX_EPOCH) { + let current_timestamp = duration_since_epoch.as_secs() as f64; + gauge!("block.process_successful_last_unix").set(current_timestamp); + } } Err(err) => { error!("Error occurred while processing block: {:?}", err);