Is there a way to hook into the queue depth warning?

26 views
Skip to first unread message

jdavi...@gmail.com

unread,
May 21, 2021, 4:51:52 PM5/21/21
to pylons-discuss
I understand the cause of the warning, I just wonder if there's a way to hook into the process that triggers it to allow it to send a warning email or something when the queue depth reaches a certain threshold? 

Alternatively is there a way to query it to see what the queue depth is currently?

Michael Merickel

unread,
May 21, 2021, 5:42:10 PM5/21/21
to pylons-...@googlegroups.com
It's using the python stdlib logging library. You can add a handler to that logger that sends emails or does anything else. It really depends on how you're running your processes how to setup logging properly but in Pyramid (which uses logging.config.fileConfig) it would be done by adding another section to your ini file to catch the "waitress.queue" logger.

[loggers]
keys = ..., waitress_queue

[handlers]
keys = ..., waitress_queue

[logger_waitress_queue]
handlers = waitress_queue
qualname = waitress.queue

[handler_waitress_queue]
class = handlers.SMTPHandler
args = (('example.com', 578, 'fr...@example.com', ['t...@example.com'], 'queue depth warning', ('username', 'password'))
formatter = generic

- Michael

On May 21, 2021, at 15:51, jdavi...@gmail.com <jdavi...@gmail.com> wrote:

I understand the cause of the warning, I just wonder if there's a way to hook into the process that triggers it to allow it to send a warning email or something when the queue depth reaches a certain threshold? 

Alternatively is there a way to query it to see what the queue depth is currently?

--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/d65251f9-61b4-4551-9c3b-761c193074f8n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages