Skip to content

Commit

Permalink
Merge pull request voxpupuli#532 from anarcat/scrape-uri-fix
Browse files Browse the repository at this point in the history
fix default scrape_uri in apache_exporter
  • Loading branch information
anarcat authored Feb 24, 2021
2 parents e95460f + 0e8f223 commit 8c0223d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ prometheus::collectd_exporter::service_name: 'collectd_exporter'
prometheus::collectd_exporter::user: 'collectd-exporter'
prometheus::collectd_exporter::version: '0.5.0'
prometheus::collectd_exporter::options: ''
prometheus::apache_exporter::scrape_uri: 'http://localhost/server-status?auto'
prometheus::apache_exporter::scrape_uri: 'http://localhost/server-status/?auto'
prometheus::apache_exporter::download_extension: 'tar.gz'
prometheus::apache_exporter::download_url_base: 'https://github.com/Lusitaniae/apache_exporter/releases'
prometheus::apache_exporter::extra_groups: []
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/apache_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
it { is_expected.to be_listening.with('tcp6') }
end
describe process('apache_exporter') do
its(:args) { is_expected.to match %r{\ --scrape_uri http://localhost/server-status\?auto} }
its(:args) { is_expected.to match %r{\ --scrape_uri http://localhost/server-status/\?auto} }
end
end

Expand All @@ -33,7 +33,7 @@
end

describe process('apache_exporter') do
its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status\?auto} }
its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status/\?auto} }
end

describe port(9117) do
Expand All @@ -51,7 +51,7 @@
end

describe process('apache_exporter') do
its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status\?auto} }
its(:args) { is_expected.to match %r{\ -scrape_uri http://localhost/server-status/\?auto} }
end

describe port(9117) do
Expand Down
10 changes: 5 additions & 5 deletions spec/classes/apache_exporter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
it { is_expected.to contain_class('prometheus') }
it { is_expected.to contain_group('apache-exporter') }
it { is_expected.to contain_user('apache-exporter') }
it { is_expected.to contain_prometheus__daemon('apache_exporter').with('options' => '-scrape_uri "http://localhost/server-status?auto" ') }
it { is_expected.to contain_prometheus__daemon('apache_exporter').with('options' => '-scrape_uri "http://localhost/server-status/?auto" ') }
it { is_expected.to contain_service('apache_exporter') }
end
describe 'install correct binary' do
Expand All @@ -54,7 +54,7 @@
context 'with version, scrape_uri and extra options specified' do
let(:params) do
{
scrape_uri: 'http://127.0.0.1/server-status?auto',
scrape_uri: 'http://127.0.0.1/server-status/?auto',
extra_options: '-test',
version: '0.4.0',
arch: 'amd64',
Expand All @@ -71,7 +71,7 @@
it { is_expected.to contain_class('prometheus') }
it { is_expected.to contain_group('apache-exporter') }
it { is_expected.to contain_user('apache-exporter') }
it { is_expected.to contain_prometheus__daemon('apache_exporter').with('options' => '-scrape_uri "http://127.0.0.1/server-status?auto" -test') }
it { is_expected.to contain_prometheus__daemon('apache_exporter').with('options' => '-scrape_uri "http://127.0.0.1/server-status/?auto" -test') }
it { is_expected.to contain_service('apache_exporter') }
end
describe 'install correct binary' do
Expand All @@ -82,7 +82,7 @@
context 'with version 0.8.0+' do
let(:params) do
{
scrape_uri: 'http://127.0.0.1/server-status?auto',
scrape_uri: 'http://127.0.0.1/server-status/?auto',
extra_options: '--test',
version: '0.8.0',
arch: 'amd64',
Expand All @@ -93,7 +93,7 @@
end

describe 'uses argument prefix correctly' do
it { is_expected.to contain_prometheus__daemon('apache_exporter').with('options' => '--scrape_uri "http://127.0.0.1/server-status?auto" --test') }
it { is_expected.to contain_prometheus__daemon('apache_exporter').with('options' => '--scrape_uri "http://127.0.0.1/server-status/?auto" --test') }
end
end
end
Expand Down

0 comments on commit 8c0223d

Please sign in to comment.