Skip to main content
Technical Enough

Monitoring, how you know it broke (and what it costs)

Chapter 7 of 7 in The Technology Stack · 19 min · the part’s closing chapter

Launch week went well, and you have been posting a rising sign-up graph to the group chat your pilot customers read. Then, at 3:02 one morning, the outside email service your sign-up form uses starts rejecting requests. Nothing you can see changes: the homepage loads, the demo runs, and every visitor who tries to join watches a spinner until they give up. Two days later you get an email from a stranger: "Tried to sign up three times this week. Is this still happening?" It has been happening for 41 hours. That email is your entire monitoring system: you heard about the problem two days late, and only because one visitor was patient enough to write to you instead of leaving.

Things break in every website and app. The real failure in this story is that a user found out before you did.

Monitoring is the practice of finding out about a problem before your users do; in an AI app, it also means tracking the one thing users cannot report to you: what every answer costs.

Logs, metrics, and error tracking: the three layers you need

The monitoring you need comes down to three layers, and you can see all three in the log, the diary your server writes on the host, one line per request, each starting with the time. Here are three lines from the night of the outage: a normal request, a slow one, and the first failure.

03:01:57 INFO   POST /api/signup 200 in 412ms
03:02:09 INFO   POST /api/signup 200 in 2967ms
03:02:14 ERROR  POST /api/signup 502 in 30004ms  email-service: connection refused

Each line carries the time, the action (POST /api/signup, a sign-up request), the status code from the journey of a request, and the wait in milliseconds (ms), which builders call latency.

  • Logs answer "what happened?" Read the three lines in order: a healthy sign-up, a slow one at almost three seconds, then a 502 (a status code meaning a machine this server depends on failed) after the 30-second spinner your visitor stared at, and at the end of that line the note that names the cause, your email service.
  • Metrics answer "how much?" A metric is one number you get by counting log lines over time: requests per minute, the share of requests that end in an error, and, in an AI app, the day's spend.
  • Error tracking answers "what broke, and who did it affect?" An error tracker (Sentry is the common first pick) collects every ERROR line, groups identical failures onto one card, and counts the users each failure affected, so you can fix the worst one first.
The three layers of monitoring you needThree stacked rows, each a layer of monitoring answering one question. Logs answer what happened: timestamped lines read after the fact. Metrics answer how much: numbers over time such as rate, latency, errors, and tokens. Error tracking answers what broke: failures grouped, ranked, and triaged. A spruce spine labeled one job runs down the left of all three. Caption: three layers, one job: find out before your users do.ONE JOBLOGStimestamped lines, read after the factwhat happened?METRICSnumbers over time: rate, latency, errors, tokenshow much?ERROR TRACKINGfailures grouped, ranked, and triagedwhat broke?Three layers, one job: find out before your users do.

The drawing stacks the three layers with one job running down all of them: find out before your users do. Its metrics row lists rate (requests per minute), latency, errors, and tokens, and its error tracking row says failures are grouped, ranked, and triaged (sorted by which to fix first).

You build little of this yourself: hosts write the log and draw charts of basic metrics by default, and an error tracker is quick to add. You will read your own build's log in After launch: watch real use and decide what to do next.

The missing piece at 3 a.m. was an alert

Go back through the scene layer by layer: the ERROR line was written to your log at 03:02:14, and your sign-up success metric fell to zero and stayed there for 41 hours. Everything was recorded while you slept, and you still heard about it from a stranger, because a recorded line stays unread until someone opens the log, and you did not open it for 41 hours. Some hosts keep only the last hour of the log on their free plan (Vercel does), so by the time you looked, most of those lines were already gone. That is one more reason to have an alert that tells you, rather than a log you have to remember to open.

The missing piece is an alert: an automatic message that goes out (builders say the alert fires) when a number you chose crosses a line you chose, called the threshold, and that is sent somewhere that interrupts you. An alert set as "If sign-up success drops below 90 percent for fifteen minutes, message our shared channel" would have made your phone buzz at 03:17. You write your own before the end of this chapter.

The objection: the dashboard already shows this

Your host includes a dashboard of requests and errors, so the natural objection is that monitoring comes with the hosting you pay for, and with no users yet there is nothing to watch. But a dashboard shows you something only when you open it, and the stranger who emailed was your first real user, who found a form that did not work. And the two failures that matter most in an AI app never show up on that dashboard at all.

The AI bill climbs without anything failing

Every model call is charged in tokens, the same token counts you priced in APIs, how systems talk to each other. The bill is a monitoring problem because it climbs while everything succeeds: a bug in the code that resends failed requests calls the model three times per question, an edit to the prompt doubles the text sent with every call, or one user pastes a whole contract where you expected a paragraph. Each request returns success, and only the cost goes up.

REQUESTS A DAYTOKENS PER REQUESTTHE BILLTHE ALERT×=→Set the alert before the cost curve starts to climb.

The drawing shows three numbers to watch (requests a day, tokens per request, and the bill, which rises when either of the first two rises) and a fourth tile for the alert, a threshold line set well above today's spend.

Setting up the provider's spending alert is a step on the checklist in The pre-flight check: secrets, money, data, and the law. For now, treat spend per day as one more metric your monitoring spec can set a threshold on.

A request can succeed while the answer is wrong

Everything so far catches problems that machines can detect: a crash, a timeout (a request that waited too long and was given up), an error code. A model feature can fail with none of those: the model returns a fluent, confident-sounding, wrong answer, and the request completes without an error. A support bot can misstate your refund policy a hundred times before the first angry email, because your servers record every one of those conversations as a success.

Count what users do next. Track thumbs-down if your app has the buttons, retries (the same user asking the same question within a minute), and how often a user quits halfway through a task. These rough stand-ins turn "answered badly" into a number you can chart over time and set an alert on. Measuring quality properly is its own discipline, called evaluation, and you learn it in The Practice.

A status page tells users what you already know is broken

Model providers have the same 3 a.m. problem, and they deal with it in public: a status page that shows whether their service is working right now and lists past incidents and how they were resolved. When your AI feature gets slow or starts failing, check the provider's status page before you debug your own code: it is the fastest way to answer "is the problem ours or theirs?" Once people rely on your build, a small status page of your own shows them you noticed the problem before they did.

Write your one-sentence monitoring spec

You do not have to design any of this, but you do have to specify it: what to watch, and where the alert goes.

A complete monitoring spec is one sentence with three parts: the worst silent failure (one you would not notice unless something told you), the signal (a number) that would show it happening, and where the alert lands. You write the sentence, and your build tool proposes how to set it up.

The worst silent failure is the one your users would notice before you did, usually in sign-up, checkout, or the AI feature itself. The sign-up alert above is one complete spec; "if daily token spend doubles compared with the week before, email both of us" is another. If you cannot finish your sentence, the failure is not specific enough yet; keep narrowing it down.

The whole stack in one food delivery order

This is the last chapter of The Technology Stack, so here is the whole part in one everyday example: a food delivery app. The menu screen that responds the instant you tap is the frontend, running on your phone. When you place the order, the request goes to the company's servers, where the backend checks that the restaurant is open and charges the card once. The phone sends requests and the server sends back responses, both in the fixed format of an API.

Your address, the order, and the driver's position live in a database, so closing the app loses nothing. All of it runs on rented, hosted computers that stay up around the clock. You see only your own orders because auth checks who you are at sign-in and what you may do on every request. And when the payment provider starts refusing payments at 3 a.m., a phone at the delivery company buzzes within minutes, because someone there wrote a sentence very like yours and set it up as an alert in the company's monitoring. Every website and app you use is built this way, including the one you will build.

One food delivery order across the whole stackSeven stacked rows, one per layer of the stack, each pairing the layer with the moment of a food delivery order where it does its work: the frontend is the menu screen that answers your tap, the backend checks the restaurant and charges the card once, the API is the fixed format phone and server speak, the database holds your address, the order, and the driver's position, hosting is the rented machines up around the clock, auth means you see only your own orders, and monitoring is the phone that buzzes when payments start failing.ONE ORDER, EVERY LAYERFRONTENDthe menu screen that answers your tapBACKENDchecks the restaurant, charges the card onceAPIthe fixed format phone and server speakDATABASEyour address, the order, the driver's positionHOSTINGrented machines, up around the clockAUTHyou see only your own ordersMONITORINGa phone buzzes when payments start failingOne everyday order, every layer of the stack.

Try it now

This drill takes about ten minutes, and you spend nothing. You start with the cost sentence from Hosting, renting a computer on the internet and finish with your one-sentence monitoring spec, which goes into your Build Plan in Finish your Build Plan and launch.

No setup: Write the spec by hand for the idea you have been considering: its worst silent failure, the number that changes when that failure happens, and a place to send the alert where it will interrupt you. If the signal is hard to name, start from the cost sentence you wrote in Hosting, because the meter it names is a number you can set a threshold on, or borrow one: sign-up success rate, or spend per day compared with the week before. Add the finished sentence to the idea file you started in Decode the technical questions that stop you.

With your tools: Describe the same idea to Claude Code and ask for the three most likely silent failures, ranked by how much each would hurt. Pick the worst, finish the sentence yourself, and copy it into your idea file; once you have a build, you can hand the sentence back to Claude Code and ask it to set up the alert. In Codex or Cursor: ask the sidebar chat for candidate silent failures, then complete the spec by hand. If your tools are not installed yet, the Setup Clinic gets you there in one sitting.

Chapter Summary

  • Monitoring means finding out about a problem before your users have to tell you about it.
  • Logs record what happened (a timestamped diary of every request), metrics count how much (one number tracked over time), and error tracking groups what broke by how many users it hit.
  • The 3 a.m. outage was recorded by all three layers while you slept; a recorded line stays unread until you open the log, so you still heard about it from a stranger.
  • The missing piece was an alert: an automatic message that fires when a number you chose crosses a line you chose, sent somewhere that interrupts you.
  • A host dashboard cannot replace an alert, because a dashboard requires you to open it, and things break after you have stopped checking.
  • An AI app adds two signals that status codes and error tracking do not catch: the bill, which climbs while every request succeeds, and answer quality, where counting what users do next (thumbs-down, retries, quitting mid-task) stands in until you measure it properly.
  • Setting the provider's spending alert is a pre-flight step you will run before strangers use your build; in this chapter you only name spend per day as a signal worth setting a threshold on.
  • Check the provider's status page before debugging your own code, and run a small one of your own once people depend on your build.
  • Your whole monitoring job is one sentence naming the worst silent failure, the signal that would catch it, and where the alert lands; force every alert to fire once before you trust it.
  • You have now seen the whole stack; next, in Decide what goes in your first version, you start scoping the website or app you will build.

Sources

  • Anthropic status page, status.anthropic.com (last verified July 2026).
  • OpenAI status page, status.openai.com (last verified July 2026).
  • Vercel runtime logs documentation, including how long logs are kept on each plan (last verified November 2026).
  • Sentry error monitoring documentation (last verified July 2026).