DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your Stripe Webhook Endpoints with Vigilmon

How to Monitor Your Stripe Webhook Endpoints with Vigilmon

Stripe webhooks are the backbone of payment-driven applications. They notify your system when payments succeed, subscriptions renew, disputes open, invoices are generated, and refunds process. If your webhook endpoint goes down — even briefly — you can miss critical payment events that affect subscription access, accounting, and customer communication.

This guide shows how to monitor your Stripe webhook endpoints with Vigilmon.

Why Webhook Endpoint Monitoring Matters

Unlike regular API calls you make to Stripe, webhooks work in reverse: Stripe calls your servers. If your endpoint is down, Stripe retries for up to 3 days before giving up and marking the event as failed. During that window:

  • Subscription renewals aren't processed (users lose access)
  • Payment failure emails aren't triggered
  • Refunds aren't acknowledged in your database
  • Fraud dispute notices go unhandled

Stripe does not guarantee delivery order, and does not delay real payments waiting for your webhook — the business impact of missed events compounds quickly.

Setting Up Stripe Webhook Monitoring

1. Add a Lightweight Health Endpoint Alongside Your Webhook

Your Stripe webhook handler receives POST requests. Add a GET handler for health checks:

from flask import Flask, request, jsonify
import stripe

app = Flask(__name__)
stripe.api_key = "sk_live_..."

@app.route("/webhooks/stripe", methods=["POST"])
def stripe_webhook():
    payload = request.data
    sig_header = request.headers.get("Stripe-Signature")

    try:
        event = stripe.Webhook.construct_event(
            payload, sig_header, "whsec_your_webhook_secret"
        )
        # Handle event...
        return jsonify({"received": True})
    except stripe.error.SignatureVerificationError:
        return "Invalid signature", 400

@app.route("/health/stripe/webhook")
def stripe_webhook_health():
    # Just confirm the endpoint is alive and reachable
    return jsonify({"status": "ok", "endpoint": "stripe_webhook"})
Enter fullscreen mode Exit fullscreen mode

2. Configure Vigilmon

  1. Go to vigilmon.onlineAdd Monitor
  2. Type: HTTP(S)
  3. URL: https://yourapp.com/health/stripe/webhook
  4. Interval: 1 minute (payment webhooks are time-sensitive)
  5. Timeout: 5 seconds
  6. Expected status: 200
  7. Keyword check: "status":"ok"

Critical: Set the check interval to 1 minute. Stripe retries failed webhook deliveries after 5 minutes, 30 minutes, 2 hours, and so on. If you're down for 5 minutes, you'll get backfill events — but Stripe's retry logic doesn't guarantee order, and your system must handle out-of-order events correctly.

3. Monitor Your Stripe API Integration Too

Beyond webhooks, monitor your outbound Stripe API calls:

@app.route("/health/stripe/api")
def stripe_api_health():
    try:
        # Very lightweight: retrieve account info
        account = stripe.Account.retrieve()
        return jsonify({
            "status": "ok",
            "account_id": account.id,
            "charges_enabled": account.charges_enabled
        })
    except stripe.error.AuthenticationError:
        return jsonify({"status": "error", "reason": "invalid_api_key"}), 503
    except stripe.error.APIConnectionError:
        return jsonify({"status": "error", "reason": "stripe_unreachable"}), 503
    except Exception as e:
        return jsonify({"status": "error"}), 503
Enter fullscreen mode Exit fullscreen mode

Multi-Region Webhook Monitoring

Stripe delivers webhooks from multiple source IPs. Your endpoint needs to be reachable from any Stripe IP, not just your primary region. Vigilmon's multi-region monitoring verifies this by testing your endpoint from different geographic locations simultaneously.

Enable multi-region in Vigilmon to ensure Stripe can reach your webhook from anywhere.

Alert Configuration

Alert Priority Action
Webhook endpoint down P0 Immediately restore; manually replay missed events from Stripe dashboard
API key invalid P0 Rotate key immediately
charges_enabled: false P0 Contact Stripe support
Latency > 3s P1 Stripe times out webhooks at 30s; optimize handler

Replaying Missed Events

When your endpoint comes back after downtime, go to the Stripe Dashboard → DevelopersWebhooksEvent deliveries and replay any failed events. Vigilmon's downtime timestamps tell you exactly which time window to replay.

Conclusion

Payment webhook reliability is non-negotiable. A 5-minute outage can create billing inconsistencies that take hours to reconcile. Monitor your Stripe webhook endpoints with Vigilmon at vigilmon.online — at 1-minute intervals — so you catch downtime before Stripe's retry window expires.

Top comments (0)