ObservabilityintermediatePro runbook

Watch wait events in pg_stat_activity

wait_event_type and wait_event in pg_stat_activity tell you why a session is not running, waiting on a lock, on the client, or sleeping. Three sessions here show three different causes at a glance.

Problem

What you're actually looking at

The symptom as it shows up on a real server.

A session that is not making progress could be blocked on a lock, waiting for the client to send more data, or deliberately sleeping. pg_stat_activity's wait_event columns name the exact reason, turning 'it's stuck' into a specific diagnosis.

Meridian sees three sessions in odd states. The wait columns immediately distinguish a real lock wait from a session that is merely idle-in-transaction waiting on the client, and from one that is just sleeping.

Simple terms

When a session is not making progress, "it's stuck" is not a diagnosis, you need to know what it is stuck on. pg_stat_activity has two columns, wait_event_type and wait_event, that name the exact reason a backend is parked: waiting on a lock, waiting for the client to send its next command, or just sleeping. One glance turns three mysterious sessions into three specific causes.

ProCaptured evidence where the run produced it

Full runbook for this incident

The scenario above is free. What Pro unlocks is the fix: how to identify watch wait events in pg_stat_activity, the exact SQL to trace it, PostgreSQL 18 output for the steps we captured, the resolution path, and how to stop it recurring.
  • The full identify checklist, the exact signals that tell you it's this incident
  • Every diagnostic query; lab output is attached only to the steps we actually captured
  • The resolution path and the pitfalls that make it worse
  • Mitigation steps to stop it recurring, plus a verify-you're-done query

Card required. Cancel before day 7 and you are not charged.

Compare plans

Connected

How this connects to the rest of the library

A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.

Open in the interactive map →
ShareLinkedInX

Need the full procedure?

Pro runbooks finish the incident path

Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.

FollowSubstackLinkedInnew errors · lab notes · hiring loops