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

If the frequency update the prometheus.yml is faster than scrape, it will never to scrape data #3315

Closed
shanquanqiang opened this Issue Oct 19, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@shanquanqiang
Copy link

shanquanqiang commented Oct 19, 2017

If the frequency update the prometheus.yml is faster than scrape, it will never to scrape data.

it will return in case <-sl.scrapeCtx.Done():

func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) {
select {
case <-time.After(sl.scraper.offset(interval)):
// Continue after a scraping offset.
case <-sl.scrapeCtx.Done():
close(sl.stopped)
return
}

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Oct 23, 2017

Is this something you are interpreting from the code or something you observed in a running instance. The called offest() method does not make us wait for interval here. Instead it divides time into consistent slots and returns the time until the next one. Thus reloading frequently does not always reset the wait timer to interval and should not result in scrapes never happening.

Note that you should generally not have a need to reload Prometheus frequently regardless.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 20, 2018

If this was a problem, it should no longer be the case with the latest versions.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.