From 1805192291b91591cb44a225fe0c865118c6742e Mon Sep 17 00:00:00 2001 From: "forkline-dev[bot]" Date: Thu, 5 Mar 2026 22:38:25 +0000 Subject: [PATCH 1/3] fix: adjust reconcile duration histogram buckets for millisecond-level precision The previous bucket boundaries (0.1, 0.5, 1.0, 5.0, 10.0 seconds) were too coarse for the actual reconcile durations which average around 0.9ms. All values were falling into the first bucket (< 0.1s), making the histogram uninformative. New buckets provide better granularity: - 0.001s (1ms), 0.005s (5ms), 0.01s (10ms), 0.025s (25ms), 0.05s (50ms) - 0.1s (100ms), 0.25s (250ms), 0.5s (500ms), 1.0s, 2.5s, 5.0s, 10.0s This captures the typical sub-10ms reconcile times while still tracking outliers in the second range. Resolves: #54 --- src/metrics.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/metrics.rs b/src/metrics.rs index 611fbe0..b2d603f 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -1,8 +1,8 @@ use std::{sync::Arc, time::Instant}; use opentelemetry::{ - KeyValue, metrics::{Counter, Gauge, Histogram, Meter}, + KeyValue, }; use tokio::time::Instant as TokioInstant; use tracing::debug; @@ -37,7 +37,9 @@ impl Metrics { let reconcile_duration = meter .f64_histogram("reconcile_duration_seconds") .with_description("Duration of reconcile operations") - .with_boundaries(vec![0.1, 0.5, 1.0, 5.0, 10.0]) + .with_boundaries(vec![ + 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0, + ]) .build(); let services_managed = meter From 5a413423e0ee8204bca74de77961f0cc6d0dadf5 Mon Sep 17 00:00:00 2001 From: "forkline-dev[bot]" Date: Thu, 5 Mar 2026 22:51:46 +0000 Subject: [PATCH 2/3] fix: reduce histogram buckets to essential ranges Simplified bucket boundaries from 12 to 5 values: - 0.001s (1ms): typical reconcile time (~0.9ms avg) - 0.01s (10ms): slightly slower operations - 0.1s (100ms): slow reconciles - 1.0s: significant outliers - 10.0s: extreme cases This maintains useful granularity for monitoring while reducing cardinality. --- src/metrics.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/metrics.rs b/src/metrics.rs index b2d603f..e0ecb23 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -37,9 +37,7 @@ impl Metrics { let reconcile_duration = meter .f64_histogram("reconcile_duration_seconds") .with_description("Duration of reconcile operations") - .with_boundaries(vec![ - 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0, - ]) + .with_boundaries(vec![0.001, 0.01, 0.1, 1.0, 10.0]) .build(); let services_managed = meter From 798548ce59bb68698c0eaeec3e8d470e1f8e0269 Mon Sep 17 00:00:00 2001 From: "forkline-dev[bot]" Date: Thu, 5 Mar 2026 22:58:58 +0000 Subject: [PATCH 3/3] fix: correct import ordering for cargo fmt --- src/metrics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metrics.rs b/src/metrics.rs index e0ecb23..97c5e96 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -1,8 +1,8 @@ use std::{sync::Arc, time::Instant}; use opentelemetry::{ - metrics::{Counter, Gauge, Histogram, Meter}, KeyValue, + metrics::{Counter, Gauge, Histogram, Meter}, }; use tokio::time::Instant as TokioInstant; use tracing::debug;