The rule then counts the total backends and the number of NOT NULL events "t" (waitNum).
The wait percent is calculated, 100*(waitNum/total)
The rule is fired based on the wait percent (default 10 warning, 20 critical, 30 fatal)
There isn't a specific query to determine why the alarm is triggered, however running a select statement from the table pg_stat_activity can obtain backend information to filter out the queries that are waiting.
An example might be this
SELECT datname, usename, wait_event_type, wait_event, backend_type, query
WHERE wait_event_type IS NOT NULL
AND wait_event_type NOT IN ('Activity', 'Client');
For more information refer to: https://www.postgresql.org/docs/current/monitoring-stats.html