Aggregator¶
Metrics aggregation utilities for combining metrics from multiple collectors.
Classes¶
- class arshai.observability.metrics.aggregator.MetricsAggregator[source]¶
Bases:
objectAggregates metrics from multiple collectors.
Example
aggregator = MetricsAggregator()
# Add collectors aggregator.add_collector(“circuit_breaker”, cb.metrics) aggregator.add_collector(“batch_processor”, bp.metrics)
# Get aggregated stats all_stats = aggregator.get_aggregated_stats()
- add_collector(name, collector)[source]¶
Add a metrics collector.
- Parameters:
name (
str) – Name for this collectorcollector (
MetricsCollector) – MetricsCollector instance
- remove_collector(name)[source]¶
Remove a metrics collector.
- Parameters:
name (
str) – Name of collector to remove