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

Abort scrapes after configurable timeout #340

Merged
merged 4 commits into from
Aug 3, 2019
Merged

Conversation

carlpett
Copy link
Collaborator

Depends on #335.
This implements a rough abort after a timeout, so the scrape can return even if WMI has hung for some collectors (eg #89, #270).

I'm not super happy about the implementation, it feels like a mess of interleaved goroutines that are not easy to understand. Tried a few variations of using the normal context, but it also had a lot of them.
Happy for suggestions. Maybe the main Collect function should be rewritten.

Copy link
Collaborator

@martinlindhe martinlindhe left a comment

Choose a reason for hiding this comment

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

Looks ok.

One thing I was thinking of is the wording
maxScrapeDuration vs scrapeTimeout

@martinlindhe martinlindhe self-requested a review June 23, 2019 20:44
@martinlindhe martinlindhe self-requested a review June 23, 2019 20:45
exporter.go Outdated Show resolved Hide resolved
@carlpett carlpett changed the title WIP/PoC: Abort scrapes after configurable timeout Abort scrapes after configurable timeout Aug 3, 2019
@carlpett
Copy link
Collaborator Author

carlpett commented Aug 3, 2019

Merging this (but note that it merges into the perflib-cpu branch, not master)

@carlpett carlpett merged commit 0ecf3cd into perflib-cpu Aug 3, 2019
@carlpett carlpett deleted the timeout-scrapes branch August 4, 2019 12:31
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
…-scrapes

Abort scrapes after configurable timeout
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.

2 participants