fix(metrics): preserve runtime limit rejection labels
CI / UI Checks (pull_request) Successful in 12s
CI / Rust Checks (pull_request) Successful in 38m11s
CI / Rust Feature Validation (pull_request) Failing after 10s
CI / Frontend E2E (pull_request) Failing after 25m28s
CI / Community Image Smoke (pull_request) Failing after 27m22s
CI / Required Checks (pull_request) Failing after 1s
CI / Deploy (pull_request) Skipped

This commit is contained in:
Codex (teamlead-profile) committed 2026-12-05 19:25:05 +00:00
1 parent 2fa5b9de67
commit c31a0e8e5c
8 files changed
+92 -43

No files matched your search

+4 -10
View File
@@ -350,24 +350,18 @@ pub fn record_limit_rejection(stage: LimitStage) {
if bound_family("crank_runtime_limit_rejections_total").is_none() {
return;
}
metrics::counter!(
"crank_runtime_limit_rejections_total",
"stage" => stage.as_str(),
"reason" => RejectionReason::Limit.as_str(),
"scope_kind" => ScopeKind::Process.as_str()
)
.increment(1);
metrics::counter!("crank_runtime_limit_rejections_total", "stage" => stage.as_str())
.increment(1);
}
/// Typed admission refusal with finite, low-cardinality labels only: no workspace, Agent, Tool,
/// request id, fingerprint or arbitrary error text ever becomes a label.
pub fn record_admission_rejection(reason: RejectionReason, scope_kind: ScopeKind) {
if bound_family("crank_runtime_limit_rejections_total").is_none() {
if bound_family("crank_runtime_admission_rejections_total").is_none() {
return;
}
metrics::counter!(
"crank_runtime_limit_rejections_total",
"stage" => LimitStage::Admission.as_str(),
"crank_runtime_admission_rejections_total",
"reason" => reason.as_str(),
"scope_kind" => scope_kind.as_str()
)