Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@
# Set to `true` if you want the handler to send the Chef policy name and group as host tags
default['datadog']['send_policy_tags'] = false

# Set to an integer if you want the handler to retry submitting tags if the host isn't yet present
# on Datadog. The handler will retry evey 2 seconds until this number of retries is reached or the tags are
# submitted successfully.
default['datadog']['tags_submission_retries'] = nil

# Autorestart agent
default['datadog']['autorestart'] = false

Expand Down
5 changes: 3 additions & 2 deletions recipes/dd-handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def extra_endpoints
extra_endpoints
end

def handler_config # rubocop:disable Metrics/AbcSize
def handler_config # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
config = {
:api_key => Chef::Datadog.api_key(node),
:application_key => Chef::Datadog.application_key(node),
Expand All @@ -70,7 +70,8 @@ def handler_config # rubocop:disable Metrics/AbcSize
:url => node['datadog']['url'],
:extra_endpoints => extra_endpoints,
:tags_blacklist_regex => node['datadog']['tags_blacklist_regex'],
:send_policy_tags => node['datadog']['send_policy_tags']
:send_policy_tags => node['datadog']['send_policy_tags'],
:tags_submission_retries => node['datadog']['tags_submission_retries']
}

unless node['datadog']['use_ec2_instance_id']
Expand Down
3 changes: 2 additions & 1 deletion spec/dd-handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
url: 'https://app.datadoghq.com',
extra_endpoints: extra_endpoints || [],
tags_blacklist_regex: tags_blacklist_regex,
send_policy_tags: false
send_policy_tags: false,
tags_submission_retries: nil
}

expect(chef_run).to enable_chef_handler('Chef::Handler::Datadog').with(
Expand Down