|
| 1 | +{%- import '_macros.j2' as macros with context -%} |
| 2 | + |
| 3 | +{% set config = item.config|default([]) -%} |
| 4 | + |
| 5 | +# Read metrics about docker containers |
| 6 | +[[inputs.docker]] |
| 7 | + ## Docker Endpoint |
| 8 | + ## To use TCP, set endpoint = "tcp://[ip]:[port]" |
| 9 | + ## To use environment variables (ie, docker-machine), set endpoint = "ENV" |
| 10 | + {{ macros.config_row(config, 'endpoint', 'endpoint = "unix:///var/run/docker.sock', 0, true) }} |
| 11 | + |
| 12 | + ## Set to true to collect Swarm metrics(desired_replicas, running_replicas) |
| 13 | + ## Note: configure this in one of the manager nodes in a Swarm cluster. |
| 14 | + ## configuring in multiple Swarm managers results in duplication of metrics. |
| 15 | + {{ macros.config_row(config, 'gather_services', 'gather_services = false', 0, true) }} |
| 16 | + |
| 17 | + ## Only collect metrics for these containers. Values will be appended to |
| 18 | + ## container_name_include. |
| 19 | + ## Deprecated (1.4.0), use container_name_include |
| 20 | + container_names = [] |
| 21 | + {{ macros.config_row(config, 'container_names', 'container_names = []', 0, true) }} |
| 22 | + |
| 23 | + ## Set the source tag for the metrics to the container ID hostname, eg first 12 chars |
| 24 | + source_tag = false |
| 25 | + |
| 26 | + ## Containers to include and exclude. Collect all if empty. Globs accepted. |
| 27 | + {{ macros.config_row(config, 'container_name_include', 'container_name_include = []', 0, true) }} |
| 28 | + {{ macros.config_row(config, 'container_name_exclude', 'container_name_exclude = []', 0, true) }} |
| 29 | + |
| 30 | + ## Container states to include and exclude. Globs accepted. |
| 31 | + ## When empty only containers in the "running" state will be captured. |
| 32 | + ## example: container_state_include = ["created", "restarting", "running", "removing", "paused", "exited", "dead"] |
| 33 | + ## example: container_state_exclude = ["created", "restarting", "running", "removing", "paused", "exited", "dead"] |
| 34 | + {{ macros.config_row(config, 'container_state_include', '# container_state_include = []', 0, true) }} |
| 35 | + {{ macros.config_row(config, 'container_state_exclude', '# container_state_exclude = []', 0, true) }} |
| 36 | + |
| 37 | + ## Timeout for docker list, info, and stats commands |
| 38 | + {{ macros.config_row(config, 'timeout', 'timeout = "5s"', 0, true) }} |
| 39 | + |
| 40 | + ## Whether to report for each container per-device blkio (8:0, 8:1...) and |
| 41 | + ## network (eth0, eth1, ...) stats or not |
| 42 | + {{ macros.config_row(config, 'perdevice', 'perdevice = true', 0, true) }} |
| 43 | + |
| 44 | + ## Whether to report for each container total blkio and network stats or not |
| 45 | + {{ macros.config_row(config, 'total', 'total = false', 0, true) }} |
| 46 | + |
| 47 | + ## docker labels to include and exclude as tags. Globs accepted. |
| 48 | + ## Note that an empty array for both will include all labels as tags |
| 49 | + {{ macros.config_row(config, 'docker_label_include', 'docker_label_include = []', 0, true) }} |
| 50 | + {{ macros.config_row(config, 'docker_label_exclude', 'docker_label_exclude = []', 0, true) }} |
| 51 | + |
| 52 | + ## Which environment variables should we use as a tag |
| 53 | + {{ macros.config_row(config, 'tag_env', 'tag_env = ["JAVA_HOME", "HEAP_SIZE"]', 0, true) }} |
| 54 | + |
| 55 | + ## Optional TLS Config |
| 56 | + {{ macros.config_row(config, 'tls_ca', '# tls_ca = "/etc/telegraf/ca.pem"', 0, true) }} |
| 57 | + {{ macros.config_row(config, 'tls_cert', '# tls_cert = "/etc/telegraf/cert.pem"', 0, true) }} |
| 58 | + {{ macros.config_row(config, 'tls_key', '# tls_key = "/etc/telegraf/key.pem"', 0, true) }} |
| 59 | + ## Use TLS but skip chain & host verification |
| 60 | + {{ macros.config_row(config, 'insecure_skip_verify', '# insecure_skip_verify = false', 0, true) }} |
0 commit comments