Closed michael-doubez closed 4 years ago
You can write to promfile, then use an exporter_exporter exec target to cat it. I'd consider adding support for reading a file. Cacheingis better done elsewhere
Yes, that's how I implement it right now: I have a generic python script that acts as a proxy to other modules and uses the file change time to compute aging. But yet, it requires python installed and a writeable space.
Sometimes, I need to time the scraping of an endpoint or to run a script less frequently than the minimum scrape interval (~5min in prometheus before declaring the data stale). This may happens when the scraping may have a cost (contention, costly operations or on weak servers) and
The idea would be to add the possibility to cache the result of the scrape and set a stamp on it. When the next scrape arrives
Currently, the only way to achieve that is to write the result in a promfile, execute the script at the wanted interval and use node_exporter to collect it. It adds a lot of setup for such a simple use case.
In terms of configuration, it could be something similar to HTTP configuration:
Another nice addition for the HTTP method would be the possibility to make a HEAD request on the endpoint to at least check if it is up but this would depend on the exporter supporting it.