Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example on how to update prometheus targets #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ecksun
Copy link
Contributor

@ecksun ecksun commented Dec 9, 2019

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

@brian-brazil
Copy link
Contributor

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.

@ecksun
Copy link
Contributor Author

ecksun commented Dec 9, 2019

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

@brian-brazil
Copy link
Contributor

How would you do that?

A replace action to append a port number.

@ecksun
Copy link
Contributor Author

ecksun commented Dec 18, 2019

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?

Signed-off-by: Linus Wallgren <linus@nectarinehealth.com>
@ecksun
Copy link
Contributor Author

ecksun commented Sep 2, 2020

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

@scythargon
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants