Add example on how to update prometheus targets
This will build a deb packge (does not follow the debian guidelines) that can be installed which updates a target list in the format expected by file_sd_config0 every 20 seconds.
I do not expect all of this to be merged, this is what we will use internally to integrate pushprox with prometheus.
What I have a feeling might be of most interest is the update.sh file that transforms the pushprox's /client json into a json that prometheus understands (given a number of ports to scrape). Secondly the systemd service file might also be of interest.
I fully expect this PR to become much smaller (possibly nothing), so don't hesitate to let me know what to throw away :)
update.sh file that transforms the pushprox's /client json
No need for jq, you can do this with relabelling on the Prometheus side.
A curl in a cronjob doesn't really need an example including a debian package.
update.sh file that transforms the pushprox's /client json
No need for jq, you can do this with relabelling on the Prometheus side.
How would you do that? could you give an example? :)
A curl in a cronjob doesn't really need an example including a debian package.
Agreed, removed it
How would you do that?
A replace action to append a port number.
How would you do that?
A replace action to append a port number.
Hmm, I have been trying to do this for a while now but can't figure out how to expand one target (./clients) to multiple. But perhaps that was a misunderstanding from my part on what you meant.
Did you actually mean simply doing curl http://pushprox.example/clients -O /etc/prometheus/file_sd/clients.json you can THEN apply a replace action?
I revisited this now and I think I figured out what you meant. Perhaps this is a good addition to the README?
