kennel 2.12.1 → 2.12.2

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: 820cb0c4f746cbbafc79598199ba6c4e6d8d762e8505b432af9bf3c27de3ca74
4
- data.tar.gz: d1c54c6ecd55bfd00e432b9258dfb6c6f16fa15c9181f862adca7bd885a0c4c2
3
+ metadata.gz: e5fd8e04a85ff166271cdf705344e6d0a55f8bc313ef761260673061ec475da3
4
+ data.tar.gz: a9c6b0f6f8adcf33bd3cd9cd02e1d437332bcd79d2705134aea43139b0ea179b
5
5
  SHA512:
6
- metadata.gz: e001bd09798e846ddabdd5dae8b47aa9174cdd19be8f4af77b52d2eb877ed2cb6043a2022c229f23e0c232700104c930902ec89ecb2db416e77de2e29074ef0b
7
- data.tar.gz: bd930e26de4108718b8228056b726a5aeb41407ddef31175879b8126b250639e027b2d1e05cbabe47d5e94399aa8a8c609dddc3bb0163eeb920051d436186b1d
6
+ metadata.gz: df94a5253b481df52ae71ab3c8cff4d6e8f2608d310d86de481090ef5397f99593aeadc99a73e262d227de0ab67ec0f3d6dff74db5f485ceefd67d7d20bf1706
7
+ data.tar.gz: 6f5f299ecf2381df854102ee2b501b8521746b68055414ec898e5b0cb3aefbc256b9ba1f47af44c5364f8e4e5c3eb462333459b9d52dcf5f5c062a541afa06f0
@@ -33,6 +33,7 @@ module Kennel
33
33
  DEFAULT_ESCALATION_MESSAGE = ["", nil].freeze
34
34
  ALLOWED_PRIORITY_CLASSES = [NilClass, Integer].freeze
35
35
  SKIP_NOTIFY_NO_DATA_TYPES = ["event alert", "event-v2 alert", "log alert"].freeze
36
+ ON_MISSING_DATA_UNSUPPORTED_TYPES = ["composite", "datadog-usage alert"].freeze
36
37
  MINUTES_PER_UNIT = {
37
38
  "m" => 1,
38
39
  "h" => 60,
@@ -155,14 +156,19 @@ module Kennel
155
156
  action ||= "default" if type == "event-v2 alert"
156
157
 
157
158
  # TODO: mark setting action && !notify.nil? at all as invalid
158
- if action && timeframe
159
- invalid! :invalid_no_data_config, "set either no_data_timeframe or on_missing_data"
160
- end
161
- if type == "composite" && action
162
- invalid! :invalid_no_data_config, "cannot use on_missing_data with composite monitor"
163
- end
164
- if action == "resolve" && timeout_h.to_i != 0
165
- invalid! :invalid_no_data_config, "timeout_h cannot be set and non-zero when on_missing_data is `resolve`"
159
+ if action
160
+ if ON_MISSING_DATA_UNSUPPORTED_TYPES.include?(type)
161
+ invalid! :invalid_no_data_config, "cannot use on_missing_data with #{type} monitor"
162
+ end
163
+ if timeframe
164
+ invalid! :invalid_no_data_config, "set either no_data_timeframe or on_missing_data"
165
+ end
166
+ if action != "default" && type == "query alert" && query.to_s.include?("default_zero(") # is allowed for log alert for example
167
+ invalid! :invalid_no_data_config, "set on_missing_data to `default` when using default_zero"
168
+ end
169
+ if action == "resolve" && timeout_h.to_i != 0
170
+ invalid! :invalid_no_data_config, "timeout_h cannot be set and non-zero when on_missing_data is `resolve`"
171
+ end
166
172
  end
167
173
 
168
174
  # on_missing_data cannot be used with notify_no_data + no_data_timeframe
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "2.12.1"
3
+ VERSION = "2.12.2"
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: 2.12.1
4
+ version: 2.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-01-12 00:00:00.000000000 Z
11
+ date: 2026-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs