Machine Room · 3 Nov 2026 · 19:57
What Is Observability? Logs, Metrics, Traces, Alerts and SLOs Explained

Watch on YouTube
Logs, metrics, traces, correlation IDs, alerts, SLOs and cardinality are the seven levels of observability, and each one answers a question the level before it could not. This episode climbs them on one failed checkout at a small online shoe shop: every light on the server is green, and nobody can pay.
Structured logs shipped to Grafana Loki tell you what happened. Metrics scraped by Prometheus and charted in Grafana show it getting worse, using the p95 instead of the average. Distributed tracing with OpenTelemetry and Jaeger shows where the time went: one database call, 4.8 seconds. A trace ID on every log line and in the slow-query log gives you the why, a query with no index. Alert rules through Alertmanager and PagerDuty turn ten hours in the dark into twenty minutes. An SLO with an error budget (SLI vs SLO vs SLA) replaces twelve noisy pages a night with one rule. And high cardinality, a user ID on a metric, is the one line of code that takes Prometheus down and turns a monitoring bill from under $100 a month into $50,000.
This episode with chapters, full transcript and sources: https://themachineroom.dev/v/levels-of-observability/?utm_source=youtube&utm_medium=description&utm_campaign=levels-of-observability
Chapters
- 0:00Saturday Night: every light green, nobody can pay
- 2:11Level 1, Logs: one line per event, in Loki
- 3:54Level 2, Metrics: Prometheus, Grafana and the p95
- 7:08Level 3, Traces: OpenTelemetry and Jaeger
- 9:19Level 4, Correlation: one ID on every log line
- 11:09Level 5, Alerts: Alertmanager and PagerDuty
- 13:31Level 6, SLOs: SLI, SLA and the error budget
- 16:21Level 7, Cardinality: the label that explodes the bill
- 18:53Which Level Is Your Team On?
Notes
the shop, Kate and every number on the night's clock are a made-up example. Seven levels is our framing, not an industry standard. The $50,000 is Datadog's list price of $5 per 100 custom metrics a month applied to a million metrics; existing customers' agreements differ. The 99.99 % is AWS's EC2 region-level SLA, with a 10 % service credit below it. A real PostgreSQL slow-query line reads "duration: … ms statement: …"; the video's line is shortened.
Sources
- Google SRE Book, "Monitoring Distributed Systems" and "Service Level Objectives" https://sre.google/sre-book/service-level-objectives/ — https://sre.google/sre-book/monitoring-distributed-systems/
- OpenTelemetry, "Observability primer" — https://opentelemetry.io/docs/concepts/observability-primer/
- W3C Trace Context — https://www.w3.org/TR/trace-context/
- Prometheus, metric and label naming — https://prometheus.io/docs/practices/naming/
- Grafana Loki — https://grafana.com/docs/loki/latest/get-started/overview/
- Jaeger — https://www.jaegertracing.io/docs/
- Alertmanager — https://prometheus.io/docs/alerting/latest/alertmanager/
- sqlcommenter — https://google.github.io/sqlcommenter/
- AWS Compute SLA — https://aws.amazon.com/compute/sla/
- Datadog pricing — https://www.datadoghq.com/pricing/list/
Transcript
The narration, word for word, from the subtitle file that ships with the video.
0:00Saturday Night: every light green, nobody can pay
Saturday, 10:24 PM. Kate presses Pay on a pair of sneakers, forty-eight dollars, and the page says "payment failed". She tries again, and it fails again. By 10:31 the shop's inbox has eleven emails that say the same thing: checkout is broken. Nobody reads them until the morning. The client forwards them to you at 8:10 on Sunday. You open the server. Forty copies of the program are running, the database is up, the queue is up, Redis is up. Every light is green, and nobody can pay. And there is nothing to look at. The program takes a request, does its work, answers, and keeps nothing about what it did. Half a million requests an hour go through it and leave no mark. So you cannot answer the simplest question. What broke, and when. That is tonight's problem. The shop runs, but you cannot see inside it. Seeing inside it is called observability, and it comes in seven levels. We climb all seven with this one night, and each level fixes one thing about it. We start with logs, so you know what happened. Then metrics in Prometheus and Grafana, so you see it getting worse before it is broken. Then traces with OpenTelemetry, so you know which of the five services is slow. Then one ID on every request, so you find the one bad query. Then alerts through PagerDuty, so your phone rings at 10:23 on Saturday night, ten hours before the client forwards the first email. Then a target for what good means, so you stop getting paged for nothing. And at the top, the one mistake that makes the monitoring bill explode. By the top you will know which of the seven your team is on.
2:11Level 1, Logs: one line per event, in Loki
Level one is logs. The fix for "nothing to look at" is the simplest one there is. The program writes one line for every event: what happened, and exactly when. That is logging. The options: the ELK stack, Elasticsearch, Logstash and Kibana; Loki, from the Grafana people; or a paid service like Datadog. Our shop uses Loki, because it is free and it sits next to the dashboards we add later. Every copy of the program prints its lines. A small agent on each machine collects them and ships them to it, and you search all forty copies in one place. Run the night again with it on. At ten twenty-four and thirty-three seconds the orders service writes: ERROR, checkout timed out, forty-eight dollars. That is Kate. One line, and you know what happened and when. Search for "timeout" between 10:20 and midnight and you get her whole evening: three tries, three timeouts. But a line says what happened once. Half a million requests an hour means half a million lines an hour, and the timeout lines all look the same. So here is what one line cannot tell you. Is it one customer, or everyone? Is it getting worse? You could scroll and count. People have. But counting is a different job.
3:54Level 2, Metrics: Prometheus, Grafana and the p95
Level two is metrics. A metric is a number, not a line. How many requests this second, how many of them failed, how long they took. The options: Prometheus with Grafana, which is free; Datadog; or the cloud's own, like CloudWatch on AWS. Our shop uses Prometheus and Grafana. Why? Because it is free. Every copy of the program keeps three counters for checkout: requests served, requests failed, and how long each one took. Every fifteen seconds Prometheus visits all forty copies and writes the numbers down. It stores them, but its own screen is a plain text box. Grafana is the dashboard: a web page where each number becomes a chart, time along the bottom, so a number that keeps going up is a line going up. Run the night again with it on. The shop's dashboard shows three numbers: 122 requests a second, almost no errors, and how long a checkout takes. The dashboard shows that as one number, the p95. At 10:19 it is 327 milliseconds. That means ninety-five percent of checkouts finish in 327 milliseconds or less. Why not the average? Because the average hides the slow ones. If most checkouts are fast and a few take several seconds, the average still looks good, and that is bad. The p95 shows you the delay those slower customers are getting. At 10:20 that line starts to climb. The slow checkouts are holding up the ones behind them, so more and more of them are slow, and the number goes up. 800 milliseconds. Two seconds. Every checkout gets five seconds. After that it fails on purpose, because a stuck checkout hangs on to its connection the whole time it waits, and the customer just sits there looking at a spinner. That limit is called a timeout. So by 10:24 the line is at five seconds, the slow checkouts are now failed checkouts, and the error line climbs with it. That is Kate's timeout. Now the two questions from level one have answers. It is everyone, not just Kate. And it is getting worse, and it started at 10:20, four minutes before her first try. But checkout is not one program. A checkout crosses five services: the gateway, auth, orders, payments, and the database. The graph says checkout is slow. It cannot say which of the five. Most teams restart all five at this point and go to bed.
7:08Level 3, Traces: OpenTelemetry and Jaeger
Level three is traces. A trace follows one request through every service it touches, and times each step. The library that collects them is OpenTelemetry, whatever you store them in. To store and draw them: Jaeger, which is free; Zipkin; or Datadog again. Our shop uses OpenTelemetry and Jaeger. When Kate's request arrives, the gateway gives it a random ID and passes that ID along with the request to every service after it. Each service, as it does its part, writes down when it started, when it finished, and that ID. That is a span. Jaeger collects the spans from all five services and groups the ones with the same ID. Five spans, one ID, one trace. It draws them as bars under each other: the top bar is the whole checkout, the bars under it are each service's share. Run the night again with it on. Open Kate's checkout at ten twenty-four and thirty-three seconds. Gateway, 15 milliseconds. Auth, 30. Orders, 80, and inside orders, one call to the database: 4.8 seconds. Payments never ran, because the five seconds ran out. So now you know where. Almost the whole five seconds is one database call. The database is up and says it is fine. But a trace tells you how long, not why. 4.8 seconds doing what? Which query? One table or every table? The bar is just a bar. The why is written somewhere. The database logged a slow query at ten twenty-four and thirty-three seconds. But that line is in the logs, and the bar is in the trace, and nothing joins them.
9:19Level 4, Correlation: one ID on every log line
Level four is correlation. No new tool. One rule. At level three the gateway made an ID for each request. Now that ID goes on every log line too. Every service already has the ID, because it came in with the request. So when a service writes a log line, it writes the ID in it. The orders service even puts it in a comment on the query it sends, so the database's slow-query log carries it as well. Now one screen answers everything. Grafana can read Loki and Jaeger together. Type Kate's ID and you get four things: her trace, the checkout numbers at that second, the orders service's log line, and the database's line: one query on the orders table, 4.8 seconds. That is the why. The query that finds Kate's order has no index, so the database read every row in the orders table to find her one. The table passed two million rows this week, and Saturday night is the busiest hour of the week. You add the index. The query goes from 4.8 seconds to 3 milliseconds. Checkout is back at 8:40 on Sunday morning. Four levels, and the night is solved. But look at the clock. Trouble started at 10:20 on Saturday. You opened the server at 8:10 on Sunday, because the client forwarded the emails over breakfast. Ten hours in the dark, and the customers were the alarm.
11:09Level 5, Alerts: Alertmanager and PagerDuty
Level five is alerts. A rule that watches the numbers for you, so the alarm is the dashboard and not the customers. The options: Prometheus comes with Alertmanager, which is free, and it hands the page to a service like PagerDuty, which rings your phone; or Grafana's own alerting; or Datadog again. Our shop uses Alertmanager and PagerDuty. Prometheus already has the checkout numbers every fifteen seconds. A rule is a question it asks of them, every fifteen seconds. Ours: is the checkout p95 above two seconds, and has it been for two minutes? If yes, Alertmanager sends it to PagerDuty, and PagerDuty rings your phone until someone answers. Run the night again with it on. 10:20, the line climbs. 10:23, two minutes above two seconds. Your phone rings. You open Grafana, find the slow trace, find the database line, add the index. Checkout is back at 10:40. Kate still fails at 10:24. But by 10:40 it is fixed, and you knew before the client did. Ten hours in the dark becomes twenty minutes, and the client hears it from you, not from the inbox. So you write a rule for everything. CPU above 80 percent. Disk above 70. A copy of the program restarting. Memory, queue length, every number you have. A week later, the phone. 2:10 AM, CPU 81 percent on one machine, back to 60 by the time you look. 3:40, a copy restarted, and Kubernetes had already replaced it. 4:15, disk 72 percent. Twelve pages a night, and not one of them a customer problem. By Thursday your phone is on silent. And the one page that matters rings into silence with the rest.
13:31Level 6, SLOs: SLI, SLA and the error budget
Level six is SLOs. The fix for twelve pages a night is to decide what good means, before anything breaks. Good means what the customer feels. For the shop, one number: how many checkouts succeeded, out of all of them. That number is the SLI, the service level indicator. Not CPU, not disk. Customers do not feel CPU. Then pick a target for it. 999 out of every thousand checkouts succeed, each month. That target is the SLO, the service level objective. A target of 999 means one in every thousand is allowed to fail. That allowance has a name: the error budget. It is something you spend. It is easier to count it in time. A month is forty-three thousand minutes. One in a thousand of those is forty-three minutes. So checkout may be broken for forty-three minutes a month and the shop still hits its target. Every broken minute spends from that budget. Spend it all, and you missed. An SLA, the service level agreement, is the same target written into a contract. AWS has one with the shop: ninety-nine point nine nine percent a month. Below that, the shop gets 10 percent off the bill. The shop has none with Kate. Now the alerts change. The twelve rules go. One rule stays: ring the phone when the error budget is going down fast. Run the week again with it on. CPU hits 81 percent at 2 AM. No checkout failed, so the budget did not move, so the phone stays quiet. Saturday night, checkouts are failing. The budget is going down every second. The phone rings. The budget was forty-three minutes for the whole month. That Saturday, fixed in twenty minutes, used up half of it. One bad night, half the month. Now you want to know more. Which customers did Saturday hit? Kate, and who else? The easy way: add the user ID to the checkout metric, as a label. One line of code. That one line is the mistake. It looks harmless, and it is the most expensive mistake on the ladder.
16:21Level 7, Cardinality: the label that explodes the bill
Level seven is cardinality. The word is new. The mistake is old: putting the user ID on a metric. Remember level two. A metric is a line on a graph, with a new point every fifteen seconds. The checkout count is one line. Split it by status, succeeded and failed, and it is two lines. Split it by payment method, card, PayPal and Apple Pay, and it is two times three: six lines. Every split is a label, and every label multiplies the lines, stored and updated every fifteen seconds, forever. Six lines is fine. Now split it by user ID. The shop has a million customers. A million lines on the graph. A million lines in memory. A million lines collected every fifteen seconds. Cardinality is a count: how many different values a label has. Status has two. Payment method has three. User ID has a million. High cardinality means a label with a huge number of values, and every one of them is a line to store. On Prometheus, the memory climbs until the machine kills it, and the dashboard that saved you on Saturday goes dark. On Datadog, the metric bill goes from under a hundred dollars a month to fifty thousand. The one line of code costs more than the servers it is watching. So the rule at the top of the ladder: a label gets a few values. Status, method, region. Never a user, never an order. So which customers did Saturday hit? Not from a graph. From the logs. Every failed checkout is already one log line, and the user ID is a word in that line, next to the time and the request ID. Search failed checkouts between 10:20 and 10:40 and read the user IDs off the lines. A log line is written once. A graph line is updated forever. That is the whole difference. That is the top of the ladder.
18:53Which Level Is Your Team On?
Seven levels, one Saturday night. Read the ladder again, and each level is a question the shop could not answer the night before. Logs tell you what happened. Metrics tell you how much, and whether it is getting worse. A trace tells you where. The ID on every line tells you why. An alert tells you before the customers do. An SLO tells you what good means, so the phone only rings for that. And cardinality tells you what all of it costs. The shop started that night at level zero, with nothing to look at. Most teams are not at zero. Plenty stop at level two, with a dashboard on a TV in the office that nobody looked at on Saturday. Which level is your team on? Say it in the comments, and say which one you are missing. And if this helped, subscribe.
← What Is an API? REST, Webhooks, WebSockets, GraphQL and gRPC ExplainedNetflix System Design: Live Streaming to 65 Million Screens →