kennel 1.96.0 → 1.98.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kennel/models/monitor.rb +6 -1
- data/lib/kennel/models/project.rb +1 -1
- data/lib/kennel/version.rb +1 -1
- data/lib/kennel.rb +20 -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: c3a596895475dbc4577d69916cb277fecfb45add58faf0bf1b6e06d314f161c3
|
4
|
+
data.tar.gz: 1f618cd4aa9a8eed2ad38ec067876e21f6d3f148d541a96bcc9afaa79619a48d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4324951f97ef28dd0a5081231ea6aa676b81c3f405598dcf683d0ad5abc5dc346333d0e5029e84c5c742aa896b90aa1c11cd5891483f5c3bb5e67f0bec6ba6a8
|
7
|
+
data.tar.gz: 44e1c9af9868579db4497c2a9807a814bc6a78e49956c165d0b954fd4cbc0d6511ee046a43777354ef4f18c79ab70e5ae5061468ab5fd410aab5f55f1f219af2
|
@@ -31,7 +31,7 @@ module Kennel
|
|
31
31
|
settings(
|
32
32
|
:query, :name, :message, :escalation_message, :critical, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
|
33
33
|
:ok, :no_data_timeframe, :notify_no_data, :notify_audit, :tags, :critical_recovery, :warning_recovery, :require_full_window,
|
34
|
-
:threshold_windows, :new_host_delay, :priority
|
34
|
+
:threshold_windows, :new_host_delay, :new_group_delay, :priority
|
35
35
|
)
|
36
36
|
|
37
37
|
defaults(
|
@@ -45,6 +45,7 @@ module Kennel
|
|
45
45
|
no_data_timeframe: -> { 60 },
|
46
46
|
notify_audit: -> { MONITOR_OPTION_DEFAULTS.fetch(:notify_audit) },
|
47
47
|
new_host_delay: -> { MONITOR_OPTION_DEFAULTS.fetch(:new_host_delay) },
|
48
|
+
new_group_delay: -> { nil },
|
48
49
|
tags: -> { @project.tags },
|
49
50
|
timeout_h: -> { MONITOR_OPTION_DEFAULTS.fetch(:timeout_h) },
|
50
51
|
evaluation_delay: -> { MONITOR_OPTION_DEFAULTS.fetch(:evaluation_delay) },
|
@@ -70,6 +71,7 @@ module Kennel
|
|
70
71
|
notify_audit: notify_audit,
|
71
72
|
require_full_window: require_full_window,
|
72
73
|
new_host_delay: new_host_delay,
|
74
|
+
new_group_delay: new_group_delay,
|
73
75
|
include_tags: true,
|
74
76
|
escalation_message: Utils.presence(escalation_message.strip),
|
75
77
|
evaluation_delay: evaluation_delay,
|
@@ -106,6 +108,9 @@ module Kennel
|
|
106
108
|
options[:threshold_windows] = windows
|
107
109
|
end
|
108
110
|
|
111
|
+
# Datadog requires only either new_group_delay or new_host_delay, never both
|
112
|
+
options.delete(options[:new_group_delay] ? :new_host_delay : :new_group_delay)
|
113
|
+
|
109
114
|
validate_json(data) if validate
|
110
115
|
|
111
116
|
@as_json = data
|
data/lib/kennel/version.rb
CHANGED
data/lib/kennel.rb
CHANGED
@@ -138,10 +138,29 @@ module Kennel
|
|
138
138
|
Dir.exist?("parts") && loader.push_dir("parts")
|
139
139
|
loader.setup
|
140
140
|
|
141
|
-
# TODO: also do projects
|
141
|
+
# TODO: also do projects and update expected path too
|
142
142
|
["projects"].each do |folder|
|
143
143
|
Dir["#{folder}/**/*.rb"].sort.each { |f| require "./#{f}" }
|
144
144
|
end
|
145
|
+
rescue NameError => e
|
146
|
+
message = e.message
|
147
|
+
raise unless klass = message[/uninitialized constant (.*)/, 1]
|
148
|
+
|
149
|
+
# inverse of zeitwerk lib/zeitwerk/inflector.rb
|
150
|
+
path = klass.gsub("::", "/").gsub(/([a-z])([A-Z])/, "\\1_\\2").downcase + ".rb"
|
151
|
+
expected_path = (path.start_with?("teams/") ? path : "parts/#{path}")
|
152
|
+
|
153
|
+
# TODO: prefer to raise a new exception with the old backtrace attacked
|
154
|
+
e.define_singleton_method(:message) do
|
155
|
+
"\n" + <<~MSG.gsub(/^/, " ")
|
156
|
+
#{message}
|
157
|
+
Unable to load #{klass} from #{expected_path}
|
158
|
+
- Option 1: rename the constant or the file it lives in, to make them match
|
159
|
+
- Option 2: Use `require` or `require_relative` to load the constant
|
160
|
+
MSG
|
161
|
+
end
|
162
|
+
|
163
|
+
raise
|
145
164
|
end
|
146
165
|
end
|
147
166
|
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.
|
4
|
+
version: 1.98.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: 2021-10-
|
11
|
+
date: 2021-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|