Skip to content

Debugging Dropped Stripe, GitHub, and Slack Webhooks in Production

Webhook bugs rarely throw exceptions inside your app: a middleware parses JSON too early, HMAC verification returns 400, and customer state silently drifts.

Exla Engineering··5 min read

3,000 ms

Slack Events API hard ack deadline

Raw body

Top cause of 400 HMAC signature drops

100% traced

Receipt -> queue -> handler visibility

Key takeaway

Log every inbound webhook receipt with provider, event_type, delivery_id, and verification outcome before signature rejection so dropped deliveries surface immediately in Libra Logs.

The three silent killers of production webhooks

Third-party providers retry quietly in the background and disable endpoints after sustained failures, often without waking anyone on call.

  • Parsed JSON breaking HMAC signatures: Re-serializing req.body alters whitespace, causing Stripe or GitHub HMAC checks to reject 100% of live events with HTTP 400.
  • Slack 3-second ack timeouts: Running an LLM or database transaction before returning 200 OK triggers duplicate Slack retries (x-slack-retry-num) and triple-posted messages.
  • Out-of-order event races: customer.subscription.updated arriving 80ms before customer.subscription.created fails foreign-key lookups unless queued idempotently.

Minimal structured webhook receipt wrapper

Emit one structured log record at the edge of your webhook route so rejected signatures and retry counts are visible alongside normal errors.

webhook-receipt.ts
export async function POST(req: Request) {
  const rawBody = await req.text();
  const deliveryId = req.headers.get("x-github-delivery") ?? req.headers.get("stripe-signature")?.slice(0, 24);
  const retryNum = Number(req.headers.get("x-slack-retry-num") ?? 0);

  const verified = verifySignature(rawBody, req.headers);
  if (!verified.ok) {
    console.error(JSON.stringify({
      event: "webhook.signature_rejected",
      delivery_id: deliveryId,
      retry_num: retryNum,
      reason: verified.reason,
    }));
    return new Response("Invalid signature", { status: 400 });
  }
  await enqueueWebhookJob(verified.payload, { deliveryId });
  return new Response("ok", { status: 200 });
}

Instant webhook root-cause in Libra Logs

Libra correlates webhook 400/401 spikes directly with recent GitHub deploys and lets your coding agent inspect failing delivery IDs over MCP, starting at $20/mo.

Simple pricing · 30-day free trial

Stop paying per indexed log event. Group bugs by customer instead.

$20/mo

1-2 employees · up to 25 GB

$150/mo

3-9 employees · up to 100 GB + Slack alerts

10+ staff

We beat your Datadog/Sentry bill

Talk to sales

FAQ

Common engineering questions

Should webhook log lines include the raw webhook payload?

No. Log only safe metadata (provider, event type, delivery ID, tenant ID, status, duration) so secrets and PII never enter log storage.

Can Libra alert Slack when a webhook route suddenly goes quiet or spikes 401s?

Yes. On the $150/mo Team plan (and 10+ enterprise plans via sales@exla.ai), Libra alerts Slack with the failing route, count, and recent deploy context.