pg_stat_activity
holds extremely useful information for post-mortem analysis of various issues, especially concurrency-related, and so augmenting errors or logging with this data (properly filtered and correlated) is invaluable. However querying it requires getting a database connection which might be in short supply at the very moment it's most needed.
Is there a side-channel of some sort which would allow getting that information without the additional database connection?