Expand description
Telemetry and metrics collection (feature-gated). Telemetry and metrics collection for SLO assessment and escalation operations.
This module provides structured metrics for monitoring SLO-driven acquisition decisions. Metrics are collected optionally (feature-gated) to provide observability without overhead when disabled.
§Metrics Types
- slo_assessment_count: Counter of investigations with SLO assessment
- escalation_triggered_count: Counter of escalations (warning + critical)
- blocked_ratio_histogram: Distribution of blocked ratios observed
- target_class_distribution: Breakdown by target class (API, ContentSite, HighSecurity, Unknown)
- escalation_level_distribution: Breakdown by escalation level (Acceptable, Medium, High)
§Usage (Feature-Gated)
When the metrics feature is enabled:
ⓘ
use stygian_charon::metrics::MetricsCollector;
let collector = MetricsCollector::new();
let report = investigate_har(&har)?;
let requirements = infer_requirements_with_target_class(&report, TargetClass::Api);
collector.record_assessment(&report, &requirements);Metrics can be exported to Prometheus format:
ⓘ
println!("{}", collector.to_prometheus());Structs§
- Metrics
Collector - Global metrics collector for SLO assessment operations.