-
Notifications
You must be signed in to change notification settings - Fork 41
Description
The only dimensions captured right now for wait events are pid and queryid. It would be helpful to capture additional dimensions for troubleshooting issues.
roleId and databaseId should be easy to grab from PGPROC while in pgws_should_sample_proc (corresponding with usesysid and datid in pg_stat_activity). lockGroupLeader->pid would be useful for sessions executing parallel queries.
There are also a number of fields from the backend status that would be very useful as dimensions: the application name, client addr/host/port and backend/bgworker type
Finally, (backend) proc_start_timestamp would be useful because technically this is needed together with pid to uniquely identify sessions (and disambiguate a new connection that reuses a PID)
And activity_start_timestamp would be useful to identify if the same query showing up in repeated samples is a single execution, or multiple executions of the same query
oh - and of course - the actual query text would be useful in some cases! (pgstat_clip_activity(beentry->st_activity_raw))
Might be able to copy code from pg_stat_get_activity() if needed