Treat deployment lines, policy changes and outages as versioned data with time windows and uncertainty.
Chart annotations: align events to the right clock without claiming causality
An annotation is another dataset
A vertical line on a chart often marks a deployment, policy change or outage. That event has its own timestamp, time zone, scope, source and uncertainty. A release may roll through regions over several hours; drawing one instant across all regions invents precision. Model it as a window or per-region events, then map it to the same clock as the measured series. The time-series clock must be settled before annotations are placed.
Scope must match the measured population
If only one depot received a new workflow, an all-depot annotation can imply that every plotted change followed the intervention. Filter event records by affected site, product and population, and expose the scope in the label. Preserve events outside the visible interval in the export but do not draw them in the viewport. Distinguish a data outage from a true operational incident: both can create a cliff, but only one is a measured outcome. Population contracts determine whether a note belongs on a chart.
Timing does not prove effect
A change in the curve after a marked event may be coincidence, seasonality, a denominator shift or a delayed measurement. Write labels such as 'workflow enabled' rather than 'workflow improved response time' unless a separate analysis supports the latter. If an effect is being estimated, show the design, comparison group and uncertainty elsewhere. Effect-size analysis is distinct from descriptive annotation. Keep the event visible even when the post-event result disappoints expectations.
Avoid collision and preserve provenance
Several events on one day can produce overlapping labels. Group them in a visible list keyed to markers, prioritizing material scope and preserving access to every event. The annotation export should include event ID, earliest and latest time, scope, label and source version. A revised event time should update the chart and its manifest together. Reproducible exports need both series and annotation versions. Test daylight-saving boundaries and a deployment window that straddles the chart's range.
Worked contract
from datetime import datetime, timezone
def visible_events(
events: list[tuple[str, datetime, datetime, set[str]]],
view_start: datetime, view_end: datetime, depot_id: str
) -> list[str]:
if view_start.tzinfo is None or view_end.tzinfo is None or view_start >= view_end:
raise ValueError("invalid aware view interval")
selected = []
for event_id, began, ended, depots in events:
if not event_id or began.tzinfo is None or ended.tzinfo is None or began >= ended:
raise ValueError("invalid event interval")
if depot_id in depots and began < view_end and ended > view_start:
selected.append(event_id)
return selected
utc = timezone.utc
window = [("release-47", datetime(2026, 8, 11, 9, tzinfo=utc),
datetime(2026, 8, 11, 11, tzinfo=utc), {"north"})]
assert visible_events(window, datetime(2026, 8, 11, 10, tzinfo=utc),
datetime(2026, 8, 12, tzinfo=utc), "north") == ["release-47"]
assert visible_events(window, datetime(2026, 8, 11, 10, tzinfo=utc),
datetime(2026, 8, 12, tzinfo=utc), "south") == []Performance and operating cost
Scanning E events is O(E) time and O(M) output space for M matching IDs. An indexed event store can narrow by time and scope for many dashboards. The example uses half-open display intervals and event windows, so a window ending exactly at the view start is excluded. It does not infer causality or validate whether a deployment reached every unit in its declared scope; those are separate evidence checks.
Common Mistakes
- Drawing a gradual rollout as one global instant.
- Annotating all depots with an event that affected only one.
- Writing a causal outcome claim in an event label without a study.
- Failing to version corrected event times alongside the plotted series.
Validation drill
Annotate a 29-day response-time chart with three region-specific rollouts, one data outage and one event that crosses the visible interval boundary. Verify the right events appear for each region and export their time windows.
Read next
- Time-series charts: distinguish missing days, zeros and provisional periods
- Chart exports: carry the data, filters and render contract together
- Dashboard filters and provenance: make every view reproducible
- Uncertainty on charts: show denominators and intervals beside estimates
