Expand description
§buswatch-adapters
Pre-built adapters for collecting metrics from popular message bus systems.
This crate provides ready-to-use collectors that automatically gather metrics from message buses and convert them to buswatch format.
§Supported Systems
- RabbitMQ (
rabbitmqfeature) - Collects queue depths, consumer counts, and message rates via the RabbitMQ Management API - Kafka (
kafkafeature) - Collects consumer group lag and partition metrics - NATS (
natsfeature) - Collects JetStream consumer and stream metrics
§Quick Start (RabbitMQ)
ⓘ
use buswatch_adapters::rabbitmq::RabbitMqAdapter;
use std::time::Duration;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let adapter = RabbitMqAdapter::builder()
.endpoint("http://localhost:15672")
.credentials("guest", "guest")
.build();
// Collect a snapshot
let snapshot = adapter.collect().await?;
println!("Collected {} modules", snapshot.modules.len());
Ok(())
}Re-exports§
pub use error::AdapterError;
Modules§
- error
- Error types for adapters.
Structs§
- Module
Metrics - Metrics for a single module/consumer/producer in the message bus.
- Read
Metrics - Metrics for reading from a topic (subscription/consumer).
- Snapshot
- A point-in-time snapshot of message bus metrics.
- Write
Metrics - Metrics for writing to a topic (publication/producer).