pg-telemetry
pg-telemetry copied to clipboard
Make long-running queries report state change duration and improve pg_dump handling
- we should report time since last state change in addition to time since the query start
- if the rule being matched contains a specific state we should count the time since state change (otherwise a query running for 1h that just became 'idle in transaction' will immediately trigger the 'idle in transaction' rule without waiting for the 5m specified in the rules.
- pg_dump pattern should use a prefix match to handle pg_dump11 and similar cases of application_name.