chef-handler-datadog 0.10.0 → 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01bc6ae7378af8b66b2d96bab70c6d4b24637f0b
4
- data.tar.gz: 104cd9bdb7bb30740ad127d1732d3438832a8346
3
+ metadata.gz: 308a47f2627c273fad10d5450844bd1f7df24fa2
4
+ data.tar.gz: 92becd3cd3618f5d912cd84dfbe1f2e12eed13d8
5
5
  SHA512:
6
- metadata.gz: e43909c4f1e8f5e596f9c887d056eb8b3fc348d2e304fbe67507f6c8abb73088be9ee34293d4e83838488838883d923fb1eb19f7d845c3693f01502ef52bc172
7
- data.tar.gz: 1906194964adb5ebe6d2ce82070b6598f91f6cb50a6a193550cced13b82b68d7978df3c3086e3f9a707b66a21ac9f26a297eba2e4f9007f60b4a5149ecb0725e
6
+ metadata.gz: c0be776ba0d0470bf430f3c34160690192fa03ca5ab1e1fd6a261b516a297915a8d1bfcf6dfc2129bb8ac31dbec712f09aa8cfe11321110318cf7b31bc23307e
7
+ data.tar.gz: 4d03811f3daa58f408b37a40779d6d7ee600278778392ae67fa3bfe46ab2f1dab9f7bf86003e939f30bee339b7d1d6feba4bf131244c98905eba2243b5f362bb
@@ -9,8 +9,8 @@ rvm:
9
9
  before_install:
10
10
  - gem update --system
11
11
  - gem --version
12
- # Use a stable version once 1.13.0 is released
13
- - gem install bundler --version 1.13.0.rc.1
12
+ # Use the latest bundler
13
+ - gem install bundler
14
14
 
15
15
  bundler_args: --without=localdev
16
16
 
@@ -1,6 +1,12 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ # 0.11.0 / 2017-02-21
5
+
6
+ * [FEATURE] Send policy name and group tags if they exist (opt-in) [#90][] & [#97][] [@david-ds][] & [@olivielpeau][]
7
+ * [BUGFIX] Improve detection of compile time error before sending event [#96][] [@olivielpeau][] (thanks [@DanielRedOak][] and [@andrewjamesbrown][])
8
+ * [BUGFIX] Remove spurious `puts` debug statement [#93][] [@kingpong][]
9
+
4
10
  # 0.10.0 / 2016-09-20
5
11
 
6
12
  * [FEATURE] Allow passing `scope_prefix` param that prefixes env and role tags [#82][] [@DanielMuller][]
@@ -100,15 +106,23 @@ And all other versions were prior to this. See git history for more.
100
106
  [#86]: https://github.com/DataDog/chef-handler-datadog/issues/86
101
107
  [#87]: https://github.com/DataDog/chef-handler-datadog/issues/87
102
108
  [#89]: https://github.com/DataDog/chef-handler-datadog/issues/89
109
+ [#90]: https://github.com/DataDog/chef-handler-datadog/issues/90
110
+ [#93]: https://github.com/DataDog/chef-handler-datadog/issues/93
111
+ [#96]: https://github.com/DataDog/chef-handler-datadog/issues/96
112
+ [#97]: https://github.com/DataDog/chef-handler-datadog/issues/97
103
113
  [@ABrehm264]: https://github.com/ABrehm264
104
114
  [@DanielMuller]: https://github.com/DanielMuller
115
+ [@DanielRedOak]: https://github.com/DanielRedOak
105
116
  [@alq]: https://github.com/alq
117
+ [@andrewjamesbrown]: https://github.com/andrewjamesbrown
106
118
  [@bigbam505]: https://github.com/bigbam505
107
119
  [@datwiz]: https://github.com/datwiz
120
+ [@david-ds]: https://github.com/david-ds
108
121
  [@degemer]: https://github.com/degemer
109
122
  [@devonbleak]: https://github.com/devonbleak
110
123
  [@dwradcliffe]: https://github.com/dwradcliffe
111
124
  [@jhulten]: https://github.com/jhulten
125
+ [@kingpong]: https://github.com/kingpong
112
126
  [@miketheman]: https://github.com/miketheman
113
127
  [@mstepniowski]: https://github.com/mstepniowski
114
128
  [@olivielpeau]: https://github.com/olivielpeau
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency 'bundler'
21
21
  gem.add_development_dependency 'chef', '>= 10.14.4', '<= 13'
22
22
  gem.add_development_dependency 'dotenv'
23
- gem.add_development_dependency 'rake'
23
+ gem.add_development_dependency 'rake', '< 12.0'
24
24
  gem.add_development_dependency 'rspec', '~> 3.2.0'
25
25
  gem.add_development_dependency 'rubocop', '~> 0.34.2'
26
26
  gem.add_development_dependency 'simplecov'
@@ -59,6 +59,7 @@ class Chef
59
59
  .with_retries(config[:tags_submission_retries])
60
60
  .with_tag_blacklist(config[:tags_blacklist_regex])
61
61
  .with_scope_prefix(config[:scope_prefix])
62
+ .with_policy_tags_enabled(config[:send_policy_tags])
62
63
 
63
64
  # Build the chef event information
64
65
  @event =
@@ -96,7 +97,6 @@ class Chef
96
97
  (config.key?(:use_ec2_instance_id) && config[:use_ec2_instance_id])
97
98
 
98
99
  if config[:hostname]
99
- puts "found hostname #{config[:hostname]} in config object"
100
100
  config[:hostname]
101
101
  elsif use_ec2_instance_id && node.attribute?('ec2') && node.ec2.attribute?('instance_id')
102
102
  node.ec2.instance_id
@@ -4,8 +4,12 @@ require 'chef/handler'
4
4
  require 'chef/mash'
5
5
  require 'dogapi'
6
6
 
7
+ require_relative 'datadog_util'
8
+
7
9
  # helper class for sending events about chef runs
8
10
  class DatadogChefEvents
11
+ include DatadogUtil
12
+
9
13
  def initialize
10
14
  @hostname = nil
11
15
  @run_status = nil
@@ -128,7 +132,7 @@ class DatadogChefEvents
128
132
  def build_event_data
129
133
  # bail early in case of a compiletime failure
130
134
  # OPTIMIZE: Use better inspectors to handle failure scenarios, refactor needed.
131
- if @run_status.elapsed_time.nil?
135
+ if compile_error?
132
136
  @alert_type = 'error'
133
137
  @event_title = "Chef failed during compile phase on #{@hostname} "
134
138
  @event_priority = 'normal'
@@ -1,8 +1,12 @@
1
1
  # encoding: utf-8
2
2
  require 'dogapi'
3
3
 
4
+ require_relative 'datadog_util'
5
+
4
6
  # helper class for sending datadog metrics from a chef run
5
7
  class DatadogChefMetrics
8
+ include DatadogUtil
9
+
6
10
  def initialize
7
11
  @hostname = ''
8
12
  @run_status = nil
@@ -46,10 +50,4 @@ class DatadogChefMetrics
46
50
  rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT => e
47
51
  Chef::Log.error("Could not send metrics to Datadog. Connection error:\n" + e)
48
52
  end
49
-
50
- private
51
-
52
- def compile_error?
53
- @run_status.all_resources.nil? || @run_status.elapsed_time.nil? || @run_status.updated_resources.nil?
54
- end
55
53
  end # end class DatadogChefMetrics
@@ -15,6 +15,7 @@ class DatadogChefTags
15
15
  @retries = 0
16
16
  @combined_host_tags = nil
17
17
  @regex_black_list = nil
18
+ @policy_tags_enabled = false
18
19
  end
19
20
 
20
21
  # set the chef run status used for the report
@@ -76,6 +77,15 @@ class DatadogChefTags
76
77
  self
77
78
  end
78
79
 
80
+ # enable policy tags
81
+ #
82
+ # @param enabled [TrueClass,FalseClass] enable or disable policy tags
83
+ # @return [DatadogChefTags] instance reference to self enabling method chaining
84
+ def with_policy_tags_enabled(enabled)
85
+ @policy_tags_enabled = enabled unless enabled.nil?
86
+ self
87
+ end
88
+
79
89
  # send updated chef run generated tags to Datadog
80
90
  #
81
91
  # @param dog [Dogapi::Client] Dogapi Client to be used
@@ -113,7 +123,7 @@ class DatadogChefTags
113
123
  # @return [Array] the set of host tags based off the chef run
114
124
  def combined_host_tags
115
125
  # Combine (union) all arrays. Removes duplicates if found.
116
- node_env.split | node_roles | node_tags
126
+ node_env.split | node_roles | node_policy_tags | node_tags
117
127
  end
118
128
 
119
129
  private
@@ -126,6 +136,21 @@ class DatadogChefTags
126
136
  "#{@scope_prefix}env:#{@node.chef_environment}" if @node.respond_to?('chef_environment')
127
137
  end
128
138
 
139
+ # Send the policy name and policy group as chef tags when using chef policyfiles feature
140
+ # The policy_group and policy_name attributes exist only for chef >= 12.5.1
141
+ def node_policy_tags
142
+ policy_tags = []
143
+ if @policy_tags_enabled
144
+ if @node.respond_to?('policy_group') && !@node.policy_group.nil?
145
+ policy_tags << "#{@scope_prefix}policy_group:#{@node.policy_group}"
146
+ end
147
+ if @node.respond_to?('policy_name') && !@node.policy_name.nil?
148
+ policy_tags << "#{@scope_prefix}policy_name:#{@node.policy_name}"
149
+ end
150
+ end
151
+ policy_tags
152
+ end
153
+
129
154
  def node_tags
130
155
  return [] unless @node.tags
131
156
  output = @node.tags.map { |tag| "#{@tag_prefix}#{tag}" }
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+ # util class that groups common methods used by the helper classes
3
+ module DatadogUtil
4
+ private
5
+
6
+ def compile_error?
7
+ @run_status.all_resources.nil? || @run_status.elapsed_time.nil? || @run_status.updated_resources.nil?
8
+ end
9
+ end
@@ -2,5 +2,5 @@
2
2
  # Helper module for version number only.
3
3
  # Real deal in 'chef/handler/datadog.rb'
4
4
  module ChefHandlerDatadog
5
- VERSION = '0.10.0'
5
+ VERSION = '0.11.0'
6
6
  end
@@ -324,6 +324,49 @@ describe Chef::Handler::Datadog, :vcr => :new_episodes do
324
324
  )).to have_been_made.times(1)
325
325
  end
326
326
  end
327
+
328
+ describe 'when policy tags are not enabled' do
329
+ # This feature is available only for chef >= 12.5.1
330
+ if Chef::Version.new(Chef::VERSION) < Chef::Version.new("12.5.1")
331
+ next
332
+ end
333
+ it 'does not set the policy name and policy group tags' do
334
+ @node.send(:policy_name, 'the_policy_name')
335
+ @node.send(:policy_group, 'the_policy_group')
336
+ @handler.run_report_unsafe(@run_status)
337
+
338
+ expect(a_request(:put, HOST_TAG_ENDPOINT + @node.name).with(
339
+ :query => { 'api_key' => @handler.config[:api_key],
340
+ 'application_key' => @handler.config[:application_key],
341
+ 'source' => 'chef' },
342
+ :body => hash_including(:tags => [
343
+ 'env:hostile', 'role:highlander'
344
+ ]),
345
+ )).to have_been_made.times(1)
346
+ end
347
+ end
348
+
349
+ describe 'when policy tags are enabled' do
350
+ # This feature is available only for chef >= 12.5.1
351
+ if Chef::Version.new(Chef::VERSION) < Chef::Version.new("12.5.1")
352
+ next
353
+ end
354
+ it 'sets the policy name and policy group tags' do
355
+ @node.send(:policy_name, 'the_policy_name')
356
+ @node.send(:policy_group, 'the_policy_group')
357
+ @handler.config[:send_policy_tags] = true
358
+ @handler.run_report_unsafe(@run_status)
359
+
360
+ expect(a_request(:put, HOST_TAG_ENDPOINT + @node.name).with(
361
+ :query => { 'api_key' => @handler.config[:api_key],
362
+ 'application_key' => @handler.config[:application_key],
363
+ 'source' => 'chef' },
364
+ :body => hash_including(:tags => [
365
+ 'env:hostile', 'role:highlander', 'policy_group:the_policy_group', 'policy_name:the_policy_name'
366
+ ]),
367
+ )).to have_been_made.times(1)
368
+ end
369
+ end
327
370
  end
328
371
 
329
372
  context 'tags submission retries' do
@@ -525,7 +568,6 @@ describe Chef::Handler::Datadog, :vcr => :new_episodes do
525
568
  @node = Chef::Node.build('chef.handler.datadog.test-resources')
526
569
  @node.send(:chef_environment, 'resources')
527
570
  @events = Chef::EventDispatch::Dispatcher.new
528
- @run_context = Chef::RunContext.new(@node, {}, @events)
529
571
  @run_status = Chef::RunStatus.new(@node, @events)
530
572
  end
531
573
 
@@ -548,6 +590,36 @@ describe Chef::Handler::Datadog, :vcr => :new_episodes do
548
590
  )).to have_been_made.times(1)
549
591
  end
550
592
  end
593
+
594
+ context 'failure during compile phase with an elapsed time and incomplete resource collection' do
595
+ before(:each) do
596
+ @run_context = Chef::RunContext.new(@node, {}, @events)
597
+
598
+ allow(@run_context.resource_collection).to receive(:all_resources).and_return(nil)
599
+ @run_status.run_context = @run_context
600
+
601
+ @expected_time = Time.now
602
+ allow(Time).to receive(:now).and_return(@expected_time, @expected_time + 5)
603
+ @run_status.start_clock
604
+ @run_status.stop_clock
605
+
606
+ @handler.run_report_unsafe(@run_status)
607
+ end
608
+
609
+ it 'only emits the run status metrics' do
610
+ expect(a_request(:post, METRICS_ENDPOINT).with(
611
+ :query => { 'api_key' => @handler.config[:api_key] }
612
+ )).to have_been_made.times(2)
613
+ end
614
+
615
+ it 'posts an event' do
616
+ expect(a_request(:post, EVENTS_ENDPOINT).with(
617
+ :query => { 'api_key' => @handler.config[:api_key] },
618
+ :body => hash_including(:msg_text => 'Chef was unable to complete a run, an error during compilation may have occured.'),
619
+ :body => hash_including(:msg_title => "Chef failed during compile phase on #{@node.name} "),
620
+ )).to have_been_made.times(1)
621
+ end
622
+ end
551
623
  end
552
624
 
553
625
  describe '#endpoints' do
@@ -0,0 +1,173 @@
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.success","points":[[1485547327,1.0]],"type":"counter","host":"chef.handler.datadog.test-resources","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
+ - Fri, 27 Jan 2017 20:02:02 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: Fri, 27 Jan 2017 20:02:07 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.run.failure","points":[[1485547327,0.0]],"type":"counter","host":"chef.handler.datadog.test-resources","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
+ - Fri, 27 Jan 2017 20:02:02 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: Fri, 27 Jan 2017 20:02:07 GMT
81
+ - request:
82
+ method: post
83
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
84
+ body:
85
+ encoding: UTF-8
86
+ string: '{"msg_text":"Chef was unable to complete a run, an error during compilation
87
+ may have occurred.","date_happened":1485547327,"msg_title":"Chef failed during
88
+ 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
89
+ failed during compile phase on chef.handler.datadog.test-resources ","text":"Chef
90
+ was unable to complete a run, an error during compilation may have occurred.","host":"chef.handler.datadog.test-resources","device":null}'
91
+ headers:
92
+ Accept-Encoding:
93
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
94
+ Accept:
95
+ - "*/*"
96
+ User-Agent:
97
+ - Ruby
98
+ Content-Type:
99
+ - application/json
100
+ response:
101
+ status:
102
+ code: 202
103
+ message: Accepted
104
+ headers:
105
+ Content-Type:
106
+ - text/plain; charset=utf-8
107
+ Date:
108
+ - Fri, 27 Jan 2017 20:02:02 GMT
109
+ Dd-Pool:
110
+ - propjoe
111
+ Strict-Transport-Security:
112
+ - max-age=15724800;
113
+ X-Content-Type-Options:
114
+ - nosniff
115
+ Content-Length:
116
+ - '401'
117
+ Connection:
118
+ - keep-alive
119
+ body:
120
+ encoding: UTF-8
121
+ string: '{"status":"ok","event":{"id":913219659465841444,"title":"Chef failed
122
+ during compile phase on chef.handler.datadog.test-resources ","text":"Chef
123
+ was unable to complete a run, an error during compilation may have occurred.","date_happened":1485547327,"handle":null,"priority":"normal","related_event_id":null,"tags":["env:resources"],"url":"https://app.datadoghq.com/event/event?id=913219659465841444"}}'
124
+ http_version:
125
+ recorded_at: Fri, 27 Jan 2017 20:02:07 GMT
126
+ - request:
127
+ method: put
128
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-resources?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
129
+ body:
130
+ encoding: UTF-8
131
+ string: '{"tags":["env:resources"]}'
132
+ headers:
133
+ Accept-Encoding:
134
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
135
+ Accept:
136
+ - "*/*"
137
+ User-Agent:
138
+ - Ruby
139
+ Content-Type:
140
+ - application/json
141
+ response:
142
+ status:
143
+ code: 201
144
+ message: Created
145
+ headers:
146
+ Cache-Control:
147
+ - no-cache
148
+ Content-Type:
149
+ - application/json
150
+ Date:
151
+ - Fri, 27 Jan 2017 20:02:02 GMT
152
+ Dd-Pool:
153
+ - dogweb_sameorig
154
+ Pragma:
155
+ - no-cache
156
+ Strict-Transport-Security:
157
+ - max-age=15724800;
158
+ X-Content-Type-Options:
159
+ - nosniff
160
+ X-Dd-Debug:
161
+ - tfYTpqMVXM3M7Ic3NSslg9OvOysbx8Mrdhv4OAsMKCDdYga06HUB/8z0VnhYMv3C
162
+ X-Frame-Options:
163
+ - SAMEORIGIN
164
+ Content-Length:
165
+ - '71'
166
+ Connection:
167
+ - keep-alive
168
+ body:
169
+ encoding: UTF-8
170
+ string: '{"host":"chef.handler.datadog.test-resources","tags":["env:resources"]}'
171
+ http_version:
172
+ recorded_at: Fri, 27 Jan 2017 20:02:07 GMT
173
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,173 @@
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.success","points":[[1485547327,1.0]],"type":"counter","host":"chef.handler.datadog.test-resources","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
+ - Fri, 27 Jan 2017 20:02:02 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: Fri, 27 Jan 2017 20:02:07 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.run.failure","points":[[1485547327,0.0]],"type":"counter","host":"chef.handler.datadog.test-resources","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
+ - Fri, 27 Jan 2017 20:02:02 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: Fri, 27 Jan 2017 20:02:07 GMT
81
+ - request:
82
+ method: post
83
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
84
+ body:
85
+ encoding: UTF-8
86
+ string: '{"msg_text":"Chef was unable to complete a run, an error during compilation
87
+ may have occurred.","date_happened":1485547327,"msg_title":"Chef failed during
88
+ 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
89
+ failed during compile phase on chef.handler.datadog.test-resources ","text":"Chef
90
+ was unable to complete a run, an error during compilation may have occurred.","host":"chef.handler.datadog.test-resources","device":null}'
91
+ headers:
92
+ Accept-Encoding:
93
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
94
+ Accept:
95
+ - "*/*"
96
+ User-Agent:
97
+ - Ruby
98
+ Content-Type:
99
+ - application/json
100
+ response:
101
+ status:
102
+ code: 202
103
+ message: Accepted
104
+ headers:
105
+ Content-Type:
106
+ - text/plain; charset=utf-8
107
+ Date:
108
+ - Fri, 27 Jan 2017 20:02:02 GMT
109
+ Dd-Pool:
110
+ - propjoe
111
+ Strict-Transport-Security:
112
+ - max-age=15724800;
113
+ X-Content-Type-Options:
114
+ - nosniff
115
+ Content-Length:
116
+ - '401'
117
+ Connection:
118
+ - keep-alive
119
+ body:
120
+ encoding: UTF-8
121
+ string: '{"status":"ok","event":{"id":913219665218676295,"title":"Chef failed
122
+ during compile phase on chef.handler.datadog.test-resources ","text":"Chef
123
+ was unable to complete a run, an error during compilation may have occurred.","date_happened":1485547327,"handle":null,"priority":"normal","related_event_id":null,"tags":["env:resources"],"url":"https://app.datadoghq.com/event/event?id=913219665218676295"}}'
124
+ http_version:
125
+ recorded_at: Fri, 27 Jan 2017 20:02:07 GMT
126
+ - request:
127
+ method: put
128
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-resources?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
129
+ body:
130
+ encoding: UTF-8
131
+ string: '{"tags":["env:resources"]}'
132
+ headers:
133
+ Accept-Encoding:
134
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
135
+ Accept:
136
+ - "*/*"
137
+ User-Agent:
138
+ - Ruby
139
+ Content-Type:
140
+ - application/json
141
+ response:
142
+ status:
143
+ code: 201
144
+ message: Created
145
+ headers:
146
+ Cache-Control:
147
+ - no-cache
148
+ Content-Type:
149
+ - application/json
150
+ Date:
151
+ - Fri, 27 Jan 2017 20:02:02 GMT
152
+ Dd-Pool:
153
+ - dogweb_sameorig
154
+ Pragma:
155
+ - no-cache
156
+ Strict-Transport-Security:
157
+ - max-age=15724800;
158
+ X-Content-Type-Options:
159
+ - nosniff
160
+ X-Dd-Debug:
161
+ - gViavZoY8rjtSLcIomJIWXS+mOF/f74cR9lPqFPI7NQ=
162
+ X-Frame-Options:
163
+ - SAMEORIGIN
164
+ Content-Length:
165
+ - '71'
166
+ Connection:
167
+ - keep-alive
168
+ body:
169
+ encoding: UTF-8
170
+ string: '{"host":"chef.handler.datadog.test-resources","tags":["env:resources"]}'
171
+ http_version:
172
+ recorded_at: Fri, 27 Jan 2017 20:02:07 GMT
173
+ recorded_with: VCR 3.0.3
@@ -0,0 +1,289 @@
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.success","points":[[1453838676,1.0]],"type":"counter","host":"chef.handler.datadog.test-tags","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:31 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:36 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.run.failure","points":[[1453838676,0.0]],"type":"counter","host":"chef.handler.datadog.test-tags","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:31 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:36 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.total","points":[[1453838676,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","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:31 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:36 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.updated","points":[[1453838676,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","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:31 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:36 GMT
159
+ - request:
160
+ method: post
161
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
162
+ body:
163
+ encoding: UTF-8
164
+ string: '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1453838676,5.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
165
+ headers:
166
+ Accept-Encoding:
167
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
168
+ Accept:
169
+ - "*/*"
170
+ User-Agent:
171
+ - Ruby
172
+ Content-Type:
173
+ - application/json
174
+ response:
175
+ status:
176
+ code: 202
177
+ message: Accepted
178
+ headers:
179
+ Content-Type:
180
+ - text/json
181
+ Date:
182
+ - Tue, 26 Jan 2016 20:04:31 GMT
183
+ Dd-Pool:
184
+ - propjoe
185
+ Strict-Transport-Security:
186
+ - max-age=15724800;
187
+ X-Content-Type-Options:
188
+ - nosniff
189
+ Content-Length:
190
+ - '16'
191
+ Connection:
192
+ - keep-alive
193
+ body:
194
+ encoding: UTF-8
195
+ string: '{"status": "ok"}'
196
+ http_version:
197
+ recorded_at: Tue, 26 Jan 2016 20:04:36 GMT
198
+ - request:
199
+ method: post
200
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
201
+ body:
202
+ encoding: UTF-8
203
+ string: '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1458601273,"msg_title":"Chef
204
+ completed in 5 seconds on chef.handler.datadog.test-tags ","priority":"low","parent":null,"tags":["env:hostile","role:highlander","tag:the_one_and_only","tag:datacenter:my-cloud"],"aggregation_key":"chef.handler.datadog.test-tags","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
205
+ completed in 5 seconds on chef.handler.datadog.test-tags ","text":"Chef updated
206
+ 0 resources out of 0 resources total.","host":"chef.handler.datadog.test-tags","device":null}'
207
+ headers:
208
+ Accept-Encoding:
209
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
210
+ Accept:
211
+ - "*/*"
212
+ User-Agent:
213
+ - Ruby
214
+ Content-Type:
215
+ - application/json
216
+ response:
217
+ status:
218
+ code: 202
219
+ message: Accepted
220
+ headers:
221
+ Content-Type:
222
+ - text/plain; charset=utf-8
223
+ Date:
224
+ - Tue, 26 Jan 2016 20:04:31 GMT
225
+ Dd-Pool:
226
+ - propjoe
227
+ Strict-Transport-Security:
228
+ - max-age=15724800;
229
+ X-Content-Type-Options:
230
+ - nosniff
231
+ Content-Length:
232
+ - '422'
233
+ Connection:
234
+ - keep-alive
235
+ body:
236
+ encoding: UTF-8
237
+ string: '{"status":"ok","event":{"id":461139917332183580,"title":"Chef completed
238
+ in 5 seconds on chef.handler.datadog.test-tags ","text":"Chef updated 0 resources
239
+ out of 0 resources total.","date_happened":1458601273,"handle":null,"priority":"low","related_event_id":null,"tags":["env:hostile","role:highlander","tag:the_one_and_only","tag:datacenter:my-cloud"],"url":"https://app.datadoghq.com/event/event?id=461139917332183580"}}'
240
+ http_version:
241
+ recorded_at: Mon, 21 Mar 2016 23:01:13 GMT
242
+ - request:
243
+ method: put
244
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-tags?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
245
+ body:
246
+ encoding: UTF-8
247
+ string: '{"tags":["env:hostile","role:highlander","policy_group:the_policy_group","policy_name:the_policy_name"]}'
248
+ headers:
249
+ Accept-Encoding:
250
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
251
+ Accept:
252
+ - "*/*"
253
+ User-Agent:
254
+ - Ruby
255
+ Content-Type:
256
+ - application/json
257
+ response:
258
+ status:
259
+ code: 201
260
+ message: Created
261
+ headers:
262
+ Cache-Control:
263
+ - no-cache
264
+ Content-Type:
265
+ - application/json
266
+ Date:
267
+ - Tue, 26 Jan 2016 20:04:31 GMT
268
+ Dd-Pool:
269
+ - dogweb_sameorig
270
+ Pragma:
271
+ - no-cache
272
+ Strict-Transport-Security:
273
+ - max-age=15724800;
274
+ X-Content-Type-Options:
275
+ - nosniff
276
+ X-Dd-Debug:
277
+ - EhhnoBinSJ/mFOFx8c30LkIq8VSKonD/kqf6I2QWUws=
278
+ X-Frame-Options:
279
+ - SAMEORIGIN
280
+ Content-Length:
281
+ - '137'
282
+ Connection:
283
+ - keep-alive
284
+ body:
285
+ encoding: UTF-8
286
+ string: '{"host": "chef.handler.datadog.test-tags", "tags":["env:hostile","role:highlander","policy_group:the_policy_group","policy_name:the_policy_name"]}'
287
+ http_version:
288
+ recorded_at: Tue, 26 Jan 2016 20:04:36 GMT
289
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,289 @@
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.success","points":[[1486079857,1.0]],"type":"counter","host":"chef.handler.datadog.test-tags","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
+ - Thu, 02 Feb 2017 23:57:32 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: Thu, 02 Feb 2017 23:57:37 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.run.failure","points":[[1486079857,0.0]],"type":"counter","host":"chef.handler.datadog.test-tags","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
+ - Thu, 02 Feb 2017 23:57:32 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: Thu, 02 Feb 2017 23:57:37 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.total","points":[[1486079857,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","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
+ - Thu, 02 Feb 2017 23:57:32 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: Thu, 02 Feb 2017 23:57:37 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.updated","points":[[1486079857,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","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
+ - Thu, 02 Feb 2017 23:57:32 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: Thu, 02 Feb 2017 23:57:37 GMT
159
+ - request:
160
+ method: post
161
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
162
+ body:
163
+ encoding: UTF-8
164
+ string: '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1486079857,5.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
165
+ headers:
166
+ Accept-Encoding:
167
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
168
+ Accept:
169
+ - "*/*"
170
+ User-Agent:
171
+ - Ruby
172
+ Content-Type:
173
+ - application/json
174
+ response:
175
+ status:
176
+ code: 202
177
+ message: Accepted
178
+ headers:
179
+ Content-Type:
180
+ - text/json
181
+ Date:
182
+ - Thu, 02 Feb 2017 23:57:33 GMT
183
+ Dd-Pool:
184
+ - propjoe
185
+ Strict-Transport-Security:
186
+ - max-age=15724800;
187
+ X-Content-Type-Options:
188
+ - nosniff
189
+ Content-Length:
190
+ - '16'
191
+ Connection:
192
+ - keep-alive
193
+ body:
194
+ encoding: UTF-8
195
+ string: '{"status": "ok"}'
196
+ http_version:
197
+ recorded_at: Thu, 02 Feb 2017 23:57:37 GMT
198
+ - request:
199
+ method: post
200
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
201
+ body:
202
+ encoding: UTF-8
203
+ string: '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1486079857,"msg_title":"Chef
204
+ completed in 5 seconds on chef.handler.datadog.test-tags ","priority":"low","parent":null,"tags":["env:hostile","role:highlander"],"aggregation_key":"chef.handler.datadog.test-tags","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
205
+ completed in 5 seconds on chef.handler.datadog.test-tags ","text":"Chef updated
206
+ 0 resources out of 0 resources total.","host":"chef.handler.datadog.test-tags","device":null}'
207
+ headers:
208
+ Accept-Encoding:
209
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
210
+ Accept:
211
+ - "*/*"
212
+ User-Agent:
213
+ - Ruby
214
+ Content-Type:
215
+ - application/json
216
+ response:
217
+ status:
218
+ code: 202
219
+ message: Accepted
220
+ headers:
221
+ Content-Type:
222
+ - text/plain; charset=utf-8
223
+ Date:
224
+ - Thu, 02 Feb 2017 23:57:33 GMT
225
+ Dd-Pool:
226
+ - propjoe
227
+ Strict-Transport-Security:
228
+ - max-age=15724800;
229
+ X-Content-Type-Options:
230
+ - nosniff
231
+ Content-Length:
232
+ - '373'
233
+ Connection:
234
+ - keep-alive
235
+ body:
236
+ encoding: UTF-8
237
+ string: '{"status":"ok","event":{"id":922154041878767484,"title":"Chef completed
238
+ in 5 seconds on chef.handler.datadog.test-tags ","text":"Chef updated 0 resources
239
+ out of 0 resources total.","date_happened":1486079857,"handle":null,"priority":"low","related_event_id":null,"tags":["env:hostile","role:highlander"],"url":"https://app.datadoghq.com/event/event?id=922154041878767484"}}'
240
+ http_version:
241
+ recorded_at: Thu, 02 Feb 2017 23:57:37 GMT
242
+ - request:
243
+ method: put
244
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-tags?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
245
+ body:
246
+ encoding: UTF-8
247
+ string: '{"tags":["env:hostile","role:highlander"]}'
248
+ headers:
249
+ Accept-Encoding:
250
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
251
+ Accept:
252
+ - "*/*"
253
+ User-Agent:
254
+ - Ruby
255
+ Content-Type:
256
+ - application/json
257
+ response:
258
+ status:
259
+ code: 201
260
+ message: Created
261
+ headers:
262
+ Cache-Control:
263
+ - no-cache
264
+ Content-Type:
265
+ - application/json
266
+ Date:
267
+ - Thu, 02 Feb 2017 23:57:33 GMT
268
+ Dd-Pool:
269
+ - dogweb_sameorig
270
+ Pragma:
271
+ - no-cache
272
+ Strict-Transport-Security:
273
+ - max-age=15724800;
274
+ X-Content-Type-Options:
275
+ - nosniff
276
+ X-Dd-Debug:
277
+ - fTGHC5140Slzi8+VUckQeb7JtG5SB73QXNv+4EfnG/s=
278
+ X-Frame-Options:
279
+ - SAMEORIGIN
280
+ Content-Length:
281
+ - '82'
282
+ Connection:
283
+ - keep-alive
284
+ body:
285
+ encoding: UTF-8
286
+ string: '{"host":"chef.handler.datadog.test-tags","tags":["env:hostile","role:highlander"]}'
287
+ http_version:
288
+ recorded_at: Thu, 02 Feb 2017 23:57:37 GMT
289
+ recorded_with: VCR 3.0.3
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.10.0
4
+ version: 0.11.0
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-09-20 00:00:00.000000000 Z
13
+ date: 2017-02-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: dogapi
@@ -92,16 +92,16 @@ dependencies:
92
92
  name: rake
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - "<"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: '12.0'
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - "<"
103
103
  - !ruby/object:Gem::Version
104
- version: '0'
104
+ version: '12.0'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rspec
107
107
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +204,7 @@ files:
204
204
  - lib/chef/handler/datadog_chef_events.rb
205
205
  - lib/chef/handler/datadog_chef_metrics.rb
206
206
  - lib/chef/handler/datadog_chef_tags.rb
207
+ - lib/chef/handler/datadog_util.rb
207
208
  - lib/chef_handler_datadog.rb
208
209
  - spec/datadog_spec.rb
209
210
  - spec/spec_helper.rb
@@ -222,6 +223,10 @@ files:
222
223
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/sets_tags/puts_the_tags_for_the_current_node.yml
223
224
  - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_the_run_status_metrics.yml
224
225
  - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/posts_an_event.yml
226
+ - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase_with_an_elapsed_time_and_incomplete_resource_collection/only_emits_the_run_status_metrics.yml
227
+ - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase_with_an_elapsed_time_and_incomplete_resource_collection/posts_an_event.yml
228
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_policy_tags_are_enabled/sets_the_policy_name_and_policy_group_tags.yml
229
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_policy_tags_are_not_enabled/does_not_set_the_policy_name_and_policy_group_tags.yml
225
230
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_scope_prefix.yml
226
231
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_tag_prefix.yml
227
232
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_scope_prefix.yml
@@ -257,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
262
  version: '0'
258
263
  requirements: []
259
264
  rubyforge_project:
260
- rubygems_version: 2.6.4
265
+ rubygems_version: 2.6.8
261
266
  signing_key:
262
267
  specification_version: 4
263
268
  summary: Chef Handler reports events and metrics to Datadog
@@ -279,6 +284,10 @@ test_files:
279
284
  - spec/support/cassettes/Chef_Handler_Datadog/reports_metrics_event_and_sets_tags/sets_tags/puts_the_tags_for_the_current_node.yml
280
285
  - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/only_emits_the_run_status_metrics.yml
281
286
  - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase/posts_an_event.yml
287
+ - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase_with_an_elapsed_time_and_incomplete_resource_collection/only_emits_the_run_status_metrics.yml
288
+ - spec/support/cassettes/Chef_Handler_Datadog/resources/failure_during_compile_phase_with_an_elapsed_time_and_incomplete_resource_collection/posts_an_event.yml
289
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_policy_tags_are_enabled/sets_the_policy_name_and_policy_group_tags.yml
290
+ - spec/support/cassettes/Chef_Handler_Datadog/tags/when_policy_tags_are_not_enabled/does_not_set_the_policy_name_and_policy_group_tags.yml
282
291
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_scope_prefix.yml
283
292
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_empty_tag_prefix.yml
284
293
  - spec/support/cassettes/Chef_Handler_Datadog/tags/when_specified/allows_for_user-specified_scope_prefix.yml
@@ -294,4 +303,3 @@ test_files:
294
303
  - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_events/posts_an_event.yml
295
304
  - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/emits_metrics/reports_metrics.yml
296
305
  - spec/support/cassettes/Chef_Handler_Datadog/when_reporting_to_multiple_endpoints/sets_tags/puts_the_tags_for_the_current_node.yml
297
- has_rdoc: