@@ -2,23 +2,39 @@ init_config:
22 # Change the root directory to look at to get cgroup statistics. Useful when running inside a
33 # container with host directories mounted on a different folder. Default: /.
44 # Example for the docker-dd-agent container:
5- # docker_root: /host
5+ docker_root: <%= @docker_root %>
66
77 # Timeout in seconds for the connection to the docker daemon
88 # Default: 5 seconds
99 #
10- # timeout: 10
10+ timeout: <%= @timeout %>
1111
1212 # The version of the API the client will use. Specify 'auto' to use the API version provided by the server.
13- # api_version: auto
13+ api_version: <%= @api_version %>
1414
1515 # Use TLS encryption while communicating with the Docker API
1616 #
17- # tls: False
18- # tls_client_cert: /path/to/client-cert.pem
19- # tls_client_key: /path/to/client-key.pem
20- # tls_cacert: /path/to/ca.pem
21- # tls_verify: True
17+ tls: <%= @tls %>
18+ tls_client_cert: <%= @tls_client_cert %>
19+ tls_client_key: <%= @tls_client_key %>
20+ tls_cacert: <%= @tls_cacert %>
21+ tls_verify: <%= @tls_verify %>
22+
23+ # Initialization retries
24+ #
25+ # if the agent is expected to start before Docker,
26+ # use these settings to configure the retry policy.
27+
28+ # init_retry_interval defines how long (in seconds) the docker client
29+ # will wait before retrying initialization.
30+ # Defaults to 0.
31+ #
32+ init_retry_interval: <%= @init_retry_interval %>
33+
34+ # init_retries configures how many retries are made before failing permanently.
35+ # Defaults to 0.
36+ #
37+ init_retries: <%= @init_retries %>
2238
2339instances:
2440 - ## Daemon and system configuration
@@ -35,29 +51,76 @@ instances:
3551 # Create events whenever a container status change.
3652 # Defaults to true.
3753 #
38- # collect_events: false
54+ collect_events: <%= @collect_events %>
55+
56+ # By default we do not collect events with a status ['top', 'exec_start', 'exec_create'].
57+ # Here can be added additional statuses to be filtered.
58+ # List of available statuses can be found here https://docs.docker.com/engine/reference/commandline/events/#object-types
59+ filtered_event_types: [<%= @filtered_event_types && !@filtered_event_types.empty? ? '"' + @filtered_event_types.reject(&:empty?).join('", "') + '"' : nil %> ]
3960
4061 # Collect disk usage per container with docker.container.size_rw and
4162 # docker.container.size_rootfs metrics.
4263 # Warning: This might take time for Docker daemon to generate,
4364 # ensure that `docker ps -a -q` run fast before enabling it.
4465 # Defaults to false.
4566 #
46- # collect_container_size: false
67+ collect_container_size: <%= @collect_container_size %>
68+
69+ # Do you use custom cgroups for this particular instance?
70+ # Note: enabling this option modifies the way in which we inspect the containers and causes
71+ # some overhead - if you run a high volume of containers we may timeout.
72+ #
73+ custom_cgroups: <%= @custom_cgroups %>
74+
75+ # Report docker container healthcheck events as service checks
76+ # Note: enabling this option modifies the way in which we inspect the containers and causes
77+ # some overhead - if you run a high volume of containers we may timeout.
78+ # Container Healthchecks are available starting with docker 1.12, enabling with older
79+ # versions will result in an UNKNOWN state for the service check.
80+ #
81+ # You must whitelist the containers you wish to submit health service checks for.
82+ # Use the same mechanism as the tagging system (see Tag:performance_tags section).
83+ # Example: ["docker_image:tomcat", "container_name:web_front_nginx"]
84+ #
85+ health_service_check_whitelist: [<%= @health_service_check_whitelist && !@health_service_check_whitelist.empty? ? '"' + @health_service_check_whitelist.reject(&:empty?).join('", "') + '"' : nil %> ]
86+
87+ # Collect the container count tagged by state (running, paused, exited, dead)
88+ # Defaults to false.
89+ #
90+ collect_container_count: <%= @collect_container_count %>
91+
92+ # Collect the volume count for attached and dangling volumes.
93+ # Defaults to false.
94+ #
95+ collect_volume_count: <%= @collect_volume_count %>
4796
4897 # Collect images stats
4998 # Number of available active images and intermediate images as gauges.
5099 # Defaults to false.
51100 #
52- # collect_images_stats: false
101+ collect_images_stats: <%= @collect_images_stats %>
53102
54103 # Collect disk usage per image with docker.image.size and docker.image.virtual_size metrics.
55104 # The check gets this size with the `docker images` command.
56105 # Requires collect_images_stats to be enabled.
57106 # Defaults to false.
58107 #
59- # collect_image_size: false
108+ collect_image_size: <%= @collect_image_size %>
109+
110+ # Collect disk metrics (total, used, free) through the docker info command for data and metadata.
111+ # This is useful when these values can't be obtained by the disk check.
112+ # Example: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html
113+ # Note that it only works when the storage driver is devicemapper.
114+ # Explanation of these metrics can be found here:
115+ # https://github.com/docker/docker/blob/v1.11.1/daemon/graphdriver/devmapper/README.md
116+ # Defaults to false.
117+ #
118+ collect_disk_stats: <%= @collect_disk_stats %>
60119
120+ # Collect containers exit codes and send service checks critical when exit code is not 0
121+ # Defaults to false.
122+ #
123+ collect_exit_codes: <%= @collect_exit_codes %>
61124
62125 # Exclude containers based on their tags
63126 # An excluded container will be completely ignored. The rule is a regex on the tags.
@@ -75,28 +138,20 @@ instances:
75138 #
76139 # Default: include all containers
77140
78-
141+ exclude: [<%= @exclude && !@exclude.empty? ? '"' + @exclude.reject(&:empty?).join('", "') + '"' : nil %> ]
142+ include: [<%= @include && !@include.empty? ? '"' + @include.reject(&:empty?).join('", "') + '"' : nil %> ]
79143
80144 ## Tagging
81145 ##
82- <% if @tags and ! @tags.empty? -%>
83- tags:
84- <%- Array(@tags).each do |tag| -%>
85- <%- if tag != '' -%>
86- - <%= tag %>
87- <%- end -%>
88- <%- end -%>
89- <% end -%>
90-
91146 # You can add extra tags to your Docker metrics with the tags list option.
92147 # Example: ["extra_tag", "env:testing"]
93148 #
94- # tags: []
149+ tags: [<%= @tags && !@tags.empty? ? '"' + @tags.reject(&:empty?).join('", "') + '"' : nil %> ]
95150
96151 # If the agent is running in an Amazon ECS task, tags container metrics with the ECS task name and version.
97152 # Default: true
98153 #
99- # ecs_tags: false
154+ ecs_tags: <%= @ecs_tags %>
100155
101156 # Custom metrics tagging
102157 # Define which Docker tags to apply on metrics.
@@ -110,14 +165,19 @@ instances:
110165 # - container_name: Name of the container (example: "boring_euclid")
111166 # - container_command: Command ran by the container (example: "echo 1")
112167 #
113- # performance_tags: ["container_name", image_name ", "image_tag", "docker_image" ]
168+ performance_tags: [<%= @performance_tags && !@performance_tags.empty? ? '"' + @performance_tags.reject(&:empty?).join(' ", "') + '"' : nil %> ]
114169
115170 # Tags for containers count metrics.
116171 # Available: ["image_name", "image_tag", "docker_image", "container_command"]
117172 #
118- # container_tags: ["image_name ", "image_tag", "docker_image" ]
173+ container_tags: [<%= @container_tags && !@container_tags.empty? ? '"' + @container_tags.reject(&:empty?).join(' ", "') + '"' : nil %> ]
119174
120175 # List of container label names that should be collected and sent as tags.
121176 # Default to None
122177 # Example:
123- # collect_labels_as_tags: ["com.docker.compose.service", "com.docker.compose.project"]
178+ collect_labels_as_tags: [<%= @collect_labels_as_tags && !@collect_labels_as_tags.empty? ? '"' + @collect_labels_as_tags.reject(&:empty?).join('", "') + '"' : nil %> ]
179+
180+ # List of docker event attributes to add as tags of the datadog events
181+ # Defaults to None.
182+ #
183+ event_attributes_as_tags: [<%= @event_attributes_as_tags && !@event_attributes_as_tags.empty? ? '"' + @event_attributes_as_tags.reject(&:empty?).join('", "') + '"' : nil %> ]
0 commit comments