Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#401 - Allow configuration of Traces settings in datadog.conf #402

Merged
merged 8 commits into from Mar 7, 2017
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -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.
Expand Down
13 changes: 13 additions & 0 deletions attributes/default.rb
Expand Up @@ -252,3 +252,16 @@
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'] = 7777
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're actually deprecating 7777 for 8126 to be contiguous with statsd (though both work for the time being) . mind updating the default?

default['datadog']['connection_limit'] = 2000

# ddtrace python version
default['datadog']['ddtrace_python_ver'] = nil
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use a full ddtrace_python_version attribute name here? (just trying to be consistent with all the other occurences of *_version in the attributes names of the cookbook)

same thing for ddtrace_gem_version below


# ddtrace ruby gem version
default['datadog']['ddtrace_gem_ver'] = nil
2 changes: 2 additions & 0 deletions metadata.rb
Expand Up @@ -34,6 +34,8 @@
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'
Expand Down
8 changes: 8 additions & 0 deletions recipes/ddtrace-python.rb
@@ -0,0 +1,8 @@
#
# Cookbook Name:: datadog
# Recipe:: ddtrace-python.rb
#

easy_install_package 'ddtrace' do
version node['datadog']['ddtrace_python_ver']
end
8 changes: 8 additions & 0 deletions recipes/ddtrace-ruby.rb
@@ -0,0 +1,8 @@
#
# Cookbook Name:: datadog
# Recipe:: ddtrace-ruby.rb
#

gem_package 'ddtrace' do
version node['datadog']['ddtrace_gem_ver']
end
13 changes: 13 additions & 0 deletions templates/default/datadog.conf.erb
Expand Up @@ -61,6 +61,19 @@ graphite_listen_port: <%= node['datadog']['graphite_port'] %>
histogram_aggregates: <%= node['datadog']['histogram_aggregates'] %>
histogram_percentiles: <%= node['datadog']['histogram_percentiles'] %>

## Trace settings
<% if node['datadog']['enable_trace_agent'] == true -%>
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 #
Expand Down