-
-
Notifications
You must be signed in to change notification settings - Fork 240
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 Bind exporter #312
Add Bind exporter #312
Conversation
@anarcat Could you please do a rebase? |
manifests/apache_exporter.pp
Outdated
@@ -89,6 +89,7 @@ | |||
Boolean $restart_on_change = true, | |||
Boolean $service_enable = true, | |||
String[1] $service_ensure = 'running', | |||
String $service_name = 'apache_exporter', |
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.
I like this change, but there are a lot of exporters which still use a static service_name:
apache_exporter.pp
beanstalkd_exporter.pp
collectd_exporter.pp
consul_exporter.pp
elasticsearch_exporter.pp
graphite_exporter.pp
haproxy_exporter.pp
mesos_exporter.pp
mongodb_exporter.pp
mysqld_exporter.pp
nginx_vts_exporter.pp
process_exporter.pp
rabbitmq_exporter.pp
server.pp
snmp_exporter.pp
statsd_exporter.pp
varnish_exporter.pp
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.
are you suggesting that this change should also make the service_name
dynamic in all those? that change is probably part of #303 anyways...
@@ -0,0 +1,138 @@ | |||
# Class: prometheus::bind_exporter |
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.
@anarcat If you introduce a new exporter, you should also provide the files spec/acceptance/bind_exporter.rb
, spec/classes/bind_exporter.rb
. Otherwise the new exporter will not be tested.
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.
@dhoppe totally agreed!
bfdb901
to
94ec7a1
Compare
i've rebased this on master to avoid depending on the Debian branch (#303). This basically means dropping the Debian-specific package/service/perms configuration like this:
... which then need to be set by the user. But that's a problem that belongs in the Debian package support (#303), not here. |
@anarcat ping :) |
94ec7a1
to
1702873
Compare
one change i made in one of the last few commits is remove support for HTTP-only URL. it seems to me that if we're going to download and run arbitrary code on servers, we should at least do this over HTTPS, no? |
@bastelfreak - pong! i think i made a good (if minimal) test suite here. test pass locally at last, and hopefully on travis too as well, although i need to run and can't check any further for now... hopefully this will be all green and ready to merge once travis finishes! |
and travis still fails here, unfortunately. I can't reproduce locally, i don't understand why, and would need help in figuring that out... thanks! |
actually, now that i think about it, i think the test failures might be related to the bind exporter itself. i believe i'm running with specific flags locally so that the thing actually works (see also prometheus-community/bind_exporter#50)... maybe that's what's going on here? do the tests actually start bind and everything? |
@anarcat the acceptance tests try to start bind_exporter. Is it failing because bind is missing? |
that is very likely. can i get away with just |
You've got multiple options here. Please keep in mind that the acceptance tests are executed on multiple platforms: Lines 4 to 10 in c074197
You can run shell commands in an acceptance test: But you could also tell the spec helper to install another puppet module (for example one to install bind): |
5ee134b
to
da3f338
Compare
data/defaults.yaml
Outdated
@@ -328,3 +328,10 @@ prometheus::apache_exporter::package_ensure: 'latest' | |||
prometheus::apache_exporter::package_name: 'apache_exporter' | |||
prometheus::apache_exporter::user: 'apache-exporter' | |||
prometheus::apache_exporter::version: '0.7.0' | |||
prometheus::bind_exporter::download_url: 'https://github.com/digitalocean/bind_exporter/releases/download/v0.2.0-dev/bind_exporter' |
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.
I think the idea is download_url
is a way of a user overriding the url built from the download_url_base
and version
parameters. As such, it should default to undef
.
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.
i don't know how this stuff works. i use debian packages. :p feel free to take over this PR as well, i couldn't figure out how to make the test suite work properly...
As I think you discovered, the download available from github is not an archive, but the actual executable binary. Even more disappointing is that when I tried it, it didn't even work.
I was able to compile an amd64 linux binary, but where to host it? |
at this point, i think one course of action that might be needed is to just fork that darn thing. the patches and MRs are all in, it's just a matter of laying down tags and publishing the release properly... |
looks like the project might be reclaimed by the prometheus community eventually: prometheus-community/community#15 |
i rebased this on top of the latest release here, and rebuilt it against teh v.0.4.0 release from prometheus-communtiy.. hopefully this will work? |
CI, as usual, fails here. :( i was hoping the update to 0.4.0 would fix it, but it seems like it didn't. i'd love if someone could help me on that front, otherwise I'll just keep rebasing this in the future. :) |
This way they show up in the REFERENCE.md documentation
441c333
to
2469a83
Compare
* bind exporter support * add tests * fix robocop warnings * fix download URLs * bind: remove update tests as there's only one version * fix download url *again* * fix download extension type, it can be (and is) empty * properly set download_url parameters * mark the url_base as optional, enforce https (!) * this is not an archive after all * add support for scrape_job_labels from 8.x * catchup with the newer bind_exporter version (0.4.0 * convert to puppet strings * move defaults to the class This way they show up in the REFERENCE.md documentation * add missing documentation variables * mark download_url as optional * fix some linter warning
This hooks the bind exporter in this puppet module. it is built on top of #303