kennel 1.53.1 → 1.54.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a39dd7d2e69ff27625b450457e54c3e57ff2e0950e10f239f6b14d28dc0826b
4
- data.tar.gz: 4effd0e4f0428a9e065e7b1e272115356aa352749a7dc11b1aaadf657a6cd81e
3
+ metadata.gz: ff469d7ae1bcb0d5dc6fb5d867c9dad761b5f2d07159ea147d99620544ec2580
4
+ data.tar.gz: e3322d92c13faee31f51ef53042cc0c768a0c85cfa0644d4fb2dafcf67f3e03a
5
5
  SHA512:
6
- metadata.gz: '0930a5440d6c4d7ced1f838d8c5489f8899064b4a7ba8b12dba2a3c7daea71eab51e797667ee8ede2e496200316fe1244f230ed95f9aa12bbcc1ceb5d361ecad'
7
- data.tar.gz: 56e685b04a6fb73cfb273d6af73fab31f8daf901266acd7934892fff2dc17113c99cf0f4b70e5d9cca9f4f208fce36bc98f6702b3d027fdb059fe058c40d78d0
6
+ metadata.gz: 18d054b93d83f78b98dabdd584fcec0a99759f32734c2808c32bb64d51042e3087ca36722c88aa61c24707999f7dbefc1aebdd16ce996c964ba3ca2595bec7df
7
+ data.tar.gz: d1876da783f71a72287ede64c20c9865622f409ec0857a483161cb1f2914c0e40c3a232165697bee8984ea515d34abfc0beb8eede8b42164d0b324c7805e1468
data/Readme.md CHANGED
@@ -49,13 +49,16 @@ Keep datadog monitors/dashboards/etc in version control, avoid chaotic managemen
49
49
 
50
50
  ### Adding a team
51
51
 
52
+ - `mention` is used for all team monitors via `super()`
53
+ - `renotify_interval` is used for all team monitors (defaults to `0` / off)
54
+ - `tags` is used for all team monitors/dashboards (defaults to `team:<team-name>`)
55
+
52
56
  ```Ruby
53
57
  # teams/my_team.rb
54
58
  module Teams
55
59
  class MyTeam < Kennel::Models::Team
56
60
  defaults(
57
- slack: -> { "my-alerts" }, # where to send alerts
58
- email: -> { "my-team@example.com" } # optional
61
+ mention: -> { "@slack-my-team" }
59
62
  )
60
63
  end
61
64
  end
@@ -158,12 +161,6 @@ end
158
161
  Some validations might be too strict for your usecase or just wrong, please [open an issue](https://github.com/grosser/kennel/issues) and
159
162
  to unblock use the `validate: -> { false }` option.
160
163
 
161
- ### Monitor re-notification
162
-
163
- Monitors inherit the re-notification setting from their `project.team`.
164
- Set this to for example `renotify_interval: -> { 120 }` minutes,
165
- to make alerts not get ignored by popping back up if they are still alerting.
166
-
167
164
  ### Linking with kennel_ids
168
165
 
169
166
  To link to existing monitors via their kennel_id
@@ -206,7 +203,7 @@ Reuse it in multiple projects.
206
203
  ```Ruby
207
204
  class Database < Kennel::Models::Project
208
205
  defaults(
209
- team: -> { Kennel::Models::Team.new(slack: -> { 'foo' }, kennel_id: -> { 'foo' }) },
206
+ team: -> { Kennel::Models::Team.new(mention: -> { '@slack-foo' }, kennel_id: -> { 'foo' }) },
210
207
  parts: -> { [Monitors::LoadTooHigh.new(self, critical: -> { 13 })] }
211
208
  )
212
209
  end
@@ -27,7 +27,7 @@ module Kennel
27
27
  )
28
28
 
29
29
  defaults(
30
- message: -> { "\n\n@slack-#{project.slack}" },
30
+ message: -> { "\n\n#{project.mention}" },
31
31
  escalation_message: -> { DEFAULT_ESCALATION_MESSAGE.first },
32
32
  renotify_interval: -> { project.team.renotify_interval },
33
33
  warning: -> { nil },
@@ -2,10 +2,10 @@
2
2
  module Kennel
3
3
  module Models
4
4
  class Project < Base
5
- settings :team, :parts, :tags, :slack
5
+ settings :team, :parts, :tags, :mention
6
6
  defaults(
7
7
  tags: -> { ["service:#{kennel_id}"] + team.tags },
8
- slack: -> { team.slack }
8
+ mention: -> { team.mention }
9
9
  )
10
10
 
11
11
  def self.file_location
@@ -2,20 +2,11 @@
2
2
  module Kennel
3
3
  module Models
4
4
  class Team < Base
5
- settings :slack, :email, :tags, :renotify_interval, :kennel_id
5
+ settings :mention, :tags, :renotify_interval, :kennel_id
6
6
  defaults(
7
7
  tags: -> { ["team:#{kennel_id.sub(/^teams_/, "")}"] },
8
8
  renotify_interval: -> { 0 }
9
9
  )
10
-
11
- def initialize(*)
12
- super
13
- invalid! "remove leading # from slack" if slack.to_s.start_with?("#")
14
- end
15
-
16
- def tracking_id
17
- kennel_id
18
- end
19
10
  end
20
11
  end
21
12
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.53.1"
3
+ VERSION = "1.54.0"
4
4
  end
@@ -31,13 +31,16 @@ Keep datadog monitors/dashboards/etc in version control, avoid chaotic managemen
31
31
 
32
32
  ### Adding a team
33
33
 
34
+ - `mention` is used for all team monitors via `super()`
35
+ - `renotify_interval` is used for all team monitors (defaults to `0` / off)
36
+ - `tags` is used for all team monitors/dashboards (defaults to `team:<team-name>`)
37
+
34
38
  ```Ruby
35
39
  # teams/my_team.rb
36
40
  module Teams
37
41
  class MyTeam < Kennel::Models::Team
38
42
  defaults(
39
- slack: -> { "my-alerts" }, # where to send alerts
40
- email: -> { "my-team@example.com" } # optional
43
+ mention: -> { "@slack-my-team" }
41
44
  )
42
45
  end
43
46
  end
@@ -140,12 +143,6 @@ end
140
143
  Some validations might be too strict for your usecase or just wrong, please [open an issue](https://github.com/grosser/kennel/issues) and
141
144
  to unblock use the `validate: -> { false }` option.
142
145
 
143
- ### Monitor re-notification
144
-
145
- Monitors inherit the re-notification setting from their `project.team`.
146
- Set this to for example `renotify_interval: -> { 120 }` minutes,
147
- to make alerts not get ignored by popping back up if they are still alerting.
148
-
149
146
  ### Linking with kennel_ids
150
147
 
151
148
  To link to existing monitors via their kennel_id
@@ -188,7 +185,7 @@ Reuse it in multiple projects.
188
185
  ```Ruby
189
186
  class Database < Kennel::Models::Project
190
187
  defaults(
191
- team: -> { Kennel::Models::Team.new(slack: -> { 'foo' }, kennel_id: -> { 'foo' }) },
188
+ team: -> { Kennel::Models::Team.new(mention: -> { '@slack-foo' }, kennel_id: -> { 'foo' }) },
192
189
  parts: -> { [Monitors::LoadTooHigh.new(self, critical: -> { 13 })] }
193
190
  )
194
191
  end
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.53.1
4
+ version: 1.54.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-12 00:00:00.000000000 Z
11
+ date: 2019-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday