kennel 2.2.0 → 2.3.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 +1 -1
- data/lib/kennel/models/slo.rb +27 -3
- 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: 9a72c925b5388b403514bc0be5c998595428bb41cdf41f97f91571a374716e14
|
4
|
+
data.tar.gz: 6bcd5f992433b13f088c633e1cd3468c1966cada8df12a689a07343a17e23d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 713d35626d870aeaaa1148a73b56b73b25e515dfa2523a97e2e423f5f63dc84461b4bcadbe0fc928698717f2928e99fca47ccb9c7a755057635b4b3b51025acc
|
7
|
+
data.tar.gz: 1d65adb907acd6c31f60c53be6dabf9d3849793f684d2d142403f7fa4b71439ec4544e72b325eb7d4181a50e81542b7704c1144ff2e7e79bb7d90716a9b0ce2e
|
@@ -6,7 +6,7 @@ module Kennel
|
|
6
6
|
|
7
7
|
OPTIONAL_SERVICE_CHECK_THRESHOLDS = [:ok, :warning].freeze
|
8
8
|
READONLY_ATTRIBUTES = superclass::READONLY_ATTRIBUTES + [
|
9
|
-
:multi, :matching_downtimes, :overall_state_modified, :overall_state, :restricted_roles
|
9
|
+
:multi, :matching_downtimes, :overall_state_modified, :overall_state, :restricted_roles, :draft_status
|
10
10
|
]
|
11
11
|
TRACKING_FIELD = :message
|
12
12
|
|
data/lib/kennel/models/slo.rb
CHANGED
@@ -14,10 +14,11 @@ module Kennel
|
|
14
14
|
query: nil,
|
15
15
|
groups: nil,
|
16
16
|
monitor_ids: [],
|
17
|
-
thresholds: []
|
17
|
+
thresholds: [],
|
18
|
+
primary: nil
|
18
19
|
}.freeze
|
19
20
|
|
20
|
-
settings :type, :description, :thresholds, :query, :tags, :monitor_ids, :monitor_tags, :name, :groups, :sli_specification
|
21
|
+
settings :type, :description, :thresholds, :query, :tags, :monitor_ids, :monitor_tags, :name, :groups, :sli_specification, :primary
|
21
22
|
|
22
23
|
defaults(
|
23
24
|
tags: -> { @project.tags },
|
@@ -25,7 +26,8 @@ module Kennel
|
|
25
26
|
description: -> { DEFAULTS.fetch(:description) },
|
26
27
|
monitor_ids: -> { DEFAULTS.fetch(:monitor_ids) },
|
27
28
|
thresholds: -> { DEFAULTS.fetch(:thresholds) },
|
28
|
-
groups: -> { DEFAULTS.fetch(:groups) }
|
29
|
+
groups: -> { DEFAULTS.fetch(:groups) },
|
30
|
+
primary: -> { DEFAULTS.fetch(:primary) }
|
29
31
|
)
|
30
32
|
|
31
33
|
def build_json
|
@@ -38,6 +40,23 @@ module Kennel
|
|
38
40
|
type: type
|
39
41
|
)
|
40
42
|
|
43
|
+
# Add timeframe and thresholds based on primary setting
|
44
|
+
if primary
|
45
|
+
data[:timeframe] = primary
|
46
|
+
|
47
|
+
threshold =
|
48
|
+
thresholds.detect { |t| t[:timeframe] == primary } ||
|
49
|
+
raise("unable to find threshold with timeframe #{primary}")
|
50
|
+
|
51
|
+
# Only add warning_threshold if it exists
|
52
|
+
if threshold[:warning]
|
53
|
+
data[:warning_threshold] = threshold[:warning]
|
54
|
+
end
|
55
|
+
|
56
|
+
# target is required
|
57
|
+
data[:target_threshold] = threshold[:target]
|
58
|
+
end
|
59
|
+
|
41
60
|
if type == "time_slice"
|
42
61
|
data[:sli_specification] = sli_specification
|
43
62
|
elsif (v = query)
|
@@ -97,6 +116,11 @@ module Kennel
|
|
97
116
|
invalid! :tags_are_upper_case, "Tags must not be upper case (bad tags: #{bad_tags.sort.inspect})"
|
98
117
|
end
|
99
118
|
|
119
|
+
# Check that thresholds are not empty
|
120
|
+
if !data[:thresholds] || data[:thresholds].empty?
|
121
|
+
invalid! :thresholds_empty, "SLO must have at least one threshold defined"
|
122
|
+
end
|
123
|
+
|
100
124
|
# prevent "Invalid payload: The target is incorrect: target must be a positive number between (0.0, 100.0)"
|
101
125
|
data[:thresholds]&.each do |threshold|
|
102
126
|
target = threshold.fetch(:target)
|
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.3.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-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|