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,143 @@
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.resources.total","points":[[1410264888,0.0]],"type":"gauge","host":"chef.handler.datadog.test-noapp","device":null}]}'
9
+ headers:
10
+ Accept:
11
+ - ! '*/*'
12
+ User-Agent:
13
+ - Ruby
14
+ Content-Type:
15
+ - application/json
16
+ response:
17
+ status:
18
+ code: 202
19
+ message: Accepted
20
+ headers:
21
+ Content-Type:
22
+ - text/json; charset=UTF-8
23
+ Date:
24
+ - Tue, 09 Sep 2014 12:14:44 GMT
25
+ Server:
26
+ - dogdispatcher/5.1.1
27
+ Content-Length:
28
+ - '15'
29
+ Connection:
30
+ - keep-alive
31
+ body:
32
+ encoding: US-ASCII
33
+ string: ! '{"status":"ok"}'
34
+ http_version:
35
+ recorded_at: Tue, 09 Sep 2014 12:14:48 GMT
36
+ - request:
37
+ method: post
38
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
39
+ body:
40
+ encoding: UTF-8
41
+ string: ! '{"series":[{"metric":"chef.resources.updated","points":[[1410264888,0.0]],"type":"gauge","host":"chef.handler.datadog.test-noapp","device":null}]}'
42
+ headers:
43
+ Accept:
44
+ - ! '*/*'
45
+ User-Agent:
46
+ - Ruby
47
+ Content-Type:
48
+ - application/json
49
+ response:
50
+ status:
51
+ code: 202
52
+ message: Accepted
53
+ headers:
54
+ Content-Type:
55
+ - text/json; charset=UTF-8
56
+ Date:
57
+ - Tue, 09 Sep 2014 12:14:44 GMT
58
+ Server:
59
+ - dogdispatcher/5.1.1
60
+ Content-Length:
61
+ - '15'
62
+ Connection:
63
+ - keep-alive
64
+ body:
65
+ encoding: US-ASCII
66
+ string: ! '{"status":"ok"}'
67
+ http_version:
68
+ recorded_at: Tue, 09 Sep 2014 12:14:48 GMT
69
+ - request:
70
+ method: post
71
+ uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
72
+ body:
73
+ encoding: UTF-8
74
+ string: ! '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1410264888,5.0]],"type":"gauge","host":"chef.handler.datadog.test-noapp","device":null}]}'
75
+ headers:
76
+ Accept:
77
+ - ! '*/*'
78
+ User-Agent:
79
+ - Ruby
80
+ Content-Type:
81
+ - application/json
82
+ response:
83
+ status:
84
+ code: 202
85
+ message: Accepted
86
+ headers:
87
+ Content-Type:
88
+ - text/json; charset=UTF-8
89
+ Date:
90
+ - Tue, 09 Sep 2014 12:14:45 GMT
91
+ Server:
92
+ - dogdispatcher/5.1.1
93
+ Content-Length:
94
+ - '15'
95
+ Connection:
96
+ - keep-alive
97
+ body:
98
+ encoding: US-ASCII
99
+ string: ! '{"status":"ok"}'
100
+ http_version:
101
+ recorded_at: Tue, 09 Sep 2014 12:14:48 GMT
102
+ - request:
103
+ method: post
104
+ uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
105
+ body:
106
+ encoding: UTF-8
107
+ string: ! '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1410264888,"msg_title":"Chef
108
+ completed in 5 seconds on chef.handler.datadog.test-noapp ","priority":"low","parent":null,"tags":["env:hostile","role:highlander","tag:the_one_and_only"],"aggregation_key":"chef.handler.datadog.test-noapp","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
109
+ completed in 5 seconds on chef.handler.datadog.test-noapp ","text":"Chef updated
110
+ 0 resources out of 0 resources total.","host":"chef.handler.datadog.test-noapp","device":null}'
111
+ headers:
112
+ Accept:
113
+ - ! '*/*'
114
+ User-Agent:
115
+ - Ruby
116
+ Content-Type:
117
+ - application/json
118
+ response:
119
+ status:
120
+ code: 202
121
+ message: Accepted
122
+ headers:
123
+ Content-Type:
124
+ - text/json; charset=UTF-8
125
+ Date:
126
+ - Tue, 09 Sep 2014 12:14:45 GMT
127
+ Server:
128
+ - dogdispatcher/5.1.1
129
+ Content-Length:
130
+ - '429'
131
+ Connection:
132
+ - keep-alive
133
+ body:
134
+ encoding: US-ASCII
135
+ string: ! '{"status": "ok", "event": {"priority": "low", "date_happened": 1410264888,
136
+ "handle": null, "title": "Chef completed in 5 seconds on chef.handler.datadog.test-noapp
137
+ ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2449507422336115049",
138
+ "text": "Chef updated 0 resources out of 0 resources total.", "tags": ["env:hostile",
139
+ "role:highlander", "tag:the_one_and_only"], "related_event_id": null, "id":
140
+ 2449507422336115049}}'
141
+ http_version:
142
+ recorded_at: Tue, 09 Sep 2014 12:14:48 GMT
143
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,250 @@
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":[[1453838669,1.0]],"type":"counter","host":"chef.handler.datadog.test-hostname","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:24 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:29 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":[[1453838669,0.0]],"type":"gauge","host":"chef.handler.datadog.test-hostname","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:24 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:29 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":[[1453838669,0.0]],"type":"gauge","host":"chef.handler.datadog.test-hostname","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:24 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:29 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":[[1453838669,5.0]],"type":"gauge","host":"chef.handler.datadog.test-hostname","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:24 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:29 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":"Chef updated 0 resources out of 0 resources total.","date_happened":1453838669,"msg_title":"Chef
165
+ completed in 5 seconds on chef.handler.datadog.test-hostname ","priority":"low","parent":null,"tags":["env:testing"],"aggregation_key":"chef.handler.datadog.test-hostname","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
166
+ completed in 5 seconds on chef.handler.datadog.test-hostname ","text":"Chef
167
+ updated 0 resources out of 0 resources total.","host":"chef.handler.datadog.test-hostname","device":null}'
168
+ headers:
169
+ Accept-Encoding:
170
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
171
+ Accept:
172
+ - "*/*"
173
+ User-Agent:
174
+ - Ruby
175
+ Content-Type:
176
+ - application/json
177
+ response:
178
+ status:
179
+ code: 202
180
+ message: Accepted
181
+ headers:
182
+ Content-Type:
183
+ - text/plain; charset=utf-8
184
+ Date:
185
+ - Tue, 26 Jan 2016 20:04:24 GMT
186
+ Dd-Pool:
187
+ - propjoe
188
+ Strict-Transport-Security:
189
+ - max-age=15724800;
190
+ X-Content-Type-Options:
191
+ - nosniff
192
+ Content-Length:
193
+ - '359'
194
+ Connection:
195
+ - keep-alive
196
+ body:
197
+ encoding: UTF-8
198
+ string: '{"status":"ok","event":{"id":381236660345629768,"title":"Chef completed
199
+ in 5 seconds on chef.handler.datadog.test-hostname ","text":"Chef updated
200
+ 0 resources out of 0 resources total.","date_happened":1453838669,"handle":null,"priority":"low","related_event_id":null,"tags":["env:testing"],"url":"https://app.datadoghq.com/event/event?id=381236660345629768"}}'
201
+ http_version:
202
+ recorded_at: Tue, 26 Jan 2016 20:04:29 GMT
203
+ - request:
204
+ method: put
205
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-hostname?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
206
+ body:
207
+ encoding: UTF-8
208
+ string: '{"tags":["env:testing"]}'
209
+ headers:
210
+ Accept-Encoding:
211
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
212
+ Accept:
213
+ - "*/*"
214
+ User-Agent:
215
+ - Ruby
216
+ Content-Type:
217
+ - application/json
218
+ response:
219
+ status:
220
+ code: 201
221
+ message: Created
222
+ headers:
223
+ Cache-Control:
224
+ - no-cache
225
+ Content-Type:
226
+ - application/json
227
+ Date:
228
+ - Tue, 26 Jan 2016 20:04:24 GMT
229
+ Dd-Pool:
230
+ - dogweb_sameorig
231
+ Pragma:
232
+ - no-cache
233
+ Strict-Transport-Security:
234
+ - max-age=15724800;
235
+ X-Content-Type-Options:
236
+ - nosniff
237
+ X-Dd-Debug:
238
+ - iqUR658eMoTIiWZD4IiijxvuH1187cP4WmZ1rEzFTak=
239
+ X-Frame-Options:
240
+ - SAMEORIGIN
241
+ Content-Length:
242
+ - '71'
243
+ Connection:
244
+ - keep-alive
245
+ body:
246
+ encoding: UTF-8
247
+ string: '{"host": "chef.handler.datadog.test-hostname", "tags": ["env:testing"]}'
248
+ http_version:
249
+ recorded_at: Tue, 26 Jan 2016 20:04:29 GMT
250
+ recorded_with: VCR 3.0.1
@@ -0,0 +1,250 @@
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":[[1453838668,1.0]],"type":"counter","host":"my-imaginary-hostname.local","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:23 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,0.0]],"type":"gauge","host":"my-imaginary-hostname.local","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:23 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,0.0]],"type":"gauge","host":"my-imaginary-hostname.local","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:24 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,5.0]],"type":"gauge","host":"my-imaginary-hostname.local","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:24 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":"Chef updated 0 resources out of 0 resources total.","date_happened":1453838668,"msg_title":"Chef
165
+ completed in 5 seconds on my-imaginary-hostname.local ","priority":"low","parent":null,"tags":["env:testing"],"aggregation_key":"my-imaginary-hostname.local","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
166
+ completed in 5 seconds on my-imaginary-hostname.local ","text":"Chef updated
167
+ 0 resources out of 0 resources total.","host":"my-imaginary-hostname.local","device":null}'
168
+ headers:
169
+ Accept-Encoding:
170
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
171
+ Accept:
172
+ - "*/*"
173
+ User-Agent:
174
+ - Ruby
175
+ Content-Type:
176
+ - application/json
177
+ response:
178
+ status:
179
+ code: 202
180
+ message: Accepted
181
+ headers:
182
+ Content-Type:
183
+ - text/plain; charset=utf-8
184
+ Date:
185
+ - Tue, 26 Jan 2016 20:04:24 GMT
186
+ Dd-Pool:
187
+ - propjoe
188
+ Strict-Transport-Security:
189
+ - max-age=15724800;
190
+ X-Content-Type-Options:
191
+ - nosniff
192
+ Content-Length:
193
+ - '352'
194
+ Connection:
195
+ - keep-alive
196
+ body:
197
+ encoding: UTF-8
198
+ string: '{"status":"ok","event":{"id":381236652309264256,"title":"Chef completed
199
+ in 5 seconds on my-imaginary-hostname.local ","text":"Chef updated 0 resources
200
+ out of 0 resources total.","date_happened":1453838668,"handle":null,"priority":"low","related_event_id":null,"tags":["env:testing"],"url":"https://app.datadoghq.com/event/event?id=381236652309264256"}}'
201
+ http_version:
202
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
203
+ - request:
204
+ method: put
205
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/my-imaginary-hostname.local?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
206
+ body:
207
+ encoding: UTF-8
208
+ string: '{"tags":["env:testing"]}'
209
+ headers:
210
+ Accept-Encoding:
211
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
212
+ Accept:
213
+ - "*/*"
214
+ User-Agent:
215
+ - Ruby
216
+ Content-Type:
217
+ - application/json
218
+ response:
219
+ status:
220
+ code: 201
221
+ message: Created
222
+ headers:
223
+ Cache-Control:
224
+ - no-cache
225
+ Content-Type:
226
+ - application/json
227
+ Date:
228
+ - Tue, 26 Jan 2016 20:04:24 GMT
229
+ Dd-Pool:
230
+ - dogweb_sameorig
231
+ Pragma:
232
+ - no-cache
233
+ Strict-Transport-Security:
234
+ - max-age=15724800;
235
+ X-Content-Type-Options:
236
+ - nosniff
237
+ X-Dd-Debug:
238
+ - wwu/bgxccjlNazhLUNsdV85F8rKnw6/fYnlKNBhfzOg=
239
+ X-Frame-Options:
240
+ - SAMEORIGIN
241
+ Content-Length:
242
+ - '64'
243
+ Connection:
244
+ - keep-alive
245
+ body:
246
+ encoding: UTF-8
247
+ string: '{"host": "my-imaginary-hostname.local", "tags": ["env:testing"]}'
248
+ http_version:
249
+ recorded_at: Tue, 26 Jan 2016 20:04:28 GMT
250
+ recorded_with: VCR 3.0.1