chef-handler-datadog 0.9.0 → 0.10.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -0
  3. data/Appraisals +9 -1
  4. data/CHANGELOG.md +15 -0
  5. data/chef-handler-datadog.gemspec +1 -1
  6. data/gemfiles/chef_11.gemfile +2 -0
  7. data/lib/chef/handler/datadog.rb +70 -12
  8. data/lib/chef/handler/datadog_chef_events.rb +12 -20
  9. data/lib/chef/handler/datadog_chef_metrics.rb +8 -15
  10. data/lib/chef/handler/datadog_chef_tags.rb +33 -34
  11. data/lib/chef_handler_datadog.rb +1 -1
  12. data/spec/datadog_spec.rb +266 -7
  13. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_alert_handles_when_specified.yml +90 -12
  14. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_event_title_correctly.yml +45 -6
  15. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_priority_correctly.yml +45 -6
  16. data/spec/support/cassettes/Chef_Handler_Datadog/hostname/uses_the_node_name_when_no_config_specified.yml +45 -6
  17. data/spec/support/cassettes/Chef_Handler_Datadog/hostname/uses_the_specified_hostname_when_provided.yml +45 -6
  18. 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 +45 -6
  19. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/uses_the_instance_id_when_config_is_specified.yml +45 -6
  20. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/uses_the_instance_id_when_no_config_specified.yml +45 -6
  21. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/posts_an_event.yml +45 -6
  22. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/sets_priority_correctly.yml +45 -6
  23. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_metrics/reports_metrics.yml +45 -6
  24. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/sets_tags/puts_the_tags_for_the_current_node.yml +45 -6
  25. data/spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/{only_emits_a_failure_metric.yml → only_emits_the_run_status_metrics.yml} +43 -4
  26. data/spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/posts_an_event.yml +43 -4
  27. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_scope_prefix.yml +290 -0
  28. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_tag_prefix.yml +84 -6
  29. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_scope_prefix.yml +290 -0
  30. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_tag_prefix.yml +45 -6
  31. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/sets_the_role_and_env_and_tags.yml +45 -6
  32. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_tag_blacklist_is_specified/does_not_include_the_tag_s_specified.yml +289 -0
  33. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_tag_blacklist_is_unspecified/should_include_all_of_the_tag_s_.yml +289 -0
  34. data/spec/support/cassettes/Chef_Handler_Datadog/tags/when_unspecified/sets_role_env_and_nothing_else.yml +45 -6
  35. data/spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_not_specified/does_not_retry_after_a_failed_submission.yml +37 -0
  36. data/spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/retries_no_more_than_twice.yml +37 -0
  37. data/spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/stops_retrying_once_submission_is_successful.yml +37 -0
  38. data/spec/support/cassettes/Chef_Handler_Datadog/updated_resources/posts_an_event.yml +45 -6
  39. data/spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_events/posts_an_event.yml +575 -0
  40. data/spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_metrics/reports_metrics.yml +575 -0
  41. data/spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/sets_tags/puts_the_tags_for_the_current_node.yml +575 -0
  42. metadata +24 -11
  43. data/spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/does_not_emit_metrics.yml +0 -82
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-handler-datadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Fiedler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-03-22 00:00:00.000000000 Z
13
+ date: 2016-09-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dogapi
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '1.6'
21
+ version: '1.23'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '1.6'
28
+ version: '1.23'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: appraisal
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -220,17 +220,23 @@ files:
220
220
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/sets_priority_correctly.yml
221
221
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_metrics/reports_metrics.yml
222
222
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/sets_tags/puts_the_tags_for_the_current_node.yml
223
- - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/does_not_emit_metrics.yml
224
- - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_a_failure_metric.yml
223
+ - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_the_run_status_metrics.yml
225
224
  - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/posts_an_event.yml
225
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_scope_prefix.yml
226
226
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_tag_prefix.yml
227
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_scope_prefix.yml
227
228
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_tag_prefix.yml
228
229
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/sets_the_role_and_env_and_tags.yml
230
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_tag_blacklist_is_specified/does_not_include_the_tag_s_specified.yml
231
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_tag_blacklist_is_unspecified/should_include_all_of_the_tag_s_.yml
229
232
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_unspecified/sets_role_env_and_nothing_else.yml
230
233
  - spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_not_specified/does_not_retry_after_a_failed_submission.yml
231
234
  - spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/retries_no_more_than_twice.yml
232
235
  - spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/stops_retrying_once_submission_is_successful.yml
233
236
  - spec/support/cassettes/Chef_Handler_Datadog/updated_resources/posts_an_event.yml
237
+ - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_events/posts_an_event.yml
238
+ - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_metrics/reports_metrics.yml
239
+ - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/sets_tags/puts_the_tags_for_the_current_node.yml
234
240
  homepage: http://www.datadoghq.com/
235
241
  licenses:
236
242
  - BSD
@@ -246,12 +252,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
246
252
  version: '0'
247
253
  required_rubygems_version: !ruby/object:Gem::Requirement
248
254
  requirements:
249
- - - ">="
255
+ - - ">"
250
256
  - !ruby/object:Gem::Version
251
- version: '0'
257
+ version: 1.3.1
252
258
  requirements: []
253
259
  rubyforge_project:
254
- rubygems_version: 2.4.3
260
+ rubygems_version: 2.6.4
255
261
  signing_key:
256
262
  specification_version: 4
257
263
  summary: Chef Handler reports events and metrics to Datadog
@@ -271,14 +277,21 @@ test_files:
271
277
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/sets_priority_correctly.yml
272
278
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_metrics/reports_metrics.yml
273
279
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/sets_tags/puts_the_tags_for_the_current_node.yml
274
- - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/does_not_emit_metrics.yml
275
- - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_a_failure_metric.yml
280
+ - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_the_run_status_metrics.yml
276
281
  - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/posts_an_event.yml
282
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_scope_prefix.yml
277
283
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_tag_prefix.yml
284
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_scope_prefix.yml
278
285
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_tag_prefix.yml
279
286
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/sets_the_role_and_env_and_tags.yml
287
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_tag_blacklist_is_specified/does_not_include_the_tag_s_specified.yml
288
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_tag_blacklist_is_unspecified/should_include_all_of_the_tag_s_.yml
280
289
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_unspecified/sets_role_env_and_nothing_else.yml
281
290
  - spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_not_specified/does_not_retry_after_a_failed_submission.yml
282
291
  - spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/retries_no_more_than_twice.yml
283
292
  - spec/support/cassettes/Chef_Handler_Datadog/tags_submission_retries/when_specified_as_2_retries/stops_retrying_once_submission_is_successful.yml
284
293
  - spec/support/cassettes/Chef_Handler_Datadog/updated_resources/posts_an_event.yml
294
+ - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_events/posts_an_event.yml
295
+ - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_metrics/reports_metrics.yml
296
+ - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/sets_tags/puts_the_tags_for_the_current_node.yml
297
+ has_rdoc:
@@ -1,82 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: post
5
- uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
6
- body:
7
- encoding: UTF-8
8
- string: ! '{"msg_text":"Chef was unable to complete a run, an error during compilation
9
- may have occurred.","date_happened":1410264902,"msg_title":"Chef failed during
10
- compile phase on chef.handler.datadog.test-resources ","priority":"normal","parent":null,"tags":["env:resources"],"aggregation_key":"chef.handler.datadog.test-resources","alert_type":"error","event_type":"config_management.run","source_type_name":"chef","title":"Chef
11
- failed during compile phase on chef.handler.datadog.test-resources ","text":"Chef
12
- was unable to complete a run, an error during compilation may have occurred.","host":"chef.handler.datadog.test-resources","device":null}'
13
- headers:
14
- Accept:
15
- - ! '*/*'
16
- User-Agent:
17
- - Ruby
18
- Content-Type:
19
- - application/json
20
- response:
21
- status:
22
- code: 202
23
- message: Accepted
24
- headers:
25
- Content-Type:
26
- - text/json; charset=UTF-8
27
- Date:
28
- - Tue, 09 Sep 2014 12:15:02 GMT
29
- Server:
30
- - dogdispatcher/5.1.1
31
- Content-Length:
32
- - '431'
33
- Connection:
34
- - keep-alive
35
- body:
36
- encoding: US-ASCII
37
- string: ! '{"status": "ok", "event": {"priority": "normal", "date_happened":
38
- 1410264902, "handle": null, "title": "Chef failed during compile phase on
39
- chef.handler.datadog.test-resources ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2449507704361410798",
40
- "text": "Chef was unable to complete a run, an error during compilation may
41
- have occurred.", "tags": ["env:resources"], "related_event_id": null, "id":
42
- 2449507704361410798}}'
43
- http_version:
44
- recorded_at: Tue, 09 Sep 2014 12:15:02 GMT
45
- - request:
46
- method: put
47
- uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-resources?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
48
- body:
49
- encoding: UTF-8
50
- string: ! '{"tags":["env:resources"]}'
51
- headers:
52
- Accept:
53
- - ! '*/*'
54
- User-Agent:
55
- - Ruby
56
- Content-Type:
57
- - application/json
58
- response:
59
- status:
60
- code: 201
61
- message: Created
62
- headers:
63
- Cache-Control:
64
- - no-cache
65
- Content-Type:
66
- - application/json
67
- Date:
68
- - Tue, 09 Sep 2014 12:15:03 GMT
69
- Pragma:
70
- - no-cache
71
- Server:
72
- - gunicorn/19.1.0
73
- Content-Length:
74
- - '74'
75
- Connection:
76
- - keep-alive
77
- body:
78
- encoding: US-ASCII
79
- string: ! '{"host": "chef.handler.datadog.test-resources", "tags": ["env:resources"]}'
80
- http_version:
81
- recorded_at: Tue, 09 Sep 2014 12:15:03 GMT
82
- recorded_with: VCR 2.9.2