Scheduling queries of a collector #881
-
|
Hello everybody, Is there a way to schedule some collectors with a specific time execution instead of an interval ? For example, for some technical reasons, I sometimes needs to execute a collector every 24 hours, but at 8 am ever day. I have tried with Regards, Nicolas |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi @majordhote,
What can be done here (an idea):
The problem still remains as Prometheus doesn't support any scheduled scrapes as well, only intervals (every N seconds/minutes/hours). So what can be done next is (which sounds a bit like a workaround but might worth a try):
Have a look and give it a try. If you need some assistance or advice, please let me know. 👍 |
Beta Was this translation helpful? Give feedback.
Hi @majordhote,
sql_exporterdoesn't scrape targets on its own, the scrapes are controlled and fully performed by a Prometheus instance. In other words, if Prometheus doesn't hit the/metricsendpoint ofsql_exporter, nothing is scraped.What can be done here (an idea):
sql_exporterto organise jobs (can be multi-target if needed) and assign collectors to them. This way if you hit/metrics?jobs[]=myjob1, only collectors against the specified targets will be scraped. If you just hit/metrics, all jobs are scraped. Please check the readme for theMultiple database connectionssection. You can use the same target across multiple jobs. Here is the reference on job filte…