feat(rustproxy-http): add protocol failure suppression, h3 fallback escalation, and protocol cache metrics exposure

This commit is contained in:
2026-03-22 10:20:00 +00:00
parent d12812bb8d
commit f04875885f
8 changed files with 602 additions and 31 deletions

View File

@@ -72,6 +72,7 @@ export interface IMetrics {
byBackend(): Map<string, IBackendMetrics>;
protocols(): Map<string, string>;
topByErrors(limit?: number): Array<{ backend: string; errors: number }>;
detectedProtocols(): IProtocolCacheEntry[];
};
// UDP metrics
@@ -113,6 +114,26 @@ export interface IMetricsConfig {
prometheusPrefix: string; // Default: smartproxy_
}
/**
* Protocol cache entry from the Rust proxy's auto-detection cache.
* Shows which protocol (h1/h2/h3) is detected for each backend+domain pair,
* including failure suppression state with escalating cooldowns.
*/
export interface IProtocolCacheEntry {
host: string;
port: number;
domain: string | null;
protocol: string;
h3Port: number | null;
ageSecs: number;
h2Suppressed: boolean;
h3Suppressed: boolean;
h2CooldownRemainingSecs: number | null;
h3CooldownRemainingSecs: number | null;
h2ConsecutiveFailures: number | null;
h3ConsecutiveFailures: number | null;
}
/**
* Per-backend metrics
*/