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

Enable graceful shutdown for start_{http,wsgi}_server #999

Merged
merged 1 commit into from
Feb 1, 2024

Conversation

arsatiki
Copy link
Contributor

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

Copy link
Member

@csmarchbanks csmarchbanks left a comment

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.

@arsatiki
Copy link
Contributor Author

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.

@csmarchbanks csmarchbanks merged commit b9edc43 into prometheus:master Feb 1, 2024
11 checks passed
@jwiesler
Copy link

jwiesler commented Feb 6, 2024

Is there going to be a pypi release for this? @csmarchbanks

@csmarchbanks
Copy link
Member

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
Copy link
Member

@jwiesler I just released https://github.com/prometheus/client_python/releases/tag/v0.20.0 with this feature included!

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

Successfully merging this pull request may close these issues.

Please return thread from start_http_server
3 participants