diff --git a/crates/drainer/src/metrics.rs b/crates/drainer/src/metrics.rs index 52fe1d216734..06e9119787d5 100644 --- a/crates/drainer/src/metrics.rs +++ b/crates/drainer/src/metrics.rs @@ -20,4 +20,4 @@ histogram_metric!(QUERY_EXECUTION_TIME, DRAINER_METER); // Time in (ms) millisec histogram_metric!(REDIS_STREAM_READ_TIME, DRAINER_METER); // Time in (ms) milliseconds histogram_metric!(REDIS_STREAM_TRIM_TIME, DRAINER_METER); // Time in (ms) milliseconds histogram_metric!(CLEANUP_TIME, DRAINER_METER); // Time in (ms) milliseconds -histogram_metric_i64!(DRAINER_DELAY_MS, DRAINER_METER); // Time in (ms) milliseconds +histogram_metric_i64!(DRAINER_DELAY_SECONDS, DRAINER_METER); // Time in (s) seconds diff --git a/crates/drainer/src/utils.rs b/crates/drainer/src/utils.rs index 04c7c3dc349c..5d3bd241d4df 100644 --- a/crates/drainer/src/utils.rs +++ b/crates/drainer/src/utils.rs @@ -132,10 +132,12 @@ pub fn push_drainer_delay(pushed_at: Option<&String>, operation: String) { if let Some(pushed_at) = pushed_at { if let Ok(time) = pushed_at.parse::() { let drained_at = common_utils::date_time::now_unix_timestamp(); - let delay_ms = (drained_at - time) * 1000; - metrics::DRAINER_DELAY_MS.record( + let delay = drained_at - time; + + logger::debug!(operation = operation, delay = delay); + metrics::DRAINER_DELAY_SECONDS.record( &metrics::CONTEXT, - delay_ms, + delay, &[metrics::KeyValue { key: "operation".into(), value: operation.into(),