Skip to content

Commit 65b1621

Browse files
authored
bump prometheus-client and fix breaking change to empty label set (#132)
replaces #130 Signed-off-by: clux <[email protected]>
1 parent 558bb2a commit 65b1621

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ opentelemetry-otlp = { version = "0.27.0", optional = true }
4343
opentelemetry_sdk = { version = "0.27.1", features = ["rt-tokio"] }
4444
thiserror = "2.0.11"
4545
anyhow = "1.0.95"
46-
prometheus-client = "0.22.2"
46+
prometheus-client = "0.23.1"
4747

4848
[dev-dependencies]
4949
assert-json-diff = "2.0.2"

src/metrics.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ impl TryFrom<&TraceId> for TraceLabel {
4545

4646
#[derive(Clone)]
4747
pub struct ReconcileMetrics {
48-
pub runs: Family<(), Counter>,
48+
pub runs: Counter,
4949
pub failures: Family<ErrorLabels, Counter>,
5050
pub duration: HistogramWithExemplars<TraceLabel>,
5151
}
5252

5353
impl Default for ReconcileMetrics {
5454
fn default() -> Self {
5555
Self {
56-
runs: Family::<(), Counter>::default(),
56+
runs: Counter::default(),
5757
failures: Family::<ErrorLabels, Counter>::default(),
5858
duration: HistogramWithExemplars::new([0.01, 0.1, 0.25, 0.5, 1., 5., 15., 60.].into_iter()),
5959
}
@@ -90,7 +90,7 @@ impl ReconcileMetrics {
9090
}
9191

9292
pub fn count_and_measure(&self, trace_id: &TraceId) -> ReconcileMeasurer {
93-
self.runs.get_or_create(&()).inc();
93+
self.runs.inc();
9494
ReconcileMeasurer {
9595
start: Instant::now(),
9696
labels: trace_id.try_into().ok(),

0 commit comments

Comments
 (0)