kennel 1.33.0 → 1.33.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kennel/importer.rb +1 -0
- data/lib/kennel/models/monitor.rb +9 -9
- 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: 9cd29b9d1c95396dfb8baf030859d4ba7954f8895cbf252d6993a097057a78b6
|
4
|
+
data.tar.gz: 799443d45fc704d5fc1f6e3d77055e5a03765acb3d39bb1c0a3178b9dd8e0980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ce30c2ba6cd55df961aee2b5a1ba220580b86aecc2628f022681241e17a067133ad5705a4eb96cf9bb193c4d35a765e4e32b4788fc5038edda40bd8c15145b0
|
7
|
+
data.tar.gz: '08a052fecd266243e0bb58183b9eedf068912609629cfe3e40c588645a8a18dc16c2ba1a93d63c7fad638d598055e1176c6c99d9cc38eca096b9306ec79dcb2d'
|
data/lib/kennel/importer.rb
CHANGED
@@ -36,6 +36,7 @@ module Kennel
|
|
36
36
|
# flatten monitor options so they are all on the base
|
37
37
|
data.merge!(data.delete(:options))
|
38
38
|
data.merge!(data.delete(:thresholds) || {})
|
39
|
+
[:notify_no_data, :notify_audit].each { |k| data.delete(k) if data[k] } # monitor uses true by default
|
39
40
|
data = data.slice(*model.instance_methods)
|
40
41
|
|
41
42
|
# make query use critical method if it matches
|
@@ -9,15 +9,15 @@ module Kennel
|
|
9
9
|
QUERY_INTERVALS = ["1m", "5m", "10m", "15m", "30m", "1h", "2h", "4h", "1d"].freeze
|
10
10
|
OPTIONAL_SERVICE_CHECK_THRESHOLDS = [:ok, :warning].freeze
|
11
11
|
READONLY_ATTRIBUTES = Base::READONLY_ATTRIBUTES + [:multi]
|
12
|
+
|
13
|
+
# defaults that datadog uses when options are not sent, so safe to leave out if our values match their defaults
|
12
14
|
MONITOR_OPTION_DEFAULTS = {
|
13
15
|
evaluation_delay: nil,
|
14
16
|
timeout_h: 0,
|
15
17
|
renotify_interval: 120,
|
16
|
-
notify_audit: true,
|
17
|
-
notify_no_data: true,
|
18
18
|
no_data_timeframe: nil # this works out ok since if notify_no_data is on, it would never be nil
|
19
19
|
}.freeze
|
20
|
-
|
20
|
+
DEFAULT_ESCALATION_MESSAGE = ["", nil].freeze
|
21
21
|
|
22
22
|
settings(
|
23
23
|
:query, :name, :message, :escalation_message, :critical, :kennel_id, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
|
@@ -27,14 +27,14 @@ module Kennel
|
|
27
27
|
|
28
28
|
defaults(
|
29
29
|
message: -> { "\n\n@slack-#{project.slack}" },
|
30
|
-
escalation_message: -> {
|
30
|
+
escalation_message: -> { DEFAULT_ESCALATION_MESSAGE.first },
|
31
31
|
renotify_interval: -> { MONITOR_OPTION_DEFAULTS.fetch(:renotify_interval) },
|
32
32
|
warning: -> { nil },
|
33
|
-
ok: ->
|
34
|
-
id: ->
|
35
|
-
notify_no_data: -> {
|
33
|
+
ok: -> { nil },
|
34
|
+
id: -> { nil },
|
35
|
+
notify_no_data: -> { true },
|
36
36
|
no_data_timeframe: -> { notify_no_data ? 60 : nil },
|
37
|
-
notify_audit: -> {
|
37
|
+
notify_audit: -> { true },
|
38
38
|
tags: -> { @project.tags },
|
39
39
|
timeout_h: -> { MONITOR_OPTION_DEFAULTS.fetch(:timeout_h) },
|
40
40
|
evaluation_delay: -> { MONITOR_OPTION_DEFAULTS.fetch(:evaluation_delay) },
|
@@ -142,7 +142,7 @@ module Kennel
|
|
142
142
|
|
143
143
|
expected_options = expected[:options] || {}
|
144
144
|
ignore_default(expected_options, options, MONITOR_OPTION_DEFAULTS)
|
145
|
-
if
|
145
|
+
if DEFAULT_ESCALATION_MESSAGE.include?(options[:escalation_message])
|
146
146
|
options.delete(:escalation_message)
|
147
147
|
expected_options.delete(:escalation_message)
|
148
148
|
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.33.
|
4
|
+
version: 1.33.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-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|