yugabyte / yugabyte-db

YugabyteDB - the cloud native distributed SQL database for mission-critical applications.
https://www.yugabyte.com
Other
8.66k stars 1.04k forks source link

[New Feature] yb_active_session_history (ash): Asking to include PID #23070

Open pdvmoto opened 1 week ago

pdvmoto commented 1 week ago

Description

Asking to include PID in yb_active_session_history. This field is already present in pg_stat_activity, which seems to contain similar data. the current ysql_session_id is just a local-counter, and is not much use "externally", wheras the linux-PID will allow linkup to an actual process.

Warning: Please confirm that this issue does not contain any sensitive information

hbhanawat commented 5 days ago

@pdvmoto Thanks for submitting the issue. Can you elaborate on the use case when PID will help and ysql_session_id will not? Since the PID is not available for sessions that have ended, I am not sure how to correlate that.

FranckPachot commented 5 days ago

I can add some cases where PID may be helpful:

pdvmoto commented 4 hours ago

What Franck Said. The first use of PID would be for "immediate viewing" and troubleshooting. plus: I am already working to save some of the data from ahs and pg_stat_activity. This will allow after-the-fact investigation to put together the (sampled) activity of a given session (pid + startdate).

The "problem" I have with sql_session_id: it doesnt seem to link to anything (yet) ?

and I realize the limitation of "sampled" information. but ASH is a Good Start!