kennel 1.141.0 → 1.143.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e82dacccbb0c14e8b8bedd9545b782b7405ca057a02724e89aa03f0a624fa3e4
4
- data.tar.gz: f70302b436c823c6cbcb765edbd56da1103b83fadf398c2c904372a8f73b36a7
3
+ metadata.gz: 9ab445d9dd8e549520dd2e46d36ccfe47034788d73cae66f8515fd4c0220379f
4
+ data.tar.gz: 87738e50cb08c6b1653d1553d130b2ff8cb780e1bc33bda8de7326e9a3c16b1b
5
5
  SHA512:
6
- metadata.gz: c34733bc887129a6bda1ebc96898ca46cec0346bb008af8020d4159d23db515de54d8db8813749ba7883c0417b0cecb243a530789a4a99d6aa146679996007aa
7
- data.tar.gz: a7821e5e67899aa71a068bfabbd895f7c69a369a187b7245510fc969a69d4354bad352cfb953f64293140c6282fa21d38f0e8695ab60d9186a19b30faeddd019
6
+ metadata.gz: 2b063a1e29ca81eaf2868359f7389fe92eb91a8d3cac7389bf8b21fc4cda640a0716b987366741bbcb90530f588e18214f5720ce757fb66e23b10b49bffdce9f
7
+ data.tar.gz: 450eaa3a67d63da9cf51f7ec96f69a29e746dc70fc7cf639905e21348db432f550ded7bd6c40b93e5a8a37b424856efd48802ec69dc500e033db75dbba047e2d
data/Readme.md CHANGED
@@ -28,6 +28,7 @@ end
28
28
  class Bar < Kennel::Models::Project
29
29
  defaults(
30
30
  team: -> { Teams::Foo.new }, # use mention and tags from the team
31
+ tags: -> { super() + ["project:bar"] }, # unique tag for all project components
31
32
  parts: -> {
32
33
  [
33
34
  Kennel::Models::Monitor.new(
@@ -26,7 +26,8 @@ module Kennel
26
26
  groupby_simple_monitor: false,
27
27
  variables: nil,
28
28
  on_missing_data: "default", # "default" is "evaluate as zero"
29
- notification_preset_name: nil
29
+ notification_preset_name: nil,
30
+ notify_by: nil
30
31
  }.freeze
31
32
  DEFAULT_ESCALATION_MESSAGE = ["", nil].freeze
32
33
  ALLOWED_PRIORITY_CLASSES = [NilClass, Integer].freeze
@@ -35,7 +36,7 @@ module Kennel
35
36
  :query, :name, :message, :escalation_message, :critical, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
36
37
  :ok, :no_data_timeframe, :notify_no_data, :notify_audit, :tags, :critical_recovery, :warning_recovery, :require_full_window,
37
38
  :threshold_windows, :scheduling_options, :new_host_delay, :new_group_delay, :priority, :variables, :on_missing_data,
38
- :notification_preset_name
39
+ :notification_preset_name, :notify_by
39
40
  )
40
41
 
41
42
  defaults(
@@ -59,7 +60,8 @@ module Kennel
59
60
  priority: -> { MONITOR_DEFAULTS.fetch(:priority) },
60
61
  variables: -> { MONITOR_OPTION_DEFAULTS.fetch(:variables) },
61
62
  on_missing_data: -> { MONITOR_OPTION_DEFAULTS.fetch(:on_missing_data) },
62
- notification_preset_name: -> { MONITOR_OPTION_DEFAULTS.fetch(:notification_preset_name) }
63
+ notification_preset_name: -> { MONITOR_OPTION_DEFAULTS.fetch(:notification_preset_name) },
64
+ notify_by: -> { MONITOR_OPTION_DEFAULTS.fetch(:notify_by) }
63
65
  )
64
66
 
65
67
  def build_json
@@ -109,6 +111,11 @@ module Kennel
109
111
  end
110
112
  end
111
113
 
114
+ # set without causing lots of nulls to be stored
115
+ if notify_by_value = notify_by
116
+ options[:notify_by] = notify_by_value
117
+ end
118
+
112
119
  # setting this via the api breaks the UI with
113
120
  # "The no_data_timeframe option is not allowed for log alert monitors"
114
121
  if data.fetch(:type) == "log alert"
@@ -4,7 +4,7 @@ module Kennel
4
4
  class Project < Base
5
5
  settings :team, :parts, :tags, :mention, :name, :kennel_id
6
6
  defaults(
7
- tags: -> { ["service:#{kennel_id}"] + team.tags },
7
+ tags: -> { team.tags },
8
8
  mention: -> { team.mention }
9
9
  )
10
10
 
@@ -92,6 +92,14 @@ module Kennel
92
92
  invalid! :tags_are_upper_case, "Tags must not be upper case (bad tags: #{bad_tags.sort.inspect})"
93
93
  end
94
94
 
95
+ # prevent "Invalid payload: The target is incorrect: target must be a positive number between (0.0, 100.0)"
96
+ data[:thresholds]&.each do |threshold|
97
+ target = threshold.fetch(:target)
98
+ if !target || target <= 0 || target >= 100
99
+ invalid! :threshold_target_invalid, "SLO threshold target must be > 0 and < 100"
100
+ end
101
+ end
102
+
95
103
  # warning must be <= critical
96
104
  if data[:thresholds].any? { |t| t[:warning] && t[:warning].to_f <= t[:critical].to_f }
97
105
  invalid! :warning_must_be_gt_critical, "Threshold warning must be greater-than critical value"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.141.0"
3
+ VERSION = "1.143.0"
4
4
  end
data/template/Readme.md CHANGED
@@ -28,6 +28,7 @@ end
28
28
  class Bar < Kennel::Models::Project
29
29
  defaults(
30
30
  team: -> { Teams::Foo.new }, # use mention and tags from the team
31
+ tags: -> { super() + ["project:bar"] }, # unique tag for all project components
31
32
  parts: -> {
32
33
  [
33
34
  Kennel::Models::Monitor.new(
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.141.0
4
+ version: 1.143.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: 2023-06-04 00:00:00.000000000 Z
11
+ date: 2023-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs