Skip to content

Commit d628440

Browse files
CodingAnarchyclaude
andcommitted
chore: Update prometheus dependency to 0.14 and bump version to 1.7.3
- Updated prometheus from version 0.13 to 0.14 - Fixed metrics API compatibility for prometheus 0.14 label value handling - Improved workspace dependency management for prometheus crate - Updated version to 1.7.3 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b619b3a commit d628440

File tree

4 files changed

+25
-15
lines changed

4 files changed

+25
-15
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.7.3] - 2025-07-04
9+
10+
### Changed
11+
- **⬆️ Dependency Updates**
12+
- Updated `prometheus` from version 0.13 to 0.14
13+
- Improved workspace dependency management for `prometheus` crate
14+
- Fixed metrics API compatibility for prometheus 0.14 label value handling
15+
816
## [1.7.2] - 2025-07-04
917

1018
### Fixed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
resolver = "2"
1010

1111
[workspace.package]
12-
version = "1.7.2"
12+
version = "1.7.3"
1313
edition = "2024"
1414
license = "MIT"
1515
repository = "https://github.com/CodingAnarchy/hammerwork"
@@ -19,7 +19,7 @@ documentation = "https://docs.rs/hammerwork"
1919
rust-version = "1.86"
2020

2121
[workspace.dependencies]
22-
hammerwork = { version = "1.7.2", path = "." }
22+
hammerwork = { version = "1.7.3", path = "." }
2323
tokio = { version = "1.0", features = ["full"] }
2424
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "chrono", "uuid", "json"] }
2525
chrono = { version = "0.4", features = ["serde"] }
@@ -34,7 +34,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
3434
async-trait = "0.1"
3535
tokio-test = "0.4"
3636
rand = "0.8"
37-
prometheus = { version = "0.13" }
37+
prometheus = { version = "0.14" }
3838
reqwest = { version = "0.12", features = ["json"] }
3939
warp = { version = "0.3" }
4040
clap = { version = "4.0", features = ["derive"] }
@@ -84,7 +84,7 @@ thiserror = { workspace = true }
8484
tracing = { workspace = true }
8585
async-trait = { workspace = true }
8686
rand = { workspace = true }
87-
prometheus = { version = "0.13", optional = true }
87+
prometheus = { workspace = true, optional = true }
8888
reqwest = { version = "0.12", features = ["json"], optional = true }
8989
warp = { version = "0.3", optional = true }
9090
clap = { workspace = true }

src/encryption/key_manager.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222
//! # #[cfg(feature = "encryption")]
2323
//! # {
2424
//! use hammerwork::encryption::{KeyManager, EncryptionAlgorithm, KeyManagerConfig};
25+
//! use sqlx::{postgres::PgPool, Pool};
2526
//!
2627
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
28+
//! # let pool: Pool<sqlx::Postgres> = todo!();
2729
//! let config = KeyManagerConfig::new()
2830
//! .with_master_key_env("MASTER_KEY")
2931
//! .with_auto_rotation_enabled(true);
3032
//!
31-
//! let mut key_manager = KeyManager::new(config).await?;
33+
//! let mut key_manager = KeyManager::new(config, pool).await?;
3234
//!
3335
//! // Generate a new encryption key
3436
//! let key_id = key_manager.generate_key("payment-encryption", EncryptionAlgorithm::AES256GCM).await?;

src/metrics.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,19 +295,19 @@ impl PrometheusMetricsCollector {
295295
match event.event_type {
296296
crate::stats::JobEventType::Completed => {
297297
self.jobs_total
298-
.with_label_values(&[queue, "completed", &priority])
298+
.with_label_values(&[queue.as_str(), "completed", priority.as_str()])
299299
.inc();
300300

301301
if let Some(duration_ms) = event.processing_time_ms {
302302
let duration_secs = duration_ms as f64 / 1000.0;
303303
self.jobs_duration
304-
.with_label_values(&[queue, &priority])
304+
.with_label_values(&[queue.as_str(), priority.as_str()])
305305
.observe(duration_secs);
306306
}
307307
}
308308
crate::stats::JobEventType::Failed => {
309309
self.jobs_total
310-
.with_label_values(&[queue, "failed", &priority])
310+
.with_label_values(&[queue.as_str(), "failed", priority.as_str()])
311311
.inc();
312312

313313
let error_type = event
@@ -326,35 +326,35 @@ impl PrometheusMetricsCollector {
326326
.unwrap_or("unknown");
327327

328328
self.jobs_failed_total
329-
.with_label_values(&[queue, error_type, &priority])
329+
.with_label_values(&[queue.as_str(), error_type, priority.as_str()])
330330
.inc();
331331
}
332332
crate::stats::JobEventType::TimedOut => {
333333
self.jobs_total
334-
.with_label_values(&[queue, "timed_out", &priority])
334+
.with_label_values(&[queue.as_str(), "timed_out", priority.as_str()])
335335
.inc();
336336

337337
self.jobs_failed_total
338-
.with_label_values(&[queue, "timeout", &priority])
338+
.with_label_values(&[queue.as_str(), "timeout", priority.as_str()])
339339
.inc();
340340
}
341341
crate::stats::JobEventType::Dead => {
342342
self.jobs_total
343-
.with_label_values(&[queue, "dead", &priority])
343+
.with_label_values(&[queue.as_str(), "dead", priority.as_str()])
344344
.inc();
345345

346346
self.jobs_failed_total
347-
.with_label_values(&[queue, "exhausted", &priority])
347+
.with_label_values(&[queue.as_str(), "exhausted", priority.as_str()])
348348
.inc();
349349
}
350350
crate::stats::JobEventType::Retried => {
351351
self.jobs_total
352-
.with_label_values(&[queue, "retried", &priority])
352+
.with_label_values(&[queue.as_str(), "retried", priority.as_str()])
353353
.inc();
354354
}
355355
crate::stats::JobEventType::Started => {
356356
self.jobs_total
357-
.with_label_values(&[queue, "started", &priority])
357+
.with_label_values(&[queue.as_str(), "started", priority.as_str()])
358358
.inc();
359359
}
360360
}

0 commit comments

Comments
 (0)