PushProx icon indicating copy to clipboard operation
PushProx copied to clipboard

Add example on how to update prometheus targets

Open ecksun opened this issue 6 years ago • 6 comments

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 :)

ecksun avatar Dec 09 '19 11:12 ecksun

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.

brian-brazil avatar Dec 09 '19 13:12 brian-brazil

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

ecksun avatar Dec 09 '19 13:12 ecksun

How would you do that?

A replace action to append a port number.

brian-brazil avatar Dec 09 '19 17:12 brian-brazil

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?

ecksun avatar Dec 18 '19 16:12 ecksun

I revisited this now and I think I figured out what you meant. Perhaps this is a good addition to the README?

ecksun avatar Sep 02 '20 15:09 ecksun

image

scythargon avatar Sep 22 '21 10:09 scythargon