Skip to content

Commit fc945de

Browse files
CodingAnarchyclaude
andcommitted
Release v0.6.0: Advanced monitoring and documentation restructure
### Added - **📊 Prometheus Metrics Integration** (enabled by default) - PrometheusMetricsCollector with comprehensive job queue metrics - Built-in metrics: job counts, duration histograms, failure rates, queue depth, worker utilization - Custom gauge and histogram metrics support - HTTP exposition server for Prometheus scraping using warp - **🚨 Advanced Alerting System** (enabled by default) - AlertingConfig with configurable thresholds for error rates, queue depth, worker starvation - Multiple notification targets: Webhook, Slack (with rich formatting), and email alerts - Cooldown periods to prevent alert storms - Background monitoring task for real-time threshold checking - **📖 Comprehensive Documentation Restructure** - Restructured README from 677 to 124 lines (82% reduction) - Created detailed documentation subpages: - docs/quick-start.md - PostgreSQL and MySQL setup examples - docs/job-types.md - Job configuration, priorities, timeouts, cron jobs - docs/worker-configuration.md - Worker setup, rate limiting, statistics - docs/cron-scheduling.md - Recurring jobs with timezone support - docs/priority-system.md - Five-level priority system with weighted scheduling - docs/monitoring.md - Prometheus metrics and alerting systems ### Enhanced - Optional feature flags: `metrics` and `alerting` (enabled by default) - Background monitoring task for metrics collection and alerting - Updated ROADMAP.md to remove completed features (metrics and alerting) - Worker event recording now feeds both statistics and metrics collectors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fe1259a commit fc945de

16 files changed

+3176
-628
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,45 @@ 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+
## [0.6.0] - 2025-06-26
9+
10+
### Added
11+
- **📊 Prometheus Metrics Integration** (enabled by default)
12+
- `PrometheusMetricsCollector` with comprehensive job queue metrics
13+
- Built-in metrics: job counts, duration histograms, failure rates, queue depth, worker utilization
14+
- Custom gauge and histogram metrics support
15+
- HTTP exposition server for Prometheus scraping using warp
16+
- Real-time metrics collection integrated into worker event recording
17+
18+
- **🚨 Advanced Alerting System** (enabled by default)
19+
- `AlertingConfig` with configurable thresholds for error rates, queue depth, worker starvation, and processing times
20+
- Multiple notification targets: Webhook, Slack (with rich formatting), and email alerts
21+
- Cooldown periods to prevent alert storms
22+
- Background monitoring task for real-time threshold checking
23+
- Custom alert types and severity levels (Info, Warning, Critical)
24+
25+
- **⚙️ Optional Feature Flags**
26+
- `metrics` feature flag for Prometheus integration (enabled by default)
27+
- `alerting` feature flag for notification system (enabled by default)
28+
- Backward compatible: existing users automatically get new features
29+
- Opt-out available with `default-features = false` for minimal installations
30+
31+
- **🔍 Background Monitoring**
32+
- Automatic background task for metrics collection and alerting
33+
- Queue depth monitoring every 30 seconds
34+
- Worker starvation detection and alerts
35+
- Statistics-based threshold monitoring
36+
37+
### Changed
38+
- Default features now include `metrics` and `alerting` for enhanced monitoring capabilities
39+
- Enhanced worker integration with optional metrics and alerting components
40+
- Updated documentation with feature flag usage examples
41+
42+
### Enhanced
43+
- Worker event recording now feeds both statistics collectors and metrics collectors
44+
- Thread-safe alerting with proper async handling and Send compatibility
45+
- Comprehensive test suite with 110 tests covering all features
46+
847
## [0.5.0] - 2025-06-26
948

1049
### Added

Cargo.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2222
async-trait = "0.1"
2323
tokio-test = "0.4"
2424
rand = "0.8"
25+
prometheus = { version = "0.13" }
26+
reqwest = { version = "0.12", features = ["json"] }
27+
warp = { version = "0.3" }
2528

2629
[package]
2730
name = "hammerwork"
28-
version = "0.5.0"
31+
version = "0.6.0"
2932
edition = "2021"
30-
description = "A high-performance, database-driven job queue for Rust with PostgreSQL and MySQL support, featuring job prioritization, cron scheduling, timeouts, dead job management, and comprehensive statistics collection"
33+
description = "A high-performance, database-driven job queue for Rust with PostgreSQL and MySQL support, featuring job prioritization, cron scheduling, timeouts, rate limiting, Prometheus metrics, alerting, and comprehensive statistics collection"
3134
license = "MIT"
3235
repository = "https://github.com/CodingAnarchy/hammerwork"
3336
authors = ["CodingAnarchy <[email protected]>"]
@@ -50,11 +53,16 @@ thiserror = { workspace = true }
5053
tracing = { workspace = true }
5154
async-trait = { workspace = true }
5255
rand = { workspace = true }
56+
prometheus = { version = "0.13", optional = true }
57+
reqwest = { version = "0.12", features = ["json"], optional = true }
58+
warp = { version = "0.3", optional = true }
5359

5460
[features]
55-
default = []
61+
default = ["metrics", "alerting"]
5662
postgres = ["sqlx/postgres"]
5763
mysql = ["sqlx/mysql"]
64+
metrics = ["prometheus", "warp"]
65+
alerting = ["reqwest"]
5866

5967
[dev-dependencies]
6068
tokio-test = { workspace = true }

0 commit comments

Comments
 (0)