Rush has submitted this change and it was merged.
Change subject: diamond: Prefix metrics with project name
......................................................................
diamond: Prefix metrics with project name
Change-Id: I275aa5d9a54191a1a52d3c44b81580265746acfb
---
M manifests/role/diamond.pp
M modules/diamond/manifests/init.pp
M modules/diamond/templates/diamond.conf.erb
3 files changed, 17 insertions(+), 5 deletions(-)
Approvals:
Rush: Verified; Looks good to me, approved
diff --git a/manifests/role/diamond.pp b/manifests/role/diamond.pp
index d2f8d99..3758c93 100644
--- a/manifests/role/diamond.pp
+++ b/manifests/role/diamond.pp
@@ -14,11 +14,18 @@
default: { $host = '10.64.0.18' }
}
+ # Prefix labs metrics with project name
+ case $::realm {
+ 'labs': { $path_prefix = $::instanceproject }
+ default: { $path_prefix = 'servers' }
+ }
+
class { '::diamond':
- settings => {
- enabled => 'true',
- host => $host,
- port => '8125',
+ path_prefix => $path_prefix,
+ settings => {
+ enabled => 'true',
+ host => $host,
+ port => '8125',
},
}
diff --git a/modules/diamond/manifests/init.pp
b/modules/diamond/manifests/init.pp
index 415af04..c6cd14e 100644
--- a/modules/diamond/manifests/init.pp
+++ b/modules/diamond/manifests/init.pp
@@ -25,6 +25,10 @@
# See <https://github.com/BrightcoveOS/Diamond/wiki/Handlers>
# for a listing of configuration options.
#
+# [*path_prefix*]
+# The prefix to be used for metrics, used to namespace where
+# the metric came from.
+#
# === Examples
#
# A Graphite configuration for Diamond:
@@ -43,6 +47,7 @@
$settings = { host => 'localhost',
port => '8125',
},
+ $path_prefix = 'servers',
) {
package { [ 'python-diamond', 'python-configobj' ]:
ensure => present,
diff --git a/modules/diamond/templates/diamond.conf.erb
b/modules/diamond/templates/diamond.conf.erb
index 6f077cc..a85fe83 100644
--- a/modules/diamond/templates/diamond.conf.erb
+++ b/modules/diamond/templates/diamond.conf.erb
@@ -24,7 +24,7 @@
[collectors]
[[default]]
### Defaults options for all Collectors
-path_prefix = servers
+path_prefix = <%= @path_prefix %>
interval = <%= @interval %>
[loggers]
--
To view, visit https://gerrit.wikimedia.org/r/142228
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I275aa5d9a54191a1a52d3c44b81580265746acfb
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits