If you look after websites or APIs for clients, sooner or later someone asks for a number: what was our uptime last month?

Most monitoring dashboards will happily give you one. The problem is that the default calculation is usually wrong for client work, and in a way that makes you look worse than you actually performed.

Here is the naive formula almost every tool starts from:

uptime % = successful checks / total checks × 100 

It looks reasonable. It breaks in two specific ways.

Mistake 1: counting planned maintenance as downtime

Say you take a client site offline for 40 minutes at 2am to run agreed, announced updates. Over a 30-day month (43,200 minutes), the naive formula records that as downtime:

(43,200 − 40) / 43,200 = 99.907% 

If your SLA target is 99.95%, you just "breached" it by doing exactly what the client asked you to do.

The fix is to remove planned maintenance from the denominator, rather than counting it as downtime. The SLA is measured over the time you were actually responsible for:

monitored_time = period − planned_maintenance uptime % = (monitored_time − downtime) / monitored_time × 100 

Two rules make this honest rather than creative accounting:

  1. The maintenance window must be planned and agreed in advance, not declared after an outage.
  2. Every excluded window is logged and shown in the report. An exclusion you can't evidence is indistinguishable from fudging the numbers.

Mistake 2: treating every failed check as an outage

A single failed check is not an outage. DNS hiccups, packet loss, a problem on the monitoring provider's own network, or a target that treats datacentre IPs differently will all produce failed checks while real users see a perfectly working site.

If every failed check counts as downtime, your report understates your service, and you end up explaining phantom outages at renewal time.

Count downtime from confirmed incidents instead: when a check fails, re-test it (ideally from a different network path) before opening an incident. Downtime runs from the first confirmed failure to the first successful check after it.

Putting it together

Here's a minimal implementation in Python. It takes incidents and maintenance windows as (start, end) datetime pairs:

from datetime import datetime, timedelta def overlap(a_start, a_end, b_start, b_end): """Length of overlap between two intervals.""" start, end = max(a_start, b_start), min(a_end, b_end) return max(end - start, timedelta(0)) def sla_uptime(period_start, period_end, incidents, maintenance): period = period_end - period_start # Time we were responsible for excluded = sum((overlap(s, e, period_start, period_end) for s, e in maintenance), timedelta(0)) monitored = period - excluded # Downtime from confirmed incidents, ignoring any part # that falls inside a maintenance window downtime = timedelta(0) for s, e in incidents: d = overlap(s, e, period_start, period_end) for ms, me in maintenance: d -= overlap(s, e, ms, me) downtime += max(d, timedelta(0)) uptime = (monitored - downtime) / monitored * 100 return round(uptime, 2), monitored, downtime 

(For brevity, this assumes maintenance windows don't overlap each other.)

Running it for a 31-day month with two confirmed incidents (11 and 15 minutes) and one 2h15m maintenance window:

start = datetime(2026, 8, 1) end = datetime(2026, 9, 1) incidents = [ (datetime(2026, 8, 14, 3, 4), datetime(2026, 8, 14, 3, 15)), (datetime(2026, 8, 27, 21, 41), datetime(2026, 8, 27, 21, 56)), ] maintenance = [ (datetime(2026, 8, 14, 1, 0), datetime(2026, 8, 14, 3, 15)), ] print(sla_uptime(start, end, incidents, maintenance)) # (99.97, monitored ≈ 44,505 min, downtime = 15 min) 

Notice that the first incident falls entirely inside the maintenance window, so it doesn't count. That's the point: work you announced and the client agreed to isn't a failure of service.

What to put next to the number

A bare "99.97%" is close to meaningless to a client. In the report, show:

  • the SLA target next to the achieved figure (and a clear met/breached verdict)
  • monitored time, so the denominator is visible
  • total downtime in minutes, which is easier to grasp than a percentage
  • each incident with start/end times
  • each excluded maintenance window, with when it was agreed
  • one line on methodology (check interval, how incidents are confirmed)

That last section is what makes the report auditable, and auditable reports end arguments before they start.

I wrote up a fuller version of this, including a one-page report template you can copy, here: How to write a client SLA report.

How do you handle maintenance windows in your own uptime numbers? I'd be curious whether people exclude them or just eat the hit.