losing metrics

35 views
Skip to first unread message

Josefo Serra

unread,
Nov 26, 2020, 12:18:52 PM11/26/20
to Prometheus Users
Hi, I'm losing metrics between scraps and I understand that it's because I scrape every 10 minutes and they must "expire" or something. Could someone tell me which parameter I have to modify?
Thanks!

Stuart Clark

unread,
Nov 26, 2020, 1:31:18 PM11/26/20
to Josefo Serra, Prometheus Users
The maximum scrape interval should be 2 minutes, so you want to adjust
those jobs to scrape every 2 minutes instead of 10.

Josefo

unread,
Nov 27, 2020, 1:35:18 PM11/27/20
to Stuart Clark, Prometheus Users
Hi Stuart, thanks for your time!
The problem I have is that with script_exporter I make database queries that normally take between 5 and 8 minutes and can reach 15 On the other hand I am saving that information in a database and I don't really need that much data

Stuart Clark

unread,
Nov 27, 2020, 1:40:11 PM11/27/20
to Josefo, Prometheus Users
In that situation of very slow scrapes, I'd suggest two options.

Either split the queries up if possible, which would allow things to be parallelised.

Alternatively, run the queries via cron or a script and write the results to the filesystem and then use the node exporter's textfile collector. Then you can scrape say ever 30 seconds so you won't have issues with staleness.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Reply all
Reply to author
Forward
0 new messages