How can I add targets to blackbox exporter via an api or something similar?
Background I created a small front end for status monitoring of websites, I am utilizing the blackbox exporter and created a simple interface for adding and removing targets (Bootstrap front, PHP backend). I couldn't find a programmatic way to manage targets so I'm add just editing the text and manually reloading the config via curl.
This works but is inconsistent, and restarts my probe times so it takes some time before I see the change. Wondering if anyone has experience doing it a better way?
Welcome to StackOverflow.
The usual way to do this is to use the FileSD. This allows you to point to a directory or file which Prometheus will watch for changes.
The Workflow would be: