Lesson 1 of 6 · Monitoring & Observability

Monitoring and Observability

What monitoring and observability are, the signals they're built from, database diagnostics, and the golden signals, USE, and RED methods.

Beginner 5 sections 4 min read

Monitoring and observability

Monitoring tells you whether a database is working, by watching for problems you already know to look for: high CPU, a full tablespace, a failed backup. Observability helps you understand why it isn't working, even for problems nobody predicted, by letting you explore the detailed data a system produces. Modern DBA teams need both.

MONITORING Is it working? CPU under 80%tablespaces under 90% fulllast backup succeededreplication lag under 30 s okokalertok OBSERVABILITY Why isn't it working? metricslogstraces Slow checkout: one SQL statement, waiting on a row lock since 14:02
Monitoring
Collecting predefined measurements, comparing them with thresholds, and alerting when something crosses one. It answers questions you knew to ask in advance, sometimes called the known unknowns: "is the disk filling up?", "did the backup run?".
Observability
A property of a system: how well you can understand what's happening inside it from the data it produces. A highly observable system lets you ask new questions during an incident, the unknown unknowns: "why are only orders from one region slow, and only since the last release?"

The two work together. Monitoring is the alarm that tells you something is wrong; observability is the investigation that finds out what and why. A team with only monitoring knows that checkout is slow, but may spend hours guessing at the cause.

The signals

Observability is built from several kinds of data, often called telemetry. The three main ones are known as the three pillars:

SignalWhat it isDatabase examples
MetricsNumbers measured over time, cheap to store and fast to chartCPU, active sessions, transactions per second, IOPS, buffer cache hit ratio, replication lag, free space
LogsTimestamped records of events, with detailThe Oracle alert log, listener log, audit trail, PostgreSQL and MySQL slow query logs, error logs
TracesThe path of one request through every system it touches, with timingsA checkout request: web server, application, then each SQL statement it ran, and how long each took
EventsNotable changes, often added to charts as markersA deployment, a parameter change, a failover, a patch

Databases also have their own deep diagnostics, which are an essential part of database observability:

  • Wait events: what sessions are waiting on, such as I/O, locks, or CPU. In Oracle, Active Session History (ASH) samples every active session each second.
  • Workload history: Oracle's AWR, SQL Server's Query Store, and PostgreSQL's pg_stat_statements record what ran and how it performed over time.
  • Execution plans: how each query was actually run, and whether that changed.

What to watch: three useful methods

With so much data available, teams use simple frameworks to decide what matters most:

The four golden signals
From Google's SRE book, for any service: latency (how long requests take), traffic (how many there are), errors (how many fail), and saturation (how full the system is). For a database: query response time, queries or transactions per second, failed connections and errors, and CPU, I/O, sessions, and space.
The USE method
For each resource, such as CPU, memory, disk, and network: utilization, saturation, and errors. Good for finding infrastructure bottlenecks under a database.
The RED method
For each service: rate, errors, and duration. Good for looking at the database from the application's point of view.

In practice: green dashboard, unhappy users

Customers report that checkout is hanging. Kofi's monitoring dashboard is entirely green: CPU at 30%, plenty of memory and space, no alerts. Monitoring checked everything it was told to, and nothing it checked was wrong.

Observability finds the real problem. The application's traces show checkout requests waiting on one SQL statement. Active Session History shows dozens of sessions waiting on a row lock, all blocked by one session that has been open for 20 minutes: a support engineer who updated an order in a tool and went to lunch without committing. Kofi ends the session, checkout recovers, and the team adds two things: an alert on long-blocked sessions, and a timeout in the support tool. The next time, monitoring will catch it.

Key takeaways

  • Monitoring checks known conditions and alerts on them: is it working?
  • Observability lets you understand new, unexpected problems from the data a system produces: why isn't it working?
  • The main signals are metrics, logs, and traces, plus events such as deployments.
  • Databases add wait events, workload history such as AWR and Query Store, and execution plans.
  • The golden signals, USE, and RED help decide what to watch, starting from the user's experience.