Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect long-running Queries #131

Closed
nunziotocci opened this issue Aug 7, 2018 · 2 comments
Closed

Detect long-running Queries #131

nunziotocci opened this issue Aug 7, 2018 · 2 comments
Assignees

Comments

@nunziotocci
Copy link
Collaborator

Envelope should keep track of what queries it's running and when they started so that if it takes a certain amount of time it issues a log.

This would be configurable by the config parameter log_queries_over=<seconds>. If set to zero, don't issue logs.

Also, these logs should be issued no matter what the log_level is.

It would be interesting if you could attach a custom action to this handler, but that would need to be discussed.

@nunziotocci nunziotocci self-assigned this Aug 7, 2018
@justintocci
Copy link
Collaborator

it would be cool to call a database function when this happens, because then it would be a piece of cake to notify the sysadmin of the long running query via text or email.

@nunziotocci
Copy link
Collaborator Author

Ok, I'll add a log_queries_over_action_name=<pg_function> parameter and Envelope will pass the PID of the process to the function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants