kennel 0.2.11 → 0.3.0

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
  SHA1:
3
- metadata.gz: 4b7a11207e37f7d021e4f0e1831f513f44a2e061
4
- data.tar.gz: 693d9a286d4cb9f08ec4969ac0d27e33d67f987c
3
+ metadata.gz: 1d04df6004bdc388dbb4ceed94c05e013cfee900
4
+ data.tar.gz: 160234c0a44f19c710fd498ffcd1a457a0526b07
5
5
  SHA512:
6
- metadata.gz: 8c4a2e1748d677fef1bc27a267fb8f93a8c83fa83fd0357e26ae467564ccf30f459d5b07549b41f8380f2f3137dc5958ce82a61b4eca03853f36b3329c51b5b8
7
- data.tar.gz: 39f4b547ec20fc4c1159d2a405485a8ad0dff52952fc6eb7075bf9d58a99803d6420057b57490d5730edac47a14e79d8c7a666f68cc9dd1f878c8e4a1cfe5d7e
6
+ metadata.gz: e728b8ed2c4e9d2e3a4acc1c524c473cc12daadda8864f29ab48e6a8df1a1a67db2ab38c62c1e05b1312ebd20af230b6e3f2dffb17294917f6029d0019a329ad
7
+ data.tar.gz: dc95e835d9fff8aecbcf15042449ab84d921e970f55cbe36875d4055180cb78f7d78b1f5537d6a9c5c45308f6c293d7d6e8de3972097ce9ef682f8f7578db216
@@ -10,7 +10,7 @@ module Kennel
10
10
 
11
11
  settings(
12
12
  :query, :name, :message, :escalation_message, :critical, :kennel_id, :type, :renotify_interval, :warning,
13
- :ok, :id, :no_data_timeframe, :notify_no_data, :tags, :multi
13
+ :ok, :id, :no_data_timeframe, :notify_no_data, :tags, :multi, :critical_recovery, :warning_recovery
14
14
  )
15
15
  defaults(
16
16
  message: -> { "" },
@@ -23,7 +23,9 @@ module Kennel
23
23
  notify_no_data: -> { true },
24
24
  no_data_timeframe: -> { notify_no_data ? 60 : nil },
25
25
  tags: -> { [] },
26
- multi: -> { type != "query alert" || query.include?(" by ") }
26
+ multi: -> { type != "query alert" || query.include?(" by ") },
27
+ critical_recovery: -> { nil },
28
+ warning_recovery: -> { nil }
27
29
  )
28
30
 
29
31
  attr_reader :project
@@ -76,9 +78,12 @@ module Kennel
76
78
 
77
79
  data[:id] = id if id
78
80
 
79
- # warning and ok are optional
80
- thresholds[:warning] = warning if warning
81
- thresholds[:ok] = ok if ok
81
+ # warning, ok, critical_recovery, and warning_recovery are optional
82
+ [:warning, :ok, :critical_recovery, :warning_recovery].each do |key|
83
+ if value = send(key)
84
+ thresholds[key] = value
85
+ end
86
+ end
82
87
 
83
88
  # metric and query values are stored as float by datadog
84
89
  if data.fetch(:type) == "query alert"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "0.2.11"
3
+ VERSION = "0.3.0"
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: 0.2.11
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2018-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday