Prometheus already does this. Each target within a job is scheduled in a
separate goroutine (lightweight thread), with a millisecond resolution
offset generated by the hash of the target labels.

If you query for `time() - timestamp(up{job="some-job"})`, you can see
exactly how the offset works.

On Tue, Mar 2, 2021 at 5:43 PM John Dexter <[email protected]> wrote:

> Hello all,
>
> I was thinking that if you use the same scrape-interval for many targets,
> doesn't this mean every 15/30/60s your Prometheus server sends out a huge
> barrage of requests all at once, potentially to many modules on the same
> server?
>
> I wondered if this can lead to any issues with network spikes and so on,
> and if Prometheus allows/encourages all the various scrapes to be staggered
> slightly so there is a constant stream of polls not so 'lumpy'? Maybe it
> naturally works this way anyway, that polls are run sequentially rather
> than in parallel?
>
> Thanks for any insight,
> John.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CAGJRanhhPZ26Zit71-BZWwmn4VZYrd6fp7%3DM6ipnqSvefpx4kA%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAGJRanhhPZ26Zit71-BZWwmn4VZYrd6fp7%3DM6ipnqSvefpx4kA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CABbyFmr4o5csbZ_KypKzCKa_-Ry65fe5co-WLXt%3DgfX9vQGzLA%40mail.gmail.com.

Reply via email to