feat(rustproxy-http): add protocol failure suppression, h3 fallback escalation, and protocol cache metrics exposure
This commit is contained in:
@@ -937,8 +937,29 @@ impl RustProxy {
|
||||
}
|
||||
|
||||
/// Get current metrics snapshot.
|
||||
/// Includes protocol cache entries from the HTTP proxy service.
|
||||
pub fn get_metrics(&self) -> Metrics {
|
||||
self.metrics.snapshot()
|
||||
let mut metrics = self.metrics.snapshot();
|
||||
if let Some(ref lm) = self.listener_manager {
|
||||
let entries = lm.http_proxy().protocol_cache_snapshot();
|
||||
metrics.detected_protocols = entries.into_iter().map(|e| {
|
||||
rustproxy_metrics::ProtocolCacheEntryMetric {
|
||||
host: e.host,
|
||||
port: e.port,
|
||||
domain: e.domain,
|
||||
protocol: e.protocol,
|
||||
h3_port: e.h3_port,
|
||||
age_secs: e.age_secs,
|
||||
h2_suppressed: e.h2_suppressed,
|
||||
h3_suppressed: e.h3_suppressed,
|
||||
h2_cooldown_remaining_secs: e.h2_cooldown_remaining_secs,
|
||||
h3_cooldown_remaining_secs: e.h3_cooldown_remaining_secs,
|
||||
h2_consecutive_failures: e.h2_consecutive_failures,
|
||||
h3_consecutive_failures: e.h3_consecutive_failures,
|
||||
}
|
||||
}).collect();
|
||||
}
|
||||
metrics
|
||||
}
|
||||
|
||||
/// Add a listening port at runtime.
|
||||
|
||||
Reference in New Issue
Block a user