queuerious
Rust SDK for the Queuerious job queue observability platform.
Report job lifecycle events (started, completed, failed, retrying, dead-lettered) from your Rust applications to Queuerious for real-time monitoring, alerting, and debugging.
Installation
[]
= "0.1"
Feature flags
| Feature | Description |
|---|---|
tower |
Tower middleware for automatic job tracking |
metrics |
Queue metrics collection traits + agent for pushing metrics to Queuerious |
commands |
Remote command execution traits + agent for polling commands from Queuerious |
agent |
Convenience — enables both metrics and commands |
Features can be combined freely. Enabling metrics or commands (or both) gives you access to the Agent struct, which runs a background loop that registers with the Queuerious API, sends heartbeats, and handles whichever capabilities you've enabled.
# Metrics only — agent pushes queue metrics, no remote commands
= { = "0.1", = ["metrics"] }
# Commands only — agent polls and executes remote commands, no metrics
= { = "0.1", = ["commands"] }
# Both — full agent experience
= { = "0.1", = ["agent"] }
Quick start
Event reporting (no features required)
The core SDK reports job lifecycle events via batched HTTP calls. No agent or feature flags needed.
use ;
async
Agent (requires metrics and/or commands)
The agent is a long-running background task that registers with the Queuerious API, sends periodic heartbeats, and — depending on which features are enabled — collects and pushes queue metrics, polls for remote commands, or both.
use ;
use Arc;
// Build an agent using the client's connection details.
// Attach a MetricsCollector, a CommandExecutor, or both,
// depending on which features you've enabled.
let agent = builder
.config
// .metrics_collector(my_collector) // when "metrics" is enabled
// .command_executor(my_executor) // when "commands" is enabled
.build?;
let = agent.spawn;
// ... later, trigger graceful shutdown:
let _ = shutdown_tx.send;
handle.await.ok;
The MetricsCollector and CommandExecutor traits are designed for queue backend adapters to implement. See the adapter crate section below for ready-made implementations.
Queue backend adapters
For automatic lifecycle tracking with specific queue backends, use one of the adapter crates:
| Crate | Backend | Description |
|---|---|---|
queuerious-lapin |
RabbitMQ | Wraps lapin::Consumer with automatic event tracking, metrics collection, and command execution |
Adapter crates provide TrackedConsumer for lifecycle events, plus implementations of MetricsCollector and CommandExecutor that you can plug directly into the agent — or use the ObservabilityRuntime to wire everything together in one call.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.