Skip to content

Commit f228758

Browse files
iadjivontbavelier
andauthored
Agent Basic Usage - Chef doc changes (#957)
* Agent Basic Usage - chef doc changes * re-trigger CI attempt --------- Co-authored-by: Timothée Bavelier <timothee.bavelier@datadoghq.com>
1 parent 1800759 commit f228758

File tree

1 file changed

+37
-33
lines changed

1 file changed

+37
-33
lines changed

README.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Datadog Chef Cookbook
22

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+
37
The Datadog Chef recipes are used to deploy Datadog's components and configuration automatically. The cookbook includes support for:
48

59
* Datadog Agent v7.x (default)
@@ -9,9 +13,7 @@ The Datadog Chef recipes are used to deploy Datadog's components and configurati
913
**Note**: This page may discuss features that are not available for your selected version. Check the README of the
1014
git tag or gem version for your version's documentation.
1115

12-
## Setup
13-
14-
### Requirements
16+
## Prerequisites
1517

1618
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.
1719

@@ -44,6 +46,8 @@ The following Opscode cookbooks are dependencies:
4446

4547
**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.
4648

49+
## Setup
50+
4751
### Installation
4852

4953
1. Add the cookbook to your Chef server with [Berkshelf][5] or [Knife][6]:
@@ -80,7 +84,7 @@ The following Opscode cookbooks are dependencies:
8084
8185
5. Wait for the next scheduled `chef-client` run or trigger it manually.
8286
83-
#### Datadog attributes
87+
### Datadog attributes
8488
8589
The following methods are available for adding your [Datadog API and application keys][4]:
8690
@@ -90,11 +94,11 @@ The following methods are available for adding your [Datadog API and application
9094
9195
**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.
9296
93-
#### Extra configuration
97+
## Advanced configurations
9498
9599
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.
96100
97-
##### Examples
101+
### Examples
98102
99103
The following code sets the field `secret_backend_command` in the configuration file `datadog.yaml`:
100104
@@ -120,7 +124,7 @@ For nested attributes, use object syntax. The following code sets the field `log
120124
default['datadog']['extra_config']['logs_config'] = { 'use_port_443' => true }
121125
```
122126

123-
#### AWS OpsWorks Chef deployment
127+
### AWS OpsWorks Chef deployment
124128

125129
Follow the steps below to deploy the Datadog Agent with Chef on AWS OpsWorks:
126130

@@ -167,7 +171,7 @@ run_list %w(
167171

168172
**Note**: `data_bags` are not used in this recipe because it is unlikely to have multiple API keys with only one application key.
169173

170-
## Versions
174+
### Versions
171175

172176
By default, the current major version of this cookbook installs Agent v7. The following attributes are available to control the Agent version installed:
173177

@@ -180,7 +184,7 @@ By default, the current major version of this cookbook installs Agent v7. The fo
180184

181185
See the sample [attributes/default.rb][1] for your cookbook version for all available attributes.
182186

183-
### Upgrade
187+
#### Upgrade
184188

185189
Some attribute names have changed from version 3.x to 4.x of the cookbook. Use this reference table to update your configuration:
186190

@@ -213,7 +217,7 @@ default_attributes(
213217
)
214218
```
215219

216-
### Downgrade
220+
#### Downgrade
217221

218222
To downgrade the Agent version, set the `'agent_major_version'`, `'agent_version'`, and `'agent_allow_downgrade'`.
219223

@@ -229,11 +233,11 @@ The following example downgrades to Agent v6. The same applies if you are downgr
229233
)
230234
```
231235

232-
### Uninstall
236+
#### Uninstall
233237

234238
To uninstall the Agent, remove the `dd-agent` recipe and add the `remove-dd-agent` recipe with no attributes.
235239

236-
### Custom Agent repository
240+
#### Custom Agent repository
237241

238242
To use an Agent from a custom repository, you can set the `aptrepo` option.
239243

@@ -249,25 +253,25 @@ The example below uses the staging repository:
249253
}
250254
```
251255

252-
## Recipes
256+
### Recipes
253257

254258
Access the [Datadog Chef recipes on GitHub][7].
255259

256-
### Default
260+
#### Default
257261

258262
The [default recipe][8] is a placeholder.
259263

260-
### Agent
264+
#### Agent
261265

262266
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.
263267

264268
**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].
265269

266-
### Handler
270+
#### Handler
267271

268272
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.
269273

270-
### DogStatsD
274+
#### DogStatsD
271275

272276
To install a language-specific library that interacts with DogStatsD:
273277

@@ -277,7 +281,7 @@ To install a language-specific library that interacts with DogStatsD:
277281
python_package 'dogstatsd-python' # assumes python and pip are installed
278282
```
279283

280-
### Tracing
284+
#### Tracing
281285

282286
To install a language-specific library for application tracing (APM):
283287

@@ -287,11 +291,11 @@ To install a language-specific library for application tracing (APM):
287291
python_package 'ddtrace' # assumes python and pip are installed
288292
```
289293

290-
### Integrations
294+
#### Integrations
291295

292296
There are many [recipes][7] to assist you with deploying Agent integration configuration files and dependencies.
293297

294-
### System-probe
298+
#### System-probe
295299

296300
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.
297301

@@ -301,18 +305,18 @@ To enable [Universal Service Monitoring][7] (USM) in `system-probe.yaml`, set `n
301305

302306
**Note for Windows 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 true when 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.
303307

304-
## Resources
308+
### Resources
305309

306-
### Integrations without recipes
310+
#### Integrations without recipes
307311

308312
Use the `datadog_monitor` resource for enabling Agent integrations without a recipe.
309313

310-
#### Actions
314+
##### Actions
311315

312316
- `:add`: (default) Enables the integration by setting up the configuration file, adding the correct permissions to the file, and restarting the Agent.
313317
- `:remove`: Disables an integration.
314318

315-
#### Syntax
319+
##### Syntax
316320

317321
```ruby
318322
datadog_monitor 'name' do
@@ -325,7 +329,7 @@ datadog_monitor 'name' do
325329
end
326330
```
327331

328-
#### Properties
332+
##### Properties
329333

330334
| Property | Description |
331335
|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -336,7 +340,7 @@ end
336340
| `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. |
337341
| `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`. |
338342

339-
#### Example
343+
##### Example
340344

341345
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.
342346

@@ -354,16 +358,16 @@ end
354358

355359
See the [Datadog integration Chef recipes][7] for additional examples.
356360

357-
### Integration versions
361+
#### Integration versions
358362

359363
To install a specific version of a Datadog integration, use the `datadog_integration` resource.
360364

361-
#### Actions
365+
##### Actions
362366

363367
- `:install`: (default) Installs an integration with the specified version.
364368
- `:remove`: Removes an integration.
365369

366-
#### Syntax
370+
##### Syntax
367371

368372
```ruby
369373
datadog_integration 'name' do
@@ -373,13 +377,13 @@ datadog_integration 'name' do
373377
end
374378
```
375379

376-
#### Properties
380+
##### Properties
377381

378382
- `'name'`: The name of the Agent integration to install, for example: `datadog-apache`.
379383
- `version`: The version of the integration to install (only required with the `:install` action).
380384
- `third_party`: Set to false if installing a Datadog integration, true otherwise. Available for Datadog Agents version 6.21/7.21 and higher only.
381385

382-
#### Example
386+
##### Example
383387

384388
This example installs version `1.11.0` of the ElasticSearch integration by using the `datadog_integration` resource.
385389

@@ -397,9 +401,9 @@ To get the available versions of the integrations, see the integration-specific
397401

398402
**Note**: For Chef Windows 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.
399403

400-
## Development
404+
### Development
401405

402-
### Dockerized environment
406+
#### Dockerized environment
403407

404408
To build a Docker environment with which to run kitchen tests, use the files under `docker_test_env`:
405409

0 commit comments

Comments
 (0)