Start with the incident questions
- Are users seeing errors?
- Which deployment is producing them?
- Which route and region are affected?
- Is an upstream dependency contributing to the latency?
1. Stream logs
apex logs tail --project checkout --environment production
Use the CLI for an interactive incident view or the API when you want to ship structured events into an observability platform.
2. Add meaningful fields
Include request ID, deployment ID, route, region, status code, and dependency timings. Avoid logging raw credentials, payment data, or unnecessary personal information.
3. Alert on impact
- Create a latency alert on p95 rather than average latency.
- Create an error alert scoped to the affected route or deployment.
- Use region-level thresholds when a global aggregate would hide a localized failure.
4. Close the loop
After an incident, save the alert and runbook next to the service documentation. The best alert reduces diagnosis time the next time the same failure appears.
Control risky releases
Use version-aware metrics to compare a canary against the current production version.
