Adoptable Cookbooks List

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Recipes

default

Just a placeholder for now, when we have more shared components they will probably live there.

dd-agent

Installs the Datadog agent on the target system, sets the API key, and start the service to report on the local system metrics

Notes for Windows:

With Chef >= 12.6 and the windows cookbook >= 1.39.0, Agent upgrades are known to fail.
For Chef>=12.6 users on Windows, we recommend pinning the windows cookbook to a lower version (~> 1.38.0 for instance).

If that's not an option, a known workaround is to use the remove-dd-agent recipe (since the 2.5.0 version of the present cookbook) to uninstall the Agent
prior to any Agent upgrade.

Because of changes in the Windows Agent packaging and install in version 5.12.0, when upgrading the Agent from versions <= 5.10.1 to versions >= 5.12.0,
please set the windows_agent_use_exe attribute to true.

Once the upgrade is complete, you can leave the attribute to its default value (false).

dd-handler

Installs the chef-handler-datadog gem and invokes the handler at the end of a Chef run to report the details back to the newsfeed.

dogstatsd-(python|ruby)

Installs the language-specific libraries to interact with dogstatsd.

Note for Chef >= 13 users: the datadog::dogstatsd-python recipe is not compatible with Chef >= 13, as it relies on a resource that was removed in Chef 13.0.
To install the dogstatsd-python library with Chef, please add a dependency on the poise-python cookbook to your custom/wrapper cookbook, and use the following resource:
ruby
python_package 'dogstatsd-python' # assumes that python and pip are installed
For more advanced usage, please refer to the poise-python cookbook documentation

ddtrace-(python|ruby)

Note for Chef >= 13 users: the datadog::ddtrace-python recipe is not compatible with Chef >= 13, as it relies on a resource that was removed in Chef 13.0.
To install the ddtrace-python library with Chef, please add a dependency on the poise-python cookbook to your custom/wrapper cookbook, and use the following resource:
ruby
python_package 'ddtrace' # assumes that python and pip are installed
For more advanced usage, please refer to the poise-python cookbook documentation

other

There are many other integration-specific recipes, that are meant to assist in deploying the correct agent configuration files and dependencies for a given integration.

Usage

Agent 6 Support

Please note the cookbook now supports installing both Agent v5 and Agent v6 of the Datadog Agent on Linux (since v2.14.0) and Windows (since v2.15.0). By default versions <=2.x of the cookbook will default to install Agent5, you may however override this behavior with the node['datadog']['agent6'] attribute.
default_attributes(
'datadog' => {
'agent6' => true
}
)

Note: to upgrade to Agent 6 on a node with Agent 5 already installed, you also have to pin agent6_version to a v6 version (recommended), or set agent6_package_action to 'upgrade'.

Additional attributes are available to have finer control over how you install Agent 6. These are Agent 6 counterparts to several well known Agent 5 attributes (code here):
* agent6_version: allows you to pin the agent version (recommended).
* agent6_package_action: defaults to 'install', may be set to 'upgrade' to automatically upgrade to latest (not recommended, we recommend pinning to a version with agent6_version and change that version to upgrade).
* agent6_aptrepo: desired APT repo for the agent. Defaults to http://apt.datadoghq.com
* agent6_aptrepo_dist: desired distribution for the APT repo. Defaults to stable
* agent6_yumrepo: desired YUM repo for the agent. Defaults to https://yum.datadoghq.com/stable/6/x86_64/

Please review the attributes/default.rb file (at the version of the cookbook you use) for the list and usage of the attributes used by the cookbook.

Should you wish to add additional elements to the agent6 configuration file (typically /etc/datadog-agent/datadog.yaml) that are not directly available as attributes of the cookbook, you may use the node['datadog']['extra_config'] attribute. This attribute is a hash and will be marshaled into the configuration file accordingly.

For general information on the Datadog Agent 6, please refer to the datadog-agent repo.

Instructions

Add this cookbook to your Chef Server, either by installing with knife or by adding it to your Berksfile:
cookbook 'datadog', '~> 2.14.0'

Add your API Key either:

as a node attribute via an environment or role, or

as a node attribute by declaring it in another cookbook at a higher precedence level, or

in the node run_state by setting node.run_state['datadog']['api_key'] in another cookbook preceding datadog's recipes in the run_list. This approach has the benefit of not storing the credential in clear text on the Chef Server.

Create an 'application key' for chef_handlerhere, and add it as a node attribute or in the run state, as in Step #2.

NB: if you're using the run state to store the api and app keys you need to set them at compile time before datadog::dd-handler in the run list.

Associate the recipes with the desired roles, i.e. "role:chef-client" should contain "datadog::dd-handler" and a "role:base" should start the agent with "datadog::dd-agent". Here's an example role with both recipes:
```
name 'example'
description 'Example role using DataDog'

NOTE The strict version constraint on chef_handler had been introduced because the 1.2 minor release
of chef_handler broke compatibility with Chef 11. Chef 11 compatibility has been re-introduced in the 1.3
release, we recommend using that version or higher if you use Chef 11.

2.2.0 / 2015-10-27

This release deserves a specific callout for a feature that has been finally
implemented and deserves a major round of applause to @EasyAsABC123,
@rlaveycal, @olivielpeau for their efforts in making Windows platform
support in this cookbook a reality.

NOTE This has been broken for some time, and has had multiple attempts at fixing properly. The correct interface
has never been documented, and the implementation has always been left up to the reader. We have changed this to be
much simpler - instead of trying to account for any possible methods

2.0.0 / 2014-08-22

BREAKING CHANGE: Datadog Agent 5.0.0 Release Edition

With the release of Datadog Agent 5.x, all Python dependencies are now bundled, and extensions for monitoring are no
longer needed. Integration-specific recipes no longer install any packages, so if you are using a version older than
5.x, you may have to install these yourself. This greatly simplifies deployment of all components for monitoring.
See commit b77582122f3db774a838f90907b421e544dd099c for the exact package resources that have been removed.
Affected recipes:

We haven't supported this version of Chef in some time, so it's unlikely that you will be affected at all.
Just in case, please review what versions of Chef you have installed, and use an older version of this cookbook until
you can upgrade them.

Dependency Note

One of the dependencies of this cookbook is the apt cookbook.
A change introduced in the apt cookbook 2.0.0 release was a Chef 11-specific feature that would break on any Chef 10 system, so we considered adding a restriction in our metadata.rb to anything below 2.0.0.

A fix has gone in to apt 2.1.0 that relaxes this condition, and plays well with both Chef 10 and 11. We recommend using this version, or higher.

1.0.0 / 2013-05-06

Reasoning behind this was that originally we attempted to auto-detect many common attributes and deploy automatic monitoring for them.
We found that since inclusion of the datadog cookbook early in the run list caused the compile phase to be populated with our defaults (mostly nil), instead of the desired target, and namespacing of the attributes became necessary.

NEW PROVIDER: Added a new datadog_monitor provider for integration use

The new provider is used in many pre-provided integration recipes, such as datadog::apache.
This enables a run list to include this recipe, as well as populate a node attribute with the needed instance details to monitor the given service