Page 6 of 8~112 min topic

Webhook lab

Instrument metrics and rollout decisions

Metrics for webhook_accept_total and duplicate_suppressed_total must distinguish bad input from component failure for indexer worker waiting on provider batch.completed callbacks.

~14 min this pageObservability

1Try it yourself

Decision drill

Webhook lab

Webhooks push events — polling pulls. Verify signatures before acting.

Integration safety70%

1/3Nightly index job finished.

2Learn the idea

Read

Golden signals for this system

Instrument FastAPI receiver for batch-index completion events → durable queue so indexer worker waiting on provider batch.completed callbacks can answer: demand, errors, latency/age, saturation. Emit fields needed by webhook_accept_total and duplicate_suppressed_total 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 HOOK-SIG-OFF-16, 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("webhook_accept", event="batch.completed", duplicate=dup)

Read

Tests for telemetry

Add a unit/integration check that metrics increment on the happy path and on the signature optional in staging config accidentally shipped to prod 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 HOOK-SIG-OFF-16. 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 /webhooks/batch-index. Practice the query you will type at 2am once, while calm.

Read

Field notes for `webhook-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 FastAPI receiver for batch-index completion events → durable queue, the human stakeholder is indexer worker waiting on provider batch.completed callbacks, and the incident id you design against is HOOK-SIG-OFF-16. Re-state the oracle in your notes — valid event → 202 + one queue message; replay same event_id → 202 no duplicate work — and keep the invariant visible: verify HMAC signature + timestamp skew ≤ 5m; enqueue idempotent by event_id. Track webhook_accept_total and duplicate_suppressed_total as the scoreboard. Surface under change control: POST /webhooks/batch-index. If you only have forty minutes, finish the fixture for signature optional in staging config accidentally shipped to prod before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.

Read

Extra rehearsal for Webhook lab (observability)

Set a timer for twelve minutes and attempt only the observability concerns for Webhook lab. Speak aloud what indexer worker waiting on provider batch.completed callbacks would see on success versus on signature optional in staging config accidentally shipped to prod. Write three bullet artifacts you must keep: a fixture name tied to HOOK-SIG-OFF-16, a metric query for webhook_accept_total and duplicate_suppressed_total, and the rollback or refuse command for POST /webhooks/batch-index. Then extend the notes with one sentence on how verify HMAC signature + timestamp skew ≤ 5m; enqueue idempotent by event_id would be violated if you skipped this page. Close by restating the oracle in your own words without looking: valid event → 202 + one queue message; replay same event_id → 202 no duplicate work.

Go deeper

Before you start

Why this matters

Name the dashboard row or log line indexer worker waiting on provider batch.completed callbacks opens first during HOOK-SIG-OFF-16. It must include a correlation id and a bounded label from webhook_accept_total and duplicate_suppressed_total. If telemetry is missing, write whether you promote, hold, or roll back — and why hold is the default.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Can you jump from alert to HOOK-SIG-OFF-16-class evidence?
2. Do labels stay low-cardinality?
3. Is missing telemetry treated as hold?

All responses are required.