kennel 1.37.0 → 1.37.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kennel/models/monitor.rb +19 -18
- data/lib/kennel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a96e8b2291bb1c3d4c1ab62a60fc77615a6b950edde80a44a33163b98cfc52c
|
4
|
+
data.tar.gz: e95efb468b68784b0411f9bb773c6ed733219ba74980e5afe9a724c7902193d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 534e2b021f1e88000e08a514339e02540686031aa7b91d6624f195d5f6adc28f88939c39894ce9276187619c728ecc3d1775638c03eb06f9011c8392db8050df
|
7
|
+
data.tar.gz: 4ec6f62c45ab64bb111cee7302cd2f6c08ea5fdfcb24204af0ecbde0fe9485bb554fb89b609bfb5f779b028c9189bd4c85638d487f77c071e803a0d7084ab444
|
@@ -69,31 +69,32 @@ module Kennel
|
|
69
69
|
escalation_message: Utils.presence(escalation_message.strip),
|
70
70
|
evaluation_delay: evaluation_delay,
|
71
71
|
locked: false, # setting this to true prevents any edit and breaks updates when using replace workflow
|
72
|
-
renotify_interval: renotify_interval || 0
|
73
|
-
thresholds: {}
|
72
|
+
renotify_interval: renotify_interval || 0
|
74
73
|
}
|
75
74
|
}
|
76
75
|
|
77
76
|
options = data[:options]
|
78
|
-
|
79
|
-
|
77
|
+
if data.fetch(:type) != "composite"
|
78
|
+
thresholds = (options[:thresholds] = { critical: critical })
|
80
79
|
|
81
|
-
|
80
|
+
data[:id] = id if id
|
82
81
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
82
|
+
# warning, ok, critical_recovery, and warning_recovery are optional
|
83
|
+
[:warning, :ok, :critical_recovery, :warning_recovery].each do |key|
|
84
|
+
if value = send(key)
|
85
|
+
thresholds[key] = value
|
86
|
+
end
|
87
87
|
end
|
88
|
-
end
|
89
88
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
89
|
+
thresholds[:critical] = critical unless
|
90
|
+
case data.fetch(:type)
|
91
|
+
when "service check"
|
92
|
+
# avoid diff for default values of 1
|
93
|
+
OPTIONAL_SERVICE_CHECK_THRESHOLDS.each { |t| thresholds[t] ||= 1 }
|
94
|
+
when "query alert"
|
95
|
+
# metric and query values are stored as float by datadog
|
96
|
+
thresholds.each { |k, v| thresholds[k] = Float(v) }
|
97
|
+
end
|
97
98
|
end
|
98
99
|
|
99
100
|
if windows = threshold_windows
|
@@ -166,7 +167,7 @@ module Kennel
|
|
166
167
|
end
|
167
168
|
|
168
169
|
# verify query includes critical value
|
169
|
-
if query_value = data.fetch(:query)[/\s*[<>]
|
170
|
+
if query_value = data.fetch(:query)[/\s*[<>]=?\s*(\d+(\.\d+)?)\s*$/, 1]
|
170
171
|
if Float(query_value) != Float(data.dig(:options, :thresholds, :critical))
|
171
172
|
invalid! "critical and value used in query must match"
|
172
173
|
end
|
data/lib/kennel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kennel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.37.
|
4
|
+
version: 1.37.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|