kennel 1.150.0 → 1.152.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +1 -0
- data/lib/kennel/importer.rb +9 -1
- data/lib/kennel/models/dashboard.rb +8 -0
- data/lib/kennel/models/slo.rb +8 -3
- data/lib/kennel/version.rb +1 -1
- data/template/Readme.md +1 -0
- 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: c18c40b3d259f4b19d396f956937f54a50d064e79f9c069204aede3d5e743f1b
|
4
|
+
data.tar.gz: dfabe30c42756650cda60fc0d90268f672284841e8dfff76db1d08f9e956f3b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: adb30eab75ab3e4cc7a5f86ac0f7c465441c07e53fe19534f339e67ac56d14719e40e598260bb6e2a123183badd1bd38aabe8eab12d8fcfe03b89cc57f244930
|
7
|
+
data.tar.gz: 69b9d6e6bbedf62d9325d58fee3e9aa76b1f79693a9b36d7232cd6771327c1803ea26e91e09bb23078b710c32f2f13fd9b1974d71fc13539fa33e5071aaa73ba
|
data/Readme.md
CHANGED
@@ -342,6 +342,7 @@ so they can be created in a single update and can be re-created if any of them i
|
|
342
342
|
|Dashboard|uptime|`monitor: {id: "foo:bar"}`|
|
343
343
|
|Dashboard|alert_graph|`alert_id: "foo:bar"`|
|
344
344
|
|Dashboard|slo|`slo_id: "foo:bar"`|
|
345
|
+
|Dashboard|timeseries|`queries: [{ data_source: "slo", slo_id: "foo:bar" }]`|
|
345
346
|
|Monitor|composite|`query: -> { "%{foo:bar} && %{foo:baz}" }`|
|
346
347
|
|Monitor|slo alert|`query: -> { "error_budget(\"%{foo:bar}\").over(\"7d\") > 123.0" }`|
|
347
348
|
|Slo|monitor|`monitor_ids: -> ["foo:bar"]`|
|
data/lib/kennel/importer.rb
CHANGED
@@ -2,8 +2,15 @@
|
|
2
2
|
|
3
3
|
module Kennel
|
4
4
|
class Importer
|
5
|
+
# title will have the lock symbol we need to remove when re-importing
|
5
6
|
TITLES = [:name, :title].freeze
|
6
|
-
|
7
|
+
|
8
|
+
# bring important fields to the top
|
9
|
+
SORT_ORDER = [
|
10
|
+
*TITLES, :id, :kennel_id, :type, :tags, :query, :sli_specification,
|
11
|
+
*Models::Record.subclasses.flat_map { |k| k::TRACKING_FIELDS },
|
12
|
+
:template_variables
|
13
|
+
].freeze
|
7
14
|
|
8
15
|
def initialize(api)
|
9
16
|
@api = api
|
@@ -19,6 +26,7 @@ module Kennel
|
|
19
26
|
raise(ArgumentError, "#{resource} is not supported")
|
20
27
|
|
21
28
|
data = @api.show(model.api_resource, id)
|
29
|
+
|
22
30
|
id = data.fetch(:id) # keep native value
|
23
31
|
model.normalize({}, data) # removes id
|
24
32
|
data[:id] = id
|
@@ -195,6 +195,14 @@ module Kennel
|
|
195
195
|
if id = definition[:slo_id]
|
196
196
|
definition[:slo_id] = resolve(id, :slo, id_map, **args) || id
|
197
197
|
end
|
198
|
+
when "timeseries"
|
199
|
+
definition[:requests]&.each do |request|
|
200
|
+
request[:queries]&.each do |query|
|
201
|
+
if query[:data_source] == "slo" && (slo_id = query[:slo_id])
|
202
|
+
query[:slo_id] = resolve(slo_id, :slo, id_map, **args) || slo_id
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
198
206
|
end
|
199
207
|
end
|
200
208
|
end
|
data/lib/kennel/models/slo.rb
CHANGED
@@ -4,7 +4,10 @@ module Kennel
|
|
4
4
|
class Slo < Record
|
5
5
|
include TagsValidation
|
6
6
|
|
7
|
-
READONLY_ATTRIBUTES =
|
7
|
+
READONLY_ATTRIBUTES = [
|
8
|
+
*superclass::READONLY_ATTRIBUTES,
|
9
|
+
:type_id, :monitor_tags, :target_threshold, :timeframe, :warning_threshold
|
10
|
+
].freeze
|
8
11
|
TRACKING_FIELD = :description
|
9
12
|
DEFAULTS = {
|
10
13
|
description: nil,
|
@@ -14,7 +17,7 @@ module Kennel
|
|
14
17
|
thresholds: []
|
15
18
|
}.freeze
|
16
19
|
|
17
|
-
settings :type, :description, :thresholds, :query, :tags, :monitor_ids, :monitor_tags, :name, :groups
|
20
|
+
settings :type, :description, :thresholds, :query, :tags, :monitor_ids, :monitor_tags, :name, :groups, :sli_specification
|
18
21
|
|
19
22
|
defaults(
|
20
23
|
tags: -> { @project.tags },
|
@@ -35,7 +38,9 @@ module Kennel
|
|
35
38
|
type: type
|
36
39
|
)
|
37
40
|
|
38
|
-
if
|
41
|
+
if type == "time_slice"
|
42
|
+
data[:sli_specification] = sli_specification
|
43
|
+
elsif v = query
|
39
44
|
data[:query] = v
|
40
45
|
end
|
41
46
|
|
data/lib/kennel/version.rb
CHANGED
data/template/Readme.md
CHANGED
@@ -324,6 +324,7 @@ so they can be created in a single update and can be re-created if any of them i
|
|
324
324
|
|Dashboard|uptime|`monitor: {id: "foo:bar"}`|
|
325
325
|
|Dashboard|alert_graph|`alert_id: "foo:bar"`|
|
326
326
|
|Dashboard|slo|`slo_id: "foo:bar"`|
|
327
|
+
|Dashboard|timeseries|`queries: [{ data_source: "slo", slo_id: "foo:bar" }]`|
|
327
328
|
|Monitor|composite|`query: -> { "%{foo:bar} && %{foo:baz}" }`|
|
328
329
|
|Monitor|slo alert|`query: -> { "error_budget(\"%{foo:bar}\").over(\"7d\") > 123.0" }`|
|
329
330
|
|Slo|monitor|`monitor_ids: -> ["foo:bar"]`|
|
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.152.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: 2024-
|
11
|
+
date: 2024-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|