Allow configuration of Traces settings in datadog.conf
Fixes
MODIFY
README.md
README.md
@@ -79,6 +79,10 @@ dogstatsd-(python|ruby)
-----------------------
Installs the language-specific libraries to interact with `dogstatsd`.
+ddtrace-(python|ruby)
+---------------------
+Installs the language-specific libraries for application Traces (APM).
+
other
-----
There are many other integration-specific recipes, that are meant to assist in deploying the correct agent configuration files and dependencies for a given integration.

MODIFY
attributes/default.rb
attributes/default.rb
@@ -255,3 +255,16 @@ default['datadog']['extra_packages'] = {}
default['datadog']['legacy_integrations']['nagios']['enabled'] = false
default['datadog']['legacy_integrations']['nagios']['description'] = 'Nagios integration'
default['datadog']['legacy_integrations']['nagios']['config']['nagios_log'] = '/var/log/nagios3/nagios.log'
+
+# Trace functionality settings
+default['datadog']['enable_trace_agent'] = false
+default['datadog']['extra_sample_rate'] = 1
+default['datadog']['max_traces_per_second'] = 10
+default['datadog']['receiver_port'] = 8126
+default['datadog']['connection_limit'] = 2000
+
+# ddtrace python version
+default['datadog']['ddtrace_python_version'] = nil
+
+# ddtrace ruby gem version
+default['datadog']['ddtrace_gem_version'] = nil

MODIFY
metadata.rb
metadata.rb
@@ -34,6 +34,8 @@ recipe 'datadog::dd-handler', 'Installs a Chef handler for Datadog'
recipe 'datadog::repository', 'Installs the Datadog package repository'
recipe 'datadog::dogstatsd-python', 'Installs the Python dogstatsd package for custom metrics'
recipe 'datadog::dogstatsd-ruby', 'Installs the Ruby dogstatsd package for custom metrics'
+recipe 'datadog::ddtrace-python', 'Installs the Python ddtrace package for APM'
+recipe 'datadog::ddtrace-ruby', 'Installs the Ruby ddtrace package for APM'
# integration-specific
recipe 'datadog::cassandra', 'Installs and configures the Cassandra integration'

ADD
recipes/ddtrace-python.rb
+#
+# Cookbook Name:: datadog
+# Recipe:: ddtrace-python.rb
+#
+
+easy_install_package 'ddtrace' do
+ version node['datadog']['ddtrace_python_version']
+end

ADD
recipes/ddtrace-ruby.rb
+#
+# Cookbook Name:: datadog
+# Recipe:: ddtrace-ruby.rb
+#
+
+gem_package 'ddtrace' do
+ version node['datadog']['ddtrace_gem_version']
+end

MODIFY
templates/default/datadog.conf.erb
templates/default/datadog.conf.erb
@@ -61,6 +61,19 @@ graphite_listen_port: <%= node['datadog']['graphite_port'] %>
histogram_aggregates: <%= node['datadog']['histogram_aggregates'] %>
histogram_percentiles: <%= node['datadog']['histogram_percentiles'] %>
+<% if node['datadog']['enable_trace_agent'] == true -%>
+## Trace settings
+apm_enabled: true
+
+[trace.sampler]
+extra_sample_rate: <%= node['datadog']['extra_sample_rate'] %>
+max_traces_per_second: <%= node['datadog']['max_traces_per_second'] %>
+
+[trace.receiver]
+receiver_port: <%= node['datadog']['receiver_port'] %>
+connection_limit: <%= node['datadog']['connection_limit'] %>
+<% end -%>
+
<% if node['datadog']['dogstatsd'] -%>
# ========================================================================== #
# DogStatsd configuration #

Allow configuration of Traces settings in datadog.conf (#402)

Fixes #401