chef-handler-datadog 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +1 -2
  3. data/.rubocop.yml +3 -1
  4. data/.travis.yml +3 -2
  5. data/Appraisals +4 -4
  6. data/CHANGELOG.md +12 -1
  7. data/chef-handler-datadog.gemspec +6 -6
  8. data/gemfiles/chef_10.26.0.gemfile +1 -1
  9. data/gemfiles/chef_10.26.0.gemfile.lock +140 -0
  10. data/gemfiles/chef_10.32.2.gemfile +13 -0
  11. data/gemfiles/chef_10.32.2.gemfile.lock +140 -0
  12. data/gemfiles/{chef_10.14.0.gemfile → chef_11.10.4.gemfile} +2 -2
  13. data/gemfiles/chef_11.10.4.gemfile.lock +143 -0
  14. data/gemfiles/{chef_10.30.2.gemfile → chef_11.12.2.gemfile} +2 -2
  15. data/gemfiles/chef_11.12.2.gemfile.lock +139 -0
  16. data/gemfiles/chef_11.8.2.gemfile +1 -2
  17. data/gemfiles/chef_11.8.2.gemfile.lock +143 -0
  18. data/lib/chef/handler/datadog.rb +102 -79
  19. data/lib/{chef-handler-datadog.rb → chef_handler_datadog.rb} +1 -1
  20. data/spec/datadog_spec.rb +55 -7
  21. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_alert_handles_when_specified.yml +363 -0
  22. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_event_title_correctly.yml +25 -60
  23. data/spec/support/cassettes/Chef_Handler_Datadog/failed_Chef_run/sets_priority_correctly.yml +25 -60
  24. data/spec/support/cassettes/Chef_Handler_Datadog/handles_no_application_key/fails_when_no_application_key_is_provided.yml +20 -20
  25. data/spec/support/cassettes/Chef_Handler_Datadog/handles_tags_correctly/sets_the_role_and_env_and_tags.yml +25 -60
  26. data/spec/support/cassettes/Chef_Handler_Datadog/{reports_metrics_event_and_sets_tags/get_and_set_tags/gets_the_tags_for_the_current_node.yml → hostname/uses_the_node_name_when_no_config_specified.yml} +30 -65
  27. data/spec/support/cassettes/Chef_Handler_Datadog/hostname/uses_the_specified_hostname_when_provided.yml +179 -0
  28. 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 +23 -58
  29. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/uses_the_instance_id_when_config_is_specified.yml +23 -58
  30. data/spec/support/cassettes/Chef_Handler_Datadog/reports_correct_hostname_on_an_ec2_node/uses_the_instance_id_when_no_config_specified.yml +23 -58
  31. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/posts_an_event.yml +23 -58
  32. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_events/sets_priority_correctly.yml +23 -58
  33. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/emits_metrics/reports_metrics.yml +23 -58
  34. data/spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/{get_and_set_tags → sets_tags}/puts_the_tags_for_the_current_node.yml +23 -58
  35. data/spec/support/cassettes/Chef_Handler_Datadog/updated_resources/posts_an_event.yml +23 -58
  36. metadata +28 -18
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzQzODBiZTM2NjkxZDlhZTQ5OWVhNDAwZWQyODk5ZjY5NjMzMWRkNw==
4
+ ZGY5NzgzNTc5ZDY5YjA3ZGZkNWY4OTRhM2U4NmE4ZWI0NGYyNDBhMg==
5
5
  data.tar.gz: !binary |-
6
- YmI2ZTljMTFjMDQ1YjEzOWJjNzBiNTFkMzMzMzBmY2QyODhjODMxMQ==
6
+ ZjkxZDg0ZDUyOGMxOWY5YWZhMjNlNmZmMTIxN2NmMjE3ZGU5Y2Y1MA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGJiZDVlYTQ3M2RlZjg0ZDNiOTA4OGVmMGEzZDdhOGY4MDkwMmQ4MzAzNWYy
10
- NGM5MjJhOWI3MjgxMDNmOTczNmMwM2MwM2U1YjA0MTI3NTJjOThmZWFiZGM4
11
- ZDUzYzA1MWQxMWNjODVhZjNlNGZmMTJkYTY3ZGZmNGFkNmYwNGI=
9
+ ODRiMjJhZTAyMDAzZDljN2M3NWRhYmI4NTRmZTQzM2U4YzQwNmY1ZWRhZjZh
10
+ ZmMzNTBkOWM4ZjIyN2NjOWZmMzcyYmZiYjc5ZTEyOWIzZWVkODQ3ZTNjMzEz
11
+ NmE2NTYxNTM5NWEyMGY4NTBmZjdkYTM5MDIyNGQ1YzVmMzVhODA=
12
12
  data.tar.gz: !binary |-
13
- ZDE4ODE4NTdjMzAxZTgwZTkzM2M5N2Q0ZjExNGFhZTg1MThhOGMyYjAzNTYw
14
- NmI1NWI2YWRmM2FmYjNiOGExNzU5MmQzYTU5ODJhMjhlNjI1MDQ5NTYzZDMz
15
- NGE4OTBmNTMyYzQzZTEzN2ZiMTU3ZDAzMDEzZGIzMzUzNTk0MTA=
13
+ MmNjZGRmYjc1Mzg3YjJmM2E0ZjJhNzZkNDViYWVkNTZhMGFkMTg1YjhkMjI2
14
+ NGIzZDkxZGQyMzZiNDYyYTVmOTI0MDk4N2M0MmZlODQyYmU5NGUzOTBmOTY2
15
+ N2I4YjhlMDFiYjkxYmE1ODVkN2IwNjIwYmQ2MDdlMzA2NDNkODY=
data/.gitignore CHANGED
@@ -14,7 +14,7 @@ doc
14
14
  # jeweler generated
15
15
  pkg
16
16
 
17
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
17
+ # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
18
18
  #
19
19
  # * Create a file at ~/.gitignore
20
20
  # * Include files you want ignored
@@ -50,7 +50,6 @@ pkg
50
50
  json
51
51
  rake
52
52
  Gemfile.lock
53
- gemfiles/*.lock
54
53
 
55
54
  # For Ruby Managers:
56
55
  .ruby-gemset
data/.rubocop.yml CHANGED
@@ -1,9 +1,11 @@
1
1
  AllCops:
2
- Includes:
2
+ Include:
3
3
  - chef-handler-datadog.gemspec
4
4
  - Appraisals
5
5
  - Gemfile
6
6
  - Rakefile
7
+ Exclude:
8
+ - spec/*.rb
7
9
 
8
10
  # We want to continue to support Ruby 1.8.x for now
9
11
  HashSyntax:
data/.travis.yml CHANGED
@@ -3,9 +3,10 @@ rvm:
3
3
  - 1.9.3
4
4
  bundler_args: --without=localdev
5
5
  gemfile:
6
- - gemfiles/chef_10.14.0.gemfile
7
6
  - gemfiles/chef_10.26.0.gemfile
8
- - gemfiles/chef_10.30.2.gemfile
7
+ - gemfiles/chef_10.32.2.gemfile
9
8
  - gemfiles/chef_11.8.2.gemfile
9
+ - gemfiles/chef_11.10.4.gemfile
10
+ - gemfiles/chef_11.12.2.gemfile
10
11
  env:
11
12
  - API_KEY=somefakeapikey APPLICATION_KEY=somefakeapplicationkey
data/Appraisals CHANGED
@@ -1,10 +1,10 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  # Describe any version dependencies here.
4
-
5
4
  %w(
6
- 10.14.0
7
- 10.30.2
5
+ 11.8.2
6
+ 11.10.4
7
+ 11.12.2
8
8
  ).each do |tv|
9
9
  appraise "chef-#{tv}" do
10
10
  gem 'chef', tv
@@ -15,7 +15,7 @@ end
15
15
  # conflicts, specify best version here.
16
16
  %w(
17
17
  10.26.0
18
- 11.8.2
18
+ 10.32.2
19
19
  ).each do |tv|
20
20
  appraise "chef-#{tv}" do
21
21
  gem 'chef', tv
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ # 0.4.0 / Unreleased
5
+
6
+ * [FEATURE] Allow specification of a `:hostname` to config to override `node.name`, [#41][] [@miketheman][]
7
+ * [FEATURE] Allow passing an array of handles in config to alert when Chef fails, [#29][] [@miketheman][]
8
+ * [OPTIMIZE] Use new version of `dogapi` lib to submit tags for Chef only, [#28][] [@miketheman][]
9
+ * [MISC] Updated versions of Chef tested
10
+ * [MISC] Style update for source file name, parens
11
+
4
12
  # 0.3.0 / 2014-01-23
5
13
 
6
14
  * [MISC] **Breaking Change**: Chef 0.9.x is no longer supported. Extra code implemented for 0.9 versions has been removed. [@miketheman][]
@@ -31,10 +39,13 @@ And all other versions were prior to this. See git history for more.
31
39
 
32
40
  <!--- The following link definition list is generated by PimpMyChangelog --->
33
41
  [#18]: https://github.com/DataDog/chef-handler-datadog/issues/18
42
+ [#28]: https://github.com/DataDog/chef-handler-datadog/issues/28
43
+ [#29]: https://github.com/DataDog/chef-handler-datadog/issues/29
34
44
  [#31]: https://github.com/DataDog/chef-handler-datadog/issues/31
35
45
  [#34]: https://github.com/DataDog/chef-handler-datadog/issues/34
36
46
  [#37]: https://github.com/DataDog/chef-handler-datadog/issues/37
37
47
  [#39]: https://github.com/DataDog/chef-handler-datadog/issues/39
48
+ [#41]: https://github.com/DataDog/chef-handler-datadog/issues/41
38
49
  [@alq]: https://github.com/alq
39
50
  [@miketheman]: https://github.com/miketheman
40
- [@remh]: https://github.com/remh
51
+ [@remh]: https://github.com/remh
@@ -1,10 +1,10 @@
1
1
  # encoding: utf-8
2
- require File.expand_path('../lib/chef-handler-datadog', __FILE__)
2
+ require File.expand_path('../lib/chef_handler_datadog', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'chef-handler-datadog'
6
- gem.summary = %q{Chef Handler for DataDog events and metrics}
7
- gem.description = %q{This Handler will report the events and metrics for a chef-client run to DataDog.}
6
+ gem.summary = %q(Chef Handler for DataDog events and metrics)
7
+ gem.description = %q(This Handler will report the events and metrics for a chef-client run to DataDog.)
8
8
  gem.license = 'BSD'
9
9
  gem.version = ChefHandlerDatadog::VERSION
10
10
 
@@ -14,15 +14,15 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ['lib']
15
15
  gem.extra_rdoc_files = ['README.md', 'LICENSE.txt']
16
16
 
17
- gem.add_dependency 'dogapi', '>= 1.2'
17
+ gem.add_dependency 'dogapi', '>= 1.6'
18
18
 
19
- gem.add_development_dependency 'appraisal', '~> 1.0.0.beta2'
19
+ gem.add_development_dependency 'appraisal', '~> 1.0.0'
20
20
  gem.add_development_dependency 'bundler'
21
21
  gem.add_development_dependency 'chef', '>= 10', '<= 12'
22
22
  gem.add_development_dependency 'dotenv'
23
23
  gem.add_development_dependency 'rake'
24
24
  gem.add_development_dependency 'rspec'
25
- gem.add_development_dependency 'rubocop'
25
+ gem.add_development_dependency 'rubocop', '~> 0.21.0'
26
26
  gem.add_development_dependency 'simplecov'
27
27
  gem.add_development_dependency 'vcr'
28
28
  gem.add_development_dependency 'webmock'
@@ -10,4 +10,4 @@ group :localdev do
10
10
  gem "travis-lint"
11
11
  end
12
12
 
13
- gemspec :path=>".././"
13
+ gemspec :path => "../"
@@ -0,0 +1,140 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ chef-handler-datadog (0.4.0.alpha)
5
+ dogapi (>= 1.6)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ addressable (2.3.6)
11
+ appraisal (1.0.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (1.1.0)
16
+ bunny (0.7.9)
17
+ chef (10.26.0)
18
+ bunny (>= 0.6.0, < 0.8.0)
19
+ erubis
20
+ highline (>= 1.6.9)
21
+ json (>= 1.4.4, <= 1.7.7)
22
+ mixlib-authentication (>= 1.3.0)
23
+ mixlib-cli (>= 1.1.0)
24
+ mixlib-config (>= 1.1.2)
25
+ mixlib-log (>= 1.3.0)
26
+ mixlib-shellout
27
+ moneta (< 0.7.0)
28
+ net-ssh (~> 2.6)
29
+ net-ssh-multi (~> 1.1.0)
30
+ ohai (>= 0.6.0)
31
+ rest-client (>= 1.0.4, < 1.7.0)
32
+ treetop (~> 1.4.9)
33
+ uuidtools
34
+ yajl-ruby (~> 1.1)
35
+ coderay (1.1.0)
36
+ crack (0.4.1)
37
+ safe_yaml (~> 0.9.0)
38
+ diff-lcs (1.2.5)
39
+ docile (1.1.3)
40
+ dogapi (1.9.2)
41
+ json (>= 1.5.1)
42
+ dotenv (0.10.0)
43
+ erubis (2.7.0)
44
+ hashr (0.0.22)
45
+ highline (1.6.21)
46
+ ipaddress (0.8.0)
47
+ json (1.7.7)
48
+ method_source (0.8.2)
49
+ mime-types (1.25.1)
50
+ mixlib-authentication (1.3.0)
51
+ mixlib-log
52
+ mixlib-cli (1.4.0)
53
+ mixlib-config (2.1.0)
54
+ mixlib-log (1.6.0)
55
+ mixlib-shellout (1.4.0)
56
+ moneta (0.6.0)
57
+ multi_json (1.9.2)
58
+ net-ssh (2.8.0)
59
+ net-ssh-gateway (1.2.0)
60
+ net-ssh (>= 2.6.5)
61
+ net-ssh-multi (1.1)
62
+ net-ssh (>= 2.1.4)
63
+ net-ssh-gateway (>= 0.99.0)
64
+ ohai (7.0.2)
65
+ ipaddress
66
+ mime-types (~> 1.16)
67
+ mixlib-cli
68
+ mixlib-config (~> 2.0)
69
+ mixlib-log
70
+ mixlib-shellout (~> 1.2)
71
+ systemu (~> 2.5.2)
72
+ yajl-ruby
73
+ parser (2.1.8)
74
+ ast (~> 1.1)
75
+ slop (~> 3.4, >= 3.4.5)
76
+ polyglot (0.3.4)
77
+ powerpack (0.0.9)
78
+ pry (0.9.12.6)
79
+ coderay (~> 1.0)
80
+ method_source (~> 0.8)
81
+ slop (~> 3.4)
82
+ rainbow (2.0.0)
83
+ rake (10.3.1)
84
+ rest-client (1.6.7)
85
+ mime-types (>= 1.16)
86
+ rspec (2.14.1)
87
+ rspec-core (~> 2.14.0)
88
+ rspec-expectations (~> 2.14.0)
89
+ rspec-mocks (~> 2.14.0)
90
+ rspec-core (2.14.8)
91
+ rspec-expectations (2.14.5)
92
+ diff-lcs (>= 1.1.3, < 2.0)
93
+ rspec-mocks (2.14.6)
94
+ rubocop (0.20.1)
95
+ json (>= 1.7.7, < 2)
96
+ parser (~> 2.1.7)
97
+ powerpack (~> 0.0.6)
98
+ rainbow (>= 1.99.1, < 3.0)
99
+ ruby-progressbar (~> 1.4)
100
+ ruby-progressbar (1.4.2)
101
+ safe_yaml (0.9.7)
102
+ simplecov (0.8.2)
103
+ docile (~> 1.1.0)
104
+ multi_json
105
+ simplecov-html (~> 0.8.0)
106
+ simplecov-html (0.8.0)
107
+ slop (3.5.0)
108
+ systemu (2.5.2)
109
+ thor (0.19.1)
110
+ travis-lint (1.8.0)
111
+ hashr (~> 0.0.22)
112
+ safe_yaml (~> 0.9.0)
113
+ treetop (1.4.15)
114
+ polyglot
115
+ polyglot (>= 0.3.1)
116
+ uuidtools (2.1.4)
117
+ vcr (2.9.0)
118
+ webmock (1.17.4)
119
+ addressable (>= 2.2.7)
120
+ crack (>= 0.3.2)
121
+ yajl-ruby (1.2.0)
122
+
123
+ PLATFORMS
124
+ ruby
125
+
126
+ DEPENDENCIES
127
+ appraisal (~> 1.0.0)
128
+ bundler
129
+ chef (= 10.26.0)
130
+ chef-handler-datadog!
131
+ dotenv
132
+ json (= 1.7.7)
133
+ pry
134
+ rake
135
+ rspec
136
+ rubocop (~> 0.20.1)
137
+ simplecov
138
+ travis-lint
139
+ vcr
140
+ webmock
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "chef", "10.32.2"
6
+ gem "json", "1.7.7"
7
+
8
+ group :localdev do
9
+ gem "pry"
10
+ gem "travis-lint"
11
+ end
12
+
13
+ gemspec :path => "../"
@@ -0,0 +1,140 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ chef-handler-datadog (0.4.0.alpha)
5
+ dogapi (>= 1.6)
6
+
7
+ GEM
8
+ remote: http://rubygems.org/
9
+ specs:
10
+ addressable (2.3.6)
11
+ appraisal (1.0.0)
12
+ bundler
13
+ rake
14
+ thor (>= 0.14.0)
15
+ ast (1.1.0)
16
+ bunny (0.7.9)
17
+ chef (10.32.2)
18
+ bunny (>= 0.6.0, < 0.8.0)
19
+ erubis
20
+ highline (~> 1.6, >= 1.6.9)
21
+ json (>= 1.4.4, <= 1.8.1)
22
+ mime-types (~> 1.16)
23
+ mixlib-authentication (~> 1.3)
24
+ mixlib-cli (~> 1.1)
25
+ mixlib-config (~> 1.1, >= 1.1.2)
26
+ mixlib-log (~> 1.3)
27
+ mixlib-shellout (~> 1.3)
28
+ moneta (< 0.7.0)
29
+ net-ssh (~> 2.6)
30
+ net-ssh-multi (~> 1.1.0)
31
+ ohai (>= 0.6.0, < 7.0.0)
32
+ rest-client (>= 1.0.4, < 1.7.0)
33
+ treetop (~> 1.4.9)
34
+ uuidtools
35
+ yajl-ruby (~> 1.1)
36
+ coderay (1.1.0)
37
+ crack (0.4.1)
38
+ safe_yaml (~> 0.9.0)
39
+ diff-lcs (1.2.5)
40
+ docile (1.1.3)
41
+ dogapi (1.9.2)
42
+ json (>= 1.5.1)
43
+ dotenv (0.10.0)
44
+ erubis (2.7.0)
45
+ hashr (0.0.22)
46
+ highline (1.6.21)
47
+ ipaddress (0.8.0)
48
+ json (1.7.7)
49
+ method_source (0.8.2)
50
+ mime-types (1.25.1)
51
+ mixlib-authentication (1.3.0)
52
+ mixlib-log
53
+ mixlib-cli (1.4.0)
54
+ mixlib-config (1.1.2)
55
+ mixlib-log (1.6.0)
56
+ mixlib-shellout (1.4.0)
57
+ moneta (0.6.0)
58
+ multi_json (1.9.2)
59
+ net-ssh (2.8.0)
60
+ net-ssh-gateway (1.2.0)
61
+ net-ssh (>= 2.6.5)
62
+ net-ssh-multi (1.1)
63
+ net-ssh (>= 2.1.4)
64
+ net-ssh-gateway (>= 0.99.0)
65
+ ohai (6.22.0)
66
+ ipaddress
67
+ mixlib-cli
68
+ mixlib-config
69
+ mixlib-log
70
+ mixlib-shellout
71
+ systemu (~> 2.5.2)
72
+ yajl-ruby
73
+ parser (2.1.8)
74
+ ast (~> 1.1)
75
+ slop (~> 3.4, >= 3.4.5)
76
+ polyglot (0.3.4)
77
+ powerpack (0.0.9)
78
+ pry (0.9.12.6)
79
+ coderay (~> 1.0)
80
+ method_source (~> 0.8)
81
+ slop (~> 3.4)
82
+ rainbow (2.0.0)
83
+ rake (10.3.1)
84
+ rest-client (1.6.7)
85
+ mime-types (>= 1.16)
86
+ rspec (2.14.1)
87
+ rspec-core (~> 2.14.0)
88
+ rspec-expectations (~> 2.14.0)
89
+ rspec-mocks (~> 2.14.0)
90
+ rspec-core (2.14.8)
91
+ rspec-expectations (2.14.5)
92
+ diff-lcs (>= 1.1.3, < 2.0)
93
+ rspec-mocks (2.14.6)
94
+ rubocop (0.20.1)
95
+ json (>= 1.7.7, < 2)
96
+ parser (~> 2.1.7)
97
+ powerpack (~> 0.0.6)
98
+ rainbow (>= 1.99.1, < 3.0)
99
+ ruby-progressbar (~> 1.4)
100
+ ruby-progressbar (1.4.2)
101
+ safe_yaml (0.9.7)
102
+ simplecov (0.8.2)
103
+ docile (~> 1.1.0)
104
+ multi_json
105
+ simplecov-html (~> 0.8.0)
106
+ simplecov-html (0.8.0)
107
+ slop (3.5.0)
108
+ systemu (2.5.2)
109
+ thor (0.19.1)
110
+ travis-lint (1.8.0)
111
+ hashr (~> 0.0.22)
112
+ safe_yaml (~> 0.9.0)
113
+ treetop (1.4.15)
114
+ polyglot
115
+ polyglot (>= 0.3.1)
116
+ uuidtools (2.1.4)
117
+ vcr (2.9.0)
118
+ webmock (1.17.4)
119
+ addressable (>= 2.2.7)
120
+ crack (>= 0.3.2)
121
+ yajl-ruby (1.2.0)
122
+
123
+ PLATFORMS
124
+ ruby
125
+
126
+ DEPENDENCIES
127
+ appraisal (~> 1.0.0)
128
+ bundler
129
+ chef (= 10.32.2)
130
+ chef-handler-datadog!
131
+ dotenv
132
+ json (= 1.7.7)
133
+ pry
134
+ rake
135
+ rspec
136
+ rubocop (~> 0.20.1)
137
+ simplecov
138
+ travis-lint
139
+ vcr
140
+ webmock