Observability for DevOps: What to Learn First

By Branko Petric - Updated - About 3 weeks at 10 hours a week

The short answer

For DevOps, you need enough observability to learn that your app broke before users tell you, and to work out why. That means a dashboard for request rate, errors and latency, searchable logs, one tested alert and one SLO. Skip tracing pipelines at scale. Plan on about 3 weeks at 10 hours a week.

Why observability comes after Terraform

You now have a real system in the cloud, and nobody is watching it. If it failed tonight, you would hear about it from a user or not at all. Until now, there was little worth measuring. Now there is traffic, a database and a server that can run out of memory.

It also comes before Kubernetes on purpose. A single app on one server has few moving parts, so a graph is easy to connect to its cause. The next steps depend on it too. You cannot run an incident well if you cannot see what is happening.

What to learn, in order

  1. Metrics, logs and traces. Learn what each one is for (see the FAQ below). This tells you where to look first when something breaks.
  2. What to measure. Google's SRE book names four golden signals: latency, traffic, errors and saturation (how full a resource is). Start with these, not with every number you can collect.
  3. Collect metrics. Follow the Prometheus getting started guide. Add a /metrics page to your app using a client library, and run node_exporter to get CPU, memory and disk data.
  4. Query them. Learn a little PromQL, the Prometheus query language. Start with rate(), because a count that only goes up tells you little until you turn it into a per-second rate.
  5. Build one dashboard. Put rate, errors and latency at the top. Use percentiles for latency: p95 means 95% of requests were faster than this number. An average hides your slowest users.
  6. Structured logs. Write logs as JSON, with fields such as level, path and request_id. Send them to one place, such as CloudWatch Logs or Loki, so you can search without using SSH.
  7. One alert that matters. Prometheus's own advice is to alert on symptoms linked to user pain, and to have as few alerts as you can. "Error rate above 5% for 5 minutes" is a symptom. "CPU above 80%" often is not. Prometheus only decides that an alert should fire. A separate program, Alertmanager, sends the message to you.
  8. One SLO. An SLO (service level objective) is a target for how reliable your app should be. It turns "is this bad?" into a question you can answer with a number.

What to skip for now

  • Running OpenTelemetry pipelines at scale. Learn what OpenTelemetry is (a standard way to produce metrics, logs and traces), and leave it there.
  • Thanos, Mimir and other tools for storing metrics at large scale.
  • Running your own Elasticsearch cluster for logs.
  • Comparing paid vendors such as Datadog. The ideas you learn here carry over.
  • Distributed tracing, until you have more than one service to trace.

Common mistakes

  • Alerting on everything. When most alerts need no action, people stop reading them. Every alert should need a person to do something. If it does not, make it a dashboard panel.
  • Never testing the alert. An alert you have not seen fire may not work at all. Break the app and check that the message arrives.
  • Running the monitor on the machine it watches. If that server dies, your alerts die with it. Add one check from outside, such as the health-check tool from step 4 running somewhere else.
  • Putting user IDs in metric labels. Each new label value creates a new time series in Prometheus, so memory use climbs fast. Put those details in logs. The naming guide has more on labels.
  • Logging secrets. Full request bodies can hold passwords and tokens. Log only the fields you need.

Your project

Add metrics, logs and one alert to your app. Then run a load test with a tool such as k6, raising traffic until something gets slow. Save a screenshot of the graph and write a few lines on what ran out first and how you know. Then stop the database and time how long the alert takes to reach you. Add those notes to your repo, as you will use this setup at the incident response step.

You are done when

You can do all of this with no notes. If you already can, skip this step.

  • A Grafana or CloudWatch dashboard shows your app's request rate, error rate and latency.
  • You stop your app, and an alert reaches your phone or email without you looking at a dashboard.
  • Your logs are in JSON, and you can find every error from the last hour for one request path.
  • You write one SLO in a single sentence, such as "99% of requests succeed each week", and work out how many failures that allows.
  • You run a load test, then explain each change in the graph out loud, including what ran out first.

Learn it and test it

Free guides

Practice scenarios

Common questions

What is the difference between monitoring and observability?

Monitoring watches for problems you predicted, such as a high error rate. Observability is about being able to ask new questions from the outside when something fails in a way you did not predict. A beginner needs monitoring first. Good logs and labels then give you the start of observability.

Should I learn Prometheus and Grafana first?

They are a good default, because both are free to run and you will see the same ideas elsewhere. Prometheus collects and stores metrics, and Grafana draws them. If you would rather stay inside AWS, CloudWatch can teach the same ideas. Pick one for now.

What is the difference between metrics, logs and traces?

Metrics are numbers over time, and they tell you something is wrong. Logs are records of single events, and they often tell you why. Traces follow one request through several services and show where the time went. With one app, you need metrics and logs first.

Practice defending your decisions

DevOps Ledger is a scenario-based DevOps and SRE interview practice platform: you pick a real production incident, defend your decision in a chat against a senior-engineer AI that pushes back, and get scored against an answer key written before you started.

One payment. 12 months of access. No subscription, nothing renews.

Get full access - $19