fix(recovery): align host112 cold-start metric scope

This commit is contained in:
ogt
2026-07-15 02:05:14 +08:00
parent fa61d4e07a
commit a31a278e58
11 changed files with 134 additions and 36 deletions

View File

@@ -38,41 +38,41 @@ AGENT99_SAME_RUN_STATUS_VERIFIER = (
"agent99-status-same-run-no-write-post-condition-v1"
)
AGENT99_COLD_START_METRIC_HOST = "110"
AGENT99_COLD_START_METRIC_SCOPE = "110_120_121_188"
AGENT99_COLD_START_METRIC_SCOPE = "110_112_120_121_188"
AGENT99_COLD_START_MAX_AGE_SECONDS = 900
_COLD_START_QUERIES = {
"monitor_up": (
'awoooi_cold_start_monitor_up{host="110",scope="110_120_121_188",'
f'awoooi_cold_start_monitor_up{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}",'
'mode="read_only"}'
),
"pass_gates": (
'awoooi_cold_start_pass_gates{host="110",scope="110_120_121_188"}'
f'awoooi_cold_start_pass_gates{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}"}}'
),
"warn_gates": (
'awoooi_cold_start_warn_gates{host="110",scope="110_120_121_188"}'
f'awoooi_cold_start_warn_gates{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}"}}'
),
"blocked_gates": (
'awoooi_cold_start_blocked_gates{host="110",scope="110_120_121_188"}'
f'awoooi_cold_start_blocked_gates{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}"}}'
),
"last_run_timestamp": (
'awoooi_cold_start_last_run_timestamp{host="110",'
'scope="110_120_121_188"}'
f'awoooi_cold_start_last_run_timestamp{{host="110",'
f'scope="{AGENT99_COLD_START_METRIC_SCOPE}"}}'
),
"green_result": (
'awoooi_cold_start_last_result{host="110",scope="110_120_121_188",'
f'awoooi_cold_start_last_result{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}",'
'result="green"}'
),
"degraded_result": (
'awoooi_cold_start_last_result{host="110",scope="110_120_121_188",'
f'awoooi_cold_start_last_result{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}",'
'result="degraded"}'
),
"blocked_result": (
'awoooi_cold_start_last_result{host="110",scope="110_120_121_188",'
f'awoooi_cold_start_last_result{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}",'
'result="blocked"}'
),
"check_failed_result": (
'awoooi_cold_start_last_result{host="110",scope="110_120_121_188",'
f'awoooi_cold_start_last_result{{host="110",scope="{AGENT99_COLD_START_METRIC_SCOPE}",'
'result="check_failed"}'
),
"firing_blocking_alerts": (

View File

@@ -117,6 +117,17 @@ def _evidence_refs() -> dict[str, str]:
}
def test_cold_start_source_queries_include_host112_scope() -> None:
expected_scope = 'scope="110_112_120_121_188"'
assert reconcile.AGENT99_COLD_START_METRIC_SCOPE == "110_112_120_121_188"
for name, query in reconcile._COLD_START_QUERIES.items():
if name == "firing_blocking_alerts":
continue
assert expected_scope in query
assert 'scope="110_120_121_188"' not in query
def test_cold_start_source_resolution_allows_warning_only_but_requires_fresh_zero(
monkeypatch,
) -> None: