kennel 1.75.1 → 1.76.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 +2 -1
- data/lib/kennel/importer.rb +9 -2
- data/lib/kennel/models/monitor.rb +3 -2
- data/lib/kennel/tasks.rb +11 -3
- data/lib/kennel/version.rb +1 -1
- data/template/Readme.md +2 -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: a109923efbaef4c2beb6ccf136ea593a43c06b92e45add81d7f07fcbd594779e
|
4
|
+
data.tar.gz: 44a1b83e6b2e708eb3f91d98c19e90aeb663f4a6cf0926f296faae2b2570064d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfb64f23ff80eca8a8034a2bbb7c2cb08e867ec356879b85b487b093cea1109a5fca0da431355fdd597693a4da2b6a42231b99deb23398d562dfd74650448b64
|
7
|
+
data.tar.gz: e3034cd7215d04fd2020e6d12e27c1831f8e4167c3befaf24cd6725c81e9caafc71c7b14a8813d55fdd8439ae7ec4a4efa09a58a9c2d1c4616d302c77ed87a20
|
data/Readme.md
CHANGED
@@ -257,7 +257,8 @@ Run `rake kennel:alerts TAG=service:my-service` to see all un-muted alerts for a
|
|
257
257
|
|
258
258
|
### Grepping through all of datadog
|
259
259
|
|
260
|
-
`
|
260
|
+
`rake kennel:dump`
|
261
|
+
focus on a single type: `TYPE=monitors`
|
261
262
|
|
262
263
|
### Find all monitors with No-Data
|
263
264
|
|
data/lib/kennel/importer.rb
CHANGED
@@ -42,10 +42,15 @@ module Kennel
|
|
42
42
|
|
43
43
|
case resource
|
44
44
|
when "monitor"
|
45
|
-
# flatten monitor options so they are all on the base
|
45
|
+
# flatten monitor options so they are all on the base which is how Monitor builds them
|
46
46
|
data.merge!(data.delete(:options))
|
47
47
|
data.merge!(data.delete(:thresholds) || {})
|
48
|
-
|
48
|
+
|
49
|
+
# clean up values that are the default
|
50
|
+
data.delete(:notify_no_data) if data[:notify_no_data] # Monitor uses true by default
|
51
|
+
data.delete(:notify_audit) unless data[:notify_audit] # Monitor uses false by default
|
52
|
+
|
53
|
+
# keep all values that are settable
|
49
54
|
data = data.slice(*model.instance_methods)
|
50
55
|
|
51
56
|
# make query use critical method if it matches
|
@@ -61,6 +66,8 @@ module Kennel
|
|
61
66
|
widgets&.each { |widget| dry_up_query!(widget) }
|
62
67
|
end
|
63
68
|
|
69
|
+
data.delete(:tags) if data[:tags] == [] # do not create super + [] call
|
70
|
+
|
64
71
|
# simplify template_variables to array of string when possible
|
65
72
|
if vars = data[:template_variables]
|
66
73
|
vars.map! { |v| v[:default] == "*" && v[:prefix] == v[:name] ? v[:name] : v }
|
@@ -18,6 +18,7 @@ module Kennel
|
|
18
18
|
new_host_delay: 300,
|
19
19
|
timeout_h: 0,
|
20
20
|
renotify_interval: 0,
|
21
|
+
notify_audit: false,
|
21
22
|
no_data_timeframe: nil, # this works out ok since if notify_no_data is on, it would never be nil
|
22
23
|
groupby_simple_monitor: false
|
23
24
|
}.freeze
|
@@ -36,9 +37,9 @@ module Kennel
|
|
36
37
|
warning: -> { nil },
|
37
38
|
ok: -> { nil },
|
38
39
|
id: -> { nil },
|
39
|
-
notify_no_data: -> { true },
|
40
|
+
notify_no_data: -> { true }, # datadog sets this to false by default, but true is the safer
|
40
41
|
no_data_timeframe: -> { 60 },
|
41
|
-
notify_audit: -> {
|
42
|
+
notify_audit: -> { MONITOR_OPTION_DEFAULTS.fetch(:notify_audit) },
|
42
43
|
new_host_delay: -> { MONITOR_OPTION_DEFAULTS.fetch(:new_host_delay) },
|
43
44
|
tags: -> { @project.tags },
|
44
45
|
timeout_h: -> { MONITOR_OPTION_DEFAULTS.fetch(:timeout_h) },
|
data/lib/kennel/tasks.rb
CHANGED
@@ -124,10 +124,18 @@ namespace :kennel do
|
|
124
124
|
Kennel.out.puts Kennel::Importer.new(Kennel.send(:api)).import(resource, id)
|
125
125
|
end
|
126
126
|
|
127
|
-
desc "Dump ALL of datadog config as raw json ... useful for grep/search TYPE=slo|monitor|dashboard"
|
127
|
+
desc "Dump ALL of datadog config as raw json ... useful for grep/search [TYPE=slo|monitor|dashboard]"
|
128
128
|
task dump: :environment do
|
129
|
-
|
130
|
-
|
129
|
+
resources =
|
130
|
+
if type = ENV["TYPE"]
|
131
|
+
[type]
|
132
|
+
else
|
133
|
+
Kennel::Models::Record.subclasses.map(&:api_resource)
|
134
|
+
end
|
135
|
+
resources.each do |resource|
|
136
|
+
Kennel.send(:api).list(resource).each do |r|
|
137
|
+
Kennel.out.puts JSON.pretty_generate(r)
|
138
|
+
end
|
131
139
|
end
|
132
140
|
end
|
133
141
|
|
data/lib/kennel/version.rb
CHANGED
data/template/Readme.md
CHANGED
@@ -239,7 +239,8 @@ Run `rake kennel:alerts TAG=service:my-service` to see all un-muted alerts for a
|
|
239
239
|
|
240
240
|
### Grepping through all of datadog
|
241
241
|
|
242
|
-
`
|
242
|
+
`rake kennel:dump`
|
243
|
+
focus on a single type: `TYPE=monitors`
|
243
244
|
|
244
245
|
### Find all monitors with No-Data
|
245
246
|
|
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.76.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: 2020-
|
11
|
+
date: 2020-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|