-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
have node file definitions use underscore instead of column #435
have node file definitions use underscore instead of column #435
Conversation
Thanks for the fix! |
Sorry for commenting on an already merged PR. This change broke our custom While appreciating the change itself, it's kind of breaking existing behaviour - and a note in the Changelog would have been appreciated. Should a note be added to the changelog? |
@antondollmaier Maybe you can share how custom prometheus::scrabe_job on your side? Wondering if this could be refactored so that it does not break existing behaviour. |
Sure! Previously working example below. It's used to add the native RabbitMQ Prometheus plugin of 3.8 without the exporter. class mod::rabbitmq (
Boolean $export_scrape_job = true,
String $scrape_host = $facts['fqdn'],
String $scrape_job_name = 'rabbitmq',
Integer $stats_port = 15692,
) {
if $export_scrape_job {
@@prometheus::scrape_job { "${facts['fqdn']}:${stats_port}":
job_name => $scrape_job_name,
targets => ["${scrape_host}:${stats_port}"],
}
} Obviously, the change to my code is simple and does the job perfectly. Targets are scraped again. - @@prometheus::scrape_job { "${facts['fqdn']}:${stats_port}":
+ @@prometheus::scrape_job { "${scrape_job_name}_${facts['fqdn']}_${stats_port}": When comparing with the previous version in @@prometheus::scrape_job { "${scrape_host}:${scrape_port}": BTW, the As I said, I don't object in any way with the change (especially, as it's already released), I only wasn't able to read that change from the changelog and was left wondering why my targets weren't found any more. |
Between voxpupuli#435 and voxpupuli#450, the file path for the exported job names was changed to use underscores instead of colons. That's fine, except that, in the end, the actual filename had a superfluous `$scrape_job_name` parameter added. Taking the Apache exporter as an example, I used to have: /etc/prometheus/file_sd_config.d/apache_perdulce.torproject.org:9117.yaml I now have: /etc/prometheus/file_sd_config.d/apache_apache_eugeni.torproject.org_9117.yaml That still works of course: the old file is removed and the new one is picked up, but it does look silly and needlessly redundant. I should note that this might mean some clashes between jobs, if the same host/port combination is scraped by multiple jobs on the Prometheus server. I have no idea if that's a valid use case, but I should point out that, if it is, then the `job_name` parameter should just be removed and instead the resource name should forcibly include the job name, instead of enforcing this weird duplication. In other words, maybe this is also an API breaking change that should warrant a changelog entry, but I'll let my co-maintainers be the judges of this.
Between voxpupuli#435 and voxpupuli#450, the file path for the exported job names was changed to use underscores instead of colons. That's fine, except that, in the end, the actual filename had a superfluous `$scrape_job_name` parameter added. Taking the Apache exporter as an example, I used to have: /etc/prometheus/file_sd_config.d/apache_perdulce.torproject.org:9117.yaml I now have: /etc/prometheus/file_sd_config.d/apache_apache_eugeni.torproject.org_9117.yaml That still works of course: the old file is removed and the new one is picked up, but it does look silly and needlessly redundant. I should note that this might mean some clashes between jobs, if the same host/port combination is scraped by multiple jobs on the Prometheus server. I have no idea if that's a valid use case, but I should point out that, if it is, then the `job_name` parameter should just be removed and instead the resource name should forcibly include the job name, instead of enforcing this weird duplication. In other words, maybe this is also an API breaking change that should warrant a changelog entry, but I'll let my co-maintainers be the judges of this.
…name have node file definitions use underscore instead of column
Pull Request (PR) description
Currently if
collect_scrape_jobs
is set totrue
all file definitions created in/etc/prometheus/file_sd_config.d/
will contain\:
. This change would make file definitions look cleaner.On the other note, if all the exporters running on a node are running on a loop back interface - behind reverse proxy, exported resource will complain on double declarations. This change should give us more ways to set file definition names.
This Pull Request (PR) fixes the following issues