Expand description
Real-Time Metric Streaming
Provides callback-based real-time streaming of observability metrics for live monitoring, alerting, and reactive systems.
§Features
- Callback-based metric updates
- Threshold-based alerting
- Metric change detection
- Rate limiting for high-frequency metrics
- Multiple subscriber support
§Usage
ⓘ
use embeddenator_obs::streaming::{MetricStream, MetricEvent};
let mut stream = MetricStream::new();
// Subscribe to metric updates
stream.subscribe(|event| {
match event {
MetricEvent::Counter(name, value) => {
println!("Counter {}: {}", name, value);
}
MetricEvent::Gauge(name, value) => {
if value > 100.0 {
alert!("High gauge value");
}
}
_ => {}
}
});
// Publish metrics
stream.publish_counter("requests", 42);
stream.publish_gauge("cpu_usage", 75.5);Structs§
- Metric
Stream - Real-time metric streaming system.
- Threshold
Alert - Threshold-based alert configuration.
Enums§
- Metric
Event - Type of metric event.
Type Aliases§
- Metric
Callback - Metric subscriber callback.