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
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"series":[{"metric":"chef.resources.total","points":[[1390096495,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
8
+ string: ! '{"series":[{"metric":"chef.resources.total","points":[[1398157228,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
9
9
  headers:
10
10
  Accept:
11
11
  - ! '*/*'
@@ -21,9 +21,9 @@ http_interactions:
21
21
  Content-Type:
22
22
  - text/json; charset=UTF-8
23
23
  Date:
24
- - Sun, 19 Jan 2014 01:54:42 GMT
24
+ - Tue, 22 Apr 2014 09:00:25 GMT
25
25
  Server:
26
- - dogdispatcher/4.10.0
26
+ - dogdispatcher/4.12.1
27
27
  Content-Length:
28
28
  - '15'
29
29
  Connection:
@@ -32,13 +32,13 @@ http_interactions:
32
32
  encoding: US-ASCII
33
33
  string: ! '{"status":"ok"}'
34
34
  http_version:
35
- recorded_at: Sun, 19 Jan 2014 01:54:55 GMT
35
+ recorded_at: Tue, 22 Apr 2014 09:00:28 GMT
36
36
  - request:
37
37
  method: post
38
38
  uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
39
39
  body:
40
40
  encoding: UTF-8
41
- string: ! '{"series":[{"metric":"chef.resources.updated","points":[[1390096495,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
41
+ string: ! '{"series":[{"metric":"chef.resources.updated","points":[[1398157228,0.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
42
42
  headers:
43
43
  Accept:
44
44
  - ! '*/*'
@@ -54,9 +54,9 @@ http_interactions:
54
54
  Content-Type:
55
55
  - text/json; charset=UTF-8
56
56
  Date:
57
- - Sun, 19 Jan 2014 01:54:42 GMT
57
+ - Tue, 22 Apr 2014 09:00:26 GMT
58
58
  Server:
59
- - dogdispatcher/4.10.0
59
+ - dogdispatcher/4.12.1
60
60
  Content-Length:
61
61
  - '15'
62
62
  Connection:
@@ -65,13 +65,13 @@ http_interactions:
65
65
  encoding: US-ASCII
66
66
  string: ! '{"status":"ok"}'
67
67
  http_version:
68
- recorded_at: Sun, 19 Jan 2014 01:54:55 GMT
68
+ recorded_at: Tue, 22 Apr 2014 09:00:28 GMT
69
69
  - request:
70
70
  method: post
71
71
  uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
72
72
  body:
73
73
  encoding: UTF-8
74
- string: ! '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1390096495,5.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
74
+ string: ! '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1398157228,5.0]],"type":"gauge","host":"chef.handler.datadog.test-tags","device":null}]}'
75
75
  headers:
76
76
  Accept:
77
77
  - ! '*/*'
@@ -87,9 +87,9 @@ http_interactions:
87
87
  Content-Type:
88
88
  - text/json; charset=UTF-8
89
89
  Date:
90
- - Sun, 19 Jan 2014 01:54:43 GMT
90
+ - Tue, 22 Apr 2014 09:00:27 GMT
91
91
  Server:
92
- - dogdispatcher/4.10.0
92
+ - dogdispatcher/4.12.1
93
93
  Content-Length:
94
94
  - '15'
95
95
  Connection:
@@ -98,13 +98,13 @@ http_interactions:
98
98
  encoding: US-ASCII
99
99
  string: ! '{"status":"ok"}'
100
100
  http_version:
101
- recorded_at: Sun, 19 Jan 2014 01:54:55 GMT
101
+ recorded_at: Tue, 22 Apr 2014 09:00:28 GMT
102
102
  - request:
103
103
  method: post
104
104
  uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
105
105
  body:
106
106
  encoding: UTF-8
107
- string: ! '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1390096495,"msg_title":"Chef
107
+ string: ! '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1398157228,"msg_title":"Chef
108
108
  completed in 5 seconds on chef.handler.datadog.test-tags ","priority":"low","parent":null,"tags":[],"aggregation_key":"chef.handler.datadog.test-tags","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
109
109
  completed in 5 seconds on chef.handler.datadog.test-tags ","text":"Chef updated
110
110
  0 resources out of 0 resources total.","host":"chef.handler.datadog.test-tags","device":null}'
@@ -123,60 +123,25 @@ http_interactions:
123
123
  Content-Type:
124
124
  - text/json; charset=UTF-8
125
125
  Date:
126
- - Sun, 19 Jan 2014 01:54:43 GMT
126
+ - Tue, 22 Apr 2014 09:00:28 GMT
127
127
  Server:
128
- - dogdispatcher/4.10.0
128
+ - dogdispatcher/4.12.1
129
129
  Content-Length:
130
130
  - '372'
131
131
  Connection:
132
132
  - keep-alive
133
133
  body:
134
134
  encoding: US-ASCII
135
- string: ! '{"status": "ok", "event": {"priority": "low", "date_happened": 1390096495,
135
+ string: ! '{"status": "ok", "event": {"priority": "low", "date_happened": 1398157228,
136
136
  "handle": null, "title": "Chef completed in 5 seconds on chef.handler.datadog.test-tags
137
- ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2111137779131465032",
137
+ ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2246374645576517604",
138
138
  "text": "Chef updated 0 resources out of 0 resources total.", "tags": [],
139
- "related_event_id": null, "id": 2111137779131465032}}'
139
+ "related_event_id": null, "id": 2246374645576517604}}'
140
140
  http_version:
141
- recorded_at: Sun, 19 Jan 2014 01:54:55 GMT
142
- - request:
143
- method: get
144
- uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-tags?api_key=<API_KEY>&application_key=<APPLICATION_KEY>
145
- body:
146
- encoding: US-ASCII
147
- string: ''
148
- headers:
149
- Accept:
150
- - ! '*/*'
151
- User-Agent:
152
- - Ruby
153
- response:
154
- status:
155
- code: 200
156
- message: OK
157
- headers:
158
- Cache-Control:
159
- - no-cache
160
- Content-Type:
161
- - application/json
162
- Date:
163
- - Sun, 19 Jan 2014 01:54:43 GMT
164
- Pragma:
165
- - no-cache
166
- Server:
167
- - gunicorn/0.17.4
168
- Content-Length:
169
- - '44'
170
- Connection:
171
- - keep-alive
172
- body:
173
- encoding: US-ASCII
174
- string: ! '{"tags": ["env:hostile", "role:highlander"]}'
175
- http_version:
176
- recorded_at: Sun, 19 Jan 2014 01:54:55 GMT
141
+ recorded_at: Tue, 22 Apr 2014 09:00:28 GMT
177
142
  - request:
178
143
  method: put
179
- uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-tags?api_key=<API_KEY>&application_key=<APPLICATION_KEY>
144
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-tags?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
180
145
  body:
181
146
  encoding: UTF-8
182
147
  string: ! '{"tags":["env:hostile","role:highlander","tag:the_one_and_only"]}'
@@ -197,19 +162,19 @@ http_interactions:
197
162
  Content-Type:
198
163
  - application/json
199
164
  Date:
200
- - Sun, 19 Jan 2014 01:54:43 GMT
165
+ - Tue, 22 Apr 2014 09:00:30 GMT
201
166
  Pragma:
202
167
  - no-cache
203
168
  Server:
204
169
  - gunicorn/0.17.4
205
170
  Content-Length:
206
- - '86'
171
+ - '110'
207
172
  Connection:
208
173
  - keep-alive
209
174
  body:
210
175
  encoding: US-ASCII
211
176
  string: ! '{"host": "chef.handler.datadog.test-tags", "tags": ["env:hostile",
212
- "role:highlander"]}'
177
+ "role:highlander", "tag:the_one_and_only"]}'
213
178
  http_version:
214
- recorded_at: Sun, 19 Jan 2014 01:54:55 GMT
215
- recorded_with: VCR 2.8.0
179
+ recorded_at: Tue, 22 Apr 2014 09:00:28 GMT
180
+ recorded_with: VCR 2.9.0
@@ -5,7 +5,7 @@ http_interactions:
5
5
  uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
6
6
  body:
7
7
  encoding: UTF-8
8
- string: ! '{"series":[{"metric":"chef.resources.total","points":[[1390096476,0.0]],"type":"gauge","host":"chef.handler.datadog.test","device":null}]}'
8
+ string: ! '{"series":[{"metric":"chef.resources.total","points":[[1398702979,0.0]],"type":"gauge","host":"chef.handler.datadog.test-hostname","device":null}]}'
9
9
  headers:
10
10
  Accept:
11
11
  - ! '*/*'
@@ -21,9 +21,9 @@ http_interactions:
21
21
  Content-Type:
22
22
  - text/json; charset=UTF-8
23
23
  Date:
24
- - Sun, 19 Jan 2014 01:54:23 GMT
24
+ - Mon, 28 Apr 2014 16:36:15 GMT
25
25
  Server:
26
- - dogdispatcher/4.10.0
26
+ - dogdispatcher/4.12.1
27
27
  Content-Length:
28
28
  - '15'
29
29
  Connection:
@@ -32,13 +32,13 @@ http_interactions:
32
32
  encoding: US-ASCII
33
33
  string: ! '{"status":"ok"}'
34
34
  http_version:
35
- recorded_at: Sun, 19 Jan 2014 01:54:36 GMT
35
+ recorded_at: Mon, 28 Apr 2014 16:36:19 GMT
36
36
  - request:
37
37
  method: post
38
38
  uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
39
39
  body:
40
40
  encoding: UTF-8
41
- string: ! '{"series":[{"metric":"chef.resources.updated","points":[[1390096476,0.0]],"type":"gauge","host":"chef.handler.datadog.test","device":null}]}'
41
+ string: ! '{"series":[{"metric":"chef.resources.updated","points":[[1398702979,0.0]],"type":"gauge","host":"chef.handler.datadog.test-hostname","device":null}]}'
42
42
  headers:
43
43
  Accept:
44
44
  - ! '*/*'
@@ -54,9 +54,9 @@ http_interactions:
54
54
  Content-Type:
55
55
  - text/json; charset=UTF-8
56
56
  Date:
57
- - Sun, 19 Jan 2014 01:54:23 GMT
57
+ - Mon, 28 Apr 2014 16:36:15 GMT
58
58
  Server:
59
- - dogdispatcher/4.10.0
59
+ - dogdispatcher/4.12.1
60
60
  Content-Length:
61
61
  - '15'
62
62
  Connection:
@@ -65,13 +65,13 @@ http_interactions:
65
65
  encoding: US-ASCII
66
66
  string: ! '{"status":"ok"}'
67
67
  http_version:
68
- recorded_at: Sun, 19 Jan 2014 01:54:36 GMT
68
+ recorded_at: Mon, 28 Apr 2014 16:36:19 GMT
69
69
  - request:
70
70
  method: post
71
71
  uri: https://app.datadoghq.com/api/v1/series?api_key=<API_KEY>
72
72
  body:
73
73
  encoding: UTF-8
74
- string: ! '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1390096476,5.0]],"type":"gauge","host":"chef.handler.datadog.test","device":null}]}'
74
+ string: ! '{"series":[{"metric":"chef.resources.elapsed_time","points":[[1398702979,5.0]],"type":"gauge","host":"chef.handler.datadog.test-hostname","device":null}]}'
75
75
  headers:
76
76
  Accept:
77
77
  - ! '*/*'
@@ -87,9 +87,9 @@ http_interactions:
87
87
  Content-Type:
88
88
  - text/json; charset=UTF-8
89
89
  Date:
90
- - Sun, 19 Jan 2014 01:54:23 GMT
90
+ - Mon, 28 Apr 2014 16:36:16 GMT
91
91
  Server:
92
- - dogdispatcher/4.10.0
92
+ - dogdispatcher/4.12.1
93
93
  Content-Length:
94
94
  - '15'
95
95
  Connection:
@@ -98,16 +98,16 @@ http_interactions:
98
98
  encoding: US-ASCII
99
99
  string: ! '{"status":"ok"}'
100
100
  http_version:
101
- recorded_at: Sun, 19 Jan 2014 01:54:36 GMT
101
+ recorded_at: Mon, 28 Apr 2014 16:36:19 GMT
102
102
  - request:
103
103
  method: post
104
104
  uri: https://app.datadoghq.com/api/v1/events?api_key=<API_KEY>
105
105
  body:
106
106
  encoding: UTF-8
107
- string: ! '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1390096476,"msg_title":"Chef
108
- completed in 5 seconds on chef.handler.datadog.test ","priority":"low","parent":null,"tags":[],"aggregation_key":"chef.handler.datadog.test","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
109
- completed in 5 seconds on chef.handler.datadog.test ","text":"Chef updated
110
- 0 resources out of 0 resources total.","host":"chef.handler.datadog.test","device":null}'
107
+ string: ! '{"msg_text":"Chef updated 0 resources out of 0 resources total.","date_happened":1398702979,"msg_title":"Chef
108
+ completed in 5 seconds on chef.handler.datadog.test-hostname ","priority":"low","parent":null,"tags":[],"aggregation_key":"chef.handler.datadog.test-hostname","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
109
+ completed in 5 seconds on chef.handler.datadog.test-hostname ","text":"Chef
110
+ updated 0 resources out of 0 resources total.","host":"chef.handler.datadog.test-hostname","device":null}'
111
111
  headers:
112
112
  Accept:
113
113
  - ! '*/*'
@@ -123,60 +123,25 @@ http_interactions:
123
123
  Content-Type:
124
124
  - text/json; charset=UTF-8
125
125
  Date:
126
- - Sun, 19 Jan 2014 01:54:24 GMT
126
+ - Mon, 28 Apr 2014 16:36:16 GMT
127
127
  Server:
128
- - dogdispatcher/4.10.0
128
+ - dogdispatcher/4.12.1
129
129
  Content-Length:
130
- - '367'
130
+ - '376'
131
131
  Connection:
132
132
  - keep-alive
133
133
  body:
134
134
  encoding: US-ASCII
135
- string: ! '{"status": "ok", "event": {"priority": "low", "date_happened": 1390096476,
136
- "handle": null, "title": "Chef completed in 5 seconds on chef.handler.datadog.test
137
- ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2111137457629674737",
135
+ string: ! '{"status": "ok", "event": {"priority": "low", "date_happened": 1398702979,
136
+ "handle": null, "title": "Chef completed in 5 seconds on chef.handler.datadog.test-hostname
137
+ ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2255530775220917022",
138
138
  "text": "Chef updated 0 resources out of 0 resources total.", "tags": [],
139
- "related_event_id": null, "id": 2111137457629674737}}'
139
+ "related_event_id": null, "id": 2255530775220917022}}'
140
140
  http_version:
141
- recorded_at: Sun, 19 Jan 2014 01:54:36 GMT
142
- - request:
143
- method: get
144
- uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test?api_key=<API_KEY>&application_key=<APPLICATION_KEY>
145
- body:
146
- encoding: US-ASCII
147
- string: ''
148
- headers:
149
- Accept:
150
- - ! '*/*'
151
- User-Agent:
152
- - Ruby
153
- response:
154
- status:
155
- code: 200
156
- message: OK
157
- headers:
158
- Cache-Control:
159
- - no-cache
160
- Content-Type:
161
- - application/json
162
- Date:
163
- - Sun, 19 Jan 2014 01:54:24 GMT
164
- Pragma:
165
- - no-cache
166
- Server:
167
- - gunicorn/0.17.4
168
- Content-Length:
169
- - '59'
170
- Connection:
171
- - keep-alive
172
- body:
173
- encoding: US-ASCII
174
- string: ! '{"tags": ["env:hostile", "role:highlander", "env:testing"]}'
175
- http_version:
176
- recorded_at: Sun, 19 Jan 2014 01:54:36 GMT
141
+ recorded_at: Mon, 28 Apr 2014 16:36:19 GMT
177
142
  - request:
178
143
  method: put
179
- uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test?api_key=<API_KEY>&application_key=<APPLICATION_KEY>
144
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/chef.handler.datadog.test-hostname?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
180
145
  body:
181
146
  encoding: UTF-8
182
147
  string: ! '{"tags":["env:testing"]}'
@@ -197,18 +162,18 @@ http_interactions:
197
162
  Content-Type:
198
163
  - application/json
199
164
  Date:
200
- - Sun, 19 Jan 2014 01:54:24 GMT
165
+ - Mon, 28 Apr 2014 16:36:17 GMT
201
166
  Pragma:
202
167
  - no-cache
203
168
  Server:
204
169
  - gunicorn/0.17.4
205
170
  Content-Length:
206
- - '62'
171
+ - '71'
207
172
  Connection:
208
173
  - keep-alive
209
174
  body:
210
175
  encoding: US-ASCII
211
- string: ! '{"host": "chef.handler.datadog.test", "tags": ["env:testing"]}'
176
+ string: ! '{"host": "chef.handler.datadog.test-hostname", "tags": ["env:testing"]}'
212
177
  http_version:
213
- recorded_at: Sun, 19 Jan 2014 01:54:36 GMT
214
- recorded_with: VCR 2.8.0
178
+ recorded_at: Mon, 28 Apr 2014 16:36:19 GMT
179
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,179 @@
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":[[1398703658,0.0]],"type":"gauge","host":"my-imaginary-hostname.local","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
+ - Mon, 28 Apr 2014 16:47:33 GMT
25
+ Server:
26
+ - dogdispatcher/4.12.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: Mon, 28 Apr 2014 16:47:38 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":[[1398703658,0.0]],"type":"gauge","host":"my-imaginary-hostname.local","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
+ - Mon, 28 Apr 2014 16:47:34 GMT
58
+ Server:
59
+ - dogdispatcher/4.12.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: Mon, 28 Apr 2014 16:47:38 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":[[1398703658,5.0]],"type":"gauge","host":"my-imaginary-hostname.local","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
+ - Mon, 28 Apr 2014 16:47:34 GMT
91
+ Server:
92
+ - dogdispatcher/4.12.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: Mon, 28 Apr 2014 16:47:38 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":1398703658,"msg_title":"Chef
108
+ completed in 5 seconds on my-imaginary-hostname.local ","priority":"low","parent":null,"tags":[],"aggregation_key":"my-imaginary-hostname.local","alert_type":"success","event_type":"config_management.run","source_type_name":"chef","title":"Chef
109
+ completed in 5 seconds on my-imaginary-hostname.local ","text":"Chef updated
110
+ 0 resources out of 0 resources total.","host":"my-imaginary-hostname.local","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
+ - Mon, 28 Apr 2014 16:47:34 GMT
127
+ Server:
128
+ - dogdispatcher/4.12.1
129
+ Content-Length:
130
+ - '369'
131
+ Connection:
132
+ - keep-alive
133
+ body:
134
+ encoding: US-ASCII
135
+ string: ! '{"status": "ok", "event": {"priority": "low", "date_happened": 1398703658,
136
+ "handle": null, "title": "Chef completed in 5 seconds on my-imaginary-hostname.local
137
+ ", "url": "https://app.datadoghq.com/event/jump_to?event_id=2255542152438727835",
138
+ "text": "Chef updated 0 resources out of 0 resources total.", "tags": [],
139
+ "related_event_id": null, "id": 2255542152438727835}}'
140
+ http_version:
141
+ recorded_at: Mon, 28 Apr 2014 16:47:38 GMT
142
+ - request:
143
+ method: put
144
+ uri: https://app.datadoghq.com/api/v1/tags/hosts/my-imaginary-hostname.local?api_key=<API_KEY>&application_key=<APPLICATION_KEY>&source=chef
145
+ body:
146
+ encoding: UTF-8
147
+ string: ! '{"tags":["env:testing"]}'
148
+ headers:
149
+ Accept:
150
+ - ! '*/*'
151
+ User-Agent:
152
+ - Ruby
153
+ Content-Type:
154
+ - application/json
155
+ response:
156
+ status:
157
+ code: 201
158
+ message: Created
159
+ headers:
160
+ Cache-Control:
161
+ - no-cache
162
+ Content-Type:
163
+ - application/json
164
+ Date:
165
+ - Mon, 28 Apr 2014 16:47:36 GMT
166
+ Pragma:
167
+ - no-cache
168
+ Server:
169
+ - gunicorn/0.17.4
170
+ Content-Length:
171
+ - '64'
172
+ Connection:
173
+ - keep-alive
174
+ body:
175
+ encoding: US-ASCII
176
+ string: ! '{"host": "my-imaginary-hostname.local", "tags": ["env:testing"]}'
177
+ http_version:
178
+ recorded_at: Mon, 28 Apr 2014 16:47:38 GMT
179
+ recorded_with: VCR 2.9.0