LESSON 07 · Operations

Measure the full delivery path

Trace an intent through queues, providers, callbacks, and user action.

SYSTEM VIEW

The delivery path

Diagram view
End to end—
Storage—
Oldest item—

Watch one receipt’s timeline fill in under its notification ID, then see why age, not depth, is what to alert on.

  1. Monitoring tracks every stage of the email path: queue age, worker failures, provider latency and errors, retries and bounces. Each metric is labelled by channel, provider and priority, and none carries personal content.

    Labels
    channel, provider, priority
    Never in metrics
    personal content

    What changed

    • Metrics at every stage
    • Labelled by channel and priority
  2. Each event for receipt n-7731 joins one timeline in Notification DB, keyed by its notification ID, so support can answer what happened. At 12:00:01 it is accepted and queued; at 12:00:03 attempt 1 to the Email provider times out.

    12:00:01
    accepted, queued
    12:00:03
    attempt 1 timed out

    What changed

    • Timeline keyed by n-7731
    • Accepted and queued
    • Attempt 1 times out
  3. At 12:00:09 the Email provider accepts attempt 2, and at 12:00:20 its delivered callback reaches the Callback API. The receipt took 19 s end to end: from 12:00:01, when our service accepted it, to that callback.

    12:00:09
    accepted by provider
    12:00:20
    delivered callback
    12:00:01 → 12:00:20
    19 s

    What changed

    • Attempt 2 accepted
    • Delivered callback
    • 19 s end to end
  4. The Email provider reports an open to the Callback API. Opens and clicks are incomplete: Apple Mail Privacy Protection, for instance, can load tracking images without anyone reading. Treat them as product signals, not delivery proof, and keep only the personal data you need.

    Opens, clicks
    incomplete
    Treat as
    product signals

    What changed

    • Open event
    • A signal, not delivery proof
  5. Timelines cost storage. At an example 6 million notifications a day, 5 events each and 100 bytes per event, Notification DB grows by 3 GB a day, or 90 GB over 30 days, so choose a retention period deliberately.

    Per day
    6M × 5 × 100 B
    30 days
    90 GB

    What changed

    • 3 GB a day
    • 90 GB over 30 days
    • Choose retention deliberately
  6. The Email queue’s depth holds steady while receipts flow, yet its oldest receipt has waited 2 hours. Depth alone hides that delay, so Monitoring alerts on oldest-item age and end-to-end time by priority.

    Queue depth
    steady
    Oldest receipt
    2 hours

    What changed

    • Depth steady
    • Oldest receipt: 2 hours
    • Alert on age, not depth
  7. Drill both before they happen. Provider down: the Email provider fails, so the email backlog is held and kept while SMS and push continue, and its age is watched against the promise. Duplicate callback: a second delivered callback for n-7731 leaves the timeline unchanged.

    Provider down
    hold the backlog
    Duplicate
    timeline unchanged

    What changed

    • Each drill has a recovery path
    Drill

Space plays · ← → step · Home resets

THE IDEA

How it works

Track accepted intents, eligibility suppressions, queue age, worker failures, provider latency and error rate, retries, dead-letter count, accepted-by-provider rate, bounces, and invalid tokens. Label these by channel, provider, and priority without placing personal content in metrics or logs. Alert on end-to-end time for urgent messages, not just total queue depth.

An event timeline keyed by notification ID lets support answer what happened. One receipt might read: 12:00:01 accepted and queued, 12:00:03 attempt 1 timed out, 12:00:09 attempt 2 accepted by provider, 12:00:20 delivered callback. Open and click events are incomplete and affected by client behavior; Apple Mail Privacy Protection, for instance, can load tracking images without the person reading anything. They are product signals, not delivery proof. Retain only necessary personal data and constrain access to message content.

Timelines cost storage. At an example 6 million notifications a day, 5 events each, and 100 bytes per event, that is 3 GB a day, or 90 GB over 30 days, so choose a retention period deliberately.

For provider outages, pause or divert the affected queue according to policy, keep the durable backlog, use controlled retries or a consented fallback, and monitor age against the promise. Drill a failure where one provider is down while others continue, and another where a callback is duplicated. The design is complete only when operators can explain and recover those paths.

DECISION POINT

Email queue depth is steady, but some receipts arrive two hours late. What should an operator inspect?

Write a sentence or two to unlock the guidance. Committing first is what makes it stick.

Keep in mind

  • Follow one stable ID through acceptance, policy, queue, provider, and callback states.
  • Measure age and user-facing delay; queue depth alone can hide slow delivery.
CHECK YOUR UNDERSTANDING

Put it into practice.

1 OF 3
RecallQUESTION 01

Which identifier should connect ingestion, attempts, provider responses, and callbacks?

Choose an answer. You’ll see the explanation once you get it right.

Design delay and gate-change alerts for an airline

Apply the notification chapter to alerts where one event reaches a whole flight and an old message can send someone to the wrong gate.

The brief

An airline’s operations system publishes flight events: a new departure time, a gate change, a cancellation. Each event must alert everyone booked on that flight by push and, for those who opted in, by SMS. Times can change several times in an hour, so an alert that was correct when queued may be wrong by the time it is sent. Keep rebooking, baggage, crew messaging, and marketing outside this exercise.

  • The airline runs 3,000 flights a day with 200 booked passengers on average. One flight in three changes, with an average of 3 events each. Use decimal units and 86,400 seconds per day.
  • 80% of passengers receive push and 30% have opted in to SMS; some receive both. SMS costs an example $0.01 per message.
  • In a storm, 300 flights each produce 2 events within 10 minutes. The SMS account accepts at most 50 messages per second. Assume push capacity is not the constraint at this volume.
  • Target: 95% of alerts reach the provider within 60 seconds of the event. An alert superseded by a newer event for the same flight must not be sent if it has not already gone out.
  • Keep a timeline for each send for 30 days: 5 state records per send, at 200 bytes per record.

Reading a design isn’t the same as producing one under a clock. Try it timed: the requirement change stays hidden until partway through.

Loading your draft…

State your scope and what “delivered” means for an alert. Estimate daily and storm send rates by channel, the SMS backlog against the account limit, daily SMS cost, and 30 days of timeline storage. Keep units visible.

0 / 4,000 characters

Name the components and what each stores or decides. Trace one gate change from the operations event to a push and an SMS, including where the passenger list is read and where a newer event can stop an older alert.

0 / 4,000 characters

Pick the first bottleneck in a storm and the metric that would show it. Explain what happens if a worker crashes after the SMS provider accepts a message, and how you stop a stale gate from being sent or retried.

0 / 4,000 characters

Respond to the shared-itinerary change below. Explain how people without accounts give and withdraw consent, what the new recipients do to SMS capacity and cost, and one thing you would give up.

The requirement changesThe airline lets passengers share a flight with the person collecting them. On average each booked passenger adds 1 follower, reached only by SMS and often with no airline account. What changes in recipient resolution, consent, SMS capacity, and cost?

0 / 4,000 characters

Write an initial response in all four sections to unlock the checklist and two worked approaches.

Next chapter: Chat System

0 of 3 checkpoints answered correctly to complete this lesson.