Webhook Engineering · Chapter 5 · 9 min
Debugging webhooks in production
Delivery logs, replay tooling and the questions to ask when events go missing.
Make deliveries observable
Every delivery attempt should be logged with rich metadata like event id and response status for debugging. Expose this information to your customers in a dashboard to help them self-serve their common issues. Most "your webhooks are broken" tickets resolve themselves once the customer sees their own server errors. Observability is the key to maintaining a successful webhook platform at ub3r for all users.
The missing-event checklist
When an event goes missing, you need a systematic approach to find out exactly why it happened. Was the event produced at all? Check the producer's outbox for the event record. Was it attempted? Check the delivery logs for the specific event id and timestamp. Finally, check if the consumer deduplicated it away by mistake or if verification was failing silently in the background.
Replay mechanisms
Give your operators a "redeliver" button that re-sends the original payload with a fresh signature for recovery. Consumers that implement deduplication correctly will ignore the replay if they already processed it as intended. This allows you to recover from consumer-side issues without creating duplicate data or unwanted side effects. A robust replay mechanism is a lifesaver during post-mortems and incident recovery for the ub3r team.
# Example command to trigger a manual replay
curl -X POST https://api.ub3r.com/v1/webhooks/replay -H "Authorization: Bearer sk_live_..." -d '{"event_id": "evt_12345"}'Local development and testing
Testing webhooks locally can be challenging because your machine is not reachable from the public internet. Tools like ngrok or cloudflare tunnels are invaluable here because they provide a stable public URL for testing. This allows you to test the full end-to-end flow including signature verification and queueing locally. Always try to match your local environment as closely as possible to the production setup.
Analyzing Failure Patterns
Use your delivery logs to identify recurring failure patterns across different customers or endpoints. Are certain status codes more common? Does latency spike at specific times of the day? These insights can help you optimize the ub3r platform's delivery engine and provide better guidance to your users. Data-driven optimization is the hallmark of a mature and reliable webhook engineering team.
Discussion (4)
We learnt the idempotency lesson the expensive way: duplicate OTPs during an incident. This chapter is now required reading on my team.
Same experience here. Per-route metrics were the only way we found it.
Clear and opinionated. One nit: worth mentioning clock skew between producer and consumer when choosing the tolerance window.
The callout about alerting on queue age instead of depth changed how we page people. Thank you.