Faidon Liambotis has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/359448 )
Change subject: Kill module puppet_statsd
......................................................................
Kill module puppet_statsd
Unused in years. We can always revert if we ever decide to bring the
functionality back.
Change-Id: I5bf20e1db6b69d5928edcbaca58ee8cffd4a07e6
---
M .rubocop_todo.yml
D modules/puppet_statsd/README.md
D modules/puppet_statsd/lib/facter/puppet_config_dir.rb
D modules/puppet_statsd/lib/puppet/reports/statsd.rb
D modules/puppet_statsd/manifests/init.pp
D modules/puppet_statsd/templates/statsd.yaml.erb
6 files changed, 0 insertions(+), 144 deletions(-)
Approvals:
Giuseppe Lavagetto: Looks good to me, but someone else must approve
Faidon Liambotis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 4f63875..1e01d06 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -9,7 +9,6 @@
Lint/UselessAssignment:
Exclude:
- - 'modules/puppet_statsd/lib/puppet/reports/statsd.rb'
- 'modules/service/Rakefile'
- 'modules/wmflib/lib/puppet/parser/functions/validate_array_re.rb'
@@ -96,10 +95,6 @@
Exclude:
- 'modules/graphite/lib/puppet/parser/functions/configparser_format.rb'
-Style/RedundantSelf:
- Exclude:
- - 'modules/puppet_statsd/lib/puppet/reports/statsd.rb'
-
Style/RegexpLiteral:
Exclude:
- 'modules/bacula/spec/classes/bacula_client_spec.rb'
@@ -127,7 +122,6 @@
Exclude:
- 'modules/base/lib/facter/labsproject.rb'
- 'modules/graphite/lib/puppet/parser/functions/configparser_format.rb'
- - 'modules/puppet_statsd/lib/puppet/reports/statsd.rb'
- 'modules/wmflib/lib/puppet/parser/functions/ini.rb'
Layout/SpaceAroundEqualsInParameterDefault:
diff --git a/modules/puppet_statsd/README.md b/modules/puppet_statsd/README.md
deleted file mode 100644
index d2181bd..0000000
--- a/modules/puppet_statsd/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Puppet StatsD reporter
-
-This module configures a Puppet reporter that sends timing information on
-Puppet runs to StatsD.
-
-### Setup
-
-To configure StatsD reporting, enable pluginsync and reports on your master and
-clients in `puppet.conf`:
-
-```ini
-[master]
-report = true
-reports = statsd
-pluginsync = true
-
-[agent]
-report = true
-pluginsync = true
-```
-
-And include the class on all nodes you want to report:
-
-```puppet
-class { 'puppet_statsd':
- statsd_host => 'statsd.eqiad.wmnet',
- statsd_port => 8125,
- metric_format => 'puppet.<%= metric %>.<%= hostname %>',
-}
-```
-
-### Module parameters
-
-* `statsd_host`: StatsD host to send metrics to.
-* `statsd_port`: Port on which StatsD host is listening (default: 8125).
-* `metric_format`: ERB Template string for metric names; the variables
- 'hostname' and 'metric' will be set in template scope to the local hostname
- and the metric name, respectively. Default: 'puppet.<%= metric %>.<%=
hostname %>'.
-
-### License
-
-Copyright (c) 2013 Ori Livneh and Wikimedia Foundation. All Rights Reserved.
-
-`puppet_statsd` is distributed under the GNU General Public License, Version 2,
-or, at your discretion, any later version. The GNU General Public License is
-available via the Web at <http://www.gnu.org/licenses/gpl-2.0.html>.
diff --git a/modules/puppet_statsd/lib/facter/puppet_config_dir.rb
b/modules/puppet_statsd/lib/facter/puppet_config_dir.rb
deleted file mode 100644
index 2aae8d4..0000000
--- a/modules/puppet_statsd/lib/facter/puppet_config_dir.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# Defines a custom Facter fact, $puppet_config_dir, which specifies the
-# location of Puppet's configuration directory (usually /etc/puppet).
-require 'puppet'
-
-Facter.add('puppet_config_dir') do
- setcode do
- Puppet.settings[:confdir]
- end
-end
diff --git a/modules/puppet_statsd/lib/puppet/reports/statsd.rb
b/modules/puppet_statsd/lib/puppet/reports/statsd.rb
deleted file mode 100644
index becf69d..0000000
--- a/modules/puppet_statsd/lib/puppet/reports/statsd.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# Puppet StatsD reporter
-# Sends timing measurements for Puppet runs to StatsD
-require 'puppet'
-require 'yaml'
-require 'erb'
-
-Puppet::Reports.register_report(:statsd) do
- desc = 'Send Puppet metrics to StatsD'
-
- def load_config
- config_file = File.join Puppet.settings[:confdir], 'statsd.yaml'
- raise Puppet::ParseError, "#{config_file} is missing" unless
File.exists? config_file
- YAML.load_file(config_file)
- end
-
- def process
- config = load_config
- hostname = self.host
- Puppet.notice "Sending metrics for #{self.host} to "\
- "#{config[:statsd_host]}:#{config[:statsd_port]}.."
-
- socket = UDPSocket.new
- self.metrics['time'].values.each do |metric,description,value|
- value = (value * 1000).round # Convert fractional seconds to
whole miliseconds
- name = ERB.new(config[:metric_format]).result(binding)
- socket.send("#{name}:#{value}|ms", 0, config[:statsd_host],
config[:statsd_port])
- end
- socket.close
- end
-end
diff --git a/modules/puppet_statsd/manifests/init.pp
b/modules/puppet_statsd/manifests/init.pp
deleted file mode 100644
index 0408cee..0000000
--- a/modules/puppet_statsd/manifests/init.pp
+++ /dev/null
@@ -1,47 +0,0 @@
-# == Class: puppet_statsd
-#
-# This module configures a Puppet reporter that sends timing information
-# on Puppet runs to StatsD.
-#
-# === Parameters
-#
-# [*statsd_host*]
-# StatsD host to send metrics to.
-#
-# [*statsd_port*]
-# Port on which StatsD host is listening (default: 8125).
-#
-# [*metric_format*]
-# ERB Template string for metric names; the variables 'hostname' and
-# 'metric' will be set in template scope to the local hostname and the
-# metric name, respectively. Default: 'puppet.<%= metric %>.<%= hostname %>'.
-#
-# === Examples
-#
-# To enable, enable pluginsync and reports on your master and clients in
-# puppet.conf:
-#
-# [master]
-# report = true
-# reports = statsd
-# pluginsync = true
-#
-# [agent]
-# report = true
-# pluginsync = true
-#
-# ..and include the class:
-#
-# class { 'puppet_statsd':
-# statsd_host => 'statsd.eqiad.wmnet',
-# }
-#
-class puppet_statsd(
- $statsd_host,
- $statsd_port = 8125,
- $metric_format = 'puppet.<%= metric %>.<%= hostname %>'
-) {
- file { "${::puppet_config_dir}/statsd.yaml":
- content => template('puppet_statsd/statsd.yaml.erb'),
- }
-}
diff --git a/modules/puppet_statsd/templates/statsd.yaml.erb
b/modules/puppet_statsd/templates/statsd.yaml.erb
deleted file mode 100644
index 23921ca..0000000
--- a/modules/puppet_statsd/templates/statsd.yaml.erb
+++ /dev/null
@@ -1,6 +0,0 @@
-# Configuration file for Puppet StatsD reporter
-# Managed by Puppet.
----
-:statsd_host: '<%= @statsd_host %>'
-:statsd_port: <%= @statsd_port.to_i %>
-:metric_format: '<%= @metric_format %>'
--
To view, visit https://gerrit.wikimedia.org/r/359448
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5bf20e1db6b69d5928edcbaca58ee8cffd4a07e6
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits