Enable graceful shutdown for start_{http,wsgi}_server by arsatiki · Pull Request #999 · prometheus/client_python

@arsatiki

Hello @csmarchbanks, I made the start_http_server function a bit easier to cancel gracefully.

Signed-off-by: Antti Rasinen <antti.rasinen@relexsolutions.com>

csmarchbanks

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am happy with this and it seems helpful. I am going to leave it for a couple of days in case anyone else wants to test/chime in and then merge.

@csmarchbanks csmarchbanks linked an issue

Jan 25, 2024

that may be closed by this pull request

@arsatiki

It's quite useful with long(ish) teardown situations and short scrape intervals. The metrics can get pretty skewed and meaningless since there's no new data coming in. Easier just to not respond at all instead of inventing new shuttingdown metrics or such.

@jwiesler

@csmarchbanks

There will be soon, hopefully in the next week or two, definitely this month. Hoping to batch a couple other changes into the release.

@csmarchbanks