nov 2026 · 8 min read
If I had to design observability for a SaaS platform today
Dashboards are a by-product. The design I'd build answers one question within minutes: is any customer being hurt right now, and which one?
Ambuj Rajobservability, reliability, security
Most SaaS products I've seen do observability backwards. They install an agent, get a wall of CPU and memory charts, add a few alerts when something breaks, and call it done. Then one morning a customer emails: "we were charged twice last week, did you know?" Nobody knew. Every chart was green.
The product I have in mind is an ordinary B2B SaaS: customers sign up as a workspace, invite their team, pay by card, and trust you with their data. A few API services, a Postgres database, a queue, some scheduled jobs, a web app. Nothing exotic. And for that product, observability has exactly one job: within minutes, tell me whether any customer is being hurt right now, and which one, without ever leaking what it saw.
Everything below follows from that sentence.
The alert nobody would have seen
I'll start with the moment that changed how I think about this.
On a product I was building, we had written careful alerts for everything that could cost a customer money: payment webhooks failing, billing drifting out of sync with the payment provider, background events stuck in a queue, the audit log failing its integrity check. Good rules, reviewed, tested. Before launch I asked one simple question: if one of these fired tonight, whose phone would ring?
Nobody's. The rules were written. Nothing in production was running them.
That's the trap. Observability feels done when the signals exist. It's only done when a signal reaches a person who can act on it, and when you've proven that path works. So I stopped thinking in signals and started thinking in promises.
Start from promises, not metrics
So what does a customer actually trust you with? For most SaaS products, four things:
- they can sign in and use the product
- they're charged correctly, and their plan matches what they paid for
- their data stays theirs, and stays intact
- the history of who did what in their workspace can't be quietly rewritten
Each promise becomes a measurable target, a service level objective (SLO):
| Promise | What I measure | Target |
|---|---|---|
| Sign-in works | successful sign-ins / attempts | 99.9% over 30 days |
| The product works | API requests answered without a server error, under 1s | 99.5% over 30 days |
| Charged correctly | payment events applied within 5 minutes | 99.9% |
| Billing matches | differences found by reconciliation | zero |
Then the alerts follow the targets, not raw numbers. A fixed threshold ("error rate above 5%") is too noisy at night and too slow during a real incident. Instead I alert on how fast the error budget is being used up, the multi-window burn-rate approach from Google's SRE workbook. For a 99.9% target, "page me" looks like this:
# Burning 14.4x faster than allowed: 2% of the month's budget gone in an hour.
(
job:signin_errors:ratio_rate1h > (14.4 * 0.001)
and
job:signin_errors:ratio_rate5m > (14.4 * 0.001)
)The long window proves it's real. The short window proves it's still happening, so the page stops as soon as the problem does. A slower burn becomes a ticket, not a page.
Watch the money, and watch for silence
Here's the thing about the failures that hurt a SaaS most: they're quiet. Nothing crashes. A payment just doesn't get applied, or a nightly job just doesn't run.
So the money path gets its own signals:
- Every payment event is recorded once, with its outcome: applied, ignored or failed. The payment provider will resend events; the record makes sure each one is handled exactly once, and the failures are visible in one place. The payload is stripped before it's stored.
- A reconciliation job regularly compares my billing state with the payment provider's, customer by customer, and alerts on any difference. Webhooks get lost. Reconciliation is how you find out before the customer does.
- Every scheduled job publishes when it last ran, and the alert is "hasn't run in N hours", not just "failed". A job that silently stops never fails. It just stops.
- Every queue has alerts for stuck, failing and dead-lettered messages. A counter that no alert reads is worse than no counter, because it looks covered.
Follow one request everywhere
When something does break, you need to answer "what happened to this request?" across every service it touched. That means one pipeline, set up the same way everywhere.
- OpenTelemetry in every service. Traces, metrics and logs from one standard, so nothing is tied to a vendor and every service speaks the same language.
- Every log line is JSON, carrying the trace ID, a request ID, the workspace, and nothing sensitive (more on that below).
- Trace context crosses every hop, using the W3C Trace Context standard. HTTP calls are easy, the libraries do it. Queues are where it usually breaks: when a request writes a message to the outbox, the message stores the
traceparentof that request, and the worker that processes it continues the same trace. Now a payment webhook can be followed all the way to the plan change it caused. - One collector receives everything, and it's where the two important decisions happen: what to remove, and what to keep.
processors:
redaction: # only attributes on this list survive
allow_all_keys: false
allowed_keys: [http.route, http.response.status_code, workspace.id, error.type]
tail_sampling: # decided after the trace is complete
policies:
- name: every-error
type: status_code
status_code: { status_codes: [ERROR] }
- name: every-slow-request
type: latency
latency: { threshold_ms: 1000 }
- name: some-of-the-rest
type: probabilistic
probabilistic: { sampling_percentage: 10 }Tail sampling is the part I'd never skip. Keeping every error and every slow request, and only a slice of the boring ones, is what makes full tracing affordable.
And error tracking runs in every service and in the browser, so an exception reaches a person with its stack trace and the trace ID, not just as a line in a log nobody is reading.
Know who is hurt, without a huge bill
"Errors are up" is half an answer. Support needs "which customers?", and that needs the workspace ID on every log line and every trace.
But not on metrics. Put a workspace label on a metric and every customer becomes its own time series, and the monitoring bill grows with your customer count. So metrics stay per service and per endpoint, and customer detail lives in logs and traces, where one query answers "which workspaces hit this error in the last hour?"
The same data gives support a per-customer view: when someone writes in, you find their failing requests in seconds instead of asking them for screenshots.
An alert isn't done until a person sees it
This is the part most setups skip, and it's the part from the story at the top.
- Alert rules run in an alert manager that routes by severity. A page means customers are hurt now. A ticket means fix it this week. Anything that is neither isn't an alert; delete it.
- Every alert has an owner and a runbook link: a short page saying what it means, how to check, and the first thing to try. At 3am nobody should be reverse-engineering a rule.
- Synthetic checks from outside. Every few minutes a robot signs in and runs a test-mode checkout against production. If that fails, someone hears about it, whatever the dashboards say.
- Watch the watcher. One alert is designed to always fire, and it sends a heartbeat to an outside service. If the alerting stack dies, the heartbeat stops and the outside service pages someone.
- Every alert is fired once, on purpose, before it's trusted.
That last rule comes from a health check I once found in a side project of mine. It ran every five minutes for months and every run said "all healthy". It had never seen a single container: a small shell mistake meant the script read nothing, and "nothing" looked exactly like "all fine". The fix took minutes. The lesson was to drive every case on purpose: broken input, empty input, a really unhealthy service, a healthy one, and watch each message arrive.
Never capture what you shouldn't
Observability is a data flow too, and it leaks like any other.
- Allowlist, not blocklist. Telemetry carries only fields known to be safe: the route, not the URL; the status code, not the body; the workspace ID, not the email. A blocklist fails the day someone adds a field you didn't think of.
- Redaction happens in one place, the collector, so a new service can't forget it.
- The browser is a third party's view of your users. Error tracking and analytics in the web app run only after consent, mask typed input in session replays, and strip credentials from URLs before anything is sent.
- Every vendor is a subprocessor. Choose the hosting region on purpose, list them in your privacy policy, and set a retention limit for each kind of data.
The test matters as much as the rule. In a side project of mine, invite links, which carried a live token in the URL, went to an analytics tool with every page view. The fix was a sanitiser. The first test for it searched the source code for the sanitiser line, and passed with that line commented out, because the comment still contained the text. A useful test checks what the analytics library actually receives.
Audit is not logging
Logs are for engineers, and they get sampled, rotated and deleted. Audit history is for the customer: who changed a role, who exported data, who deleted what. It needs different rules.
- A separate, append-only store. The database refuses updates and deletes on it.
- Each record is chained to the previous one with a keyed hash, so editing any old record breaks every hash after it.
- A job verifies the whole chain every night and alerts if it's broken.
- Each day's last hash is copied to storage nobody can change, cloud object storage with an object lock. Rewriting the database can't rewrite those copies too.
- The app writes audit events with a role that can't switch the protection off, and an alert fires if anyone tries.
The nightly check isn't optional. On a product I was building, a hash chain ran for months before anyone wrote the verifier, and when they did, it failed on day one. The app hashed timestamps with nanoseconds, the database stored microseconds, so every hash covered digits the database had quietly dropped. The chain had never been verifiable. Build the checker the same day as the thing it checks.
A backup is proven by a restore
A backup job that posts "success" to Slack tells you the job ran. It doesn't tell you the backup works, and if the job itself stops, it tells you nothing at all.
- Alert on backup age and on how far behind the database's write-ahead log archive is, measured from outside the backup job.
- Restore on a schedule. Every week, restore the latest backup into a scratch database, run a few checks against it, and alert if any fail.
What I'd leave out
What about a dashboard for every service, AI that "detects anomalies", logging everything just in case, per-customer metrics? All of it costs money and attention, and none of it answers the one question faster.
Start with the promises, make sure every alert reaches a person, and follow one request everywhere. The dashboards will come on their own, once you know what you're actually looking for.