feat: guard engine UI gateway access with safe prefix fallback (#1091)

This commit is contained in:
2026-11-17 13:18:51 +01:00
parent a1e267dcd4
commit c88084d1b5
5 changed files with 141 additions and 3 deletions

View File

@ -244,6 +244,17 @@ impl Metrics {
.fold((0, 0), |(a, b), (_, x, y)| (a + x, b + y))
}
/// Fehler eines registrierten Modells seit Gateway-Start.
pub fn model_errors(&self, model: &str) -> u64 {
let m = self.lock();
m.requests
.iter()
.filter(|((name, status), _)| name == model && *status >= 500)
.map(|(_, count)| count)
.sum::<u64>()
+ m.start_failures.get(model).copied().unwrap_or(0)
}
/// Ausgabe im Prometheus-Textformat.
pub fn render(&self) -> String {
let m = self.lock();