Gehel has submitted this change and it was merged.
Change subject: WDQS - fix icinga graphite check, metric has been renamed
......................................................................
WDQS - fix icinga graphite check, metric has been renamed
Metrics published by varnish have been renamed. Check needs to be updated.
Bug: T138546
Change-Id: I58108005bd2145a4b09d78c4605424d63d430f62
---
A modules/wdqs/.fixtures.yml
A modules/wdqs/.rspec
A modules/wdqs/Rakefile
M modules/wdqs/manifests/monitor/blazegraph.pp
A modules/wdqs/spec/classes/monitor_blazegraph_spec.rb
A modules/wdqs/spec/spec_helper.rb
6 files changed, 39 insertions(+), 1 deletion(-)
Approvals:
Gehel: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/wdqs/.fixtures.yml b/modules/wdqs/.fixtures.yml
new file mode 100644
index 0000000..97bb046
--- /dev/null
+++ b/modules/wdqs/.fixtures.yml
@@ -0,0 +1,9 @@
+fixtures:
+ symlinks:
+ wdqs: "#{source_dir}"
+ base: "../../../../base"
+ diamond: "../../../../diamond"
+ java: "../../../../java"
+ monitoring: "../../../../monitoring"
+ stdlib: "../../../../stdlib"
+ wmflib: "../../../../wmflib"
diff --git a/modules/wdqs/.rspec b/modules/wdqs/.rspec
new file mode 100644
index 0000000..f449dae
--- /dev/null
+++ b/modules/wdqs/.rspec
@@ -0,0 +1,2 @@
+--format doc
+--color
diff --git a/modules/wdqs/Rakefile b/modules/wdqs/Rakefile
new file mode 100644
index 0000000..cd3d379
--- /dev/null
+++ b/modules/wdqs/Rakefile
@@ -0,0 +1 @@
+require 'puppetlabs_spec_helper/rake_tasks'
diff --git a/modules/wdqs/manifests/monitor/blazegraph.pp
b/modules/wdqs/manifests/monitor/blazegraph.pp
index 9d59481..46acbeb 100644
--- a/modules/wdqs/manifests/monitor/blazegraph.pp
+++ b/modules/wdqs/manifests/monitor/blazegraph.pp
@@ -28,9 +28,10 @@
# raise a warning / critical alert if response time was over 2 minutes / 5
minutes
# more than 5% of the time during the last minute
+ $sanitized_hostname = regsubst($::fqdn, '\.', '_', 'G')
monitoring::graphite_threshold { 'wdqs-response-time':
description => 'Response time of WDQS',
- metric => "varnish.eqiad.backends.be_${::hostname}.GET.p99",
+ metric =>
"varnish.eqiad.backends.be_${sanitized_hostname}.GET.p99",
warning => 120000, # 2 minutes
critical => 300000, # 5 minutes
from => '10min',
diff --git a/modules/wdqs/spec/classes/monitor_blazegraph_spec.rb
b/modules/wdqs/spec/classes/monitor_blazegraph_spec.rb
new file mode 100644
index 0000000..4802340
--- /dev/null
+++ b/modules/wdqs/spec/classes/monitor_blazegraph_spec.rb
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe 'wdqs::monitor::blazegraph', :type => :class do
+
+ let(:facts) { { :lsbdistrelease => 'debian',
+ :lsbdistid => 'jessie',
+ :initsystem => 'systemd',
+ :fqdn => 'my.example.net',
+ } }
+
+
+ it { is_expected.to
contain_monitoring__graphite_threshold('wdqs-response-time')
+
.with_metric('varnish.eqiad.backends.be_my_example_net.GET.p99')
+ }
+
+end
diff --git a/modules/wdqs/spec/spec_helper.rb b/modules/wdqs/spec/spec_helper.rb
new file mode 100644
index 0000000..faa3366
--- /dev/null
+++ b/modules/wdqs/spec/spec_helper.rb
@@ -0,0 +1,9 @@
+require 'rspec-puppet'
+
+fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
+
+RSpec.configure do |c|
+ c.module_path = File.join(fixture_path, 'modules')
+ c.manifest_dir = File.join(fixture_path, 'manifests')
+ c.hiera_config = 'spec/fixtures/hiera/hiera.yaml'
+end
--
To view, visit https://gerrit.wikimedia.org/r/305020
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I58108005bd2145a4b09d78c4605424d63d430f62
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <[email protected]>
Gerrit-Reviewer: Ema <[email protected]>
Gerrit-Reviewer: Gehel <[email protected]>
Gerrit-Reviewer: Smalyshev <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits