Skip to content

Commit 38ddf45

Browse files
committed
update cass/zk templates to accept arbitrary keys
also shortened one line by a few characters.
1 parent a7da7ae commit 38ddf45

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Changes
1212
* [FEATURE] Allow attribute control over whether Agent should be running, [#94][] [@jedi4ever][], [@miketheman][]
1313
* [FEATURE] Reintroduce attribute config for dogstatsd daemon, [#90][] [@jedi4ever][], [@miketheman][]
1414
* [FEATURE] Allow jmx template to accept arbitrary `key, value` statements, [#93][] [@clofresh][]
15+
* [FEATURE] Allow cassandra/zookeeper templates to accept arbitrary `key, value` statements, @miketheman
1516
* [FEATURE] Add name param to varnish recipe, [#86][] [@clofresh][]
1617
* [FEATURE] Allow attribute-driven settings for web proxy, [#82][] [@antonio-osorio][]
1718
* [FEATURE] Allow override of Agent config for hostname via attribute, [#76][] [@ryandjurovich][]

recipes/network.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# },
1010
# ]
1111

12-
Chef::Log.warn 'Datadog network check only supports a single `instance`, please check attribute assignments' if node['datadog']['network']['instances'].count > 1
12+
Chef::Log.warn 'Datadog network check only supports one `instance`, please check attribute assignments' if node['datadog']['network']['instances'].count > 1
1313

1414
datadog_monitor "network" do
1515
instances node["datadog"]["network"]["instances"]

templates/default/cassandra.yaml.erb

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<% excluded_keys = ["host", "port", "user", "password", "name"] -%>
12
instances:
23
<% @instances.each do |i| -%>
34
- host: <%= i['server'] %>
@@ -11,6 +12,9 @@ instances:
1112
<% if i['instance'] -%>
1213
name: <%= i['instance'] %>
1314
<% end -%>
15+
<% (i.keys - excluded_keys).each do |key| -%>
16+
<%= key %>: <%= i[key] %>
17+
<% end -%>
1418
<% end -%>
1519

1620
# List of metrics to be collected by the integration
@@ -49,7 +53,7 @@ init_config:
4953
- PendingTasks
5054
exclude:
5155
keyspace: system
52-
attribute:
56+
attribute:
5357
- MinimumCompactionThreshold
5458
- MaximumCompactionThreshold
5559
- RowCacheKeysToSave

templates/default/zk.yaml.erb

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<% excluded_keys = ["host", "port", "timeout", "tags"] -%>
12
instances:
23
<% @instances.each do |instance| -%>
34
- host: <%= instance["host"] %>
@@ -9,6 +10,9 @@ instances:
910
- <%= tag %>
1011
<% end -%>
1112
<% end -%>
13+
<% (instance.keys - excluded_keys).each do |key| -%>
14+
<%= key %>: <%= instance[key] %>
15+
<% end -%>
1216
<% end %>
1317

1418
init_config:

0 commit comments

Comments
 (0)