eden/.llms/rules/ACR_observability.md
Severity: MEDIUM
pub async fn handler that doesn't increment any ODS countererror!("failed") without structured fields (repo, request_id, etc.)BAD (no observability):
pub async fn handle_lookup(ctx: &CoreContext, params: LookupParams) -> Result<Response> {
let result = do_lookup(ctx, ¶ms).await?;
Ok(Response::from(result))
}
GOOD (instrumented):
pub async fn handle_lookup(ctx: &CoreContext, params: LookupParams) -> Result<Response> {
ctx.perf_counters().increment_counter(PerfCounterType::LookupCalls);
let result = do_lookup(ctx, ¶ms).await.with_context(|| {
format!("lookup failed for repo={} path={}", params.repo, params.path)
})?;
ctx.perf_counters().increment_counter(PerfCounterType::LookupSuccess);
Ok(Response::from(result))
}
Every new request handler should increment at least one ODS counter (calls + success/failure). Error logs should include structured context fields. New features should be gated behind a JustKnobs flag or config toggle so they can be disabled in production without a code push.