I've written a CustomCollector to capture some device information via API calls. I'm registering my CustomCollector() code as follows;
start_http_server(8000)
REGISTRY.register(CustomCollector())
while True:
time.sleep(1)
The API calls I'm making to generate data are fairly expensive, and I only want to update the information every 5 minutes. I have Prometheus scraping this target at 5 minute intervals - that part is fine.
However, the CustomCollector code is being executed every 60 seconds, regardless of whether there has been a scrape request.
Is this default 60s interval configurable? I've looked through the register code in detail and browsed the client_python code but I haven't found anything significant.
Cheers,
Duane.