kennel 1.25.2 → 1.25.3
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 -11
- data/lib/kennel/models/monitor.rb +8 -1
- data/lib/kennel/version.rb +1 -1
- data/template/Readme.md +5 -11
- 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: b8cda419aef3ad94847135e75aad4de557482a610fe63882b73b1a6da1bda141
|
|
4
|
+
data.tar.gz: 37b3682d146e69030a780fb51dfd00575315fed952c4c9cd46d9359176cfd4f7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9dbac39ce6f2a38e06502395b2659c7ae38d6eee2b53f8b5f85f472ddd339b0b03b7ee4be9c616af82fbf678956e8727a44a1fe29037378554ef691b6d69d8e
|
|
7
|
+
data.tar.gz: 4b253b0948f18500673b5fb258e5702b28242249f776fd1d5cc245771eaa8a19edb12499268dc035c8537541e1e816f47df7d63025f5d8ddcdb6bbb402732e6d
|
data/Readme.md
CHANGED
|
@@ -62,7 +62,8 @@ end
|
|
|
62
62
|
|
|
63
63
|
### Adding a new monitor
|
|
64
64
|
- use [datadog monitor UI](https://app.datadoghq.com/monitors#create/metric) to create a monitor
|
|
65
|
-
- get the `id` from the url
|
|
65
|
+
- get the `id` from the url
|
|
66
|
+
- `RESOURCE=monitor ID=12345 bundle exec rake kennel:import`
|
|
66
67
|
- see below
|
|
67
68
|
|
|
68
69
|
### Updating an existing monitor
|
|
@@ -77,7 +78,7 @@ end
|
|
|
77
78
|
[
|
|
78
79
|
Kennel::Models::Monitor.new(
|
|
79
80
|
self,
|
|
80
|
-
id: -> { 123456 }, # id from datadog url
|
|
81
|
+
id: -> { 123456 }, # id from datadog url, not necessary when creating a new monitor
|
|
81
82
|
type: -> { "query alert" },
|
|
82
83
|
kennel_id: -> { "load-too-high" }, # make up a unique name
|
|
83
84
|
name: -> { "Foobar Load too high" }, # nice descriptive name that will show up in alerts and emails
|
|
@@ -106,6 +107,7 @@ end
|
|
|
106
107
|
### Adding a new dashboard
|
|
107
108
|
- go to [datadog dashboard UI](https://app.datadoghq.com/dash/list) and click on _New Dashboard_ to create a dashboard
|
|
108
109
|
- get the `id` from the url
|
|
110
|
+
- `RESOURCE=dash ID=12345 bundle exec rake kennel:import`
|
|
109
111
|
- see below
|
|
110
112
|
|
|
111
113
|
### Updating an existing dashboard
|
|
@@ -119,7 +121,7 @@ end
|
|
|
119
121
|
[
|
|
120
122
|
Kennel::Models::Dash.new(
|
|
121
123
|
self,
|
|
122
|
-
id: -> { 123457 }, # id from datadog url
|
|
124
|
+
id: -> { 123457 }, # id from datadog url, not needed when creating a new dashboard
|
|
123
125
|
title: -> { "My Dashboard" },
|
|
124
126
|
description: -> { "Overview of foobar" },
|
|
125
127
|
template_variables: -> { ["environment"] }, # see https://docs.datadoghq.com/api/?lang=ruby#timeboards
|
|
@@ -146,14 +148,6 @@ end
|
|
|
146
148
|
end
|
|
147
149
|
```
|
|
148
150
|
|
|
149
|
-
### Importing an existing resources
|
|
150
|
-
|
|
151
|
-
```Bash
|
|
152
|
-
RESOURCE=dash ID=12345 rake kennel:import
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Put returned definition into a project of your choice.
|
|
156
|
-
|
|
157
151
|
### Adding a new screenboard
|
|
158
152
|
- similar to `dash.rb`
|
|
159
153
|
- add to `parts:` list
|
|
@@ -9,6 +9,11 @@ module Kennel
|
|
|
9
9
|
QUERY_INTERVALS = ["1m", "5m", "10m", "15m", "30m", "1h", "2h", "4h", "1d"].freeze
|
|
10
10
|
OPTIONAL_SERVICE_CHECK_THRESHOLDS = [:ok, :warning].freeze
|
|
11
11
|
NON_MULTI_TYPES = ["query alert", "log alert", "composite"].freeze # NOTE: event alerts don't seem to return their multi setting
|
|
12
|
+
MONITOR_DEFAULTS = {
|
|
13
|
+
escalation_message: nil,
|
|
14
|
+
evaluation_delay: nil,
|
|
15
|
+
no_data_timeframe: nil
|
|
16
|
+
}.freeze
|
|
12
17
|
|
|
13
18
|
settings(
|
|
14
19
|
:query, :name, :message, :escalation_message, :critical, :kennel_id, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
|
|
@@ -107,7 +112,7 @@ module Kennel
|
|
|
107
112
|
Utils.path_to_url "/monitors##{id}/edit"
|
|
108
113
|
end
|
|
109
114
|
|
|
110
|
-
def self.normalize(
|
|
115
|
+
def self.normalize(expected, actual)
|
|
111
116
|
super
|
|
112
117
|
options = actual.fetch(:options)
|
|
113
118
|
options.delete(:silenced) # we do not manage silenced, so ignore it when diffing
|
|
@@ -133,6 +138,8 @@ module Kennel
|
|
|
133
138
|
|
|
134
139
|
# nil / "" / 0 are not returned from the api when set via the UI
|
|
135
140
|
options[:evaluation_delay] ||= nil
|
|
141
|
+
|
|
142
|
+
ignore_default(expected[:options] || {}, options, MONITOR_DEFAULTS)
|
|
136
143
|
end
|
|
137
144
|
|
|
138
145
|
private
|
data/lib/kennel/version.rb
CHANGED
data/template/Readme.md
CHANGED
|
@@ -44,7 +44,8 @@ end
|
|
|
44
44
|
|
|
45
45
|
### Adding a new monitor
|
|
46
46
|
- use [datadog monitor UI](https://app.datadoghq.com/monitors#create/metric) to create a monitor
|
|
47
|
-
- get the `id` from the url
|
|
47
|
+
- get the `id` from the url
|
|
48
|
+
- `RESOURCE=monitor ID=12345 bundle exec rake kennel:import`
|
|
48
49
|
- see below
|
|
49
50
|
|
|
50
51
|
### Updating an existing monitor
|
|
@@ -59,7 +60,7 @@ end
|
|
|
59
60
|
[
|
|
60
61
|
Kennel::Models::Monitor.new(
|
|
61
62
|
self,
|
|
62
|
-
id: -> { 123456 }, # id from datadog url
|
|
63
|
+
id: -> { 123456 }, # id from datadog url, not necessary when creating a new monitor
|
|
63
64
|
type: -> { "query alert" },
|
|
64
65
|
kennel_id: -> { "load-too-high" }, # make up a unique name
|
|
65
66
|
name: -> { "Foobar Load too high" }, # nice descriptive name that will show up in alerts and emails
|
|
@@ -88,6 +89,7 @@ end
|
|
|
88
89
|
### Adding a new dashboard
|
|
89
90
|
- go to [datadog dashboard UI](https://app.datadoghq.com/dash/list) and click on _New Dashboard_ to create a dashboard
|
|
90
91
|
- get the `id` from the url
|
|
92
|
+
- `RESOURCE=dash ID=12345 bundle exec rake kennel:import`
|
|
91
93
|
- see below
|
|
92
94
|
|
|
93
95
|
### Updating an existing dashboard
|
|
@@ -101,7 +103,7 @@ end
|
|
|
101
103
|
[
|
|
102
104
|
Kennel::Models::Dash.new(
|
|
103
105
|
self,
|
|
104
|
-
id: -> { 123457 }, # id from datadog url
|
|
106
|
+
id: -> { 123457 }, # id from datadog url, not needed when creating a new dashboard
|
|
105
107
|
title: -> { "My Dashboard" },
|
|
106
108
|
description: -> { "Overview of foobar" },
|
|
107
109
|
template_variables: -> { ["environment"] }, # see https://docs.datadoghq.com/api/?lang=ruby#timeboards
|
|
@@ -128,14 +130,6 @@ end
|
|
|
128
130
|
end
|
|
129
131
|
```
|
|
130
132
|
|
|
131
|
-
### Importing an existing resources
|
|
132
|
-
|
|
133
|
-
```Bash
|
|
134
|
-
RESOURCE=dash ID=12345 rake kennel:import
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Put returned definition into a project of your choice.
|
|
138
|
-
|
|
139
133
|
### Adding a new screenboard
|
|
140
134
|
- similar to `dash.rb`
|
|
141
135
|
- add to `parts:` list
|
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.25.
|
|
4
|
+
version: 1.25.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Grosser
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-12-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|