diff --git a/cookbooks/datadog/CHANGELOG.md b/cookbooks/datadog/CHANGELOG.md index 797b8a4f..67b3a56a 100644 --- a/cookbooks/datadog/CHANGELOG.md +++ b/cookbooks/datadog/CHANGELOG.md @@ -1,6 +1,36 @@ Changes ======= +# 2.13.0 / 2017-12-01 + +* [FEATURE] Add support for Logs, See [#490][] [@tmichelet][] +* [FEATURE] Add go-metro recipe, [#484][] [@iancward][] +* [FEATURE] Add tokumx recipe, [#486][] [@gswallow][] +* [FEATURE] Add couchbase recipe, [#487][] [@gswallow][] +* [FEATURE] Add experimental support of Agent 6 beta RPMs, [#493][] [@olivielpeau][] +* [FEATURE] Allow `disable_ssl_validation` in the apache conf, [#480][] [@stolfi][] +* [BUGFIX] Fix `warn_on_missing_keys` option of redis integration, [#495][] [@iancward][] & [@olivielpeau][] +* [BUGFIX] Fix default log file directory on Windows, [#492][] [@borgilb][] & [@olivielpeau][] +* [BUGFIX] Add check to consul template for `tags` key, [#479][] [@grogancolin][] + +# 2.12.0 / 2017-09-28 + +* [FEATURE] Support of Agent 6 beta for debianoids, [#472][] [@olivielpeau][] +* [FEATURE] Add `tag_families` option to RabbitMQ template, [#437][] & [#460][] [@lefthand][] & [@foobarto][] +* [FEATURE] Bring elasticsearch template up-to-date, [#445][] & [#462][] [@AlexBevan][] & [@kylegoch][] +* [FEATURE] Add `additional_metrics` and `collections` to mongo template , [#463][] [@otterdude97][] +* [OPTIMIZE] Explicitly set `gpgcheck` to true for `yum_repository`, [#458][] [@dafyddcrosby][] +* [BUGFIX] Adding support for amazon linux based images with recent versions of ohai, [#448][] [@frezbo][] +* [BUGFIX] Fix `ssl_verify` option of rabbitmq template, [#474][] [@iancward][] +* [DOCS] Fix missing array braces in supervisord example, [#454][] [@benmanns][] + +# 2.11.0 / 2017-09-21 + +* [FEATURE] Add configuration for the process-agent, [#465][] [@conorbranagan][] +* [FEATURE] Add SNMP recipe, [#436][] [@mlcooper][] +* [OPTIMIZE] Do not include `yum` recipe to avoid overwriting main yum config, [#446][] [@olivielpeau][] +* [BUGFIX] Avoid failures of agent `service` resource with frequent restarts on systemd, [#469][] [@olivielpeau][] + # 2.10.1 / 2017-05-31 * [OPTIMIZE] Add compatibility with `windows` cookbook `3.0`, [#438][] [@olivielpeau][] @@ -546,8 +576,32 @@ A fix has gone in to `apt` 2.1.0 that relaxes this condition, and plays well wit [#430]: https://github.com/DataDog/chef-datadog/issues/430 [#433]: https://github.com/DataDog/chef-datadog/issues/433 [#435]: https://github.com/DataDog/chef-datadog/issues/435 +[#436]: https://github.com/DataDog/chef-datadog/issues/436 +[#437]: https://github.com/DataDog/chef-datadog/issues/437 [#438]: https://github.com/DataDog/chef-datadog/issues/438 +[#445]: https://github.com/DataDog/chef-datadog/issues/445 +[#446]: https://github.com/DataDog/chef-datadog/issues/446 +[#448]: https://github.com/DataDog/chef-datadog/issues/448 +[#454]: https://github.com/DataDog/chef-datadog/issues/454 +[#458]: https://github.com/DataDog/chef-datadog/issues/458 +[#460]: https://github.com/DataDog/chef-datadog/issues/460 +[#462]: https://github.com/DataDog/chef-datadog/issues/462 +[#463]: https://github.com/DataDog/chef-datadog/issues/463 +[#465]: https://github.com/DataDog/chef-datadog/issues/465 +[#469]: https://github.com/DataDog/chef-datadog/issues/469 +[#472]: https://github.com/DataDog/chef-datadog/issues/472 +[#474]: https://github.com/DataDog/chef-datadog/issues/474 +[#479]: https://github.com/DataDog/chef-datadog/issues/479 +[#480]: https://github.com/DataDog/chef-datadog/issues/480 +[#484]: https://github.com/DataDog/chef-datadog/issues/484 +[#486]: https://github.com/DataDog/chef-datadog/issues/486 +[#487]: https://github.com/DataDog/chef-datadog/issues/487 +[#490]: https://github.com/DataDog/chef-datadog/issues/490 +[#492]: https://github.com/DataDog/chef-datadog/issues/492 +[#493]: https://github.com/DataDog/chef-datadog/issues/493 +[#495]: https://github.com/DataDog/chef-datadog/issues/495 [@ABrehm264]: https://github.com/ABrehm264 +[@AlexBevan]: https://github.com/AlexBevan [@BrentOnRails]: https://github.com/BrentOnRails [@DorianZaccaria]: https://github.com/DorianZaccaria [@EasyAsABC123]: https://github.com/EasyAsABC123 @@ -565,16 +619,20 @@ A fix has gone in to `apt` 2.1.0 that relaxes this condition, and plays well wit [@arthurnn]: https://github.com/arthurnn [@babbottscott]: https://github.com/babbottscott [@bai]: https://github.com/bai +[@benmanns]: https://github.com/benmanns [@bflad]: https://github.com/bflad [@bitmonk]: https://github.com/bitmonk +[@borgilb]: https://github.com/borgilb [@brentm5]: https://github.com/brentm5 [@ccannell67]: https://github.com/ccannell67 [@chrissnell]: https://github.com/chrissnell [@clmoreno]: https://github.com/clmoreno [@clofresh]: https://github.com/clofresh [@cobusbernard]: https://github.com/cobusbernard +[@conorbranagan]: https://github.com/conorbranagan [@coosh]: https://github.com/coosh [@ctrlok]: https://github.com/ctrlok +[@dafyddcrosby]: https://github.com/dafyddcrosby [@darron]: https://github.com/darron [@datwiz]: https://github.com/datwiz [@degemer]: https://github.com/degemer @@ -590,10 +648,14 @@ A fix has gone in to `apt` 2.1.0 that relaxes this condition, and plays well wit [@elijahandrews]: https://github.com/elijahandrews [@evan2645]: https://github.com/evan2645 [@flah00]: https://github.com/flah00 +[@foobarto]: https://github.com/foobarto +[@frezbo]: https://github.com/frezbo [@gkze]: https://github.com/gkze [@gmmeyer]: https://github.com/gmmeyer [@graemej]: https://github.com/graemej [@gregf]: https://github.com/gregf +[@grogancolin]: https://github.com/grogancolin +[@gswallow]: https://github.com/gswallow [@hartfordfive]: https://github.com/hartfordfive [@hilli]: https://github.com/hilli [@historus]: https://github.com/historus @@ -616,6 +678,8 @@ A fix has gone in to `apt` 2.1.0 that relaxes this condition, and plays well wit [@kindlyseth]: https://github.com/kindlyseth [@krasnoukhov]: https://github.com/krasnoukhov [@kurochan]: https://github.com/kurochan +[@kylegoch]: https://github.com/kylegoch +[@lefthand]: https://github.com/lefthand [@martinisoft]: https://github.com/martinisoft [@mattrobenolt]: https://github.com/mattrobenolt [@mfischer-zd]: https://github.com/mfischer-zd @@ -629,6 +693,7 @@ A fix has gone in to `apt` 2.1.0 that relaxes this condition, and plays well wit [@nyanshak]: https://github.com/nyanshak [@olivielpeau]: https://github.com/olivielpeau [@opsline-radek]: https://github.com/opsline-radek +[@otterdude97]: https://github.com/otterdude97 [@phlipper]: https://github.com/phlipper [@qqfr2507]: https://github.com/qqfr2507 [@raycrawford]: https://github.com/raycrawford @@ -638,6 +703,7 @@ A fix has gone in to `apt` 2.1.0 that relaxes this condition, and plays well wit [@schisamo]: https://github.com/schisamo [@sethrosenblum]: https://github.com/sethrosenblum [@stensonb]: https://github.com/stensonb +[@stolfi]: https://github.com/stolfi [@takus]: https://github.com/takus [@tejom]: https://github.com/tejom [@thisismana]: https://github.com/thisismana diff --git a/cookbooks/datadog/LICENSE b/cookbooks/datadog/LICENSE deleted file mode 100644 index a213ba60..00000000 --- a/cookbooks/datadog/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2012, 2013, 2014, 2015, 2016 Datadog, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/cookbooks/datadog/README.md b/cookbooks/datadog/README.md index e0d2a922..639fd3f4 100644 --- a/cookbooks/datadog/README.md +++ b/cookbooks/datadog/README.md @@ -16,6 +16,12 @@ Datadog Cookbook Chef recipes to deploy Datadog's components and configuration automatically. +This cookbook includes experimental support of the beta version of the Datadog Agent 6.0, please refer to +the [inline docs](https://github.com/DataDog/chef-datadog/blob/v2.12.0/attributes/default.rb#L31-L66) +for more details on the supported platforms and how to use it. + +For general information on the Datadog Agent 6, please refer to the [datadog-agent](https://github.com/DataDog/datadog-agent/) repo. + **NB: This README may refer to features that are not released yet. Please check the README of the git tag/the gem version you're using for your version's documentation** diff --git a/cookbooks/datadog/attributes/default.rb b/cookbooks/datadog/attributes/default.rb index fbb4ff3f..588a2d21 100644 --- a/cookbooks/datadog/attributes/default.rb +++ b/cookbooks/datadog/attributes/default.rb @@ -28,6 +28,45 @@ # Set it as an attribute, or on your node `run_state` under the key `['datadog']['application_key']` default['datadog']['application_key'] = nil +######################################################################## +### Beta-Agent6-only attributes, experimental ### +### These attributes are not part of the stable API of the cookbook ### +### Subject to breaking changes between bugfix/minor versions ### +### Only works on Linux (DEB/RPM) for now ### + +# Set to true to install an agent6 instead of agent5. +# To upgrade from agent5 to agent6, you need to: +# * set node['datadog']['agent6'] to true, and +# * either set node['datadog']['agent6_version'] to an existing agent6 version (recommended), or +# set node['datadog']['agent6_package_action'] to 'upgrade' +# To downgrade from agent6 to agent5, you need to: +# * set node['datadog']['agent6'] to false, and +# * pin node['datadog']['agent_version'] to an existing agent5 version, and +# * set node['datadog']['agent_allow_downgrade'] to true +default['datadog']['agent6'] = false +# Default of `nil` will install latest version, applies to agent6 only. +# See documentation of `agent_version` attribute for allowed configuration format. +default['datadog']['agent6_version'] = nil +default['datadog']['agent6_package_action'] = 'install' # set to `upgrade` to always upgrade to latest + +# beta repos where datadog-agent v6 packages are available +default['datadog']['agent6_aptrepo'] = 'http://apt.datadoghq.com' +default['datadog']['agent6_aptrepo_dist'] = 'beta' +# RPMs are only available for RHEL >= 6 (-> use https protocol) and x86_64 arch +default['datadog']['agent6_yumrepo'] = 'https://yum.datadoghq.com/beta/x86_64/' + +# Values that differ on Windows +# The location of the config folder (containing conf.d) +default['datadog']['agent6_config_dir'] = '/etc/datadog-agent' + +# Set a key to true to make the agent6 use the v2 api on that endpoint, false otherwise. +# Leave key value to nil to use agent6 default for that endpoint. +# Supported keys: "series", "events", "service checks" +default['datadog']['use_v2_api'] = {} + +### End of Beta-Agent6-only experimental attributes ### +######################################################################## + # Use this attribute to send data to additional accounts # (agent and handler if enabled) # The key can be anything you want, 'prod' is used there as an example @@ -93,6 +132,8 @@ 'https' end +# NB: if you're not using the default repos and/or distributions, make sure +# to pin the version you're installing with node['datadog']['agent_version'] default['datadog']['installrepo'] = true default['datadog']['aptrepo'] = 'http://apt.datadoghq.com' default['datadog']['aptrepo_dist'] = 'stable' @@ -121,6 +162,7 @@ # Values that differ on Windows # The location of the config folder (containing conf.d) # The name of the dd agent service +# The log file directory (see logging section below) if node['platform_family'] == 'windows' default['datadog']['config_dir'] = "#{ENV['ProgramData']}/Datadog" default['datadog']['agent_name'] = 'DatadogAgent' @@ -145,7 +187,7 @@ # Agent Version # Default of `nil` will install latest version. On Windows, this will also upgrade to latest # This attribute accepts either a `string` or `hash` with the key as platform_name and value of package version -# In the case of fedora use platform_name of rhel +# In the case of fedora and amazon linux, use platform_name of rhel # Example: # default['datadog']['agent_version'] = { # 'rhel' => '5.9.0-1', @@ -223,7 +265,12 @@ default['datadog']['syslog']['udp'] = false default['datadog']['syslog']['host'] = nil default['datadog']['syslog']['port'] = nil -default['datadog']['log_file_directory'] = '/var/log/datadog' +default['datadog']['log_file_directory'] = + if node['platform_family'] == 'windows' + nil # let the agent use a default log file dir + else + '/var/log/datadog' + end # Web proxy configuration default['datadog']['web_proxy']['host'] = nil @@ -289,6 +336,45 @@ # ddtrace ruby gem version default['datadog']['ddtrace_gem_version'] = nil +# Live processes functionality settings +# Set `enable_process_agent` to: +# * `true` to explicitly enable the process agent +# * `false` to explicitly disable it +# Leave it to `nil` to let the agent's default behavior decide whether to run the process-agent +default['datadog']['enable_process_agent'] = nil + +# Comma-separated list of regex patterns matching process commands to blacklist. +# Example: 'my-secret-app,dbpass' +default['datadog']['process_agent']['blacklist'] = nil + +# Comma-separated list of regex patterns of containers to include or skip. +# Each pattern should be in the form of "field:pattern" where 'field' is either +# 'image' or 'name'. +# Example: 'image:redis,image:nginx' +default['datadog']['process_agent']['container_blacklist'] = nil +# Whitelist is applied after the blacklist. +default['datadog']['process_agent']['container_whitelist'] = nil + +# Full path to store process-agent logs to override the default. +default['datadog']['process_agent']['log_file'] = nil + +# If running in full process collection mode ('enable_process_agent' is true) +# overrides the collection intervals for the full and real-time checks in seconds. +default['datadog']['process_agent']['process_interval'] = nil +default['datadog']['process_agent']['rtprocess_interval'] = nil + +# If only collecting containers ('enable_process_agent' is false but docker is available) +# overrides the collection intervals for the full and real-time check. +default['datadog']['process_agent']['container_interval'] = nil +default['datadog']['process_agent']['rtcontainer_interval'] = nil + +# Logs functionality settings +# Set `enable_log_agent` to: +# * `true` to explicitly enable the log agent +# * `false` to explicitly disable it +# Leave it to `nil` to let the agent's default behavior decide whether to run the log-agent +default['datadog']['enable_logs_agent'] = nil + # For custom gem servers on restricted networks # This attribute only works on Chef >= 12.3 # Change false to the URL of your custom gem server diff --git a/cookbooks/datadog/attributes/go-metro.rb b/cookbooks/datadog/attributes/go-metro.rb new file mode 100644 index 00000000..8da68958 --- /dev/null +++ b/cookbooks/datadog/attributes/go-metro.rb @@ -0,0 +1,23 @@ +# The implementation for the go-metro recipe allows any package resource +# property to be defined as an attribute underneath the +# node['datadog']['go-metro']['libcap_package'] namespace +# +# For example, if you want to set the package version, you can do something +# like: +# default['datadog']['go-metro']['libcap_package']['version'] = 'foo' + +# The only required option is package_name: +# valid values for RHEL-based system are: libcap, compat-libcap1 +# valid values for Debian-based systems are: libcap, libcap2-bin +default['datadog']['go-metro']['libcap_package']['package_name'] = 'libcap' + +# init config +default['datadog']['go-metro']['init_config'] = { + 'snaplen' => 512, + 'idle_ttl' => 300, + 'exp_ttl' => 60, + 'statsd_ip' => '127.0.0.1', + 'statsd_port' => 8125, + 'log_to_file' => true, + 'log_level' => 'info' +} diff --git a/cookbooks/datadog/metadata.json b/cookbooks/datadog/metadata.json new file mode 100644 index 00000000..c59dca79 --- /dev/null +++ b/cookbooks/datadog/metadata.json @@ -0,0 +1,58 @@ +{ + "name": "datadog", + "description": "Installs/Configures datadog components", + "long_description": "Where to Find the Code\n======================\nTo submit issues and patches please visit https://github.com/DataDog/chef-datadog.\nThe code is licensed under the Apache License 2.0 (see LICENSE for details).\n\n[![Chef cookbook](https://img.shields.io/cookbook/v/datadog.svg?style=flat)](https://github.com/DataDog/chef-datadog)\n[![Build Status](https://travis-ci.org/DataDog/chef-datadog.svg?branch=master)](https://travis-ci.org/DataDog/chef-datadog)\n[![Circle CI](https://circleci.com/gh/DataDog/chef-datadog.svg?style=shield)](https://circleci.com/gh/DataDog/chef-datadog)\n[![Coverage Status](https://coveralls.io/repos/DataDog/chef-datadog/badge.svg?branch=master)](https://coveralls.io/r/DataDog/chef-datadog?branch=master)\n[![GitHub forks](https://img.shields.io/github/forks/DataDog/chef-datadog.svg)](https://github.com/DataDog/chef-datadog/network)\n[![GitHub stars](https://img.shields.io/github/stars/DataDog/chef-datadog.svg)](https://github.com/DataDog/chef-datadog/stargazers)\n[![Build Status](https://jenkins-01.eastus.cloudapp.azure.com/job/datadog-cookbook/badge/icon)](https://jenkins-01.eastus.cloudapp.azure.com/job/datadog-cookbook/)\n\nDatadog Cookbook\n================\n\nChef recipes to deploy Datadog's components and configuration automatically.\n\nThis cookbook includes experimental support of the beta version of the Datadog Agent 6.0, please refer to\nthe [inline docs](https://github.com/DataDog/chef-datadog/blob/v2.12.0/attributes/default.rb#L31-L66)\nfor more details on the supported platforms and how to use it.\n\nFor general information on the Datadog Agent 6, please refer to the [datadog-agent](https://github.com/DataDog/datadog-agent/) repo.\n\n**NB: This README may refer to features that are not released yet. Please check the README of the\ngit tag/the gem version you're using for your version's documentation**\n\nRequirements\n============\n- chef >= 10.14\n\nPlatforms\n---------\n\n* Amazon Linux\n* CentOS\n* Debian\n* RedHat\n* Scientific Linux\n* Ubuntu\n* Windows (requires chef >= 12.0)\n\nCookbooks\n---------\n\nThe following Opscode cookbooks are dependencies:\n\n* `apt`\n* `chef_handler`\n* `windows`\n* `yum`\n\n**Note for Chef 11 users**: please use these additional dependency version contraints for compatibility with Chef 11:\n\n```\ncookbook 'apt', '< 4.0'\ncookbook 'chef_handler', '< 2.0'\ncookbook 'windows', '< 2.0'\ncookbook 'yum', '~> 3.0'\n```\n\n(in Berkshelf/Librarian format)\n\nRecipes\n=======\n\ndefault\n-------\nJust a placeholder for now, when we have more shared components they will probably live there.\n\ndd-agent\n--------\nInstalls the Datadog agent on the target system, sets the API key, and start the service to report on the local system metrics\n\n**Notes for Windows**:\n\n* With Chef >= 12.6 _and_ the `windows` cookbook >= 1.39.0, Agent upgrades are known to fail.\n For Chef>=12.6 users on Windows, we recommend pinning the `windows` cookbook to a lower version (`~> 1.38.0` for instance).\n\n 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\n prior to any Agent upgrade.\n\n* 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,\n please set the `windows_agent_use_exe` attribute to `true`.\n\n Once the upgrade is complete, you can leave the attribute to its default value (`false`).\n\n For more information on these Windows packaging changes, see the related [docs on the dd-agent wiki](https://github.com/DataDog/dd-agent/wiki/Windows-Agent-Installation).\n\ndd-handler\n----------\nInstalls the [chef-handler-datadog](https://rubygems.org/gems/chef-handler-datadog) gem and invokes the handler at the end of a Chef run to report the details back to the newsfeed.\n\ndogstatsd-(python|ruby)\n-----------------------\nInstalls the language-specific libraries to interact with `dogstatsd`.\n\nddtrace-(python|ruby)\n---------------------\nInstalls the language-specific libraries for application Traces (APM).\n\nother\n-----\nThere are many other integration-specific recipes, that are meant to assist in deploying the correct agent configuration files and dependencies for a given integration.\n\n\nUsage\n=====\n\n1. Add this cookbook to your Chef Server, either by installing with knife or by adding it to your Berksfile:\n ```\n cookbook 'datadog', '~> 2.7.0'\n ```\n2. Add your API Key either:\n * as a node attribute via an `environment` or `role`, or\n * as a node attribute by declaring it in another cookbook at a higher precedence level, or\n * 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.\n3. Create an 'application key' for `chef_handler` [here](https://app.datadoghq.com/account/settings#api), and add it as a node attribute or in the run state, as in Step #2.\n\n 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.\n\n4. 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:\n ```\n name 'example'\n description 'Example role using DataDog'\n\n default_attributes(\n 'datadog' => {\n 'api_key' => 'api_key',\n 'application_key' => 'app_key'\n }\n )\n\n run_list %w(\n recipe[datadog::dd-agent]\n recipe[datadog::dd-handler]\n )\n ```\n5. Wait until `chef-client` runs on the target node (or trigger chef-client manually if you're impatient)\n\nWe are not making use of data_bags in this recipe at this time, as it is unlikely that you will have more than one API key and one application key.\n\nFor more deployment details, visit the [Datadog Documentation site](http://docs.datadoghq.com/).\n", + "maintainer": "Datadog", + "maintainer_email": "package@datadoghq.com", + "license": "Apache-2.0", + "platforms": { + "amazon": ">= 0.0.0", + "centos": ">= 0.0.0", + "debian": ">= 0.0.0", + "fedora": ">= 0.0.0", + "redhat": ">= 0.0.0", + "scientific": ">= 0.0.0", + "ubuntu": ">= 0.0.0", + "windows": ">= 0.0.0" + }, + "dependencies": { + "apt": ">= 0.0.0", + "chef_handler": ">= 1.1", + "windows": ">= 0.0.0", + "yum": ">= 3.0" + }, + "providing": { + + }, + "attributes": { + + }, + "recipes": { + "datadog::default": "Default", + "datadog::dd-agent": "Installs the Datadog Agent", + "datadog::dd-handler": "Installs a Chef handler for Datadog", + "datadog::repository": "Installs the Datadog package repository", + "datadog::dogstatsd-python": "Installs the Python dogstatsd package for custom metrics", + "datadog::dogstatsd-ruby": "Installs the Ruby dogstatsd package for custom metrics", + "datadog::ddtrace-python": "Installs the Python ddtrace package for APM", + "datadog::ddtrace-ruby": "Installs the Ruby ddtrace package for APM", + "datadog::cassandra": "Installs and configures the Cassandra integration", + "datadog::couchdb": "Installs and configures the CouchDB integration", + "datadog::postfix": "Installs and configures the Postfix integration" + }, + "version": "2.13.0", + "source_url": "https://github.com/DataDog/chef-datadog", + "issues_url": "https://github.com/DataDog/chef-datadog/issues", + "privacy": false, + "chef_versions": [ + [ + ">= 10.14" + ] + ], + "ohai_versions": [ + + ], + "gems": [ + + ] +} diff --git a/cookbooks/datadog/metadata.rb b/cookbooks/datadog/metadata.rb index 639dbb7a..f87bc720 100644 --- a/cookbooks/datadog/metadata.rb +++ b/cookbooks/datadog/metadata.rb @@ -1,14 +1,15 @@ name 'datadog' maintainer 'Datadog' maintainer_email 'package@datadoghq.com' -license 'Apache 2.0' +license 'Apache-2.0' description 'Installs/Configures datadog components' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '2.10.1' +version '2.13.0' +chef_version '>= 10.14' if respond_to? :chef_version source_url 'https://github.com/DataDog/chef-datadog' if respond_to? :source_url issues_url 'https://github.com/DataDog/chef-datadog/issues' if respond_to? :issues_url -%w( +%w[ amazon centos debian @@ -17,7 +18,7 @@ scientific ubuntu windows -).each do |os| +].each do |os| supports os end diff --git a/cookbooks/datadog/providers/monitor.rb b/cookbooks/datadog/providers/monitor.rb index feb81e2c..046cb8d6 100644 --- a/cookbooks/datadog/providers/monitor.rb +++ b/cookbooks/datadog/providers/monitor.rb @@ -9,7 +9,8 @@ def whyrun_supported? action :add do Chef::Log.debug "Adding monitoring for #{new_resource.name}" - template ::File.join(node['datadog']['config_dir'], 'conf.d', "#{new_resource.name}.yaml") do + config_dir = node['datadog']['agent6'] ? node['datadog']['agent6_config_dir'] : node['datadog']['config_dir'] + template ::File.join(config_dir, 'conf.d', "#{new_resource.name}.yaml") do if node['platform_family'] == 'windows' owner 'Administrators' rights :full_control, 'Administrators' @@ -24,7 +25,8 @@ def whyrun_supported? variables( init_config: new_resource.init_config, instances: new_resource.instances, - version: new_resource.version + version: new_resource.version, + logs: new_resource.logs ) cookbook new_resource.cookbook sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) @@ -33,11 +35,16 @@ def whyrun_supported? service 'datadog-agent' do service_name node['datadog']['agent_name'] + # HACK: the restart can fail when we hit systemd's restart limits (by default, 5 starts every 10 seconds) + # To workaround this, retry once after 5 seconds, and a second time after 10 seconds + retries 2 + retry_delay 5 end end action :remove do - confd_dir = ::File.join(node['datadog']['config_dir'], 'conf.d') + config_dir = node['datadog']['agent6'] ? node['datadog']['agent6_config_dir'] : node['datadog']['config_dir'] + confd_dir = ::File.join(config_dir, 'conf.d') Chef::Log.debug "Removing #{new_resource.name} from #{confd_dir}" file ::File.join(confd_dir, "#{new_resource.name}.yaml") do action :delete diff --git a/cookbooks/datadog/recipes/_agent6_config.rb b/cookbooks/datadog/recipes/_agent6_config.rb new file mode 100644 index 00000000..51e39fa8 --- /dev/null +++ b/cookbooks/datadog/recipes/_agent6_config.rb @@ -0,0 +1,148 @@ +# +# Cookbook Name:: datadog +# Recipe:: _agent6_config +# +# Copyright 2011-2017, Datadog +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +is_windows = node['platform_family'] == 'windows' + +# FIXME: with the agent6, we still need the agent5 conf file in duplicate in /etc/datadog-agent/trace-agent.conf +# and /etc/datadog-agent/process-agent.conf for the trace and process agents. +# Remove them when these agents can read from datadog.yaml. +trace_agent_config_file = ::File.join(node['datadog']['agent6_config_dir'], 'trace-agent.conf') +process_agent_config_file = ::File.join(node['datadog']['agent6_config_dir'], 'process-agent.conf') + +template trace_agent_config_file do + def conf_template_vars + { + :api_keys => [Chef::Datadog.api_key(node)], + :dd_urls => [node['datadog']['url']] + } + end + variables( + if respond_to?(:lazy) + lazy { conf_template_vars } + else + conf_template_vars + end + ) + if is_windows + owner 'Administrators' + rights :full_control, 'Administrators' + inherits false + else + owner 'dd-agent' + group 'dd-agent' + mode '640' + end + source 'datadog.conf.erb' + sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) + notifies :restart, 'service[datadog-agent]', :delayed unless node['datadog']['agent_start'] == false +end + +template process_agent_config_file do + def conf_template_vars + { + :api_keys => [Chef::Datadog.api_key(node)], + :dd_urls => [node['datadog']['url']] + } + end + variables( + if respond_to?(:lazy) + lazy { conf_template_vars } + else + conf_template_vars + end + ) + if is_windows + owner 'Administrators' + rights :full_control, 'Administrators' + inherits false + else + owner 'dd-agent' + group 'dd-agent' + mode '640' + end + source 'datadog.conf.erb' + sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) + notifies :restart, 'service[datadog-agent]', :delayed unless node['datadog']['agent_start'] == false +end + +# With agent6, the process-agent and trace-agent are enabled as long-running checks +# TODO: on agent6, we can't really make the trace-agent _not_ run yet +datadog_monitor 'apm' do + instances [{}] + use_integration_template true + if node['datadog']['enable_trace_agent'].is_a?(TrueClass) + action :add + else + action :remove + end +end +process_agent_init_config = { enabled: node['datadog']['enable_process_agent'] } +datadog_monitor 'process_agent' do + init_config process_agent_init_config + instances [{}] + use_integration_template true + if node['datadog']['enable_process_agent'].is_a?(TrueClass) || node['datadog']['enable_process_agent'].is_a?(FalseClass) + action :add + else + action :remove + end +end + +agent6_config_file = ::File.join(node['datadog']['agent6_config_dir'], 'datadog.yaml') +template agent6_config_file do # rubocop:disable Metrics/BlockLength + def template_vars # rubocop:disable Metrics/AbcSize, Metrics/MethodLength + additional_endpoints = {} + node['datadog']['extra_endpoints'].each do |_, endpoint| + next unless endpoint['enabled'] + url = if endpoint['url'] + endpoint['url'] + else + node['datadog']['url'] + end + if additional_endpoints.key?(url) + additional_endpoints[url] << endpoint['api_key'] + else + additional_endpoints[url] = [endpoint['api_key']] + end + end + extra_config = {} + node['datadog']['extra_config'].each do |k, v| + next if v.nil? + extra_config[k] = v + end + { + extra_config: extra_config, + api_key: Chef::Datadog.api_key(node), + additional_endpoints: additional_endpoints + } + end + + owner 'dd-agent' + group 'dd-agent' + mode '640' + variables( + if respond_to?(:lazy) + lazy { template_vars } + else + template_vars + end + ) + sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) + notifies :restart, 'service[datadog-agent]', :delayed unless node['datadog']['agent_start'] == false +end diff --git a/cookbooks/datadog/recipes/_install-linux.rb b/cookbooks/datadog/recipes/_install-linux.rb index 85f903a8..ddd4104f 100644 --- a/cookbooks/datadog/recipes/_install-linux.rb +++ b/cookbooks/datadog/recipes/_install-linux.rb @@ -20,10 +20,10 @@ # Install the Apt/Yum repository if enabled include_recipe 'datadog::repository' if node['datadog']['installrepo'] -dd_agent_version = +dd_agent5_version = if node['datadog']['agent_version'].respond_to?(:each_pair) case node['platform_family'] - when 'rhel', 'fedora' + when 'rhel', 'fedora', 'amazon' node['datadog']['agent_version']['rhel'] else node['datadog']['agent_version'][node['platform_family']] @@ -32,8 +32,28 @@ node['datadog']['agent_version'] end -# If version specified and lower than 5.x +dd_agent6_version = + if node['datadog']['agent6_version'].respond_to?(:each_pair) + case node['platform_family'] + when 'rhel', 'fedora' + node['datadog']['agent6_version']['rhel'] + else + node['datadog']['agent6_version'][node['platform_family']] + end + else + node['datadog']['agent6_version'] + end + +if node['datadog']['agent6'] + dd_agent_version = dd_agent6_version + package_action = node['datadog']['agent6_package_action'] +else + dd_agent_version = dd_agent5_version + package_action = node['datadog']['agent_package_action'] +end + if !dd_agent_version.nil? && dd_agent_version.split('.')[0].split(':').last.to_i < 5 + # If version specified and lower than 5.x Chef::Log.warn 'Support for Agent pre 5.x will be removed in datadog cookbook version 3.0' # Select correct package name based on attribute dd_pkg_name = node['datadog']['install_base'] ? 'datadog-agent-base' : 'datadog-agent' @@ -45,9 +65,10 @@ # default behavior, remove the `base` package as it is no longer needed package 'datadog-agent-base' do action :remove - only_if 'rpm -q datadog-agent-base' if %w(rhel fedora).include?(node['platform_family']) + only_if 'rpm -q datadog-agent-base' if %w[rhel fedora].include?(node['platform_family']) not_if 'apt-cache policy datadog-agent-base | grep "Installed: (none)"' if node['platform_family'] == 'debian' end + package_retries = node['datadog']['agent_package_retries'] package_retry_delay = node['datadog']['agent_package_retry_delay'] # Install the regular package @@ -57,15 +78,15 @@ version dd_agent_version retries package_retries unless package_retries.nil? retry_delay package_retry_delay unless package_retry_delay.nil? - action node['datadog']['agent_package_action'] # default is :install + action package_action # default is :install options '--force-yes' if node['datadog']['agent_allow_downgrade'] end - when 'rhel', 'fedora' + when 'rhel', 'fedora', 'amazon' yum_package 'datadog-agent' do version dd_agent_version retries package_retries unless package_retries.nil? retry_delay package_retry_delay unless package_retry_delay.nil? - action node['datadog']['agent_package_action'] # default is :install + action package_action # default is :install allow_downgrade node['datadog']['agent_allow_downgrade'] end end diff --git a/cookbooks/datadog/recipes/activemq.rb b/cookbooks/datadog/recipes/activemq.rb index 34cc9018..a934ee6b 100644 --- a/cookbooks/datadog/recipes/activemq.rb +++ b/cookbooks/datadog/recipes/activemq.rb @@ -22,4 +22,5 @@ datadog_monitor 'activemq' do instances node['datadog']['activemq']['instances'] + logs node['datadog']['activemq']['logs'] end diff --git a/cookbooks/datadog/recipes/apache.rb b/cookbooks/datadog/recipes/apache.rb index 1668c098..9fb31573 100644 --- a/cookbooks/datadog/recipes/apache.rb +++ b/cookbooks/datadog/recipes/apache.rb @@ -19,4 +19,5 @@ datadog_monitor 'apache' do instances node['datadog']['apache']['instances'] + logs node['datadog']['apache']['logs'] end diff --git a/cookbooks/datadog/recipes/cacti.rb b/cookbooks/datadog/recipes/cacti.rb index 896d58b5..55a977f3 100644 --- a/cookbooks/datadog/recipes/cacti.rb +++ b/cookbooks/datadog/recipes/cacti.rb @@ -40,4 +40,5 @@ datadog_monitor 'cacti' do instances node['datadog']['cacti']['instances'] + logs node['datadog']['cacti']['logs'] end diff --git a/cookbooks/datadog/recipes/cassandra.rb b/cookbooks/datadog/recipes/cassandra.rb index c4323b9d..ad553cfd 100644 --- a/cookbooks/datadog/recipes/cassandra.rb +++ b/cookbooks/datadog/recipes/cassandra.rb @@ -5,14 +5,14 @@ # Set the following attributes # * `instances` (required) # List of Cassandra clusters to monitor. Each cluster is generally a dictionary with a `host`, `port` and a `name`. -# More attributes are available. For more information, please refer to : https://github.com/DataDog/dd-agent/blob/master/conf.d/cassandra.yaml.example +# More attributes are available. For more information, please refer to : https://github.com/DataDog/integrations-core/blob/master/cassandra/conf.yaml.example # * `version` (optional) # Select the appropriate configuration file template. Available options are: # * `1` (Default, recommended for Cassandra < 2.2). # Use Cassandra legacy metrics, i.e. https://github.com/DataDog/dd-agent/blob/5.6.x/conf.d/cassandra.yaml.example#L23-L74 # * `2` (recommended for Cassandra >= 2.2). # Use Cassandra expanded metrics (CASSANDRA-4009) introduced in 1.2 (https://wiki.apache.org/cassandra/Metrics), -# i.e. https://github.com/DataDog/dd-agent/blob/master/conf.d/cassandra.yaml.example#L23-L102 +# i.e. https://github.com/DataDog/integrations-core/blob/master/cassandra/conf.yaml.example#L23-L102 # Example: @@ -38,4 +38,5 @@ datadog_monitor 'cassandra' do instances node['datadog']['cassandra']['instances'] version node['datadog']['cassandra']['version'] + logs node['datadog']['cassandra']['logs'] end diff --git a/cookbooks/datadog/recipes/consul.rb b/cookbooks/datadog/recipes/consul.rb index e73453f2..d771c50d 100644 --- a/cookbooks/datadog/recipes/consul.rb +++ b/cookbooks/datadog/recipes/consul.rb @@ -30,4 +30,5 @@ datadog_monitor 'consul' do instances node['datadog']['consul']['instances'] + logs node['datadog']['consul']['logs'] end diff --git a/cookbooks/datadog/recipes/couchbase.rb b/cookbooks/datadog/recipes/couchbase.rb new file mode 100644 index 00000000..897944b9 --- /dev/null +++ b/cookbooks/datadog/recipes/couchbase.rb @@ -0,0 +1,22 @@ +include_recipe 'datadog::dd-agent' + +# Monitor couchbase +# +# Assuming you have 2 instances on the same host +# you need to set up the following attributes. +# Each instance's metric will be tagged with "instance:server_url". +# to help you differentiate between instances. +# +# node['datadog']['couchbase']['instances'] = [ +# { +# server: 'http://localhost:1234' +# }, +# { +# server: 'http://localhost:4567' +# } +# ] + +datadog_monitor 'couchbase' do + instances node['datadog']['couchbase']['instances'] + logs node['datadog']['couchbase']['logs'] +end diff --git a/cookbooks/datadog/recipes/couchdb.rb b/cookbooks/datadog/recipes/couchdb.rb index 5e63dfda..95eb287a 100644 --- a/cookbooks/datadog/recipes/couchdb.rb +++ b/cookbooks/datadog/recipes/couchdb.rb @@ -20,4 +20,5 @@ datadog_monitor 'couch' do init_config nil instances node['datadog']['couch']['instances'] + logs node['datadog']['couch']['logs'] end diff --git a/cookbooks/datadog/recipes/dd-agent.rb b/cookbooks/datadog/recipes/dd-agent.rb index d487527a..64319f40 100644 --- a/cookbooks/datadog/recipes/dd-agent.rb +++ b/cookbooks/datadog/recipes/dd-agent.rb @@ -38,63 +38,67 @@ agent_enable = node['datadog']['agent_enable'] ? :enable : :disable # Set the correct Agent startup action agent_start = node['datadog']['agent_start'] ? :start : :stop -# Set the correct config file -agent_config_file = ::File.join(node['datadog']['config_dir'], 'datadog.conf') - -# Make sure the config directory exists -directory node['datadog']['config_dir'] do - if is_windows - owner 'Administrators' - rights :full_control, 'Administrators' - inherits false - else - owner 'dd-agent' - group 'root' - mode '755' - end -end # # Configures a basic agent # To add integration-specific configurations, add 'datadog::config_name' to # the node's run_list and set the relevant attributes # +if node['datadog']['agent6'] + include_recipe 'datadog::_agent6_config' +else + # Agent 5 and lower -template agent_config_file do # rubocop:disable Metrics/BlockLength - def template_vars # rubocop:disable Metrics/AbcSize - api_keys = [Chef::Datadog.api_key(node)] - dd_urls = [node['datadog']['url']] - node['datadog']['extra_endpoints'].each do |_, endpoint| - next unless endpoint['enabled'] - api_keys << endpoint['api_key'] - dd_urls << if endpoint['url'] - endpoint['url'] - else - node['datadog']['url'] - end + # Make sure the config directory exists for Agent 5 + directory node['datadog']['config_dir'] do + if is_windows + owner 'Administrators' + rights :full_control, 'Administrators' + inherits false + else + owner 'dd-agent' + group 'root' + mode '755' end - { - :api_keys => api_keys, - :dd_urls => dd_urls - } end - if is_windows - owner 'Administrators' - rights :full_control, 'Administrators' - inherits false - else - owner 'dd-agent' - group 'root' - mode '640' - end - variables( - if respond_to?(:lazy) - lazy { template_vars } + + agent_config_file = ::File.join(node['datadog']['config_dir'], 'datadog.conf') + template agent_config_file do # rubocop:disable Metrics/BlockLength + def template_vars # rubocop:disable Metrics/AbcSize + api_keys = [Chef::Datadog.api_key(node)] + dd_urls = [node['datadog']['url']] + node['datadog']['extra_endpoints'].each do |_, endpoint| + next unless endpoint['enabled'] + api_keys << endpoint['api_key'] + dd_urls << if endpoint['url'] + endpoint['url'] + else + node['datadog']['url'] + end + end + { + :api_keys => api_keys, + :dd_urls => dd_urls + } + end + if is_windows + owner 'Administrators' + rights :full_control, 'Administrators' + inherits false else - template_vars + owner 'dd-agent' + group 'root' + mode '640' end - ) - sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) + variables( + if respond_to?(:lazy) + lazy { template_vars } + else + template_vars + end + ) + sensitive true if Chef::Resource.instance_methods(false).include?(:sensitive) + end end # Common configuration @@ -107,6 +111,10 @@ def template_vars # rubocop:disable Metrics/AbcSize supports :restart => true, :status => true, :start => true, :stop => true end subscribes :restart, "template[#{agent_config_file}]", :delayed unless node['datadog']['agent_start'] == false + # HACK: the restart can fail when we hit systemd's restart limits (by default, 5 starts every 10 seconds) + # To workaround this, retry once after 5 seconds, and a second time after 10 seconds + retries 2 + retry_delay 5 end # Install integration packages diff --git a/cookbooks/datadog/recipes/directory.rb b/cookbooks/datadog/recipes/directory.rb index 63da793e..fee67eca 100644 --- a/cookbooks/datadog/recipes/directory.rb +++ b/cookbooks/datadog/recipes/directory.rb @@ -13,4 +13,5 @@ datadog_monitor 'directory' do instances node['datadog']['directory']['instances'] + logs node['datadog']['directory']['logs'] end diff --git a/cookbooks/datadog/recipes/disk.rb b/cookbooks/datadog/recipes/disk.rb index 8dee315c..fa1e93cd 100644 --- a/cookbooks/datadog/recipes/disk.rb +++ b/cookbooks/datadog/recipes/disk.rb @@ -32,4 +32,5 @@ datadog_monitor 'disk' do instances node['datadog']['disk']['instances'] init_config nil + logs node['datadog']['disk']['logs'] end diff --git a/cookbooks/datadog/recipes/dns_check.rb b/cookbooks/datadog/recipes/dns_check.rb index 6374050e..ac2e46d2 100644 --- a/cookbooks/datadog/recipes/dns_check.rb +++ b/cookbooks/datadog/recipes/dns_check.rb @@ -30,4 +30,5 @@ datadog_monitor 'dns_check' do instances node['datadog']['dns_check']['instances'] + logs node['datadog']['dns_check']['logs'] end diff --git a/cookbooks/datadog/recipes/docker.rb b/cookbooks/datadog/recipes/docker.rb index bef0fea0..4e1b6c5e 100644 --- a/cookbooks/datadog/recipes/docker.rb +++ b/cookbooks/datadog/recipes/docker.rb @@ -46,4 +46,5 @@ datadog_monitor 'docker' do init_config node['datadog']['docker']['init_config'] instances node['datadog']['docker']['instances'] + logs node['datadog']['docker']['logs'] end diff --git a/cookbooks/datadog/recipes/docker_daemon.rb b/cookbooks/datadog/recipes/docker_daemon.rb index cdf95bb6..268f167b 100644 --- a/cookbooks/datadog/recipes/docker_daemon.rb +++ b/cookbooks/datadog/recipes/docker_daemon.rb @@ -76,4 +76,5 @@ datadog_monitor 'docker_daemon' do init_config node['datadog']['docker_daemon']['init_config'] instances node['datadog']['docker_daemon']['instances'] + logs node['datadog']['docker_daemon']['logs'] end diff --git a/cookbooks/datadog/recipes/elasticsearch.rb b/cookbooks/datadog/recipes/elasticsearch.rb index 348ba35e..17914e75 100644 --- a/cookbooks/datadog/recipes/elasticsearch.rb +++ b/cookbooks/datadog/recipes/elasticsearch.rb @@ -57,4 +57,5 @@ datadog_monitor 'elastic' do instances node['datadog']['elasticsearch']['instances'] + logs node['datadog']['elasticsearch']['logs'] end diff --git a/cookbooks/datadog/recipes/etcd.rb b/cookbooks/datadog/recipes/etcd.rb index 653f05cd..55da864d 100644 --- a/cookbooks/datadog/recipes/etcd.rb +++ b/cookbooks/datadog/recipes/etcd.rb @@ -21,4 +21,5 @@ datadog_monitor 'etcd' do instances node['datadog']['etcd']['instances'] + logs node['datadog']['etcd']['logs'] end diff --git a/cookbooks/datadog/recipes/fluentd.rb b/cookbooks/datadog/recipes/fluentd.rb index dfeb0e16..f904da10 100644 --- a/cookbooks/datadog/recipes/fluentd.rb +++ b/cookbooks/datadog/recipes/fluentd.rb @@ -12,4 +12,5 @@ datadog_monitor 'fluentd' do instances node['datadog']['fluentd']['instances'] + logs node['datadog']['fluentd']['logs'] end diff --git a/cookbooks/datadog/recipes/go-metro.rb b/cookbooks/datadog/recipes/go-metro.rb new file mode 100644 index 00000000..d2afdcfb --- /dev/null +++ b/cookbooks/datadog/recipes/go-metro.rb @@ -0,0 +1,82 @@ +include_recipe 'datadog::dd-agent' + +# Go-Metro (TCP RTT) Integration: Passively monitor TCP Round Trip Time +# between the monitored host and others nodes on the network + +# Recommended default init_config: +# (these are set in the go-metro attributes file in this cookbook) +# node['datadog']['go-metro']['init_config'] = { +# 'snaplen' => 512, +# 'idle_ttl' => 300, +# 'exp_ttl' => 60, +# 'statsd_ip' => '127.0.0.1', +# 'statsd_port' => 8125, +# 'log_to_file' => true, +# 'log_level' => 'info' +# } + +# Assuming you want to monitor connections to +# 10.0.0.1, 10.0.0.2, 10.0.0.3, and app.datadoghq.com from eth0, +# create an instance configuration like this: +# node['datadog']['go-metro']['instances'] = [ +# { +# 'interface' => 'eth0', +# 'tags' => [ +# 'env:prod' +# ], +# 'ips' => [ +# '10.0.0.1', +# '10.0.0.2', +# '10.0.0.3' +# ], +# 'hosts' => [ +# 'app.datadoghq.com' +# ] +# } +# ] + +#### +# At the time of writing, the Go-Metro (TCP Round Trip Time) integration +# is only available as part of the 64-bit DEB and RPM agent distribution +# +# Bail if we're not 64-bit or not linux +if node['kernel']['machine'] != 'x86_64' || node['os'] != 'linux' + Chef::Log.fatal('The Go-Metro (TCP RTT) integration is only available') + Chef::Log.fatal('as part of the 64-bit DEB and RPM agent distribution') + if node['os'] == 'linux' + Chef::Log.fatal( + "And Chef thinks this machine is #{node['kernel']['machine']}", \ + "not 'x86_64'" + ) + else + Chef::Log.fatal( + "And Chef thinks this machine is #{node['os']}, not 'linux'" + ) + end + raise +end + +# install desired package for libcap +# This implementation allows you to set any valid package resourece property +# as an attribute underneath node['datadog']['go-metro']['libcap-package'] +package 'libcap' do + # handle scenario when entire attribute is nil + unless node['datadog']['go-metro']['libcap_package'].nil? + # send each attribute as a property to the resource + node['datadog']['go-metro']['libcap_package'].each do |prop, value| + send(prop.to_sym, value) unless value.nil? + end + end +end + +# add cap_net_raw+ep to the go-metro binary +execute 'setcap go-metro' do + command 'setcap cap_net_raw+ep /opt/datadog-agent/bin/go-metro' + not_if 'setcap -v cap_net_raw+ep /opt/datadog-agent/bin/go-metro' +end + +datadog_monitor 'go-metro' do + init_config node['datadog']['go-metro']['init_config'] + instances node['datadog']['go-metro']['instances'] + logs node['datadog']['go-metro']['logs'] +end diff --git a/cookbooks/datadog/recipes/go_expvar.rb b/cookbooks/datadog/recipes/go_expvar.rb index 35a744ed..a7cdec34 100644 --- a/cookbooks/datadog/recipes/go_expvar.rb +++ b/cookbooks/datadog/recipes/go_expvar.rb @@ -21,4 +21,5 @@ datadog_monitor 'go_expvar' do init_config node['datadog']['go_expvar']['init_config'] instances node['datadog']['go_expvar']['instances'] + logs node['datadog']['go_expvar']['logs'] end diff --git a/cookbooks/datadog/recipes/gunicorn.rb b/cookbooks/datadog/recipes/gunicorn.rb index ffdfd52d..f9a3e6b8 100644 --- a/cookbooks/datadog/recipes/gunicorn.rb +++ b/cookbooks/datadog/recipes/gunicorn.rb @@ -27,4 +27,5 @@ datadog_monitor 'gunicorn' do instances node['datadog']['gunicorn']['instances'] + logs node['datadog']['gunicorn']['logs'] end diff --git a/cookbooks/datadog/recipes/haproxy.rb b/cookbooks/datadog/recipes/haproxy.rb index 4028a816..34afa8ba 100644 --- a/cookbooks/datadog/recipes/haproxy.rb +++ b/cookbooks/datadog/recipes/haproxy.rb @@ -16,4 +16,5 @@ datadog_monitor 'haproxy' do instances node['datadog']['haproxy']['instances'] + logs node['datadog']['haproxy']['logs'] end diff --git a/cookbooks/datadog/recipes/hdfs.rb b/cookbooks/datadog/recipes/hdfs.rb index cb6a6ba5..f171e2da 100644 --- a/cookbooks/datadog/recipes/hdfs.rb +++ b/cookbooks/datadog/recipes/hdfs.rb @@ -26,4 +26,5 @@ datadog_monitor 'hdfs' do instances node['datadog']['hdfs']['instances'] + logs node['datadog']['hdfs']['logs'] end diff --git a/cookbooks/datadog/recipes/http_check.rb b/cookbooks/datadog/recipes/http_check.rb index 43f9df64..621646b7 100644 --- a/cookbooks/datadog/recipes/http_check.rb +++ b/cookbooks/datadog/recipes/http_check.rb @@ -21,4 +21,5 @@ datadog_monitor 'http_check' do instances node['datadog']['http_check']['instances'] + logs node['datadog']['http_check']['logs'] end diff --git a/cookbooks/datadog/recipes/iis.rb b/cookbooks/datadog/recipes/iis.rb index e955998d..ec639a05 100644 --- a/cookbooks/datadog/recipes/iis.rb +++ b/cookbooks/datadog/recipes/iis.rb @@ -21,4 +21,5 @@ datadog_monitor 'iis' do instances node['datadog']['iis']['instances'] + logs node['datadog']['iis']['logs'] end diff --git a/cookbooks/datadog/recipes/integrations.rb b/cookbooks/datadog/recipes/integrations.rb index 1841c710..87bf340e 100644 --- a/cookbooks/datadog/recipes/integrations.rb +++ b/cookbooks/datadog/recipes/integrations.rb @@ -38,6 +38,7 @@ datadog_monitor name do init_config node['datadog'][name]['init_config'] instances node['datadog'][name]['instances'] + logs node['datadog'][name]['logs'] use_integration_template true end end diff --git a/cookbooks/datadog/recipes/jenkins.rb b/cookbooks/datadog/recipes/jenkins.rb index d8e3693d..78a0a249 100644 --- a/cookbooks/datadog/recipes/jenkins.rb +++ b/cookbooks/datadog/recipes/jenkins.rb @@ -20,4 +20,5 @@ datadog_monitor 'jenkins' do instances node['datadog']['jenkins']['instances'] + logs node['datadog']['jenkins']['logs'] end diff --git a/cookbooks/datadog/recipes/jmx.rb b/cookbooks/datadog/recipes/jmx.rb index 2e353ba4..3a260af3 100644 --- a/cookbooks/datadog/recipes/jmx.rb +++ b/cookbooks/datadog/recipes/jmx.rb @@ -19,4 +19,5 @@ # ] datadog_monitor 'jmx' do instances node['datadog']['jmx']['instances'] + logs node['datadog']['jmx']['logs'] end diff --git a/cookbooks/datadog/recipes/kafka.rb b/cookbooks/datadog/recipes/kafka.rb index ac61a958..0e1fbd22 100644 --- a/cookbooks/datadog/recipes/kafka.rb +++ b/cookbooks/datadog/recipes/kafka.rb @@ -5,7 +5,7 @@ # Set the following attributes # * `instances` (required) # List of Kafka clusters to monitor. Each cluster is generally a dictionary with a `host`, `port` and a `name`. -# More attributes are available. For more information, please refer to : https://github.com/DataDog/dd-agent/blob/master/conf.d/kafka.yaml.example +# More attributes are available. For more information, please refer to : https://github.com/DataDog/integrations-core/blob/master/kafka/conf.yaml.example # * `version` (optional) # Select the appropriate configuration file template. Available options are: # * `1` (Default, Kafka < 0.8.2). @@ -38,4 +38,5 @@ datadog_monitor 'kafka' do instances node['datadog']['kafka']['instances'] version node['datadog']['kafka']['version'] + logs node['datadog']['kafka']['logs'] end diff --git a/cookbooks/datadog/recipes/kafka_consumer.rb b/cookbooks/datadog/recipes/kafka_consumer.rb index d5fb83c2..c9832d9f 100644 --- a/cookbooks/datadog/recipes/kafka_consumer.rb +++ b/cookbooks/datadog/recipes/kafka_consumer.rb @@ -13,4 +13,5 @@ datadog_monitor 'kafka_consumer' do instances node['datadog']['kafka_consumer']['instances'] + logs node['datadog']['kafka_consumer']['logs'] end diff --git a/cookbooks/datadog/recipes/kubernetes.rb b/cookbooks/datadog/recipes/kubernetes.rb index e0b18f4b..ce61d5d5 100644 --- a/cookbooks/datadog/recipes/kubernetes.rb +++ b/cookbooks/datadog/recipes/kubernetes.rb @@ -27,4 +27,5 @@ datadog_monitor 'kubernetes' do instances node['datadog']['kubernetes']['instances'] + logs node['datadog']['kubernetes']['logs'] end diff --git a/cookbooks/datadog/recipes/kyototycoon.rb b/cookbooks/datadog/recipes/kyototycoon.rb index aeb63622..6d3f19a1 100644 --- a/cookbooks/datadog/recipes/kyototycoon.rb +++ b/cookbooks/datadog/recipes/kyototycoon.rb @@ -19,4 +19,5 @@ datadog_monitor 'kyototycoon' do instances node['datadog']['kyototycoon']['instances'] + logs node['datadog']['kyototycoon']['logs'] end diff --git a/cookbooks/datadog/recipes/lighttpd.rb b/cookbooks/datadog/recipes/lighttpd.rb index f6b40813..16b58d03 100644 --- a/cookbooks/datadog/recipes/lighttpd.rb +++ b/cookbooks/datadog/recipes/lighttpd.rb @@ -2,4 +2,5 @@ datadog_monitor 'lighttpd' do instances node['datadog']['lighttpd']['instances'] + logs node['datadog']['lighttpd']['logs'] end diff --git a/cookbooks/datadog/recipes/memcache.rb b/cookbooks/datadog/recipes/memcache.rb index 1362b8ff..dd5a6cbe 100644 --- a/cookbooks/datadog/recipes/memcache.rb +++ b/cookbooks/datadog/recipes/memcache.rb @@ -16,4 +16,5 @@ datadog_monitor 'mcache' do instances node['datadog']['memcache']['instances'] + logs node['datadog']['memcache']['logs'] end diff --git a/cookbooks/datadog/recipes/mesos.rb b/cookbooks/datadog/recipes/mesos.rb index e8da1865..04b49d05 100644 --- a/cookbooks/datadog/recipes/mesos.rb +++ b/cookbooks/datadog/recipes/mesos.rb @@ -36,4 +36,5 @@ datadog_monitor 'mesos' do init_config node['datadog']['mesos']['init_config'] instances node['datadog']['mesos']['instances'] + logs node['datadog']['mesos']['logs'] end diff --git a/cookbooks/datadog/recipes/mongo.rb b/cookbooks/datadog/recipes/mongo.rb index 10cccad8..bc91ca6e 100644 --- a/cookbooks/datadog/recipes/mongo.rb +++ b/cookbooks/datadog/recipes/mongo.rb @@ -11,4 +11,5 @@ datadog_monitor 'mongo' do instances node['datadog']['mongo']['instances'] + logs node['datadog']['mongo']['logs'] end diff --git a/cookbooks/datadog/recipes/mysql.rb b/cookbooks/datadog/recipes/mysql.rb index 70b6bdf9..bbcff534 100644 --- a/cookbooks/datadog/recipes/mysql.rb +++ b/cookbooks/datadog/recipes/mysql.rb @@ -31,4 +31,5 @@ datadog_monitor 'mysql' do instances node['datadog']['mysql']['instances'] + logs node['datadog']['mysql']['logs'] end diff --git a/cookbooks/datadog/recipes/network.rb b/cookbooks/datadog/recipes/network.rb index 5e84aab1..04b314be 100644 --- a/cookbooks/datadog/recipes/network.rb +++ b/cookbooks/datadog/recipes/network.rb @@ -13,4 +13,5 @@ datadog_monitor 'network' do instances node['datadog']['network']['instances'] + logs node['datadog']['network']['logs'] end diff --git a/cookbooks/datadog/recipes/nginx.rb b/cookbooks/datadog/recipes/nginx.rb index 2b842fb9..d20b7342 100644 --- a/cookbooks/datadog/recipes/nginx.rb +++ b/cookbooks/datadog/recipes/nginx.rb @@ -22,4 +22,5 @@ datadog_monitor 'nginx' do instances node['datadog']['nginx']['instances'] + logs node['datadog']['nginx']['logs'] end diff --git a/cookbooks/datadog/recipes/ntp.rb b/cookbooks/datadog/recipes/ntp.rb index 739b4848..c68bd6e5 100644 --- a/cookbooks/datadog/recipes/ntp.rb +++ b/cookbooks/datadog/recipes/ntp.rb @@ -2,7 +2,7 @@ # Build a data structure with configuration. # @note NTP check is enabled by default since datadog-agent 5.3.0. -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/ntp.yaml.default +# @see https://github.com/DataDog/integrations-core/blob/master/ntp/conf.yaml.default # @example # node.override['datadog']['ntp']['instances'] = [ # { @@ -15,4 +15,5 @@ # ] datadog_monitor 'ntp' do instances node['datadog']['ntp']['instances'] + logs node['datadog']['ntp']['logs'] end diff --git a/cookbooks/datadog/recipes/pgbouncer.rb b/cookbooks/datadog/recipes/pgbouncer.rb index fe1c6770..f04a17dc 100644 --- a/cookbooks/datadog/recipes/pgbouncer.rb +++ b/cookbooks/datadog/recipes/pgbouncer.rb @@ -19,7 +19,7 @@ include_recipe 'datadog::dd-agent' # Build a data structure with configuration. -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/pgbouncer.yaml.example Pgbouncer Example +# @see https://github.com/DataDog/integrations-core/blob/master/pgbouncer/conf.yaml.example Pgbouncer Example # @example # node.override['datadog']['pgbouncer']['instances'] = [ # { @@ -36,4 +36,5 @@ datadog_monitor 'pgbouncer' do instances node['datadog']['pgbouncer']['instances'] + logs node['datadog']['pgbouncer']['logs'] end diff --git a/cookbooks/datadog/recipes/php_fpm.rb b/cookbooks/datadog/recipes/php_fpm.rb index 9294de47..5aef1aed 100644 --- a/cookbooks/datadog/recipes/php_fpm.rb +++ b/cookbooks/datadog/recipes/php_fpm.rb @@ -1,7 +1,7 @@ include_recipe 'datadog::dd-agent' # Build a data structure with configuration. -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/php_fpm.yaml.example PHP-FPM Example +# @see https://github.com/DataDog/integrations-core/blob/master/php_fpm/conf.yaml.example PHP-FPM Example # @example # node.override['datadog']['php_fpm']['instances'] = [ # { @@ -15,4 +15,5 @@ # ] datadog_monitor 'php_fpm' do instances node['datadog']['php_fpm']['instances'] + logs node['datadog']['php_fpm']['logs'] end diff --git a/cookbooks/datadog/recipes/postfix.rb b/cookbooks/datadog/recipes/postfix.rb index 22dc0227..9e882aa2 100644 --- a/cookbooks/datadog/recipes/postfix.rb +++ b/cookbooks/datadog/recipes/postfix.rb @@ -42,4 +42,5 @@ datadog_monitor 'postfix' do instances postfix_instances + logs node['datadog']['postfix']['logs'] end diff --git a/cookbooks/datadog/recipes/postgres.rb b/cookbooks/datadog/recipes/postgres.rb index 558aaec4..bad46f4a 100644 --- a/cookbooks/datadog/recipes/postgres.rb +++ b/cookbooks/datadog/recipes/postgres.rb @@ -1,7 +1,7 @@ include_recipe 'datadog::dd-agent' # Build a data structure with configuration. -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/postgres.yaml.example PostgreSQL Example +# @see https://github.com/DataDog/integrations-core/blob/master/postgres/conf.yaml.example PostgreSQL Example # @example # node.override['datadog']['postgres']['instances'] = [ # { @@ -25,4 +25,5 @@ datadog_monitor 'postgres' do instances node['datadog']['postgres']['instances'] + logs node['datadog']['postgres']['logs'] end diff --git a/cookbooks/datadog/recipes/process.rb b/cookbooks/datadog/recipes/process.rb index 5db38b0a..36d30aca 100644 --- a/cookbooks/datadog/recipes/process.rb +++ b/cookbooks/datadog/recipes/process.rb @@ -26,4 +26,5 @@ datadog_monitor 'process' do instances node['datadog']['process']['instances'] + logs node['datadog']['process']['logs'] end diff --git a/cookbooks/datadog/recipes/rabbitmq.rb b/cookbooks/datadog/recipes/rabbitmq.rb index b0b9bc4f..52adc374 100644 --- a/cookbooks/datadog/recipes/rabbitmq.rb +++ b/cookbooks/datadog/recipes/rabbitmq.rb @@ -13,9 +13,11 @@ # "user" => "guest", # "pass" => "guest", # "ssl_verify" => "true" +# "tag_families" => "false" # } # ] datadog_monitor 'rabbitmq' do instances node['datadog']['rabbitmq']['instances'] + logs node['datadog']['rabbitmq']['logs'] end diff --git a/cookbooks/datadog/recipes/redisdb.rb b/cookbooks/datadog/recipes/redisdb.rb index 17f1d731..04796c8d 100644 --- a/cookbooks/datadog/recipes/redisdb.rb +++ b/cookbooks/datadog/recipes/redisdb.rb @@ -1,7 +1,7 @@ include_recipe 'datadog::dd-agent' # Build a data structure with configuration. -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/redisdb.yaml.example RedisDB Example +# @see https://github.com/DataDog/integrations-core/blob/master/redisdb/conf.yaml.example RedisDB Example # @example # node.override['datadog']['redisdb']['instances'] = [ # { @@ -13,4 +13,5 @@ # ] datadog_monitor 'redisdb' do instances node['datadog']['redisdb']['instances'] + logs node['datadog']['redisdb']['logs'] end diff --git a/cookbooks/datadog/recipes/repository.rb b/cookbooks/datadog/recipes/repository.rb index e05e3f2c..26cca4ea 100644 --- a/cookbooks/datadog/recipes/repository.rb +++ b/cookbooks/datadog/recipes/repository.rb @@ -42,9 +42,24 @@ action :add end -when 'rhel', 'fedora' - include_recipe 'yum' - + apt_repository 'datadog-beta' do + keyserver 'hkp://keyserver.ubuntu.com:80' + key 'C7A7DA52' + uri node['datadog']['agent6_aptrepo'] + distribution node['datadog']['agent6_aptrepo_dist'] + components ['main'] + if node['datadog']['agent6'] && + (node['datadog']['agent6_aptrepo'] != node['datadog']['aptrepo'] || + node['datadog']['agent6_aptrepo_dist'] != node['datadog']['aptrepo_dist']) + # add the beta repo iff: + # * agent6 is selected (avoid automatic upgrades to agent6 if it's not), and + # * the node is configured to use a different repo than the agent5 (avoid duplicate repos) + action :add + else + action :remove + end + end +when 'rhel', 'fedora', 'amazon' # Import new RPM key if node['datadog']['yumrepo_gpgkey_new'] # gnupg is required to check the downloaded key's fingerprint @@ -73,11 +88,16 @@ yum_repository 'datadog' do name 'datadog' description 'datadog' - baseurl node['datadog']['yumrepo'] + if node['datadog']['agent6'] + baseurl node['datadog']['agent6_yumrepo'] + else + baseurl node['datadog']['yumrepo'] + end proxy node['datadog']['yumrepo_proxy'] proxy_username node['datadog']['yumrepo_proxy_username'] proxy_password node['datadog']['yumrepo_proxy_password'] gpgkey node['datadog']['yumrepo_gpgkey'] + gpgcheck true action :create end end diff --git a/cookbooks/datadog/recipes/riak.rb b/cookbooks/datadog/recipes/riak.rb index 65f74b7a..7e9df8c6 100644 --- a/cookbooks/datadog/recipes/riak.rb +++ b/cookbooks/datadog/recipes/riak.rb @@ -10,4 +10,5 @@ datadog_monitor 'riak' do instances node['datadog']['riak']['instances'] + logs node['datadog']['riak']['logs'] end diff --git a/cookbooks/datadog/recipes/snmp.rb b/cookbooks/datadog/recipes/snmp.rb new file mode 100644 index 00000000..c6111289 --- /dev/null +++ b/cookbooks/datadog/recipes/snmp.rb @@ -0,0 +1,116 @@ +include_recipe 'datadog::dd-agent' + +# see example configuration file here: +# https://github.com/DataDog/integrations-core/blob/master/snmp/conf.yaml.example + +# Example 1 - Optionally a MIBS folder is configured in the init_config +# SNMP v1 - v2 +# node['datadog']['snmp'] = +# { +# "init_config": { +# "mibs_folder": "/path/to/your/mibs/folder", +# "ignore_nonincreasing_oid": false +# }, +# "instances": [ +# { +# "ip_address": "localhost", +# "port": 161, +# "community_string": "public", +# "snmp_version": 1, +# "timeout": 1, +# "retries": 5, +# "enforce_mib_constraints": true, +# "tags": [ +# "optional_tag_2" +# ], +# "metrics": [ +# { +# "MIB": "UDP-MIB", +# "symbol": "udpInDatagrams" +# }, +# { +# "MIB": "TCP-MIB", +# "symbol": "tcpActiveOpens" +# }, +# { +# "OID": "1.3.6.1.2.1.6.5", +# "name": "tcpPassiveOpens" +# }, +# { +# "OID": "1.3.6.1.2.1.6.5", +# "metric_tags": [ +# "TCP" +# ] +# }, +# { +# "OID": "1.3.6.1.4.1.3375.2.1.1.2.1.8.0", +# "name": "F5_TotalCurrentConnections", +# "forced_type": "gauge" +# }, +# { +# "MIB": "IF-MIB", +# "table": "ifTable", +# "symbols": [ +# "ifInOctets", +# "ifOutOctets" +# ], +# { +# "tag": "interface", +# "column": "ifDescr" +# } +# { +# "MIB": "IP-MIB", +# "table": "ipSystemStatsTable", +# "symbols": [ +# "ipSystemStatsInReceives" +# ], +# "metric_tags": [ +# { +# "tag": "ipversion", +# "index": 1 +# } +# ] +# } +# ] +# } +# ] +# } + +# Example 2 - MIBS folder is not configured in init_config +# SNMP v3 +# node['datadog']['snmp'] = +# { +# "instances": [ +# { +# "ip_address": "192.168.34.10", +# "port": 161, +# "user": "user", +# "authKey": "password", +# "privKey": "private_key", +# "authProtocol": "authProtocol", +# "privProtocol": "privProtocol", +# "timeout": 1, +# "retries": 5, +# "tags": [ +# "optional_tag_1", +# "optional_tag_2" +# ], +# "metrics": [ +# { +# "MIB": "UDP-MIB", +# "symbol": "udpInDatagrams" +# }, +# { +# "MIB": "TCP-MIB", +# "symbol": "tcpActiveOpens" +# } +# ] +# } +# ] +# } + +datadog_monitor 'snmp' do + init_config node['datadog']['snmp']['init_config'] + instances node['datadog']['snmp']['instances'] + logs node['datadog']['snmp']['logs'] +end diff --git a/cookbooks/datadog/recipes/solr.rb b/cookbooks/datadog/recipes/solr.rb index 852bd886..e8673831 100644 --- a/cookbooks/datadog/recipes/solr.rb +++ b/cookbooks/datadog/recipes/solr.rb @@ -1,10 +1,11 @@ include_recipe 'datadog::dd-agent' # Monitor solr -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/solr.yaml.example Solr Example +# @see https://github.com/DataDog/integrations-core/blob/master/solr/conf.yaml.example Solr Example # @example # datadog_monitor 'solr' do instances node['datadog']['solr']['instances'] + logs node['datadog']['solr']['logs'] end diff --git a/cookbooks/datadog/recipes/sqlserver.rb b/cookbooks/datadog/recipes/sqlserver.rb index 920f2b47..68306b90 100644 --- a/cookbooks/datadog/recipes/sqlserver.rb +++ b/cookbooks/datadog/recipes/sqlserver.rb @@ -63,4 +63,5 @@ datadog_monitor 'sqlserver' do init_config node['datadog']['sqlserver']['init_config'] instances node['datadog']['sqlserver']['instances'] + logs node['datadog']['sqlserver']['logs'] end diff --git a/cookbooks/datadog/recipes/ssh_check.rb b/cookbooks/datadog/recipes/ssh_check.rb index 0a0e81fd..34cc3672 100644 --- a/cookbooks/datadog/recipes/ssh_check.rb +++ b/cookbooks/datadog/recipes/ssh_check.rb @@ -21,4 +21,5 @@ datadog_monitor 'ssh_check' do instances node['datadog']['ssh_check']['instances'] + logs node['datadog']['ssh_check']['logs'] end diff --git a/cookbooks/datadog/recipes/supervisord.rb b/cookbooks/datadog/recipes/supervisord.rb index fb2fa7a9..cdcb4e09 100644 --- a/cookbooks/datadog/recipes/supervisord.rb +++ b/cookbooks/datadog/recipes/supervisord.rb @@ -19,9 +19,9 @@ include_recipe 'datadog::dd-agent' # Build a data structure with configuration. -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/supervisord.yaml.example Supervisord Example +# @see https://github.com/DataDog/integrations-core/blob/master/supervisord/conf.yaml.example Supervisord Example # @example -# node.override['datadog']['supervisord']['instances'] = +# node.override['datadog']['supervisord']['instances'] = [ # { # name: 'server0', # socket: 'unix:///var/run/default-supervisor.sock' @@ -37,7 +37,9 @@ # 'webapp' # ] # } +# ] datadog_monitor 'supervisord' do instances node['datadog']['supervisord']['instances'] + logs node['datadog']['supervisord']['logs'] end diff --git a/cookbooks/datadog/recipes/tcp_check.rb b/cookbooks/datadog/recipes/tcp_check.rb index a1463034..1d5b9de7 100644 --- a/cookbooks/datadog/recipes/tcp_check.rb +++ b/cookbooks/datadog/recipes/tcp_check.rb @@ -15,4 +15,5 @@ datadog_monitor 'tcp_check' do instances node['datadog']['tcp_check']['instances'] + logs node['datadog']['tcp_check']['logs'] end diff --git a/cookbooks/datadog/recipes/tokumx.rb b/cookbooks/datadog/recipes/tokumx.rb new file mode 100644 index 00000000..7e281ea1 --- /dev/null +++ b/cookbooks/datadog/recipes/tokumx.rb @@ -0,0 +1,15 @@ +include_recipe 'datadog::dd-agent' + +# Monitor tokumx +# +# node.set['datadog']['tokumx']['instances'] = [ +# { +# 'host' => 'localhost', +# 'port' => '27017' +# } +# ] + +datadog_monitor 'tokumx' do + instances node['datadog']['tokumx']['instances'] + logs node['datadog']['tokumx']['logs'] +end diff --git a/cookbooks/datadog/recipes/tomcat.rb b/cookbooks/datadog/recipes/tomcat.rb index 86a0221b..0701d1e4 100644 --- a/cookbooks/datadog/recipes/tomcat.rb +++ b/cookbooks/datadog/recipes/tomcat.rb @@ -22,4 +22,5 @@ datadog_monitor 'tomcat' do instances node['datadog']['tomcat']['instances'] + logs node['datadog']['tomcat']['logs'] end diff --git a/cookbooks/datadog/recipes/varnish.rb b/cookbooks/datadog/recipes/varnish.rb index 7e823c8e..5477d2d5 100644 --- a/cookbooks/datadog/recipes/varnish.rb +++ b/cookbooks/datadog/recipes/varnish.rb @@ -23,4 +23,5 @@ datadog_monitor 'varnish' do instances node['datadog']['varnish']['instances'] + logs node['datadog']['varnish']['logs'] end diff --git a/cookbooks/datadog/recipes/win32_event_log.rb b/cookbooks/datadog/recipes/win32_event_log.rb index 0f2d772a..470a8ca6 100644 --- a/cookbooks/datadog/recipes/win32_event_log.rb +++ b/cookbooks/datadog/recipes/win32_event_log.rb @@ -1,7 +1,7 @@ include_recipe 'datadog::dd-agent' # Monitor the Windows Event Log -# @see https://github.com/DataDog/dd-agent/blob/master/conf.d/win32_event_log.yaml.example for details +# @see https://github.com/DataDog/integrations-core/blob/master/win32_event_log/conf.yaml.example for details # # @example # node['datadog']['win32_event_log']['init_config'] = { @@ -20,4 +20,5 @@ datadog_monitor 'win32_event_log' do init_config node['datadog']['win32_event_log']['init_config'] instances node['datadog']['win32_event_log']['instances'] + logs node['datadog']['win32_event_log']['logs'] end diff --git a/cookbooks/datadog/recipes/windows_service.rb b/cookbooks/datadog/recipes/windows_service.rb index 08a0ad6b..ae1ba459 100644 --- a/cookbooks/datadog/recipes/windows_service.rb +++ b/cookbooks/datadog/recipes/windows_service.rb @@ -57,4 +57,5 @@ datadog_monitor 'windows_service' do instances node['datadog']['windows_service']['instances'] + logs node['datadog']['windows_service']['logs'] end diff --git a/cookbooks/datadog/recipes/zookeeper.rb b/cookbooks/datadog/recipes/zookeeper.rb index 3078ab73..1145319c 100644 --- a/cookbooks/datadog/recipes/zookeeper.rb +++ b/cookbooks/datadog/recipes/zookeeper.rb @@ -7,4 +7,5 @@ datadog_monitor 'zk' do instances node['datadog']['zookeeper']['instances'] + logs node['datadog']['zookeeper']['logs'] end diff --git a/cookbooks/datadog/resources/monitor.rb b/cookbooks/datadog/resources/monitor.rb index 4837bb0f..7bb87078 100644 --- a/cookbooks/datadog/resources/monitor.rb +++ b/cookbooks/datadog/resources/monitor.rb @@ -6,10 +6,11 @@ attribute :name, :kind_of => String, :name_attribute => true attribute :cookbook, :kind_of => String, :default => 'datadog' -# checks have 2 sections: init_config and instances +# checks have 3 sections: init_config, instances, logs # we mimic these here, no validation is performed until the template # is evaluated. attribute :init_config, :kind_of => Hash, :required => false, :default => {} attribute :instances, :kind_of => Array, :required => false, :default => [] +attribute :logs, :kind_of => Array, :required => false, :default => [] attribute :version, :kind_of => Integer, :required => false, :default => nil attribute :use_integration_template, :kind_of => [TrueClass, FalseClass], :required => false, :default => false diff --git a/cookbooks/datadog/templates/default/activemq.yaml.erb b/cookbooks/datadog/templates/default/activemq.yaml.erb index 98b88062..6b001e0e 100644 --- a/cookbooks/datadog/templates/default/activemq.yaml.erb +++ b/cookbooks/datadog/templates/default/activemq.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # List of metrics to be collected by the integration # You should not have to modify this. diff --git a/cookbooks/datadog/templates/default/apache.yaml.erb b/cookbooks/datadog/templates/default/apache.yaml.erb index 1633c85b..6af28d1a 100644 --- a/cookbooks/datadog/templates/default/apache.yaml.erb +++ b/cookbooks/datadog/templates/default/apache.yaml.erb @@ -1,8 +1,11 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - apache_status_url: <%= i['status_url'] %> <% if i['apache_user'] -%>apache_user: <%= i['apache_user'] %><% end -%> <% if i['apache_password'] -%>apache_password: <%= i['apache_password'] %><% end -%> + <% if i['disable_ssl_validation'] -%>disable_ssl_validation: <%= i['disable_ssl_validation'] %><% end -%> <% if i.key?('tags') -%> tags: diff --git a/cookbooks/datadog/templates/default/cacti.yaml.erb b/cookbooks/datadog/templates/default/cacti.yaml.erb index 1871c668..1a73bb39 100644 --- a/cookbooks/datadog/templates/default/cacti.yaml.erb +++ b/cookbooks/datadog/templates/default/cacti.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - mysql_host: <%= i['mysql_host'] %> diff --git a/cookbooks/datadog/templates/default/cassandra.yaml.erb b/cookbooks/datadog/templates/default/cassandra.yaml.erb index d491723d..daf91319 100644 --- a/cookbooks/datadog/templates/default/cassandra.yaml.erb +++ b/cookbooks/datadog/templates/default/cassandra.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i['server'] || i['host'] %> diff --git a/cookbooks/datadog/templates/default/consul.yaml.erb b/cookbooks/datadog/templates/default/consul.yaml.erb index 3bfb784e..345bb875 100644 --- a/cookbooks/datadog/templates/default/consul.yaml.erb +++ b/cookbooks/datadog/templates/default/consul.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i['url'] %> @@ -10,7 +12,7 @@ instances: <% unless i['service_whitelist'].nil? %> service_whitelist: <%= i['service_whitelist'] %> <% end %> - <% if i.key?('tags') -%> + <% if i.key?('tags') && !i['tags'].empty? -%> tags: <% i['tags'].each do |t| -%> - <%= t %> diff --git a/cookbooks/datadog/templates/default/couch.yaml.erb b/cookbooks/datadog/templates/default/couch.yaml.erb index ea2ac05d..d4987a07 100644 --- a/cookbooks/datadog/templates/default/couch.yaml.erb +++ b/cookbooks/datadog/templates/default/couch.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: <%= i['server'] %> diff --git a/cookbooks/datadog/templates/default/couchbase.yaml.erb b/cookbooks/datadog/templates/default/couchbase.yaml.erb new file mode 100644 index 00000000..4010a711 --- /dev/null +++ b/cookbooks/datadog/templates/default/couchbase.yaml.erb @@ -0,0 +1,9 @@ +<%= JSON.parse(({ 'logs' => @logs }).to_json).to_yaml %> + +instances: +<% @instances.each do |i| -%> + - server: <%= i['server'] %> + user: <%= @node.fetch('couchbase', {}).fetch('server', {}).fetch('username', i.fetch('username', 'Administrator')) %> + password: <%= @node.fetch('couchbase', {}).fetch('server', {}).fetch('password', i.fetch('password', '')) %> +<% end %> +init_config: diff --git a/cookbooks/datadog/templates/default/datadog.conf.erb b/cookbooks/datadog/templates/default/datadog.conf.erb index 7f371496..5e2346d9 100644 --- a/cookbooks/datadog/templates/default/datadog.conf.erb +++ b/cookbooks/datadog/templates/default/datadog.conf.erb @@ -17,9 +17,6 @@ skip_ssl_validation: <%= node['datadog']['web_proxy']['skip_ssl_validation'] %> <% if node['datadog']['developer_mode'] -%> developer_mode: <%= node['datadog']['developer_mode'] %> <% end -%> -<% if node['datadog']['process_agent_enabled'] -%> -process_agent_enabled: <%= node['datadog']['process_agent_enabled'] %> -<% end -%> <% if node['datadog']['tags'].respond_to?(:each_pair) -%> tags: <%= node['datadog']['tags'].reject{ |_k,v| v.empty? }.map{ |k,v| "#{k}:#{v}" }.join(',') %> @@ -128,6 +125,7 @@ use_dogstatsd: no log_level: <%= node['datadog']['log_level'] %> +<% if node['datadog']['log_file_directory'] -%> collector_log_file: <%= node['datadog']['log_file_directory'] %>/collector.log forwarder_log_file: <%= node['datadog']['log_file_directory'] %>/forwarder.log dogstatsd_log_file: <%= node['datadog']['log_file_directory'] %>/dogstatsd.log @@ -135,6 +133,7 @@ jmxfetch_log_file: <%= node['datadog']['log_file_directory'] %>/jmxfetch.log <% unless node['platform_family'] == 'windows' -%> go-metro_log_file: <%= node['datadog']['log_file_directory'] %>/go-metro.log <% end -%> +<% end -%> # if syslog is enabled but a host and port are not set, a local domain socket # connection will be attempted @@ -170,6 +169,14 @@ if node['datadog']['legacy_integrations'] end -%> +<% if node['datadog']['enable_process_agent'].is_a?(TrueClass) || node['datadog']['enable_process_agent'].is_a?(FalseClass) -%> +process_agent_enabled: <%= node['datadog']['enable_process_agent'] %> +<% end -%> + +<% if node['datadog']['enable_trace_agent'].is_a?(TrueClass) || node['datadog']['enable_trace_agent'].is_a?(FalseClass) -%> +apm_enabled: <%= node['datadog']['enable_trace_agent'] %> +<% end -%> + <% if ! node['datadog']['extra_config'].empty? -%> # ========================================================================== # # Other config options @@ -182,9 +189,6 @@ end <% end -%> ## Trace settings -<% if node['datadog']['enable_trace_agent'].is_a?(TrueClass) || node['datadog']['enable_trace_agent'].is_a?(FalseClass) -%> -apm_enabled: <%= node['datadog']['enable_trace_agent'] %> -<% end -%> [trace.config] <% unless node['datadog']['trace_env'].nil? -%> @@ -206,3 +210,31 @@ receiver_port: <%= node['datadog']['receiver_port'] %> <% unless node['datadog']['connection_limit'].nil? -%> connection_limit: <%= node['datadog']['connection_limit'] %> <% end -%> + +## Process settings + +[process.config] +<% unless node['datadog']['process_agent']['blacklist'].nil? -%> +blacklist: <%= node['datadog']['process_agent']['blacklist'] %> +<% end -%> +<% unless node['datadog']['process_agent']['container_blacklist'].nil? -%> +container_blacklist: <%= node['datadog']['process_agent']['container_blacklist'] %> +<% end -%> +<% unless node['datadog']['process_agent']['container_whitelist'].nil? -%> +container_whitelist: <%= node['datadog']['process_agent']['container_whitelist'] %> +<% end -%> +<% unless node['datadog']['process_agent']['process_interval'].nil? -%> +process_interval = <%= node['datadog']['process_agent']['process_interval'] %> +<% end -%> +<% unless node['datadog']['process_agent']['rtprocess_interval'].nil? -%> +rtprocess_interval = <%= node['datadog']['process_agent']['rtprocess_interval'] %> +<% end -%> +<% unless node['datadog']['process_agent']['container_interval'].nil? -%> +container_interval = <%= node['datadog']['process_agent']['container_interval'] %> +<% end -%> +<% unless node['datadog']['process_agent']['rtcontainer_interval'].nil? -%> +rtcontainer_interval = <%= node['datadog']['process_agent']['rtcontainer_interval'] %> +<% end -%> +<% unless node['datadog']['process_agent']['log_file'].nil? -%> +log_file: <%= node['datadog']['process_agent']['log_file'] %> +<% end -%> diff --git a/cookbooks/datadog/templates/default/datadog.yaml.erb b/cookbooks/datadog/templates/default/datadog.yaml.erb new file mode 100644 index 00000000..8d995bc7 --- /dev/null +++ b/cookbooks/datadog/templates/default/datadog.yaml.erb @@ -0,0 +1,113 @@ +<% +# OPTIONS REMOVED IN AGENT 6: +# - check_freq +# - use_mount +# - developer_mode +# - dogstreams +# - autorestart +# - custom_emitters +# - graphite +# - dogstatsd_target +# - dogstatsd_interval +# - dogstatsd_normalize +# - legacy_integrations + +# TODO: options not supported yet: +# - agent_checks_interval +# - Autodiscovery (aka Service Discovery) related options +# - statsd_forward_host +# - statsd_forward_port +# - statsd_metric_namespace +# - enable_trace_agent: always enabled +# - all trace-related options are written to an INI file + +def string_list_to_array(string_list) + # return an array from a comma-separated list in a string + string_list.split(',').map{ |elem| elem.strip } +end + +## Normalize complex config values for agent6 format ## +if node['datadog']['tags'].respond_to?(:each_pair) + tags = node['datadog']['tags'].reject{ |_k,v| v.empty? }.map{ |k,v| "#{k.strip}:#{v.strip}" } +else + tags = string_list_to_array(node['datadog']['tags']) +end + +# TODO: support the more complete proxy settings that the agent6 supports +http_proxy = nil +if node['datadog']['web_proxy']['host'] + host = node['datadog']['web_proxy']['host'] + port = node['datadog']['web_proxy']['port'] + user = node['datadog']['web_proxy']['user'] + password = node['datadog']['web_proxy']['password'] + scheme = "" + + unless host.start_with?('http://') or host.start_with?('https://') + scheme = 'http://' + end + + http_proxy = host + if port + http_proxy += ":#{port}" + end + if user + if password + http_proxy = "#{user}:#{port}@#{http_proxy}" + else + http_proxy = "#{user}@#{http_proxy}" + end + end + + http_proxy = scheme + http_proxy +end + +## Populate agent_config ## +agent_config = @extra_config.merge({ + api_key: @api_key, + dd_url: node['datadog']['url'], + hostname: node['datadog']['hostname'], + additional_endpoints: @additional_endpoints, + listen_port: node['datadog']['agent_port'], + bind_host: node['datadog']['bind_host'], + skip_ssl_validation: node['datadog']['web_proxy']['skip_ssl_validation'], + tags: tags, + create_dd_check_tags: node['datadog']['create_dd_check_tags'], + collect_ec2_tags: node['datadog']['collect_ec2_tags'], + non_local_traffic: node['datadog']['non_local_traffic'], + histogram_aggregates: string_list_to_array(node['datadog']['histogram_aggregates']), + histogram_percentiles: string_list_to_array(node['datadog']['histogram_percentiles']), # TODO: check that the value works with agent6 + use_dogstatsd: node['datadog']['dogstatsd'], + log_level: node['datadog']['log_level'], # TODO: make sure it's a seelog-compatible log level + log_file: ::File.join(node['datadog']['log_file_directory'], "agent.log"), + + # log agent options + log_enabled: node['datadog']['enable_logs_agent'] +}) + +if node['datadog']['use_v2_api'] + agent_config['use_v2_api'] = node['datadog']['use_v2_api'] +end + +if node['datadog']['syslog']['active'] + agent_config['log_to_syslog'] = true + # TODO: double check the udp settings work with agent6 + if node['datadog']['syslog']['udp'] + agent_config['syslog_uri'] = "#{node['datadog']['syslog']['host']}:#{node['datadog']['syslog']['port']}" + end +end + +# Set proxy options +if !http_proxy.nil? + agent_config['proxy'] = { + http: http_proxy, + https: http_proxy + } +end + +# Remove nil values +agent_config.reject!{ |k,v| v.nil? } + +-%> +# Generated by Chef, local modifications will be overwritten + +<%= JSON.parse(agent_config.to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/directory.yaml.erb b/cookbooks/datadog/templates/default/directory.yaml.erb index 9569422b..26413d4f 100644 --- a/cookbooks/datadog/templates/default/directory.yaml.erb +++ b/cookbooks/datadog/templates/default/directory.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - directory: "<%= i['directory'] %>" diff --git a/cookbooks/datadog/templates/default/disk.yaml.erb b/cookbooks/datadog/templates/default/disk.yaml.erb index 0a47c395..70a04547 100644 --- a/cookbooks/datadog/templates/default/disk.yaml.erb +++ b/cookbooks/datadog/templates/default/disk.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config, 'logs' => @logs }).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/dns_check.yaml.erb b/cookbooks/datadog/templates/default/dns_check.yaml.erb index a5198850..62207e78 100644 --- a/cookbooks/datadog/templates/default/dns_check.yaml.erb +++ b/cookbooks/datadog/templates/default/dns_check.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - hostname: <%= i["hostname"] %> diff --git a/cookbooks/datadog/templates/default/docker.yaml.erb b/cookbooks/datadog/templates/default/docker.yaml.erb index 03b15149..3b2d3b1e 100644 --- a/cookbooks/datadog/templates/default/docker.yaml.erb +++ b/cookbooks/datadog/templates/default/docker.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: <% if @init_config %> diff --git a/cookbooks/datadog/templates/default/docker_daemon.yaml.erb b/cookbooks/datadog/templates/default/docker_daemon.yaml.erb index 32812bc0..1b3b8c08 100644 --- a/cookbooks/datadog/templates/default/docker_daemon.yaml.erb +++ b/cookbooks/datadog/templates/default/docker_daemon.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/elastic.yaml.erb b/cookbooks/datadog/templates/default/elastic.yaml.erb index c54502c4..37e077e2 100644 --- a/cookbooks/datadog/templates/default/elastic.yaml.erb +++ b/cookbooks/datadog/templates/default/elastic.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i["url"] %> @@ -22,6 +24,18 @@ instances: <% unless i["timeout"].nil? %> timeout: <%= i["timeout"] %> <% end %> + <% unless i["pending_task_stats"].nil? %> + pending_task_stats: <%= i["pending_task_stats"] %> + <% end %> + <% unless i["ssl_verify"].nil? %> + ssl_verify: <%= i["ssl_verify"] %> + <% end %> + <% unless i["ssl_cert"].nil? %> + ssl_cert: <%= i["ssl_cert"] %> + <% end %> + <% unless i["ssl_key"].nil? %> + ssl_key: <%= i["ssl_key"] %> + <% end %> <% if i.key?('tags') -%> tags: <% i['tags'].each do |t| -%> diff --git a/cookbooks/datadog/templates/default/etcd.yaml.erb b/cookbooks/datadog/templates/default/etcd.yaml.erb index 5c359a51..8473daa4 100644 --- a/cookbooks/datadog/templates/default/etcd.yaml.erb +++ b/cookbooks/datadog/templates/default/etcd.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i['url'] %> diff --git a/cookbooks/datadog/templates/default/fluentd.yaml.erb b/cookbooks/datadog/templates/default/fluentd.yaml.erb index 9600bb80..f09867a7 100644 --- a/cookbooks/datadog/templates/default/fluentd.yaml.erb +++ b/cookbooks/datadog/templates/default/fluentd.yaml.erb @@ -1,4 +1,4 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/cookbooks/datadog/templates/default/go-metro.yaml.erb b/cookbooks/datadog/templates/default/go-metro.yaml.erb new file mode 100644 index 00000000..7351b887 --- /dev/null +++ b/cookbooks/datadog/templates/default/go-metro.yaml.erb @@ -0,0 +1,4 @@ +# Generated by Chef, local modifications will be overwritten + +<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs}).to_json).to_yaml %> + diff --git a/cookbooks/datadog/templates/default/go_expvar.yaml.erb b/cookbooks/datadog/templates/default/go_expvar.yaml.erb index 32812bc0..1b3b8c08 100644 --- a/cookbooks/datadog/templates/default/go_expvar.yaml.erb +++ b/cookbooks/datadog/templates/default/go_expvar.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/gunicorn.yaml.erb b/cookbooks/datadog/templates/default/gunicorn.yaml.erb index 94c65e0e..2b40a714 100644 --- a/cookbooks/datadog/templates/default/gunicorn.yaml.erb +++ b/cookbooks/datadog/templates/default/gunicorn.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - proc_name: <%= i['proc_name'] %> diff --git a/cookbooks/datadog/templates/default/haproxy.yaml.erb b/cookbooks/datadog/templates/default/haproxy.yaml.erb index 7636be0a..1afb3916 100644 --- a/cookbooks/datadog/templates/default/haproxy.yaml.erb +++ b/cookbooks/datadog/templates/default/haproxy.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + <% excluded_keys = ["url", "username", "password"] -%> instances: <% @instances.each do |i| -%> diff --git a/cookbooks/datadog/templates/default/hdfs.yaml.erb b/cookbooks/datadog/templates/default/hdfs.yaml.erb index 9a16c5a5..9643fb11 100644 --- a/cookbooks/datadog/templates/default/hdfs.yaml.erb +++ b/cookbooks/datadog/templates/default/hdfs.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # Each instance requires a namenode hostname. # Port defaults to 8020. instances: diff --git a/cookbooks/datadog/templates/default/http_check.yaml.erb b/cookbooks/datadog/templates/default/http_check.yaml.erb index af4872f1..5f39a4d5 100644 --- a/cookbooks/datadog/templates/default/http_check.yaml.erb +++ b/cookbooks/datadog/templates/default/http_check.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/cookbooks/datadog/templates/default/iis.yaml.erb b/cookbooks/datadog/templates/default/iis.yaml.erb index 7942b422..8176b70c 100644 --- a/cookbooks/datadog/templates/default/iis.yaml.erb +++ b/cookbooks/datadog/templates/default/iis.yaml.erb @@ -8,6 +8,8 @@ # instance per host. Note: If you also want to check the counters on the # current machine, you will have to create an instance with empty params. +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> <% if i['host'] == 'localhost' -%> diff --git a/cookbooks/datadog/templates/default/integration.yaml.erb b/cookbooks/datadog/templates/default/integration.yaml.erb index 0a47c395..70a04547 100644 --- a/cookbooks/datadog/templates/default/integration.yaml.erb +++ b/cookbooks/datadog/templates/default/integration.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'init_config' => @init_config, 'logs' => @logs }).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/jenkins.yaml.erb b/cookbooks/datadog/templates/default/jenkins.yaml.erb index e9274568..3f81fdfd 100644 --- a/cookbooks/datadog/templates/default/jenkins.yaml.erb +++ b/cookbooks/datadog/templates/default/jenkins.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - name: <%= i['name'] %> diff --git a/cookbooks/datadog/templates/default/jmx.yaml.erb b/cookbooks/datadog/templates/default/jmx.yaml.erb index af4872f1..5f39a4d5 100644 --- a/cookbooks/datadog/templates/default/jmx.yaml.erb +++ b/cookbooks/datadog/templates/default/jmx.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/cookbooks/datadog/templates/default/kafka.yaml.erb b/cookbooks/datadog/templates/default/kafka.yaml.erb index 1153a001..45bb4ef3 100644 --- a/cookbooks/datadog/templates/default/kafka.yaml.erb +++ b/cookbooks/datadog/templates/default/kafka.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i['host'] %> diff --git a/cookbooks/datadog/templates/default/kafka_consumer.yaml.erb b/cookbooks/datadog/templates/default/kafka_consumer.yaml.erb index 8489eead..68c6d23b 100644 --- a/cookbooks/datadog/templates/default/kafka_consumer.yaml.erb +++ b/cookbooks/datadog/templates/default/kafka_consumer.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - kafka_connect_str: <%= i['kafka_connect_str'] %> diff --git a/cookbooks/datadog/templates/default/kubernetes.yaml.erb b/cookbooks/datadog/templates/default/kubernetes.yaml.erb index 9600bb80..f09867a7 100644 --- a/cookbooks/datadog/templates/default/kubernetes.yaml.erb +++ b/cookbooks/datadog/templates/default/kubernetes.yaml.erb @@ -1,4 +1,4 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/cookbooks/datadog/templates/default/kyototycoon.yaml.erb b/cookbooks/datadog/templates/default/kyototycoon.yaml.erb index d7adf234..3d9caa30 100644 --- a/cookbooks/datadog/templates/default/kyototycoon.yaml.erb +++ b/cookbooks/datadog/templates/default/kyototycoon.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # Add one or more instances, which accept report_url, # name, and optionally tags keys. The report URL should # be a URL to the Kyoto Tycoon "report" RPC endpoint. diff --git a/cookbooks/datadog/templates/default/lighttpd.yaml.erb b/cookbooks/datadog/templates/default/lighttpd.yaml.erb index 4315d7f0..e2ab2f02 100644 --- a/cookbooks/datadog/templates/default/lighttpd.yaml.erb +++ b/cookbooks/datadog/templates/default/lighttpd.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - lighttpd_status_url: <%= i['status_url'] %> diff --git a/cookbooks/datadog/templates/default/mcache.yaml.erb b/cookbooks/datadog/templates/default/mcache.yaml.erb index 33693ac7..c64cca96 100644 --- a/cookbooks/datadog/templates/default/mcache.yaml.erb +++ b/cookbooks/datadog/templates/default/mcache.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i['url'] %> diff --git a/cookbooks/datadog/templates/default/mesos.yaml.erb b/cookbooks/datadog/templates/default/mesos.yaml.erb index 290db592..88097d78 100644 --- a/cookbooks/datadog/templates/default/mesos.yaml.erb +++ b/cookbooks/datadog/templates/default/mesos.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: <% if @init_config.key?('default_timeout') -%> diff --git a/cookbooks/datadog/templates/default/mongo.yaml.erb b/cookbooks/datadog/templates/default/mongo.yaml.erb index ff12b866..cd45bae7 100644 --- a/cookbooks/datadog/templates/default/mongo.yaml.erb +++ b/cookbooks/datadog/templates/default/mongo.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: mongodb://<%= i['host']%>:<%= i['port'] %> @@ -14,7 +16,20 @@ instances: ssl_certfile: <%= i['ssl_certfile'] %> ssl_keyfile: <%= i['ssl_keyfile'] %> <% end %> + <% if i.key?('additional_metrics') -%> + additional_metrics: + <% i['additional_metrics'].each do |t| %> + - <%= t %> + <%end -%> + <% end %> + <% if i.key?('collections') -%> + collections: + <% i['collections'].each do |t| %> + - <%= t %> + <%end -%> + <% end %> <% end -%> init_config: # No init_config details needed + diff --git a/cookbooks/datadog/templates/default/mysql.yaml.erb b/cookbooks/datadog/templates/default/mysql.yaml.erb index 65c779ef..e7cc4672 100644 --- a/cookbooks/datadog/templates/default/mysql.yaml.erb +++ b/cookbooks/datadog/templates/default/mysql.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - server: <%= i['server'] %> diff --git a/cookbooks/datadog/templates/default/network.yaml.erb b/cookbooks/datadog/templates/default/network.yaml.erb index a97b1212..8646ba6c 100644 --- a/cookbooks/datadog/templates/default/network.yaml.erb +++ b/cookbooks/datadog/templates/default/network.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + init_config: # Network check supports only one configured instance diff --git a/cookbooks/datadog/templates/default/nginx.yaml.erb b/cookbooks/datadog/templates/default/nginx.yaml.erb index 252beb8a..bda9413a 100644 --- a/cookbooks/datadog/templates/default/nginx.yaml.erb +++ b/cookbooks/datadog/templates/default/nginx.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - nginx_status_url: <%= i['nginx_status_url'] %> diff --git a/cookbooks/datadog/templates/default/ntp.yaml.erb b/cookbooks/datadog/templates/default/ntp.yaml.erb index af4872f1..5f39a4d5 100644 --- a/cookbooks/datadog/templates/default/ntp.yaml.erb +++ b/cookbooks/datadog/templates/default/ntp.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/cookbooks/datadog/templates/default/pgbouncer.yaml.erb b/cookbooks/datadog/templates/default/pgbouncer.yaml.erb index 511b75ee..d6f4ae3c 100644 --- a/cookbooks/datadog/templates/default/pgbouncer.yaml.erb +++ b/cookbooks/datadog/templates/default/pgbouncer.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/cookbooks/datadog/templates/default/php_fpm.yaml.erb b/cookbooks/datadog/templates/default/php_fpm.yaml.erb index a90a865b..c4b509c7 100644 --- a/cookbooks/datadog/templates/default/php_fpm.yaml.erb +++ b/cookbooks/datadog/templates/default/php_fpm.yaml.erb @@ -1,4 +1,4 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # nothing to add here diff --git a/cookbooks/datadog/templates/default/postfix.yaml.erb b/cookbooks/datadog/templates/default/postfix.yaml.erb index fd2bf6a5..ead1e879 100644 --- a/cookbooks/datadog/templates/default/postfix.yaml.erb +++ b/cookbooks/datadog/templates/default/postfix.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # Each instance requires a directory and an array of queues. # Tags are optional. instances: diff --git a/cookbooks/datadog/templates/default/postgres.yaml.erb b/cookbooks/datadog/templates/default/postgres.yaml.erb index 3f5935b6..0ad4a4f0 100644 --- a/cookbooks/datadog/templates/default/postgres.yaml.erb +++ b/cookbooks/datadog/templates/default/postgres.yaml.erb @@ -15,7 +15,7 @@ instance['port'] = 5432 if instance['port'].nil? end -%> -<%= JSON.parse(({'instances' => instances}).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/cookbooks/datadog/templates/default/process.yaml.erb b/cookbooks/datadog/templates/default/process.yaml.erb index 6095215e..6d65c5a2 100644 --- a/cookbooks/datadog/templates/default/process.yaml.erb +++ b/cookbooks/datadog/templates/default/process.yaml.erb @@ -1,3 +1,3 @@ -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: \ No newline at end of file diff --git a/cookbooks/datadog/templates/default/rabbitmq.yaml.erb b/cookbooks/datadog/templates/default/rabbitmq.yaml.erb index 9a77a4ba..b6f9f59c 100644 --- a/cookbooks/datadog/templates/default/rabbitmq.yaml.erb +++ b/cookbooks/datadog/templates/default/rabbitmq.yaml.erb @@ -1,14 +1,17 @@ # Generated by Chef, local modifications will be overwritten +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> instances: # for every instance a 'rabbitmq_api_url' must be provided, pointing to the api # url of the RabbitMQ Managment Plugin (http://www.rabbitmq.com/management.html) - # optional: 'rabbitmq_user' (default: guest), 'rabbitmq_pass' (default: guest), and 'ssl_verify' (default: true) + # optional: 'rabbitmq_user' (default: guest), 'rabbitmq_pass' (default: guest), 'ssl_verify' (default: true) and 'tag_families' (default: false) <% @instances.each do |i| -%> - rabbitmq_api_url: <%= i['api_url'] %> rabbitmq_user: <%= i['user'] || 'guest' %> rabbitmq_pass: <%= i['pass'] || 'guest' %> - ssl_verify: <%= i['ssl_verify'] || 'true' %> + ssl_verify: <%= i.key?('ssl_verify') ? i['ssl_verify'] : 'true' %> + # https://help.datadoghq.com/hc/en-us/articles/211590103-Tagging-RabbitMQ-queues-by-tag-family + tag_families: <%= i['tag_families'] || 'false' %> <% if i.key?('tags') -%> tags: <% i['tags'].each do |x| -%> diff --git a/cookbooks/datadog/templates/default/redisdb.yaml.erb b/cookbooks/datadog/templates/default/redisdb.yaml.erb index af341a8f..e610af37 100644 --- a/cookbooks/datadog/templates/default/redisdb.yaml.erb +++ b/cookbooks/datadog/templates/default/redisdb.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> <% if i.key?("unix_socket_path") -%> @@ -19,8 +21,8 @@ instances: <% end -%> <% end -%> <% if i.key?("keys") -%> - <% if i.key?("warn_on_missing_keys") and i["warn_on_missing_keys"]-%> - warn_on_missing_keys: True + <% if i.key?("warn_on_missing_keys") -%> + warn_on_missing_keys: <%= i['warn_on_missing_keys'] %> <% end -%> keys: <% i["keys"].each do |k| -%> diff --git a/cookbooks/datadog/templates/default/riak.yaml.erb b/cookbooks/datadog/templates/default/riak.yaml.erb index df59a292..9f5f1958 100644 --- a/cookbooks/datadog/templates/default/riak.yaml.erb +++ b/cookbooks/datadog/templates/default/riak.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - url: <%= i["url"] %> diff --git a/cookbooks/datadog/templates/default/snmp.yaml.erb b/cookbooks/datadog/templates/default/snmp.yaml.erb new file mode 100644 index 00000000..11b348e0 --- /dev/null +++ b/cookbooks/datadog/templates/default/snmp.yaml.erb @@ -0,0 +1,3 @@ +# Generated by Chef, local modifications will be overwritten + +<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs}).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/solr.yaml.erb b/cookbooks/datadog/templates/default/solr.yaml.erb index 742e222d..f4e6cd90 100644 --- a/cookbooks/datadog/templates/default/solr.yaml.erb +++ b/cookbooks/datadog/templates/default/solr.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # List of metrics to be collected by the integration # Read http://docs.datadoghq.com/integrations/java/ to learn how to customize it diff --git a/cookbooks/datadog/templates/default/sqlserver.yaml.erb b/cookbooks/datadog/templates/default/sqlserver.yaml.erb index 72abd894..e44ccc5f 100644 --- a/cookbooks/datadog/templates/default/sqlserver.yaml.erb +++ b/cookbooks/datadog/templates/default/sqlserver.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/ssh_check.yaml.erb b/cookbooks/datadog/templates/default/ssh_check.yaml.erb index 02b048d3..daf37dbc 100644 --- a/cookbooks/datadog/templates/default/ssh_check.yaml.erb +++ b/cookbooks/datadog/templates/default/ssh_check.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i['host'] %> diff --git a/cookbooks/datadog/templates/default/supervisord.yaml.erb b/cookbooks/datadog/templates/default/supervisord.yaml.erb index 7ea0666b..ab6c4d5b 100644 --- a/cookbooks/datadog/templates/default/supervisord.yaml.erb +++ b/cookbooks/datadog/templates/default/supervisord.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/cookbooks/datadog/templates/default/system_core.yaml.erb b/cookbooks/datadog/templates/default/system_core.yaml.erb index 6857cc4c..5f7e3d4c 100644 --- a/cookbooks/datadog/templates/default/system_core.yaml.erb +++ b/cookbooks/datadog/templates/default/system_core.yaml.erb @@ -1,4 +1,5 @@ # Generated by Chef, local modifications will be overwritten +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> init_config: diff --git a/cookbooks/datadog/templates/default/system_swap.yaml.erb b/cookbooks/datadog/templates/default/system_swap.yaml.erb index 8ac3de8b..489e2bb4 100644 --- a/cookbooks/datadog/templates/default/system_swap.yaml.erb +++ b/cookbooks/datadog/templates/default/system_swap.yaml.erb @@ -1,5 +1,7 @@ # Generated by Chef, local modifications will be overwritten +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + # This check takes no initial configuration init_config: diff --git a/cookbooks/datadog/templates/default/tcp_check.yaml.erb b/cookbooks/datadog/templates/default/tcp_check.yaml.erb index af4872f1..5f39a4d5 100644 --- a/cookbooks/datadog/templates/default/tcp_check.yaml.erb +++ b/cookbooks/datadog/templates/default/tcp_check.yaml.erb @@ -1,5 +1,5 @@ <%# Sanitize the compiled Mash to standard Array/Hash objects by way of JSON -%> -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> init_config: # Nothing to configure here diff --git a/cookbooks/datadog/templates/default/tokumx.yaml.erb b/cookbooks/datadog/templates/default/tokumx.yaml.erb new file mode 100644 index 00000000..a7fbcb3a --- /dev/null +++ b/cookbooks/datadog/templates/default/tokumx.yaml.erb @@ -0,0 +1,34 @@ +<%= JSON.parse(({ 'logs' => @logs }).to_json).to_yaml %> + +instances: + <% @instances.each do |i| -%> + - server: mongodb://<%= i['host']%>:<%= i['port'] %> + <% if i.key?('tags') -%> + tags: + <% i['tags'].each do |t| -%> + - <%= t %> + <% end -%> + <% end -%> + <% if i.key?('ssl') -%> + ssl: <%= i['ssl'] %> + ssl_ca_certs: <%= i['ssl_ca_certs'] %> + ssl_cert_reqs: <%= i['ssl_cert_reqs'] %> + ssl_certfile: <%= i['ssl_certfile'] %> + ssl_keyfile: <%= i['ssl_keyfile'] %> + <% end %> + <% if i.key?('additional_metrics') -%> + additional_metrics: + <% i['additional_metrics'].each do |t| %> + - <%= t %> + <%end -%> + <% end %> + <% if i.key?('collections') -%> + collections: + <% i['collections'].each do |t| %> + - <%= t %> + <%end -%> + <% end %> + <% end -%> + +init_config: +# No init_config details needed diff --git a/cookbooks/datadog/templates/default/tomcat.yaml.erb b/cookbooks/datadog/templates/default/tomcat.yaml.erb index c4bfaa0e..17f4c729 100644 --- a/cookbooks/datadog/templates/default/tomcat.yaml.erb +++ b/cookbooks/datadog/templates/default/tomcat.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - host: <%= i["server"] %> diff --git a/cookbooks/datadog/templates/default/varnish.yaml.erb b/cookbooks/datadog/templates/default/varnish.yaml.erb index cadc60f0..512bbce5 100644 --- a/cookbooks/datadog/templates/default/varnish.yaml.erb +++ b/cookbooks/datadog/templates/default/varnish.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + instances: <% @instances.each do |i| -%> - varnishstat: <%= i["varnishstat"] || "/usr/bin/varnishstat" %> diff --git a/cookbooks/datadog/templates/default/win32_event_log.yaml.erb b/cookbooks/datadog/templates/default/win32_event_log.yaml.erb index 72abd894..11b348e0 100644 --- a/cookbooks/datadog/templates/default/win32_event_log.yaml.erb +++ b/cookbooks/datadog/templates/default/win32_event_log.yaml.erb @@ -1,3 +1,3 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances}).to_json).to_yaml %> +<%= JSON.parse(({'init_config' => @init_config, 'instances' => @instances, 'logs' => @logs}).to_json).to_yaml %> diff --git a/cookbooks/datadog/templates/default/windows_service.yaml.erb b/cookbooks/datadog/templates/default/windows_service.yaml.erb index 7ea0666b..ab6c4d5b 100644 --- a/cookbooks/datadog/templates/default/windows_service.yaml.erb +++ b/cookbooks/datadog/templates/default/windows_service.yaml.erb @@ -1,6 +1,6 @@ # Generated by Chef, local modifications will be overwritten -<%= JSON.parse(({ 'instances' => @instances }).to_json).to_yaml %> +<%= JSON.parse(({ 'instances' => @instances, 'logs' => @logs }).to_json).to_yaml %> # Nothing to configure here init_config: diff --git a/cookbooks/datadog/templates/default/wmi_check.yaml.erb b/cookbooks/datadog/templates/default/wmi_check.yaml.erb index 70ebf5e5..a80c523a 100644 --- a/cookbooks/datadog/templates/default/wmi_check.yaml.erb +++ b/cookbooks/datadog/templates/default/wmi_check.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + init_config: instances: diff --git a/cookbooks/datadog/templates/default/zk.yaml.erb b/cookbooks/datadog/templates/default/zk.yaml.erb index 382e3c4e..c5ee8f83 100644 --- a/cookbooks/datadog/templates/default/zk.yaml.erb +++ b/cookbooks/datadog/templates/default/zk.yaml.erb @@ -1,3 +1,5 @@ +<%= JSON.parse(({'logs' => @logs }).to_json).to_yaml %> + <% excluded_keys = ["host", "port", "timeout", "tags"] -%> instances: <% @instances.each do |instance| -%>