kennel 2.12.1 → 2.13.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 +4 -4
- data/lib/kennel/api.rb +5 -2
- data/lib/kennel/models/monitor.rb +14 -8
- data/lib/kennel/models/slo.rb +1 -1
- data/lib/kennel/projects_provider.rb +1 -1
- data/lib/kennel/subclass_tracking.rb +8 -0
- 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: 4ad7fc83d72816d45830ddf3c46d266d8a6baba0c163d16c85ae69dcdc5058bd
|
|
4
|
+
data.tar.gz: 2ab1212ba1a378cdfe758e0821251661a977adbea8f57f88156e38131d9fac81
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf31a0b076d4d961c04bfb670d5969d71419eeb97388bcdfcd9410192efad429cb2b2de04cd02ad1798534abe61f8c9f3c65689a7f34b27d2c6d8b7dee150bcd
|
|
7
|
+
data.tar.gz: cedb8aaa36eaaa1f67cc137419891048d56b1fb1b103a51e8743cf2eecdd10d10d8bdcf609435def8fad3b8d92e8cd3c53a03f7dacd4d6996796e9f79db73b15
|
data/lib/kennel/api.rb
CHANGED
|
@@ -109,7 +109,9 @@ module Kennel
|
|
|
109
109
|
|
|
110
110
|
def request(method, path, body: nil, params: {}, ignore_404: false)
|
|
111
111
|
path = "#{path}?#{Faraday::FlatParamsEncoder.encode(params)}" if params.any?
|
|
112
|
-
|
|
112
|
+
cached = (ENV["FORCE_GET_CACHE"] && method == :get)
|
|
113
|
+
|
|
114
|
+
with_cache cached, path do
|
|
113
115
|
response = nil
|
|
114
116
|
tries = 2
|
|
115
117
|
|
|
@@ -128,7 +130,8 @@ module Kennel
|
|
|
128
130
|
redo
|
|
129
131
|
end
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
last_try = (i == tries - 1)
|
|
134
|
+
break if last_try || ![:get, :put].include?(method) || response.status < 500
|
|
132
135
|
Kennel.err.puts "Retrying on server error #{response.status} for #{path}"
|
|
133
136
|
end
|
|
134
137
|
|
|
@@ -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
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
data/lib/kennel/models/slo.rb
CHANGED
|
@@ -73,7 +73,7 @@ module Kennel
|
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
def self.parse_url(url)
|
|
76
|
-
url[/[?&]slo_id=([a-z\d]{10,})/, 1] || url[/\/slo\/([a-z\d]{10,})
|
|
76
|
+
url[/[?&]slo_id=([a-z\d]{10,})/, 1] || url[/\/slo\/([a-z\d]{10,})(:?\/edit)?(\?|$)/, 1]
|
|
77
77
|
end
|
|
78
78
|
|
|
79
79
|
def resolve_linked_tracking_ids!(id_map, **args)
|
|
@@ -9,8 +9,16 @@ module Kennel
|
|
|
9
9
|
@subclasses ||= []
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
def abstract_class?
|
|
13
|
+
!!@abstract_class
|
|
14
|
+
end
|
|
15
|
+
|
|
12
16
|
private
|
|
13
17
|
|
|
18
|
+
def abstract_class!
|
|
19
|
+
@abstract_class = true # not inherited by children
|
|
20
|
+
end
|
|
21
|
+
|
|
14
22
|
def inherited(child)
|
|
15
23
|
super
|
|
16
24
|
subclasses << child
|
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: 2.
|
|
4
|
+
version: 2.13.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: 2026-01-
|
|
11
|
+
date: 2026-01-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: diff-lcs
|