Skip to content

DevOps Operations / Service monitoring · Step 1 of 7

Lesson: Monitoring SignalsSwitch
← DevOps Operations

Delivery and containers

Monitoring Signals

Learn which measurements tell you whether a service is healthy.

Monitoring means watching a running service so you notice trouble before your users have to tell you. You cannot watch everything, so start with a few signals that answer one question: is the service doing its job?

Four useful signals

  • Traffic: how much work arrives, such as requests per second.
  • Errors: how much of that work fails.
  • Latency: how long the work takes.
  • Saturation: how full a limited resource is, such as disk, memory or a connection pool.

Traffic gives the others context. Ten errors a minute is serious if you serve twenty requests, and minor if you serve a million.

Symptoms and causes

A symptom is what a user feels: slow pages or failed logins. A cause is why it happens: a full disk or a stuck database. Watch symptoms to learn that something is wrong, and use cause measurements to find out why. A busy CPU is not a problem by itself if every request still succeeds quickly.

Metrics, logs and checks

A metric is a number sampled over time. A log is a record of individual events. A check actively tests the service and reports pass or fail.

On Linux you can read a first set of values by hand. systemctl is-active reports the state of a unit:

bash
$ systemctl is-active nginx
active

An active process can still return errors, so also send a real request. This curl command discards the body and prints the status code and total time:

bash
$ curl -s -o /dev/null -w '%{http_code} %{time_total}\n' http://localhost/
200 0.002341

uptime shows load averages over the last 1, 5 and 15 minutes:

bash
$ uptime
 10:14:02 up 6 days,  2:01,  1 user,  load average: 0.20, 0.31, 0.28

Keep a baseline

A number means little until you know what is normal. Record values on an ordinary day and compare later readings against them. Traffic often follows daily and weekly patterns, so compare Monday morning with another Monday morning, not with Sunday night.

The same commands work on most distributions, but service names differ. The web server unit is apache2 on Debian and Ubuntu, and httpd on Fedora and RHEL.

Try it

Pick a service on a test machine. Check it with systemctl is-active, then request it with the curl line above. Run both a few times and write down the normal values. For practice with processes, open the processes and cron lab.

Check your understanding

Monitoring Signals

All 3 sections · no timer

Unlimited retries

Questions from every section are combined into one assessment. Answer them all correctly to complete the article.

Your completion saves in this browser. Sign in to sync it to your account.