kennel 1.142.0 → 1.143.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +0 -2
- data/lib/kennel/api.rb +1 -1
- data/lib/kennel/models/monitor.rb +10 -3
- data/lib/kennel/version.rb +1 -1
- data/template/Readme.md +0 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 352765b10b857aa4e8d8a4fa27de59a8be5800208bcebbf76b78b6321fff48cd
|
4
|
+
data.tar.gz: 83428c482b87caca3dacc21645c493cfc8d6002e881ca792e4cb75281c51249d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79fd182dc92c9f9dd4fbdf04000c16cd0e01a613935c552780de02ff0a512a31d87cfe3a0c3e4551d3d6245ce3ea5859b293a0547dcbd66a826e6fc8e2afbbeb
|
7
|
+
data.tar.gz: b3ea7f3c6f1c883aa64da4a5a56615caaffd5179ea45fac5aa17584d44017ae454318e28fd783c323fbe363372ded94b58f7e6ea7098aa0e58f0706ba15a26e7
|
data/Readme.md
CHANGED
@@ -198,7 +198,6 @@ end
|
|
198
198
|
|
199
199
|
### Updating an existing monitor
|
200
200
|
- use [datadog monitor UI](https://app.datadoghq.com/monitors/manage) to find a monitor
|
201
|
-
- get the `id` from the url
|
202
201
|
- run `URL='https://app.datadoghq.com/monitors/123' bundle exec rake kennel:import` and copy the output
|
203
202
|
- import task also works with SLO alerts, e.g. `URL='https://app.datadoghq.com/slo/edit/123abc456def123/alerts/789' bundle exec rake kennel:import`
|
204
203
|
- find or create a project in `projects/`
|
@@ -249,7 +248,6 @@ Remove the code that created the resource. The next update will delete it (see a
|
|
249
248
|
|
250
249
|
### Updating an existing dashboard
|
251
250
|
- go to [datadog dashboard UI](https://app.datadoghq.com/dashboard/lists) and click on _New Dashboard_ to find a dashboard
|
252
|
-
- get the `id` from the url
|
253
251
|
- run `URL='https://app.datadoghq.com/dashboard/bet-foo-bar' bundle exec rake kennel:import` and copy the output
|
254
252
|
- find or create a project in `projects/`
|
255
253
|
- add a dashboard to `parts: [` list, for example:
|
data/lib/kennel/api.rb
CHANGED
@@ -129,7 +129,7 @@ module Kennel
|
|
129
129
|
if !response.success? && (response.status != 404 || !ignore_404)
|
130
130
|
message = +"Error #{response.status} during #{method.upcase} #{path}\n"
|
131
131
|
message << "request:\n#{JSON.pretty_generate(body)}\nresponse:\n" if body
|
132
|
-
message << response.body
|
132
|
+
message << response.body.encode(message.encoding, invalid: :replace, undef: :replace)
|
133
133
|
raise message
|
134
134
|
end
|
135
135
|
|
@@ -26,7 +26,8 @@ module Kennel
|
|
26
26
|
groupby_simple_monitor: false,
|
27
27
|
variables: nil,
|
28
28
|
on_missing_data: "default", # "default" is "evaluate as zero"
|
29
|
-
notification_preset_name: nil
|
29
|
+
notification_preset_name: nil,
|
30
|
+
notify_by: nil
|
30
31
|
}.freeze
|
31
32
|
DEFAULT_ESCALATION_MESSAGE = ["", nil].freeze
|
32
33
|
ALLOWED_PRIORITY_CLASSES = [NilClass, Integer].freeze
|
@@ -35,7 +36,7 @@ module Kennel
|
|
35
36
|
:query, :name, :message, :escalation_message, :critical, :type, :renotify_interval, :warning, :timeout_h, :evaluation_delay,
|
36
37
|
:ok, :no_data_timeframe, :notify_no_data, :notify_audit, :tags, :critical_recovery, :warning_recovery, :require_full_window,
|
37
38
|
:threshold_windows, :scheduling_options, :new_host_delay, :new_group_delay, :priority, :variables, :on_missing_data,
|
38
|
-
:notification_preset_name
|
39
|
+
:notification_preset_name, :notify_by
|
39
40
|
)
|
40
41
|
|
41
42
|
defaults(
|
@@ -59,7 +60,8 @@ module Kennel
|
|
59
60
|
priority: -> { MONITOR_DEFAULTS.fetch(:priority) },
|
60
61
|
variables: -> { MONITOR_OPTION_DEFAULTS.fetch(:variables) },
|
61
62
|
on_missing_data: -> { MONITOR_OPTION_DEFAULTS.fetch(:on_missing_data) },
|
62
|
-
notification_preset_name: -> { MONITOR_OPTION_DEFAULTS.fetch(:notification_preset_name) }
|
63
|
+
notification_preset_name: -> { MONITOR_OPTION_DEFAULTS.fetch(:notification_preset_name) },
|
64
|
+
notify_by: -> { MONITOR_OPTION_DEFAULTS.fetch(:notify_by) }
|
63
65
|
)
|
64
66
|
|
65
67
|
def build_json
|
@@ -109,6 +111,11 @@ module Kennel
|
|
109
111
|
end
|
110
112
|
end
|
111
113
|
|
114
|
+
# set without causing lots of nulls to be stored
|
115
|
+
if notify_by_value = notify_by
|
116
|
+
options[:notify_by] = notify_by_value
|
117
|
+
end
|
118
|
+
|
112
119
|
# setting this via the api breaks the UI with
|
113
120
|
# "The no_data_timeframe option is not allowed for log alert monitors"
|
114
121
|
if data.fetch(:type) == "log alert"
|
data/lib/kennel/version.rb
CHANGED
data/template/Readme.md
CHANGED
@@ -180,7 +180,6 @@ end
|
|
180
180
|
|
181
181
|
### Updating an existing monitor
|
182
182
|
- use [datadog monitor UI](https://app.datadoghq.com/monitors/manage) to find a monitor
|
183
|
-
- get the `id` from the url
|
184
183
|
- run `URL='https://app.datadoghq.com/monitors/123' bundle exec rake kennel:import` and copy the output
|
185
184
|
- import task also works with SLO alerts, e.g. `URL='https://app.datadoghq.com/slo/edit/123abc456def123/alerts/789' bundle exec rake kennel:import`
|
186
185
|
- find or create a project in `projects/`
|
@@ -231,7 +230,6 @@ Remove the code that created the resource. The next update will delete it (see a
|
|
231
230
|
|
232
231
|
### Updating an existing dashboard
|
233
232
|
- go to [datadog dashboard UI](https://app.datadoghq.com/dashboard/lists) and click on _New Dashboard_ to find a dashboard
|
234
|
-
- get the `id` from the url
|
235
233
|
- run `URL='https://app.datadoghq.com/dashboard/bet-foo-bar' bundle exec rake kennel:import` and copy the output
|
236
234
|
- find or create a project in `projects/`
|
237
235
|
- add a dashboard to `parts: [` list, for example:
|
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.143.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|
@@ -135,14 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 3.
|
138
|
+
version: 3.2.0
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.
|
145
|
+
rubygems_version: 3.4.10
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Keep datadog monitors/dashboards/etc in version control, avoid chaotic management
|