Adding support for list of datadog tags in v6 configuration file
MODIFY
templates/default/datadog.yaml.erb
templates/default/datadog.yaml.erb
@@ -23,8 +23,10 @@ def string_list_to_array(string_list)
end
## Normalize complex config values for agent6 format ##
-if node['datadog']['tags'].respond_to?(:each_pair)
+if node['datadog']['tags'].is_a?(Hash)
tags = node['datadog']['tags'].reject{ |_k,v| v.empty? }.map{ |k,v| "#{k.strip}:#{v.strip}" }
+elsif node['datadog']['tags'].is_a?(Array)
+ tags = node['datadog']['tags']
else
tags = string_list_to_array(node['datadog']['tags'])
end

Adding support for list of datadog tags in v6 configuration file