chef-handler-datadog-demo 0.1.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.
Files changed (51) hide show
  1. checksums.yaml +7 -0
  2. data/.env.example +2 -0
  3. data/.gitignore +63 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +44 -0
  6. data/.travis.yml +25 -0
  7. data/Appraisals +16 -0
  8. data/CHANGELOG.md +102 -0
  9. data/CONTRIBUTING.md +23 -0
  10. data/Gemfile +14 -0
  11. data/Guardfile +37 -0
  12. data/LICENSE.txt +20 -0
  13. data/README.md +40 -0
  14. data/Rakefile +23 -0
  15. data/chef-handler-datadog-demo.gemspec +33 -0
  16. data/gemfiles/chef_10.14.4.gemfile +17 -0
  17. data/gemfiles/chef_10.gemfile +16 -0
  18. data/gemfiles/chef_11.gemfile +16 -0
  19. data/gemfiles/chef_12.gemfile +16 -0
  20. data/lib/chef/handler/datadog_demo.rb +123 -0
  21. data/lib/chef/handler/datadog_demo_chef_events.rb +174 -0
  22. data/lib/chef/handler/datadog_demo_chef_metrics.rb +62 -0
  23. data/lib/chef/handler/datadog_demo_chef_tags.rb +140 -0
  24. data/lib/chef_handler_datadog_demo.rb +6 -0
  25. data/spec/datadog_spec.rb +495 -0
  26. data/spec/spec_helper.rb +47 -0
  27. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_alert_handles_when_specified.yml +513 -0
  28. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_event_title_correctly.yml +258 -0
  29. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_priority_correctly.yml +258 -0
  30. data/spec/support/cassettes/Chef_Handler_Datadog/handles_no_application_key/fails_when_no_application_key_is_provided.yml +143 -0
  31. data/spec/support/cassettes/Chef_Handler_Datadog/hostname/uses_the_node_name_when_no_config_specified.yml +250 -0
  32. data/spec/support/cassettes/Chef_Handler_Datadog/hostname/uses_the_specified_hostname_when_provided.yml +250 -0
  33. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/does_not_use_the_instance_id_when_config_specified_to_false.yml +250 -0
  34. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/uses_the_instance_id_when_config_is_specified.yml +250 -0
  35. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/uses_the_instance_id_when_no_config_specified.yml +250 -0
  36. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/posts_an_event.yml +250 -0
  37. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/sets_priority_correctly.yml +250 -0
  38. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_metrics/reports_metrics.yml +250 -0
  39. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/sets_tags/puts_the_tags_for_the_current_node.yml +250 -0
  40. data/spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/does_not_emit_metrics.yml +82 -0
  41. data/spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_a_failure_metric.yml +134 -0
  42. data/spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/posts_an_event.yml +134 -0
  43. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_tag_prefix.yml +251 -0
  44. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_tag_prefix.yml +251 -0
  45. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/sets_the_role_and_env_and_tags.yml +251 -0
  46. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_unspecified/sets_role_env_and_nothing_else.yml +251 -0
  47. data/spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_not_specified/does_not_retry_after_a_failed_submission.yml +241 -0
  48. data/spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/retries_no_more_than_twice.yml +331 -0
  49. data/spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/stops_retrying_once_submission_is_successful.yml +287 -0
  50. data/spec/support/cassettes/Chef_Handler_Datadog/updated_resources/posts_an_event.yml +250 -0
  51. metadata +285 -0
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+ require 'simplecov'
3
+ SimpleCov.start
4
+
5
+ require 'dotenv'
6
+ require 'rspec'
7
+ require 'vcr'
8
+ require 'webmock/rspec'
9
+
10
+ # Include our code
11
+ require 'chef/handler/datadog'
12
+
13
+ # Load credentials from .env
14
+ Dotenv.load
15
+
16
+ API_KEY = ENV['API_KEY']
17
+ APPLICATION_KEY = ENV['APPLICATION_KEY']
18
+
19
+ RSpec.configure do |config|
20
+ config.run_all_when_everything_filtered = true
21
+ config.filter_run :focus
22
+
23
+ # Run specs in random order to surface order dependencies. If you find an
24
+ # order dependency and want to debug it, you can fix the order by providing
25
+ # the seed, which is printed after each run.
26
+ # --seed 1234
27
+ config.order = 'random'
28
+ end
29
+
30
+ VCR.configure do |c|
31
+ c.cassette_library_dir = 'spec/support/cassettes'
32
+ c.configure_rspec_metadata!
33
+ c.default_cassette_options = {
34
+ :record => :once,
35
+ # :record => :new_episodes, # uncomment during development
36
+ }
37
+
38
+ # Remove any test-specific data
39
+ c.before_record do |i|
40
+ i.response.headers.delete('Set-Cookie')
41
+ i.response.headers.delete('X-Dd-Version')
42
+ end
43
+ c.filter_sensitive_data('<API_KEY>') { API_KEY }
44
+ c.filter_sensitive_data('<APPLICATION_KEY>') { APPLICATION_KEY }
45
+
46
+ c.hook_into :webmock
47
+ end
@@ -0,0 +1,513 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
6
+ body:
7
+ encoding: UTF-8
8
+ string: '{"series":[{"metric":"chef.run.failure","points":[[1453838668,1.0]],"type":"counter","host":"chef.handler.datadog.test-failed","device":null}]}'
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ Content-Type:
17
+ - application/json
18
+ response:
19
+ status:
20
+ code: 202
21
+ message: Accepted
22
+ headers:
23
+ Content-Type:
24
+ - text/json
25
+ Date:
26
+ - Tue, 26 Jan 2016 20:04:26 GMT
27
+ Dd-Pool:
28
+ - propjoe
29
+ Strict-Transport-Security:
30
+ - max-age=15724800;
31
+ X-Content-Type-Options:
32
+ - nosniff
33
+ Content-Length:
34
+ - '16'
35
+ Connection:
36
+ - keep-alive
37
+ body:
38
+ encoding: UTF-8
39
+ string: '{"status": "ok"}'
40
+ http_version:
41
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
42
+ - request:
43
+ method: post
44
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
45
+ body:
46
+ encoding: UTF-8
47
+ string: '{"series":[{"metric":"chef.resources.total","points":[[1453838668,6.0]],"type":"gauge","host":"chef.handler.datadog.test-failed","device":null}]}'
48
+ headers:
49
+ Accept-Encoding:
50
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
51
+ Accept:
52
+ - "*/*"
53
+ User-Agent:
54
+ - Ruby
55
+ Content-Type:
56
+ - application/json
57
+ response:
58
+ status:
59
+ code: 202
60
+ message: Accepted
61
+ headers:
62
+ Content-Type:
63
+ - text/json
64
+ Date:
65
+ - Tue, 26 Jan 2016 20:04:26 GMT
66
+ Dd-Pool:
67
+ - propjoe
68
+ Strict-Transport-Security:
69
+ - max-age=15724800;
70
+ X-Content-Type-Options:
71
+ - nosniff
72
+ Content-Length:
73
+ - '16'
74
+ Connection:
75
+ - keep-alive
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"status": "ok"}'
79
+ http_version:
80
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
81
+ - request:
82
+ method: post
83
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
84
+ body:
85
+ encoding: UTF-8
86
+ string: '{"series":[{"metric":"chef.resources.updated","points":[[1453838668,6.0]],"type":"gauge","host":"chef.handler.datadog.test-failed","device":null}]}'
87
+ headers:
88
+ Accept-Encoding:
89
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
90
+ Accept:
91
+ - "*/*"
92
+ User-Agent:
93
+ - Ruby
94
+ Content-Type:
95
+ - application/json
96
+ response:
97
+ status:
98
+ code: 202
99
+ message: Accepted
100
+ headers:
101
+ Content-Type:
102
+ - text/json
103
+ Date:
104
+ - Tue, 26 Jan 2016 20:04:26 GMT
105
+ Dd-Pool:
106
+ - propjoe
107
+ Strict-Transport-Security:
108
+ - max-age=15724800;
109
+ X-Content-Type-Options:
110
+ - nosniff
111
+ Content-Length:
112
+ - '16'
113
+ Connection:
114
+ - keep-alive
115
+ body:
116
+ encoding: UTF-8
117
+ string: '{"status": "ok"}'
118
+ http_version:
119
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
120
+ - request:
121
+ method: post
122
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
123
+ body:
124
+ encoding: UTF-8
125
+ string: '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1453838668,2.0]],"type":"gauge","host":"chef.handler.datadog.test-failed","device":null}]}'
126
+ headers:
127
+ Accept-Encoding:
128
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
129
+ Accept:
130
+ - "*/*"
131
+ User-Agent:
132
+ - Ruby
133
+ Content-Type:
134
+ - application/json
135
+ response:
136
+ status:
137
+ code: 202
138
+ message: Accepted
139
+ headers:
140
+ Content-Type:
141
+ - text/json
142
+ Date:
143
+ - Tue, 26 Jan 2016 20:04:26 GMT
144
+ Dd-Pool:
145
+ - propjoe
146
+ Strict-Transport-Security:
147
+ - max-age=15724800;
148
+ X-Content-Type-Options:
149
+ - nosniff
150
+ Content-Length:
151
+ - '16'
152
+ Connection:
153
+ - keep-alive
154
+ body:
155
+ encoding: UTF-8
156
+ string: '{"status": "ok"}'
157
+ http_version:
158
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
159
+ - request:
160
+ method: post
161
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
162
+ body:
163
+ encoding: UTF-8
164
+ string: '{"msg_text":"\n$$$\n- [paws] (dynamically defined)\n- [ears] (dynamically
165
+ defined)\n- [nose] (dynamically defined)\n- [tail] (dynamically defined)\n-
166
+ [fur] (dynamically defined)\n\n$$$\n\n$$$\nChef::Exceptions::UnsupportedAction:
167
+ Something awry.\n$$$\n\n$$$\nwhiskers.rb:2\npaws.rb:1\nfile.rb:2\nfile.rb:1\n$$$\n","date_happened":1453838668,"msg_title":"Chef
168
+ failed in 2 seconds on chef.handler.datadog.test-failed ","priority":"normal","parent":null,"tags":["env:hostile","role:highlander","tag:the_one_and_only"],"aggregation_key":"chef.handler.datadog.test-failed","alert_type":"error","event_type":"config_management.run","source_type_name":"chef","title":"Chef
169
+ failed in 2 seconds on chef.handler.datadog.test-failed ","text":"\n$$$\n-
170
+ [paws] (dynamically defined)\n- [ears] (dynamically defined)\n- [nose] (dynamically
171
+ defined)\n- [tail] (dynamically defined)\n- [fur] (dynamically defined)\n\n$$$\n\n$$$\nChef::Exceptions::UnsupportedAction:
172
+ Something awry.\n$$$\n\n$$$\nwhiskers.rb:2\npaws.rb:1\nfile.rb:2\nfile.rb:1\n$$$\n","host":"chef.handler.datadog.test-failed","device":null}'
173
+ headers:
174
+ Accept-Encoding:
175
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
176
+ Accept:
177
+ - "*/*"
178
+ User-Agent:
179
+ - Ruby
180
+ Content-Type:
181
+ - application/json
182
+ response:
183
+ status:
184
+ code: 202
185
+ message: Accepted
186
+ headers:
187
+ Content-Type:
188
+ - text/plain; charset=utf-8
189
+ Date:
190
+ - Tue, 26 Jan 2016 20:04:26 GMT
191
+ Dd-Pool:
192
+ - propjoe
193
+ Strict-Transport-Security:
194
+ - max-age=15724800;
195
+ X-Content-Type-Options:
196
+ - nosniff
197
+ Content-Length:
198
+ - '647'
199
+ Connection:
200
+ - keep-alive
201
+ body:
202
+ encoding: UTF-8
203
+ string: '{"status":"ok","event":{"id":381236694692316426,"title":"Chef failed
204
+ in 2 seconds on chef.handler.datadog.test-failed ","text":"\n$$$\n- [paws]
205
+ (dynamically defined)\n- [ears] (dynamically defined)\n- [nose] (dynamically
206
+ defined)\n- [tail] (dynamically defined)\n- [fur] (dynamically defined)\n\n$$$\n\n$$$\nChef::Exceptions::UnsupportedAction:
207
+ Something awry.\n$$$\n\n$$$\nwhiskers.rb:2\npaws.rb:1\nfile.rb:2\nfile.rb:1\n$$$\n","date_happened":1453838668,"handle":null,"priority":"normal","related_event_id":null,"tags":["env:hostile","role:highlander","tag:the_one_and_only"],"url":"https://app.datadoghq.com/event/event?id=381236694692316426"}}'
208
+ http_version:
209
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
210
+ - request:
211
+ method: put
212
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-failed?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
213
+ body:
214
+ encoding: UTF-8
215
+ string: '{"tags":["env:hostile","role:highlander","tag:the_one_and_only"]}'
216
+ headers:
217
+ Accept-Encoding:
218
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
219
+ Accept:
220
+ - "*/*"
221
+ User-Agent:
222
+ - Ruby
223
+ Content-Type:
224
+ - application/json
225
+ response:
226
+ status:
227
+ code: 201
228
+ message: Created
229
+ headers:
230
+ Cache-Control:
231
+ - no-cache
232
+ Content-Type:
233
+ - application/json
234
+ Date:
235
+ - Tue, 26 Jan 2016 20:04:26 GMT
236
+ Dd-Pool:
237
+ - dogweb_sameorig
238
+ Pragma:
239
+ - no-cache
240
+ Strict-Transport-Security:
241
+ - max-age=15724800;
242
+ X-Content-Type-Options:
243
+ - nosniff
244
+ X-Dd-Debug:
245
+ - 4G6DflkbLuEPHPN7r5QLLJW1+B1YXxXufb+VXQ5hU44=
246
+ X-Frame-Options:
247
+ - SAMEORIGIN
248
+ Content-Length:
249
+ - '112'
250
+ Connection:
251
+ - keep-alive
252
+ body:
253
+ encoding: UTF-8
254
+ string: '{"host": "chef.handler.datadog.test-failed", "tags": ["env:hostile",
255
+ "role:highlander", "tag:the_one_and_only"]}'
256
+ http_version:
257
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
258
+ - request:
259
+ method: post
260
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
261
+ body:
262
+ encoding: UTF-8
263
+ string: '{"series":[{"metric":"chef.run.failure","points":[[1453838668,1.0]],"type":"counter","host":"chef.handler.datadog.test-failed","device":null}]}'
264
+ headers:
265
+ Accept-Encoding:
266
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
267
+ Accept:
268
+ - "*/*"
269
+ User-Agent:
270
+ - Ruby
271
+ Content-Type:
272
+ - application/json
273
+ response:
274
+ status:
275
+ code: 202
276
+ message: Accepted
277
+ headers:
278
+ Content-Type:
279
+ - text/json
280
+ Date:
281
+ - Tue, 26 Jan 2016 20:04:26 GMT
282
+ Dd-Pool:
283
+ - propjoe
284
+ Strict-Transport-Security:
285
+ - max-age=15724800;
286
+ X-Content-Type-Options:
287
+ - nosniff
288
+ Content-Length:
289
+ - '16'
290
+ Connection:
291
+ - keep-alive
292
+ body:
293
+ encoding: UTF-8
294
+ string: '{"status": "ok"}'
295
+ http_version:
296
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
297
+ - request:
298
+ method: post
299
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
300
+ body:
301
+ encoding: UTF-8
302
+ string: '{"series":[{"metric":"chef.resources.total","points":[[1453838668,6.0]],"type":"gauge","host":"chef.handler.datadog.test-failed","device":null}]}'
303
+ headers:
304
+ Accept-Encoding:
305
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
306
+ Accept:
307
+ - "*/*"
308
+ User-Agent:
309
+ - Ruby
310
+ Content-Type:
311
+ - application/json
312
+ response:
313
+ status:
314
+ code: 202
315
+ message: Accepted
316
+ headers:
317
+ Content-Type:
318
+ - text/json
319
+ Date:
320
+ - Tue, 26 Jan 2016 20:04:26 GMT
321
+ Dd-Pool:
322
+ - propjoe
323
+ Strict-Transport-Security:
324
+ - max-age=15724800;
325
+ X-Content-Type-Options:
326
+ - nosniff
327
+ Content-Length:
328
+ - '16'
329
+ Connection:
330
+ - keep-alive
331
+ body:
332
+ encoding: UTF-8
333
+ string: '{"status": "ok"}'
334
+ http_version:
335
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
336
+ - request:
337
+ method: post
338
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
339
+ body:
340
+ encoding: UTF-8
341
+ string: '{"series":[{"metric":"chef.resources.updated","points":[[1453838668,6.0]],"type":"gauge","host":"chef.handler.datadog.test-failed","device":null}]}'
342
+ headers:
343
+ Accept-Encoding:
344
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
345
+ Accept:
346
+ - "*/*"
347
+ User-Agent:
348
+ - Ruby
349
+ Content-Type:
350
+ - application/json
351
+ response:
352
+ status:
353
+ code: 202
354
+ message: Accepted
355
+ headers:
356
+ Content-Type:
357
+ - text/json
358
+ Date:
359
+ - Tue, 26 Jan 2016 20:04:27 GMT
360
+ Dd-Pool:
361
+ - propjoe
362
+ Strict-Transport-Security:
363
+ - max-age=15724800;
364
+ X-Content-Type-Options:
365
+ - nosniff
366
+ Content-Length:
367
+ - '16'
368
+ Connection:
369
+ - keep-alive
370
+ body:
371
+ encoding: UTF-8
372
+ string: '{"status": "ok"}'
373
+ http_version:
374
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
375
+ - request:
376
+ method: post
377
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
378
+ body:
379
+ encoding: UTF-8
380
+ string: '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1453838668,2.0]],"type":"gauge","host":"chef.handler.datadog.test-failed","device":null}]}'
381
+ headers:
382
+ Accept-Encoding:
383
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
384
+ Accept:
385
+ - "*/*"
386
+ User-Agent:
387
+ - Ruby
388
+ Content-Type:
389
+ - application/json
390
+ response:
391
+ status:
392
+ code: 202
393
+ message: Accepted
394
+ headers:
395
+ Content-Type:
396
+ - text/json
397
+ Date:
398
+ - Tue, 26 Jan 2016 20:04:27 GMT
399
+ Dd-Pool:
400
+ - propjoe
401
+ Strict-Transport-Security:
402
+ - max-age=15724800;
403
+ X-Content-Type-Options:
404
+ - nosniff
405
+ Content-Length:
406
+ - '16'
407
+ Connection:
408
+ - keep-alive
409
+ body:
410
+ encoding: UTF-8
411
+ string: '{"status": "ok"}'
412
+ http_version:
413
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
414
+ - request:
415
+ method: post
416
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
417
+ body:
418
+ encoding: UTF-8
419
+ string: '{"msg_text":"\n$$$\n- [paws] (dynamically defined)\n- [ears] (dynamically
420
+ defined)\n- [nose] (dynamically defined)\n- [tail] (dynamically defined)\n-
421
+ [fur] (dynamically defined)\n\n$$$\n\nAlerting: @alice @bob\n\n$$$\nChef::Exceptions::UnsupportedAction:
422
+ Something awry.\n$$$\n\n$$$\nwhiskers.rb:2\npaws.rb:1\nfile.rb:2\nfile.rb:1\n$$$\n","date_happened":1453838668,"msg_title":"Chef
423
+ failed in 2 seconds on chef.handler.datadog.test-failed ","priority":"normal","parent":null,"tags":["env:hostile","role:highlander","tag:tag:the_one_and_only"],"aggregation_key":"chef.handler.datadog.test-failed","alert_type":"error","event_type":"config_management.run","source_type_name":"chef","title":"Chef
424
+ failed in 2 seconds on chef.handler.datadog.test-failed ","text":"\n$$$\n-
425
+ [paws] (dynamically defined)\n- [ears] (dynamically defined)\n- [nose] (dynamically
426
+ defined)\n- [tail] (dynamically defined)\n- [fur] (dynamically defined)\n\n$$$\n\nAlerting:
427
+ @alice @bob\n\n$$$\nChef::Exceptions::UnsupportedAction: Something awry.\n$$$\n\n$$$\nwhiskers.rb:2\npaws.rb:1\nfile.rb:2\nfile.rb:1\n$$$\n","host":"chef.handler.datadog.test-failed","device":null}'
428
+ headers:
429
+ Accept-Encoding:
430
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
431
+ Accept:
432
+ - "*/*"
433
+ User-Agent:
434
+ - Ruby
435
+ Content-Type:
436
+ - application/json
437
+ response:
438
+ status:
439
+ code: 202
440
+ message: Accepted
441
+ headers:
442
+ Content-Type:
443
+ - text/plain; charset=utf-8
444
+ Date:
445
+ - Tue, 26 Jan 2016 20:04:27 GMT
446
+ Dd-Pool:
447
+ - propjoe
448
+ Strict-Transport-Security:
449
+ - max-age=15724800;
450
+ X-Content-Type-Options:
451
+ - nosniff
452
+ Content-Length:
453
+ - '676'
454
+ Connection:
455
+ - keep-alive
456
+ body:
457
+ encoding: UTF-8
458
+ string: '{"status":"ok","event":{"id":381236701686654829,"title":"Chef failed
459
+ in 2 seconds on chef.handler.datadog.test-failed ","text":"\n$$$\n- [paws]
460
+ (dynamically defined)\n- [ears] (dynamically defined)\n- [nose] (dynamically
461
+ defined)\n- [tail] (dynamically defined)\n- [fur] (dynamically defined)\n\n$$$\n\nAlerting:
462
+ @alice @bob\n\n$$$\nChef::Exceptions::UnsupportedAction: Something awry.\n$$$\n\n$$$\nwhiskers.rb:2\npaws.rb:1\nfile.rb:2\nfile.rb:1\n$$$\n","date_happened":1453838668,"handle":null,"priority":"normal","related_event_id":null,"tags":["env:hostile","role:highlander","tag:tag:the_one_and_only"],"url":"https://app.datadoghq.com/event/event?id=381236701686654829"}}'
463
+ http_version:
464
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
465
+ - request:
466
+ method: put
467
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-failed?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
468
+ body:
469
+ encoding: UTF-8
470
+ string: '{"tags":["env:hostile","role:highlander","tag:tag:the_one_and_only"]}'
471
+ headers:
472
+ Accept-Encoding:
473
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
474
+ Accept:
475
+ - "*/*"
476
+ User-Agent:
477
+ - Ruby
478
+ Content-Type:
479
+ - application/json
480
+ response:
481
+ status:
482
+ code: 201
483
+ message: Created
484
+ headers:
485
+ Cache-Control:
486
+ - no-cache
487
+ Content-Type:
488
+ - application/json
489
+ Date:
490
+ - Tue, 26 Jan 2016 20:04:27 GMT
491
+ Dd-Pool:
492
+ - dogweb_sameorig
493
+ Pragma:
494
+ - no-cache
495
+ Strict-Transport-Security:
496
+ - max-age=15724800;
497
+ X-Content-Type-Options:
498
+ - nosniff
499
+ X-Dd-Debug:
500
+ - QKcGho/VVHvOvAFq4WeaqBhqhL8eYL3K9CW+TToIP+o=
501
+ X-Frame-Options:
502
+ - SAMEORIGIN
503
+ Content-Length:
504
+ - '116'
505
+ Connection:
506
+ - keep-alive
507
+ body:
508
+ encoding: UTF-8
509
+ string: '{"host": "chef.handler.datadog.test-failed", "tags": ["tag:tag:the_one_and_only",
510
+ "env:hostile", "role:highlander"]}'
511
+ http_version:
512
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
513
+ recorded_with: VCR 3.0.1