You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-33Lines changed: 37 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Datadog Chef Cookbook
2
2
3
+
4
+
The Datadog Chef cookbook automates the installation and configuration of the Datadog Agent across supported Linux and Windows platforms. The cookbook is compatible with `chef-client >= 12.7`, and supports Windows and Linux platforms. For full attribute references, recipes, usage examples, and integration configuration patterns, see the [Advanced configurations section](#advanced-configurations).
5
+
6
+
3
7
The Datadog Chef recipes are used to deploy Datadog's components and configuration automatically. The cookbook includes support for:
4
8
5
9
* Datadog Agent v7.x (default)
@@ -9,9 +13,7 @@ The Datadog Chef recipes are used to deploy Datadog's components and configurati
9
13
**Note**: This page may discuss features that are not available for your selected version. Check the README of the
10
14
git tag or gem version for your version's documentation.
11
15
12
-
## Setup
13
-
14
-
### Requirements
16
+
## Prerequisites
15
17
16
18
The Datadog Chef cookbook is compatible with `chef-client` >= 12.7. If you need support for Chef < 12.7, use a [release 2.x of the cookbook][2]. See the [CHANGELOG][3] for more info.
17
19
@@ -44,6 +46,8 @@ The following Opscode cookbooks are dependencies:
44
46
45
47
**Chef 13 users**: With Chef 13 and `chef_handler` 1.x, you may have trouble using the `dd-handler` recipe. The known workaround is to update your dependency to `chef_handler` >= 2.1.
46
48
49
+
## Setup
50
+
47
51
### Installation
48
52
49
53
1. Add the cookbook to your Chef server with [Berkshelf][5] or [Knife][6]:
@@ -80,7 +84,7 @@ The following Opscode cookbooks are dependencies:
80
84
81
85
5. Wait for the next scheduled `chef-client` run or trigger it manually.
82
86
83
-
#### Datadog attributes
87
+
### Datadog attributes
84
88
85
89
The following methods are available for adding your [Datadog API and application keys][4]:
86
90
@@ -90,11 +94,11 @@ The following methods are available for adding your [Datadog API and application
90
94
91
95
**Note**: When using the run state to store your API and application keys, set them at compile time before `datadog::dd-handler` in the run list.
92
96
93
-
#### Extra configuration
97
+
## Advanced configurations
94
98
95
99
To add additional elements to the Agent configuration file (typically `datadog.yaml`) that are not directly available as attributes of the cookbook, use the `node['datadog']['extra_config']` attribute. This is a hash attribute, which is marshaled into the configuration file accordingly.
96
100
97
-
##### Examples
101
+
### Examples
98
102
99
103
The following code sets the field `secret_backend_command` in the configuration file `datadog.yaml`:
100
104
@@ -120,7 +124,7 @@ For nested attributes, use object syntax. The following code sets the field `log
Follow the steps below to deploy the Datadog Agent with Chef on AWS OpsWorks:
126
130
@@ -167,7 +171,7 @@ run_list %w(
167
171
168
172
**Note**: `data_bags` are not used in this recipe because it is unlikely to have multiple API keys with only one application key.
169
173
170
-
## Versions
174
+
###Versions
171
175
172
176
By default, the current major version of this cookbook installs Agent v7. The following attributes are available to control the Agent version installed:
173
177
@@ -180,7 +184,7 @@ By default, the current major version of this cookbook installs Agent v7. The fo
180
184
181
185
See the sample [attributes/default.rb][1] for your cookbook version for all available attributes.
182
186
183
-
### Upgrade
187
+
####Upgrade
184
188
185
189
Some attribute names have changed from version 3.x to 4.x of the cookbook. Use this reference table to update your configuration:
186
190
@@ -213,7 +217,7 @@ default_attributes(
213
217
)
214
218
```
215
219
216
-
### Downgrade
220
+
####Downgrade
217
221
218
222
To downgrade the Agent version, set the `'agent_major_version'`, `'agent_version'`, and `'agent_allow_downgrade'`.
219
223
@@ -229,11 +233,11 @@ The following example downgrades to Agent v6. The same applies if you are downgr
229
233
)
230
234
```
231
235
232
-
### Uninstall
236
+
####Uninstall
233
237
234
238
To uninstall the Agent, remove the `dd-agent` recipe and add the `remove-dd-agent` recipe with no attributes.
235
239
236
-
### Custom Agent repository
240
+
####Custom Agent repository
237
241
238
242
To use an Agent from a custom repository, you can set the `aptrepo` option.
239
243
@@ -249,25 +253,25 @@ The example below uses the staging repository:
249
253
}
250
254
```
251
255
252
-
## Recipes
256
+
###Recipes
253
257
254
258
Access the [Datadog Chef recipes on GitHub][7].
255
259
256
-
### Default
260
+
####Default
257
261
258
262
The [default recipe][8] is a placeholder.
259
263
260
-
### Agent
264
+
####Agent
261
265
262
266
The [dd-agent recipe][9] installs the Datadog Agent on the target system, sets your [Datadog API key][4], and starts the service to report on local system metrics.
263
267
264
268
**Note**: Windows users upgrading the Agent from versions <= 5.10.1 to >= 5.12.0, set the `windows_agent_use_exe` attribute to `true`. For more details, see the [dd-agent wiki][10].
265
269
266
-
### Handler
270
+
####Handler
267
271
268
272
The [dd-handler recipe][11] installs the [chef-handler-datadog][12] gem and invokes the handler at the end of a Chef run to report the details to the news feed.
269
273
270
-
### DogStatsD
274
+
####DogStatsD
271
275
272
276
To install a language-specific library that interacts with DogStatsD:
273
277
@@ -277,7 +281,7 @@ To install a language-specific library that interacts with DogStatsD:
277
281
python_package 'dogstatsd-python'# assumes python and pip are installed
278
282
```
279
283
280
-
### Tracing
284
+
#### Tracing
281
285
282
286
To install a language-specific library for application tracing (APM):
283
287
@@ -287,11 +291,11 @@ To install a language-specific library for application tracing (APM):
287
291
python_package 'ddtrace' # assumes python and pip are installed
288
292
```
289
293
290
-
### Integrations
294
+
#### Integrations
291
295
292
296
There are many [recipes][7] to assist you with deploying Agent integration configuration files and dependencies.
293
297
294
-
### System-probe
298
+
#### System-probe
295
299
296
300
The [system-probe recipe][17] is automatically included by default. It writes the `system-probe.yaml` file. This behavior can be disabled by setting `node['datadog']['system_probe']['manage_config']` to false.
297
301
@@ -301,18 +305,18 @@ To enable [Universal Service Monitoring][7] (USM) in `system-probe.yaml`, set `n
301
305
302
306
**NoteforWindows users**: NPM is supported on Windows with Agent v6.27+and v7.27+. It ships as an optional component that is only installed if`node['datadog']['system_probe']['network_enabled']` is set to truewhen the Agent is installed or upgraded. Because of this, existing installations might need to do an uninstall and reinstall of the Agent once to install the NPM component, unless the Agent is upgraded at the same time.
303
307
304
-
## Resources
308
+
### Resources
305
309
306
-
### Integrations without recipes
310
+
#### Integrations without recipes
307
311
308
312
Use the `datadog_monitor` resource for enabling Agent integrations without a recipe.
309
313
310
-
#### Actions
314
+
##### Actions
311
315
312
316
-`:add`: (default) Enables the integration by setting up the configuration file, adding the correct permissions to the file, and restarting the Agent.
|`use_integration_template`|Set to `true` (recommended) to use the default template, which writes the values of `instances`, `init_config`, and`logs`in the YAML under their respective keys. This defaults to `false`for backward compatibility, but may default to `true`in a future major version of the cookbook. |
337
341
|`config_name`|The filename used when creating an integrations configuration file. Overriding this property allows the creation of multiple configuration files for a single integration. This defaults to `conf`, which creates a configuration file named `conf.yaml`. |
338
342
339
-
#### Example
343
+
##### Example
340
344
341
345
This example enables the ElasticSearch integration by using the `datadog_monitor` resource. It provides the instance configuration (in this case: the URL to connect to ElasticSearch) and sets the `use_integration_template` flag to use the default configuration template. Also, it notifies the `service[datadog-agent]` resource to restart the Agent.
342
346
@@ -354,16 +358,16 @@ end
354
358
355
359
See the [Datadog integration Chef recipes][7] for additional examples.
356
360
357
-
### Integration versions
361
+
#### Integration versions
358
362
359
363
To install a specific version of a Datadog integration, use the `datadog_integration` resource.
360
364
361
-
#### Actions
365
+
##### Actions
362
366
363
367
-`:install`: (default) Installs an integration with the specified version.
364
368
-`:remove`: Removes an integration.
365
369
366
-
#### Syntax
370
+
##### Syntax
367
371
368
372
```ruby
369
373
datadog_integration 'name' do
@@ -373,13 +377,13 @@ datadog_integration 'name' do
373
377
end
374
378
```
375
379
376
-
#### Properties
380
+
##### Properties
377
381
378
382
-`'name'`: The name of the Agent integration to install, forexample:`datadog-apache`.
379
383
-`version`: The version of the integration to install (only required with the `:install` action).
380
384
-`third_party`: Set to falseif installing a Datadog integration, true otherwise. AvailableforDatadogAgents version 6.21/7.21and higher only.
381
385
382
-
#### Example
386
+
##### Example
383
387
384
388
This example installs version `1.11.0` of the ElasticSearch integration by using the `datadog_integration` resource.
385
389
@@ -397,9 +401,9 @@ To get the available versions of the integrations, see the integration-specific
397
401
398
402
**Note**: ForChefWindows users, the `chef-client` must have read access to the `datadog.yaml` file when the `datadog-agent` binary available on the node is used by this resource.
399
403
400
-
## Development
404
+
### Development
401
405
402
-
### Dockerized environment
406
+
#### Dockerized environment
403
407
404
408
To build a Docker environment with which to run kitchen tests, use the files under `docker_test_env`:
0 commit comments