# Workflow: observability setup

## 1. Logs for debugging

- `wrangler tail` during development and deploys: live console and exception logs, including Durable Object requests.
- Real-time logs in the dashboard for when a terminal is not available.
- Tail Workers (beta) for a persistent pipeline: filter, sample, and forward telemetry to your own systems.

## 2. The incident runbook

Document the `cf-error-type` triage: headers absent means the origin errored; 1101/1102 means the Worker; 52x means origin connectivity; 525/526 means origin TLS. Put the curl command in the runbook so on-call does not have to remember it.

## 3. WAF visibility

Review Security events regularly: which rules fire, what they catch, what they wrongly block. Every false positive is a tuning task; every gap is a new rule.

## 4. Cache visibility in deploys

The deploy pipeline checks `CF-Cache-Status` on key URLs: MISS then HIT after invalidation. A deploy that nobody verified at the edge is a deploy that might not have taken effect for users.

## 5. Origin-side logging

Restore the real client IP at the origin (`CF-Connecting-IP`) so origin logs are meaningful. Correlate origin logs with edge events by timestamp during incidents.

## Checklist

- Tail during every deploy; runbook with the header triage; WAF events reviewed weekly.
- Origin logs carry the real client IP, not Cloudflare's.
- Log retention covers at least one full incident-review cycle.