Skip to content

Commit 7e63d59

Browse files
authored
Add support for multiple network configuration options (#732)
Signed-off-by: Ryan Dyer <ryan-dyer-sp@users.noreply.github.com>
1 parent 47a52fc commit 7e63d59

2 files changed

Lines changed: 64 additions & 4 deletions

File tree

manifests/integrations/network.pp

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,24 @@
2020
#
2121
#
2222
class datadog_agent::integrations::network(
23-
Boolean $collect_connection_state = false,
24-
Array[String] $excluded_interfaces = ['lo','lo0'],
25-
String $excluded_interface_re = '',
26-
Boolean $combine_connection_states = true,
23+
Boolean $collect_connection_state = false,
24+
Boolean $collect_connection_queues = false,
25+
Array[String] $excluded_interfaces = [],
26+
String $excluded_interface_re = '',
27+
Boolean $combine_connection_states = true,
28+
Boolean $collect_rate_metrics = true,
29+
Boolean $collect_count_metrics = false,
30+
String $conntrack_path = '',
31+
Boolean $use_sudo_conntrack = true,
32+
Array[String] $whitelist_conntrack_metrics = [],
33+
Array[String] $blacklist_conntrack_metrics = [],
34+
Boolean $collect_aws_ena_metrics = false,
35+
Array[String] $tags = [],
36+
String $service = '',
37+
Integer $min_collection_interval = 15,
38+
Boolean $empty_default_hostname = false,
39+
Array[String] $metric_patterns_include = [],
40+
Array[String] $metric_patterns_exclude = [],
2741
) inherits datadog_agent::params {
2842
require ::datadog_agent
2943

templates/agent-conf.d/network.yaml.erb

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ init_config:
44

55
instances:
66
- collect_connection_state: <%= @collect_connection_state %>
7+
collect_connection_queues: <%= @collect_connection_queues %>
78
<% if !@excluded_interfaces.empty? -%>
89
excluded_interfaces:
910
<%- (@excluded_interfaces.each do |interface| -%>
@@ -14,3 +15,48 @@ instances:
1415
excluded_interface_re: <%= @excluded_interface_re %>
1516
<% end -%>
1617
combine_connection_states: <%= @combine_connection_states %>
18+
collect_rate_metrics: <%= @collect_rate_metrics %>
19+
collect_count_metrics: <%= @collect_count_metrics %>
20+
<% if !@conntrack_path.empty? -%>
21+
conntrack_path: <%= @conntrack_path %>
22+
<% end -%>
23+
use_sudo_conntrack: <%= @use_sudo_conntrack %>
24+
<% if !@whitelist_conntrack_metrics.empty? -%>
25+
whitelist_conntrack_metrics:
26+
<%- (@whitelist_conntrack_metrics.each do |metric| -%>
27+
- <%= metric %>
28+
<% end ) -%>
29+
<% end -%>
30+
<% if !@blacklist_conntrack_metrics.empty? -%>
31+
blacklist_conntrack_metrics:
32+
<%- (@blacklist_conntrack_metrics.each do |metric| -%>
33+
- <%= metric %>
34+
<% end ) -%>
35+
<% end -%>
36+
collect_aws_ena_metrics: <%= @collect_aws_ena_metrics %>
37+
<% if !@tags.empty? -%>
38+
tags:
39+
<%- (@tags.each do |tag| -%>
40+
- <%= tag %>
41+
<% end ) -%>
42+
<% end -%>
43+
<% if !@service.empty? -%>
44+
service: <%= @service %>
45+
<% end -%>
46+
min_collection_interval: <%= @min_collection_interval %>
47+
empty_default_hostname: <%= @empty_default_hostname %>
48+
<% if !@metric_patterns_include.empty? or !@metric_patterns_exclude.empty? -%>
49+
metric_patterns:
50+
<% if !@metric_patterns_include.empty? -%>
51+
include:
52+
<%- (@metric_patterns_include.each do |include_pattern| -%>
53+
- <%= include_pattern %>
54+
<% end ) -%>
55+
<% end -%>
56+
<% if !@metric_patterns_exclude.empty? -%>
57+
exclude:
58+
<%- (@metric_patterns_exclude.each do |exclude_pattern| -%>
59+
- <%= exclude_pattern %>
60+
<% end ) -%>
61+
<% end -%>
62+
<% end -%>

0 commit comments

Comments
 (0)