-
Notifications
You must be signed in to change notification settings - Fork 343
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 support for multiple scrape addresses #539
Conversation
Hi @brandon1024, thanks for the PR! It seems like a relatively small change and it would make a few people happy 🙂 My only concern is that we're adding a new label Also, do you think this is considered a breaking change? |
Thanks for the review @lucacome 🙂
That's fair, and this did cross my mind when I was implementing these changes. I agree it would be better to add the address label only when more than one address is given. This will be pretty easy to implement, I'll make some tweaks today and push a new revision.
Once I make those minor changes, it would be completely backwards compatible :-) |
Done! |
Make the `nginx.scrape-uri` accept a slice of addresses, and register prometheus collectors for each nginx instance. When multiple scrape addresses are registered, include the scrape address as a label to differentiate the metrics for each instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @brandon1024 !
Hi, sorry, but I am running in circles and don't get it done... How is the final syntax to get several nginx servers collected by one prometheus-nginx-exporter? ARGS=" -nginx.scrape-uri .... how ever, but at least two uri-adresses" Regards Gerhard |
To configure several scrape addresses, you just need to provide the flag more than once:
|
Hi, thx!!! Works perfect. Regards Gerhard |
Proposed changes
Make the
nginx.scrape-uri
accept a slice of addresses, and register prometheus collectors for each monitored nginx instance.This revision came out of a discussion in #229. The general concensus by those in the thread was that it would be better to run an nginx-exporter for every monitored nginx instance. I had implemented these changes for my own use, so I decided to make them available to the wider community here.
Feel free to merge, or don't :-) I'm fine with either.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
guide