kennel 1.70.0 → 1.72.2
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/Readme.md +1 -1
- data/lib/kennel/github_reporter.rb +1 -0
- data/lib/kennel/models/dashboard.rb +13 -1
- data/lib/kennel/models/monitor.rb +1 -1
- data/lib/kennel/syncer.rb +1 -1
- data/lib/kennel/tasks.rb +2 -4
- data/lib/kennel/utils.rb +1 -0
- 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: 1aa2b3776b0249a4013afd8ef6b078f4a783b9df6461193a83ed25b4b4721ce7
|
4
|
+
data.tar.gz: 4b60552e08b14ce5e124dde66329d74983abf5306b9aa4e4e0ae66414fc42a16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04bdf0ba96f2c3911215d9f611b397a763c1890f7404bff62f050605b017944bb7e820ec2ba13697b7e29a7e007ddeb70324dfba30be6b896bf05f4f4ed1218c
|
7
|
+
data.tar.gz: '08cb0890b0235e1af195a465e9026f8465c5fed46ab1828e78c27f69002720c8a7c0c3ec58c0b6821da12d5ef57013c58a1cf7798435f30067daa84cf6f4c8f8'
|
data/Readme.md
CHANGED
@@ -23,7 +23,7 @@ Manage datadog monitors/dashboards/slos as code
|
|
23
23
|
```
|
24
24
|
- add a basic projects and teams so others can copy-paste to get started
|
25
25
|
- setup travis build for your repo
|
26
|
-
- uncomment `.travis.yml` section for automated
|
26
|
+
- uncomment `.travis.yml` section for automated PR planing and datadog updates on merge
|
27
27
|
- follow `Setup` in your repos Readme.md
|
28
28
|
<!-- NOT IN -->
|
29
29
|
|
@@ -16,12 +16,17 @@ module Kennel
|
|
16
16
|
TIMESERIES_DEFAULTS = { show_legend: false, legend_size: "0" }.freeze
|
17
17
|
SUPPORTED_DEFINITION_OPTIONS = [:events, :markers, :precision].freeze
|
18
18
|
|
19
|
-
|
19
|
+
DEFAULTS = {
|
20
|
+
template_variable_presets: nil
|
21
|
+
}.freeze
|
22
|
+
|
23
|
+
settings :title, :description, :definitions, :widgets, :layout_type, :template_variable_presets
|
20
24
|
|
21
25
|
defaults(
|
22
26
|
description: -> { "" },
|
23
27
|
definitions: -> { [] },
|
24
28
|
widgets: -> { [] },
|
29
|
+
template_variable_presets: -> { nil },
|
25
30
|
id: -> { nil }
|
26
31
|
)
|
27
32
|
|
@@ -33,6 +38,8 @@ module Kennel
|
|
33
38
|
def normalize(expected, actual)
|
34
39
|
super
|
35
40
|
|
41
|
+
ignore_default(expected, actual, DEFAULTS)
|
42
|
+
|
36
43
|
widgets_pairs(expected, actual).each do |pair|
|
37
44
|
# conditional_formats ordering is randomly changed by datadog, compare a stable ordering
|
38
45
|
pair.each do |widgets|
|
@@ -102,6 +109,7 @@ module Kennel
|
|
102
109
|
title: "#{title}#{LOCK}",
|
103
110
|
description: description,
|
104
111
|
template_variables: render_template_variables,
|
112
|
+
template_variable_presets: template_variable_presets,
|
105
113
|
widgets: all_widgets
|
106
114
|
}
|
107
115
|
|
@@ -167,6 +175,10 @@ module Kennel
|
|
167
175
|
super
|
168
176
|
|
169
177
|
validate_template_variables data, :widgets
|
178
|
+
|
179
|
+
# Avoid diff from datadog presets sorting.
|
180
|
+
presets = data[:template_variable_presets]
|
181
|
+
invalid! "template_variable_presets must be sorted by name" if presets && presets != presets.sort_by { |p| p[:name] }
|
170
182
|
end
|
171
183
|
|
172
184
|
def render_definitions
|
@@ -202,7 +202,7 @@ module Kennel
|
|
202
202
|
# verify is_match uses available variables
|
203
203
|
message = data.fetch(:message)
|
204
204
|
used = message.scan(/{{\s*#is_match\s*"([a-zA-Z\d_.-]+).name"/).flatten.uniq
|
205
|
-
allowed = data.fetch(:query)[/by\s*{([^\}]+)}/, 1].to_s.split(/\s*,\s*/)
|
205
|
+
allowed = data.fetch(:query)[/by\s*[\({]([^\}\)]+)[}\)]/, 1].to_s.gsub(/["']/, "").split(/\s*,\s*/)
|
206
206
|
unsupported = used - allowed
|
207
207
|
if unsupported.any?
|
208
208
|
invalid! "is_match used with #{unsupported}, but metric is only grouped by #{allowed}"
|
data/lib/kennel/syncer.rb
CHANGED
@@ -228,7 +228,7 @@ module Kennel
|
|
228
228
|
json = e.as_json
|
229
229
|
field = tracking_field(json)
|
230
230
|
value = json[field]
|
231
|
-
json[field] = value.dup.sub!(/\n
|
231
|
+
json[field] = value.dup.sub!(/\n?-- Managed by kennel .*/, "") || raise("did not find tracking id in #{value}")
|
232
232
|
end
|
233
233
|
|
234
234
|
def tracking_id(a)
|
data/lib/kennel/tasks.rb
CHANGED
@@ -68,7 +68,7 @@ namespace :kennel do
|
|
68
68
|
Kennel.update
|
69
69
|
end
|
70
70
|
|
71
|
-
desc "update if this is a push to the default branch, otherwise plan
|
71
|
+
desc "update if this is a push to the default branch, otherwise plan"
|
72
72
|
task :travis do
|
73
73
|
on_default_branch = (ENV["TRAVIS_BRANCH"] == (ENV["DEFAULT_BRANCH"] || "master"))
|
74
74
|
is_push = (ENV["TRAVIS_PULL_REQUEST"] == "false")
|
@@ -79,9 +79,7 @@ namespace :kennel do
|
|
79
79
|
"kennel:plan" # show plan in travis logs
|
80
80
|
end
|
81
81
|
|
82
|
-
|
83
|
-
Rake::Task[task_name].invoke
|
84
|
-
end
|
82
|
+
Rake::Task[task_name].invoke
|
85
83
|
end
|
86
84
|
|
87
85
|
desc "show unmuted alerts filtered by TAG, for example TAG=team:foo"
|
data/lib/kennel/utils.rb
CHANGED
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: 1.
|
4
|
+
version: 1.72.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|