fix(governance): collapse km slo fallback series
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
Deploy Alert Rules / Deploy Prometheus Alert Rules (push) Successful in 22s
CD Pipeline / tests (push) Successful in 1m6s
CD Pipeline / build-and-deploy (push) Successful in 5m17s
CD Pipeline / post-deploy-checks (push) Successful in 1m38s
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
Deploy Alert Rules / Deploy Prometheus Alert Rules (push) Successful in 22s
CD Pipeline / tests (push) Successful in 1m6s
CD Pipeline / build-and-deploy (push) Successful in 5m17s
CD Pipeline / post-deploy-checks (push) Successful in 1m38s
This commit is contained in:
@@ -409,7 +409,7 @@ class GovernanceAgent:
|
||||
"autonomy_rate": "sli:autonomy_rate:5m",
|
||||
"decision_accuracy": "sli:decision_accuracy:5m",
|
||||
"confidence_calibration": "sli:confidence_calibration:1h",
|
||||
"km_growth_rate": "max(knowledge_entries_created_24h) or sli:km_growth_rate:24h",
|
||||
"km_growth_rate": "max(knowledge_entries_created_24h) or max(sli:km_growth_rate:24h)",
|
||||
}
|
||||
# 硬紅線:低於此值必須告警(非軟性警告)
|
||||
hard_red_lines: dict[str, float] = {
|
||||
|
||||
@@ -695,6 +695,6 @@ class TestCheckSloCompliance:
|
||||
with patch("httpx.AsyncClient", return_value=client):
|
||||
result = await agent.check_slo_compliance()
|
||||
|
||||
assert "max(knowledge_entries_created_24h) or sli:km_growth_rate:24h" in client.queries
|
||||
assert "max(knowledge_entries_created_24h) or max(sli:km_growth_rate:24h)" in client.queries
|
||||
assert result["km_growth_rate"]["status"] == "ok"
|
||||
assert result["km_growth_rate"]["value"] == 25
|
||||
|
||||
@@ -112,7 +112,7 @@ sum(rate(approval_records_high_confidence_total[1h]))
|
||||
```promql
|
||||
max(knowledge_entries_created_24h)
|
||||
or
|
||||
increase(knowledge_entries_total[24h])
|
||||
max(increase(knowledge_entries_total[24h]))
|
||||
```
|
||||
|
||||
**Recording rule**: `sli:km_growth_rate:24h`
|
||||
|
||||
@@ -50,7 +50,7 @@ groups:
|
||||
expr: |
|
||||
max(knowledge_entries_created_24h)
|
||||
or
|
||||
increase(knowledge_entries_total[24h])
|
||||
max(increase(knowledge_entries_total[24h]))
|
||||
|
||||
# -----------------------------------------------------------------------
|
||||
# Error Budget Recording Rules(輔助 Grafana 顯示)
|
||||
|
||||
Reference in New Issue
Block a user