Skip to content

Commit

Permalink
Change server_puppetserver_profiler default to true
Browse files Browse the repository at this point in the history
Puppet Inc. enabled the profiler by default in Puppetserver 5.0.0
https://tickets.puppetlabs.com/browse/SERVER-1761

This module has been disabling by default though causing users to be
missing metrics they might reasonably expect to be present after reading
through the
[Puppetserver documentation](https://puppet.com/docs/puppet/6/server/puppet_server_metrics.html#compiler-metrics).
  • Loading branch information
alexjfisher committed Feb 21, 2022
1 parent c7693e6 commit 29ac492
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@
# Defaults to false because that's the Puppet Inc. default behaviour.
#
# $server_puppetserver_profiler:: Enable JRuby profiling.
# Defaults to false because that's the Puppet Inc. default behaviour.
# Defaults to true because that's the Puppet Inc. default behaviour (since Puppetserver 5.0.0).
# If set to false, compiler and function metrics will not be available, (eg. when enabling graphite metrics)
#
# $server_metrics_jmx_enable:: Enable or disable JMX metrics reporter. Defaults to true
#
Expand Down Expand Up @@ -708,7 +709,7 @@
Boolean $server_allow_header_cert_info = $puppet::params::server_allow_header_cert_info,
Integer[0] $server_web_idle_timeout = $puppet::params::server_web_idle_timeout,
Boolean $server_puppetserver_metrics = false,
Boolean $server_puppetserver_profiler = false,
Boolean $server_puppetserver_profiler = true,
Boolean $server_metrics_jmx_enable = $puppet::params::server_metrics_jmx_enable,
Boolean $server_metrics_graphite_enable = $puppet::params::server_metrics_graphite_enable,
String $server_metrics_graphite_host = $puppet::params::server_metrics_graphite_host,
Expand Down
12 changes: 10 additions & 2 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@
it {
should contain_file(puppetserver_conf)
.with_content(/^ # Whether to enable http-client metrics; defaults to 'true'.\n metrics-enabled: true$(.*)/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: true/)
}
it {
should contain_file('/etc/custom/puppetserver/conf.d/metrics.conf')
Expand All @@ -282,10 +282,18 @@
it {
should contain_file(puppetserver_conf)
.with_content(/^ # Whether to enable http-client metrics; defaults to 'true'.\n metrics-enabled: false$/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: true/)
}
it { should contain_file('/etc/custom/puppetserver/conf.d/metrics.conf').with_ensure('file') }
end

context 'when server_profiler => false' do
let(:params) { super().merge(server_puppetserver_profiler: false) }
it {
should contain_file(puppetserver_conf)
.with_content(/^profiler: \{\n # enable or disable profiling for the Ruby code;\n enabled: false/)
}
end
end

describe 'server_experimental' do
Expand Down

0 comments on commit 29ac492

Please sign in to comment.