kennel 1.54.0 → 1.55.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/Readme.md +5 -1
- data/lib/kennel/tasks.rb +29 -0
- data/lib/kennel/version.rb +1 -1
- data/template/Readme.md +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: adc230a06e4f7f969147e0c299ba61c4536d5623de432cfe3e247bece944962a
|
|
4
|
+
data.tar.gz: ae6d3ebe5db8fe7a5f406cda15e0a85d8a19b8d5f991a9787a63376a01572e70
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3013cb61dd5c33a7dd1772b54645d62e7cf7e70bb5202f85950ab4f2a102e723d1583725200da513a54d66020af14ca9c57b63bc50e43b1a27a4d765d478c2fb
|
|
7
|
+
data.tar.gz: 28f5812c2795043927ca2161712d6e16f100cf6999e21fc64c3ee8e557d663c526a30dc9eef3069d2f229a699304d5f1029eb61176c3c51f4f825f5a45ac9e56
|
data/Readme.md
CHANGED
|
@@ -43,7 +43,7 @@ Keep datadog monitors/dashboards/etc in version control, avoid chaotic managemen
|
|
|
43
43
|
- `cp .env.example .env`
|
|
44
44
|
- open [Datadog API Settings](https://app.datadoghq.com/account/settings#api)
|
|
45
45
|
- copy any `API Key` and add it to `.env` as `DATADOG_API_KEY`
|
|
46
|
-
- find or create your personal "Application Key" and add it to `.env` as `DATADOG_APP_KEY=`
|
|
46
|
+
- find or create (check last page) your personal "Application Key" and add it to `.env` as `DATADOG_APP_KEY=`
|
|
47
47
|
- change the `DATADOG_SUBDOMAIN=app` in `.env` to your companies subdomain if you have one
|
|
48
48
|
-->
|
|
49
49
|
|
|
@@ -179,6 +179,10 @@ To link to existing monitors via their kennel_id
|
|
|
179
179
|
|
|
180
180
|
Run `rake kennel:alerts TAG=service:my-service` to see all un-muted alerts for a given datadog monitor tag.
|
|
181
181
|
|
|
182
|
+
### Validating mentions work
|
|
183
|
+
|
|
184
|
+
`rake kennel:validate_mentions` should run as part of CI
|
|
185
|
+
|
|
182
186
|
## Examples
|
|
183
187
|
|
|
184
188
|
### Reusable monitors/dashes/etc
|
data/lib/kennel/tasks.rb
CHANGED
|
@@ -12,6 +12,35 @@ namespace :kennel do
|
|
|
12
12
|
abort "Error during diffing" unless $CHILD_STATUS.success?
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
+
# ideally do this on every run, but it's slow (~1.5s) and brittle (might not find all + might find false-positives)
|
|
16
|
+
# https://help.datadoghq.com/hc/en-us/requests/254114 for automatic validation
|
|
17
|
+
desc "Verify that all used monitor mentions are valid"
|
|
18
|
+
task validate_mentions: :environment do
|
|
19
|
+
known = Kennel.send(:api)
|
|
20
|
+
.send(:request, :get, "/monitor/notifications")
|
|
21
|
+
.fetch(:handles)
|
|
22
|
+
.values
|
|
23
|
+
.flatten(1)
|
|
24
|
+
.map { |v| v.fetch(:value) }
|
|
25
|
+
|
|
26
|
+
known += ENV["KNOWN"].to_s.split(",")
|
|
27
|
+
|
|
28
|
+
bad = []
|
|
29
|
+
Dir["generated/**/*.json"].each do |f|
|
|
30
|
+
next unless message = JSON.parse(File.read(f))["message"]
|
|
31
|
+
used = message.scan(/\s(@[^\s{,'"]+)/).flatten(1)
|
|
32
|
+
.grep(/^@.*@|^@.*-/) # ignore @here etc handles ... datadog uses @foo@bar.com for emails and @foo-bar for integrations
|
|
33
|
+
(used - known).each { |v| bad << [f, v] }
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
if bad.any?
|
|
37
|
+
subdomain = ENV["DATADOG_SUBDOMAIN"]
|
|
38
|
+
url = (subdomain ? "https://zendesk.datadoghq.com" : "") + "/account/settings"
|
|
39
|
+
puts "Invalid mentions found, either ignore them by adding to `KNOWN` env var or add them via #{url}"
|
|
40
|
+
bad.each { |f, v| puts "Invalid mention #{v} in monitor message of #{f}" }
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
|
|
15
44
|
desc "generate local definitions"
|
|
16
45
|
task generate: :environment do
|
|
17
46
|
Kennel.generate
|
data/lib/kennel/version.rb
CHANGED
data/template/Readme.md
CHANGED
|
@@ -26,7 +26,7 @@ Keep datadog monitors/dashboards/etc in version control, avoid chaotic managemen
|
|
|
26
26
|
- `cp .env.example .env`
|
|
27
27
|
- open [Datadog API Settings](https://app.datadoghq.com/account/settings#api)
|
|
28
28
|
- copy any `API Key` and add it to `.env` as `DATADOG_API_KEY`
|
|
29
|
-
- find or create your personal "Application Key" and add it to `.env` as `DATADOG_APP_KEY=`
|
|
29
|
+
- find or create (check last page) your personal "Application Key" and add it to `.env` as `DATADOG_APP_KEY=`
|
|
30
30
|
- change the `DATADOG_SUBDOMAIN=app` in `.env` to your companies subdomain if you have one
|
|
31
31
|
|
|
32
32
|
### Adding a team
|
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.55.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: 2019-09-
|
|
11
|
+
date: 2019-09-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|