fix(metrics): 輸出 AI 自動化 baseline 指標
All checks were successful
CD Pipeline / deploy (push) Successful in 1m35s

This commit is contained in:
OoO
2026-04-30 10:32:43 +08:00
parent e73cd6e6a3
commit d8f93df4ec
9 changed files with 80 additions and 8 deletions

View File

@@ -152,7 +152,28 @@ def _register_ai_automation_metrics(registry, gauge_cls, metrics_snapshot):
),
}
for (metric, labels), value in metrics_snapshot.get("counters", {}).items():
counter_samples = {
("event_router_dispatch_total", (
("event_type", "baseline"),
("outcome", "none"),
("tier", "baseline"),
)): 0,
("event_router_safe_action_total", (
("action", "baseline"),
("status", "none"),
)): 0,
("event_router_replay_total", (
("status", "none"),
)): 0,
("autoheal_action_total", (
("action", "baseline"),
("error_type", "none"),
("result", "none"),
)): 0,
}
counter_samples.update(metrics_snapshot.get("counters", {}))
for (metric, labels), value in counter_samples.items():
if metric not in definitions:
continue
name, help_text, label_names = definitions[metric]
@@ -173,7 +194,19 @@ def _register_ai_automation_metrics(registry, gauge_cls, metrics_snapshot):
),
}
for (metric, labels), values in metrics_snapshot.get("latency", {}).items():
latency_samples = {
("event_router_latency_ms", (
("event_type", "baseline"),
("tier", "baseline"),
)): {"count": 0, "sum": 0, "max": 0},
("autoheal_duration_ms", (
("action", "baseline"),
("error_type", "none"),
)): {"count": 0, "sum": 0, "max": 0},
}
latency_samples.update(metrics_snapshot.get("latency", {}))
for (metric, labels), values in latency_samples.items():
if metric not in latency_defs:
continue
name, help_text, label_names = latency_defs[metric]