# Alert rules for tenant audit & auth (DEVOPS-TEN-49-001) apiVersion: 1 groups: - name: tenant-audit rules: - alert: tenant_error_rate_gt_0_5pct expr: sum(rate(tenant_requests_total{status=~"5.."}[5m])) / sum(rate(tenant_requests_total[5m])) > 0.005 for: 5m labels: severity: page annotations: summary: Tenant error rate high description: Error rate across tenant-labelled requests exceeds 0.5%. - alert: jwks_cache_miss_spike expr: rate(auth_jwks_cache_misses_total[5m]) / (rate(auth_jwks_cache_hits_total[5m]) + rate(auth_jwks_cache_misses_total[5m])) > 0.2 for: 5m labels: severity: warn annotations: summary: JWKS cache miss rate spike description: JWKS miss ratio above 20% may indicate outage or cache expiry. - alert: tenant_rate_limit_exceeded expr: rate(tenant_rate_limit_hits_total[5m]) > 10 for: 5m labels: severity: warn annotations: summary: Frequent rate limit hits description: Tenant rate limit exceeded more than 10 times per 5m window.