Skip to content

Commit

Permalink
add support for ec2_prefer_imdsv2 option (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
whsbp authored Jun 25, 2024
1 parent ef7a220 commit 0cdd05d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
# Collect EC2 tags, set to 'yes' to collect
default['datadog']['collect_ec2_tags'] = nil

# Use IMDSv2 to collect instance metadata
default['datadog']['ec2_prefer_imdsv2'] = nil

# Set this regex to exclude some Chef node tags from the host tags that the datadog handler sends to Datadog
# https://github.com/DataDog/chef-handler-datadog/issues/85
# This means that all the metrics and service checks coming from the
Expand Down
3 changes: 3 additions & 0 deletions templates/default/datadog.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ create_dd_check_tags: <%= node['datadog']['create_dd_check_tags'] %>
<% if node['datadog']['collect_ec2_tags'] -%>
collect_ec2_tags: <%= node['datadog']['collect_ec2_tags'] %>
<% end -%>
<% if node['datadog']['ec2_prefer_imdsv2'] -%>
ec2_prefer_imdsv2: <%= node['datadog']['ec2_prefer_imdsv2'] %>
<% end -%>
<% if node['datadog']['web_proxy']['host'] -%>
proxy_host: <%= node['datadog']['web_proxy']['host'] %>
Expand Down

0 comments on commit 0cdd05d

Please sign in to comment.