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 dropsonde telemetry config #838

Merged
merged 2 commits into from
May 20, 2022
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
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@
# Defaults to true, matching defaults in Puppetserver 5+.
# If set to false, compiler and function metrics will not be available, (eg. when enabling graphite metrics)
#
# $server_puppetserver_telemetry:: Enable Dropsonde telemetry.
# Defaults to true, matching defaults in Puppetserver 7.
# If set to false, will disable module metrics submission via Dropsonde.
# Note that is only valid since Puppetserver 7.
#
# $server_metrics_jmx_enable:: Enable or disable JMX metrics reporter. Defaults to true
#
# $server_metrics_graphite_enable:: Enable or disable Graphite metrics reporter. Defaults to false
Expand Down Expand Up @@ -713,6 +718,7 @@
Integer[0] $server_web_idle_timeout = $puppet::params::server_web_idle_timeout,
Boolean $server_puppetserver_metrics = true,
Boolean $server_puppetserver_profiler = true,
Boolean $server_puppetserver_telemetry = 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
5 changes: 5 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@
# $puppetserver_profiler:: Enable JRuby profiling.
# Defaults to false because that's the Puppet Inc. default behaviour.
#
# $puppetserver_telemetry:: Enable Dropsonde telemetry.
# Valid on puppetserver >= 7
# Defaults to true because that's the Puppet Inc. default behaviour since puppet 7
#
# $metrics_jmx_enable:: Enable or disable JMX metrics reporter. Defaults to true
#
# $metrics_graphite_enable:: Enable or disable Graphite metrics reporter. Defaults to false
Expand Down Expand Up @@ -429,6 +433,7 @@
Boolean $allow_header_cert_info = $puppet::server_allow_header_cert_info,
Optional[Boolean] $puppetserver_metrics = $puppet::server_puppetserver_metrics,
Boolean $puppetserver_profiler = $puppet::server_puppetserver_profiler,
Boolean $puppetserver_telemetry = $puppet::server_puppetserver_telemetry,
Boolean $metrics_jmx_enable = $puppet::server_metrics_jmx_enable,
Boolean $metrics_graphite_enable = $puppet::server_metrics_graphite_enable,
String $metrics_graphite_host = $puppet::server_metrics_graphite_host,
Expand Down
1 change: 1 addition & 0 deletions manifests/server/puppetserver.pp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
$server_environment_class_cache_enabled = $puppet::server::environment_class_cache_enabled,
$server_metrics = $puppet::server::puppetserver_metrics,
$server_profiler = $puppet::server::puppetserver_profiler,
$server_telemetry = $puppet::server::puppetserver_telemetry,
$metrics_jmx_enable = $puppet::server::metrics_jmx_enable,
$metrics_graphite_enable = $puppet::server::metrics_graphite_enable,
$metrics_graphite_host = $puppet::server::metrics_graphite_host,
Expand Down
24 changes: 24 additions & 0 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,30 @@
end
end

describe 'server_telemetry' do
context 'when server_puppetserver_version == 7.0.0' do
let(:params) { super().merge(server_puppetserver_version: '7.0.0') }
context 'with default parameters' do
it {
should contain_file(puppetserver_conf)
.with_content(/^dropsonde: \{\n # enable or disable telemetry\n enabled: true/)
}
end

context 'when server_telemetry => false' do
let(:params) { super().merge(server_puppetserver_telemetry: false) }
it {
should contain_file(puppetserver_conf)
.with_content(/^dropsonde: \{\n # enable or disable telemetry\n enabled: false/)
}
end
end

context 'when server_puppetserver_version >= 6.15.0 and < 7.0.0' do
it { should contain_file(puppetserver_conf).without_content(/^dropsonde: \{/) }
end
end

describe 'server_experimental' do
context 'when server_experimental => true' do
let(:params) { super().merge(server_puppetserver_experimental: true) }
Expand Down
8 changes: 8 additions & 0 deletions templates/server/puppetserver/conf.d/puppetserver.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,11 @@ profiler: {
# enable or disable profiling for the Ruby code;
enabled: <%= @server_profiler %>
}
<%- if scope.function_versioncmp([@server_puppetserver_version, '7.0']) >= 0 -%>

# Settings related to telemetry
dropsonde: {
# enable or disable telemetry
enabled: <%= @server_telemetry %>
}
<%- end -%>