kennel 1.33.0 → 1.33.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59fc72147f8fbc5e6814c42fb0eb98428de06c73ce61bfa6a5d5f51c34eb4125
4
- data.tar.gz: a42cc6a71dd4c623ea15f33ae1a6c443943c2a4634d1f693406ad8eba1757ca8
3
+ metadata.gz: 9cd29b9d1c95396dfb8baf030859d4ba7954f8895cbf252d6993a097057a78b6
4
+ data.tar.gz: 799443d45fc704d5fc1f6e3d77055e5a03765acb3d39bb1c0a3178b9dd8e0980
5
5
  SHA512:
6
- metadata.gz: f419ab0130605fee062d418722b53e2b65c90b192661f8922beb0f052ca356159e2a981e08c29e89f8eb579cbb5308a8e47f3214501a12d7109141762b3af6a9
7
- data.tar.gz: 2a0ac369b1dfaee83f8accaacce2c9e5a74da8d401d088ddc80988859a8ea3314d0998ff51e447b22c037c17e56f7f1e3414213140c44546d19d5f89d513abc7
6
+ metadata.gz: 7ce30c2ba6cd55df961aee2b5a1ba220580b86aecc2628f022681241e17a067133ad5705a4eb96cf9bb193c4d35a765e4e32b4788fc5038edda40bd8c15145b0
7
+ data.tar.gz: '08a052fecd266243e0bb58183b9eedf068912609629cfe3e40c588645a8a18dc16c2ba1a93d63c7fad638d598055e1176c6c99d9cc38eca096b9306ec79dcb2d'
@@ -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
- DEFAULT_ESCALATION_MESAGE = ["", nil].freeze
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: -> { DEFAULT_ESCALATION_MESAGE.first },
30
+ escalation_message: -> { DEFAULT_ESCALATION_MESSAGE.first },
31
31
  renotify_interval: -> { MONITOR_OPTION_DEFAULTS.fetch(:renotify_interval) },
32
32
  warning: -> { nil },
33
- ok: -> { nil },
34
- id: -> { nil },
35
- notify_no_data: -> { MONITOR_OPTION_DEFAULTS.fetch(: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: -> { MONITOR_OPTION_DEFAULTS.fetch(: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 DEFAULT_ESCALATION_MESAGE.include?(options[:escalation_message])
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.33.0"
3
+ VERSION = "1.33.1"
4
4
  end
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.0
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-04-25 00:00:00.000000000 Z
11
+ date: 2019-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday