Rate limiting lab
Test rate limiting signals and thresholds
Metrics for 429_ratio_by_tenant and provider_429_ratio ≤ 0.01 must distinguish bad input from component failure for platform SRE stopping noisy neighbor tenant StormCo.
1Learn the idea
Read
Golden signals for this system
Instrument layered token-bucket limiter for multi-tenant RAG API so platform SRE stopping noisy neighbor tenant StormCo can answer: demand, errors, latency/age, saturation. Emit fields needed by 429_ratio_by_tenant and provider_429_ratio ≤ 0.01 with bounded labels. Sample successful high-volume traces; keep errors and rollout transitions denser within policy.
Read
Alert path worth paging
Define at least one alert that would fire for RL-FAILOPEN-61, with a for/pending window that survives deploy blips. Missing scrape or missing revision labels must not look like health. Include a trace/log example id format you will actually search.
Read
Implementation artifact
emit("rate_limit_decision", tenant=tenant, allow=d.allow)
Read
Tests for telemetry
Add a unit/integration check that metrics increment on the happy path and on the Redis down → fail-open floods provider → shared 429s branch. Store machine-readable output in CI artifacts when practical.
Read
Stage depth
Cardinality discipline: tenant and revision are usually enough; raw question text is not a label. Exemplars or trace links beat screenshots alone when debugging RL-FAILOPEN-61. Define who owns alert fatigue review. If you export to a vendor, record retention and access. Synthetic probes should use non-sensitive fixtures and still exercise POST /v1/rag/answer. Practice the query you will type at 2am once, while calm.
Read
Field notes for `rate-limiting-lab` / `observability`
Document the exact PromQL or log query in the runbook stub for this service. Verify histograms have buckets around your SLO target. Add a canary synthetic check that exercises the oracle path every few minutes in staging. Confirm that PII redaction happens before export. Track build/version as a label on the golden signals. Delete noisy debug logs before they become accidental product dependencies. In this chapter the product is layered token-bucket limiter for multi-tenant RAG API, the human stakeholder is platform SRE stopping noisy neighbor tenant StormCo, and the incident id you design against is RL-FAILOPEN-61. Re-state the oracle in your notes — StormCo at 200 RPM gets 429 after burst; Globex at 40 RPM unaffected — and keep the invariant visible: tenant RPM soft=60 hard=100; global 5k RPM; 429 includes Retry-After. Track 429_ratio_by_tenant and provider_429_ratio ≤ 0.01 as the scoreboard. Surface under change control: POST /v1/rag/answer. If you only have forty minutes, finish the fixture for Redis down → fail-open floods provider → shared 429s before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Read
Extra rehearsal for Rate limiting lab (observability)
Set a timer for twelve minutes and attempt only the observability concerns for Rate limiting lab. Speak aloud what platform SRE stopping noisy neighbor tenant StormCo would see on success versus on Redis down → fail-open floods provider → shared 429s. Write three bullet artifacts you must keep: a fixture name tied to RL-FAILOPEN-61, a metric query for 429_ratio_by_tenant and provider_429_ratio ≤ 0.01, and the rollback or refuse command for POST /v1/rag/answer. Then extend the notes with one sentence on how tenant RPM soft=60 hard=100; global 5k RPM; 429 includes Retry-After would be violated if you skipped this page. Close by restating the oracle in your own words without looking: StormCo at 200 RPM gets 429 after burst; Globex at 40 RPM unaffected.
Go deeper
Before you start
Why this matters
Name the dashboard row or log line platform SRE stopping noisy neighbor tenant StormCo opens first during RL-FAILOPEN-61. It must include a correlation id and a bounded label from 429_ratio_by_tenant and provider_429_ratio ≤ 0.01. If telemetry is missing, write whether you promote, hold, or roll back — and why hold is the default.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.