kennel 2.0.0 → 2.1.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/models/monitor.rb +8 -2
- data/lib/kennel/syncer/resolver.rb +5 -1
- data/lib/kennel/syncer.rb +2 -2
- 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: bbd8b93533d2675d85ec94149740499bcb3e5d04ac8099693360ee4985779907
|
4
|
+
data.tar.gz: 5edc6138f0077d2841e9fa59bb699bb389b750e5d52f3e3ff9784aae2aea156b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e2a89bc5f30b8c615bda2fedd21719045989f3f18ba43e342032661846d69a92f0d3e02cdc4427a184bddb4b9ae11fc299b5a9854846f60c4d049d160e3dfd0
|
7
|
+
data.tar.gz: 6d6413324ed9dfc6a2b045fd938f60d49946a42b96e7eeb7478b888150477f15448adee040a6208d5ed9aa8b41facdb1210efba16048074be1beec2a07f2efe2
|
@@ -22,6 +22,7 @@ module Kennel
|
|
22
22
|
renotify_interval: 0,
|
23
23
|
notify_audit: false,
|
24
24
|
no_data_timeframe: nil, # this works out ok since if notify_no_data is on, it would never be nil
|
25
|
+
group_retention_duration: nil,
|
25
26
|
groupby_simple_monitor: false,
|
26
27
|
variables: nil,
|
27
28
|
on_missing_data: "default", # "default" is "evaluate as zero"
|
@@ -35,8 +36,8 @@ module Kennel
|
|
35
36
|
settings(
|
36
37
|
:query, :name, :message, :escalation_message, :critical, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
|
37
38
|
:ok, :no_data_timeframe, :notify_no_data, :notify_audit, :tags, :critical_recovery, :warning_recovery, :require_full_window,
|
38
|
-
:threshold_windows, :scheduling_options, :new_host_delay, :new_group_delay, :
|
39
|
-
:notification_preset_name, :notify_by
|
39
|
+
:threshold_windows, :scheduling_options, :new_host_delay, :new_group_delay, :group_retention_duration, :priority,
|
40
|
+
:variables, :on_missing_data, :notification_preset_name, :notify_by
|
40
41
|
)
|
41
42
|
|
42
43
|
defaults(
|
@@ -52,6 +53,7 @@ module Kennel
|
|
52
53
|
notify_audit: -> { MONITOR_OPTION_DEFAULTS.fetch(:notify_audit) },
|
53
54
|
new_host_delay: -> { MONITOR_OPTION_DEFAULTS.fetch(:new_host_delay) },
|
54
55
|
new_group_delay: -> { nil },
|
56
|
+
group_retention_duration: -> { MONITOR_OPTION_DEFAULTS.fetch(:group_retention_duration) },
|
55
57
|
tags: -> { @project.tags },
|
56
58
|
timeout_h: -> { MONITOR_OPTION_DEFAULTS.fetch(:timeout_h) },
|
57
59
|
evaluation_delay: -> { MONITOR_OPTION_DEFAULTS.fetch(:evaluation_delay) },
|
@@ -136,6 +138,10 @@ module Kennel
|
|
136
138
|
# Datadog requires only either new_group_delay or new_host_delay, never both
|
137
139
|
options.delete(options[:new_group_delay] ? :new_host_delay : :new_group_delay)
|
138
140
|
|
141
|
+
if (duration = group_retention_duration)
|
142
|
+
options[:group_retention_duration] = duration
|
143
|
+
end
|
144
|
+
|
139
145
|
# Add in statuses where we would re notify on. Possible values: alert, no data, warn
|
140
146
|
if options[:renotify_interval] != 0
|
141
147
|
statuses = ["alert"]
|
@@ -48,9 +48,13 @@ module Kennel
|
|
48
48
|
list = list.dup
|
49
49
|
loop do
|
50
50
|
return if list.empty?
|
51
|
+
size = list.size
|
52
|
+
resolved = 0
|
51
53
|
list.reject! do |item|
|
52
54
|
if resolved?(item.expected)
|
53
|
-
|
55
|
+
last_item = (resolved + 1 == size)
|
56
|
+
yield item, last_item
|
57
|
+
resolved += 1
|
54
58
|
true
|
55
59
|
else
|
56
60
|
false
|
data/lib/kennel/syncer.rb
CHANGED
@@ -50,7 +50,7 @@ module Kennel
|
|
50
50
|
# because datadog validates that update+create of slo alerts match an existing timeframe
|
51
51
|
planned_actions.sort_by! { |item| item.expected.is_a?(Models::Slo) ? 0 : 1 }
|
52
52
|
|
53
|
-
resolver.each_resolved(planned_actions) do |item|
|
53
|
+
resolver.each_resolved(planned_actions) do |item, last_item|
|
54
54
|
if item.is_a?(Types::PlannedCreate)
|
55
55
|
message = "#{item.api_resource} #{item.tracking_id}"
|
56
56
|
Kennel.out.puts "Creating #{message}"
|
@@ -67,7 +67,7 @@ module Kennel
|
|
67
67
|
Kennel.out.puts "#{LINE_UP}Updated #{message}"
|
68
68
|
end
|
69
69
|
rescue StandardError
|
70
|
-
raise
|
70
|
+
raise if !Console.tty? || last_item
|
71
71
|
Kennel.err.puts $!.message
|
72
72
|
Kennel.err.puts $!.backtrace
|
73
73
|
raise unless Console.ask?("Continue with error ?")
|
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.1.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: 2025-
|
11
|
+
date: 2025-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|