Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

incident.io 13 min read Case study mediumAdept

We turned off Pub/Sub and nobody noticed

incident.io removed Google Cloud Pub/Sub as a single point of failure by adding NATS as a second message broker in an active-active setup behind its existing Go `eventadapter` abstraction. Publishes are split 50/50 by FNV-hashing each message's ULID, with per-broker circuit breakers and automatic failover. On the subscribe side, a scheduler inspired by delay-based MaxWeight and Oldest Cell First shares one `MaxHandlers` semaphore across both brokers and always dispatches the oldest head message, so a backed-up broker gets priority without extra resource use. The design was validated by deleting the production NATS cluster and by built-in fault injection simulating Pub/Sub outages, with no customer impact, in service of a 99.99% SLA across ~240M messages/day.

Assumes: message brokers and pub/subGo concurrencycircuit breakers

Related posts

  • Reducing our pager load

    incident.io mediumAdept

    incident.io pages on every Sentry error, and cut the resulting noise with four quick changes instead of switching to error-rate alerting. Go Slack helpers return a separate warning for expected failures such as archived channels or missing scopes, with staticcheck deprecating the raw client. Best-effort code paths set a context-level Urgency so only Urgency=page errors wake anyone. Pub/Sub handlers page only after more than three failed attempts, and errors from sales demo accounts no longer page; one engineer spent about a week and pager load dropped sharply.

  • Intermittent downtime from repeated crashes

    incident.io mediumAdept

    A poison-pill Pub/Sub message crashed incident.io's Go monolith on Heroku repeatedly, causing 13 minutes of downtime over 32 minutes. The root cause was an unhandled panic inside goroutines spawned by the Google Cloud Pub/Sub client's Receive method, which a parent goroutine's recover() cannot catch. Debugging was slowed because Go's full goroutine stack dumps overwhelmed Heroku's log rate limits, and the abrupt exit also killed Sentry reporting. The team recovered by purging suspect subscriptions, then added a recover inside the message handler and split web, worker and cron work into separate Heroku dyno tiers so worker crashes can't take down request serving.

  • How we page ourselves if incident.io goes down

    incident.io mediumAdept

    incident.io dogfoods its own paging product and covers the case where its alerting platform itself fails with a dead man's switch. Every alert is also sent to a separate backup provider with a one-minute delay, and the backup alert is acknowledged automatically once an engineer acks the page in incident.io, including a 10-15 second retry grace period for backup alerts that haven't arrived yet. If incident.io fails to page someone, or nobody acks within a minute, the backup provider pages instead. Occasional slow acks exercise the backup path for real, and a game day that pushed 100x normal load into alert ingestion shows the kind of degradation it guards against.

  • Interning at incident.io: rate limiting, resiliently

    incident.io mediumAdept

    incident.io made its rate limiter keep working when its Valkey backing store (Google Cloud Memorystore) is unavailable, instead of failing open. Each pod tracks the top-k busiest traffic gates in local memory and keeps an in-memory budget buffer for them, so it can grant up to its local budget and then deny. A simulation benchmark chose HeavyKeeper over Space-saving because Space-saving lost precision under high-cardinality traffic. The change was validated by killing a local Valkey cluster mid-test and was rolled out gradually by gate risk; a follow-up used a Kubernetes informer to divide the limit by the live pod count so the effective limit didn't become limit × pods. The post is framed as an intern's experience and recruiting pitch.

  • Service disruption on October 20, 2025

    incident.io mediumAdept

    The October 20, 2025 AWS us-east-1 outage degraded incident.io through third-party dependencies even though it runs on Google Cloud: its transcription, SAML, telecom and status page providers were all affected. Delayed SMS and phone notifications cascaded because notification queues shared worker capacity, and slow retries stretched jobs to 30s. Fixes were blocked by a hidden Docker Hub base-image dependency in the deploy pipeline. Scaling escalation workers made things worse because dead tuples in a Postgres index made queue acquisition consume about 50% of worker capacity, and a rate-limiter bug applied limits only to the top 10 organisations. Remediations include a self-contained GCP build pipeline, region failover for Scribe, aggressive autovacuum, reworked acquisition logic, and per-provider isolated notification workers.

The quest for software engineering knowledge.

Look:
Layout: