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 pgbouncer_exporter parameter #345

Merged
merged 1 commit into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,14 @@ Hash of 'postgres_exporter' config parameters.

Default value: `undef`

##### `pgbouncer_exporter`

Data type: `Optional[Hash]`

Hash of 'pgbouncer_exporter' config parameters.

Default value: `undef`

##### `gitlab_monitor`

Data type: `Optional[Hash]`
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# @param node_exporter Hash of 'node_exporter' config parameters.
# @param redis_exporter Hash of 'redis_exporter' config parameters.
# @param postgres_exporter Hash of 'postgres_exporter' config parameters.
# @param pgbouncer_exporter Hash of 'pgbouncer_exporter' config parameters.
# @param gitlab_monitor Deprecated if using Gitlab > 12.3 and < 13.0, unsupported by gitlab omnibus using Gitlab 13+. Hash of 'gitlab_monitor' config parameters.
# @param gitlab_exporter Hash of 'gitlab_exporter' config parameters.
# @param pages_external_url External URL of Gitlab Pages.
Expand Down Expand Up @@ -144,6 +145,7 @@
Enum['absent', 'present'] $pgpass_file_ensure = 'absent',
Stdlib::Absolutepath $pgpass_file_location = '/home/gitlab-consul/.pgpass',
Optional[Hash] $postgres_exporter = undef,
Optional[Hash] $pgbouncer_exporter = undef,
Optional[Hash] $gitlab_monitor = undef,
Optional[Hash] $gitlab_exporter = undef,
Optional[String] $package_name = undef,
Expand Down
1 change: 1 addition & 0 deletions manifests/omnibus_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
$node_exporter = $gitlab::node_exporter
$redis_exporter = $gitlab::redis_exporter
$postgres_exporter = $gitlab::postgres_exporter
$pgbouncer_exporter = $gitlab::pgbouncer_exporter
$gitlab_monitor = $gitlab::gitlab_monitor
$gitlab_exporter = $gitlab::gitlab_exporter
$pages_external_url = $gitlab::pages_external_url
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,18 @@
with_content(%r{^\s*puma\['worker_timeout'\] = 60$})
}
end
describe 'pgbouncer_exporter' do
let(:params) do
{ pgbouncer_exporter: {
'enable' => true
} }
end

it {
is_expected.to contain_file('/etc/gitlab/gitlab.rb'). \
with_content(%r{^\s*pgbouncer_exporter\['enable'\] = true$})
}
end
end
end
end
Expand Down
9 changes: 9 additions & 0 deletions templates/gitlab.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,15 @@ redis_exporter['<%= k -%>'] = <%= decorate(@redis_exporter[k]) %>
<%- @postgres_exporter.keys.sort.each do |k| -%>
postgres_exporter['<%= k -%>'] = <%= decorate(@postgres_exporter[k]) %>
<%- end end -%>
<%- if @pgbouncer_exporter -%>

################################################################################
## Prometheus PgBouncer exporter (EE only)
##! Docs: https://docs.gitlab.com/ee/administration/monitoring/prometheus/pgbouncer_exporter.html

<%- @pgbouncer_exporter.keys.sort.each do |k| -%>
pgbouncer_exporter['<%= k -%>'] = <%= decorate(@pgbouncer_exporter[k]) %>
<%- end end -%>
<%- if @alertmanager -%>

################################################################################
Expand Down