Immediately pull metrics from target

40 views
Skip to first unread message

Liu Bo

unread,
Mar 30, 2023, 6:01:54 AM3/30/23
to promethe...@googlegroups.com

Hi guys, can I make prometheus to pull metrics from a target immediately
after add this target to config?

For now I have to wait scrape_interval after I add target to config,
it's like if I set scrape_interval to 5m then I have to wait five
minutes so that I cat query metrics from newly added target.


--
Liu Bo

Ben Kochie

unread,
Mar 30, 2023, 6:30:22 AM3/30/23
to Liu Bo, promethe...@googlegroups.com
Prometheus is optimized to scrape at least every 1m. The typical scrape interval is 15s.

--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/87ileik16e.fsf%40gmail.com.

Liu Bo

unread,
Mar 30, 2023, 6:46:06 AM3/30/23
to promethe...@googlegroups.com
Ben Kochie <sup...@gmail.com> writes:

> Prometheus is optimized to scrape at least every 1m. The typical
> scrape interval is 15s.

Thanks, so there's no way to actively ask prometheus to pull the
target's metrics?

--
Liu Bo

Brian Candler

unread,
Mar 30, 2023, 7:17:20 AM3/30/23
to Prometheus Users
AIUI, it spreads them over the scrape interval. If it didn't, then when you add a whole load of new targets, they would all be scraped simultaneously in huge regular bursts.

Ben Kochie

unread,
Mar 30, 2023, 7:49:06 AM3/30/23
to Liu Bo, Prometheus Users
No. As Brian says, it's intentional that this is not possible in order to avoid load spikes.

--
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 prometheus-use...@googlegroups.com.

Stuart Clark

unread,
Mar 30, 2023, 7:55:00 AM3/30/23
to Ben Kochie, Liu Bo, Prometheus Users
On 2023-03-30 12:48, Ben Kochie wrote:
> No. As Brian says, it's intentional that this is not possible in order
> to avoid load spikes.

And as Ben mentioned earlier the normal scrape intervals are usually
15/30 seconds for normal metrics, or 1/2 minutes for slower use cases.
Therefore you'd only have to wait a short amount of time before metrics
start appearing - although often you need to wait for at least a few
scrapes to be able to do things like looking at counter increase rates,
etc.

--
Stuart Clark

Bo Liu

unread,
Mar 30, 2023, 9:57:00 PM3/30/23
to Prometheus Users, Stuart Clark
Sorry, forward to mail list manually.

Liu Bo <liubol...@gmail.com>于2023年3月31日 周五上午9:53写道:
Thank you guys, I got it now, that's help me a lot.

--
Liu Bo
Reply all
Reply to author
Forward
0 new messages