diff --git a/docker-compose.yml b/docker-compose.yml index 741eb2b..f5a5b84 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,21 +21,6 @@ services: - ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro - /var/run/docker.sock:/var/run/docker.sock - promtail: - image: grafana/promtail - container_name: promtail - restart: always - uts: host - env_file: - - .env - volumes: - - ./promtail:/etc/promtail - - /var/run/docker.sock:/var/run/docker.sock - - /var/log:/var/log:ro - command: - - "-config.file=/etc/promtail/promtail-config.yml" - - "-config.expand-env=true" - watchtower: image: containrrr/watchtower container_name: watchtower diff --git a/promtail/promtail-config.yml b/promtail/promtail-config.yml deleted file mode 100644 index b3627e4..0000000 --- a/promtail/promtail-config.yml +++ /dev/null @@ -1,62 +0,0 @@ -server: - http_listen_port: 9080 - grpc_listen_port: 0 - -positions: - filename: /tmp/positions.yaml - -clients: - - url: http://${LOKI_HOST:-loki}:3100/loki/api/v1/push - -scrape_configs: - - job_name: flog_scrape - docker_sd_configs: - - host: unix:///var/run/docker.sock - refresh_interval: 5s - relabel_configs: - - source_labels: ['__meta_docker_container_name'] - regex: '/(.*)' - target_label: 'container' - - source_labels: ['__meta_docker_container_label_com_docker_compose_oneoff'] - target_label: oneoff - - source_labels: ['__meta_docker_container_label_com_docker_compose_project_config_files'] - target_label: compose_file - - source_labels: ['__meta_docker_container_label_com_docker_compose_project'] - target_label: project_name - - source_labels: ['__meta_docker_container_label_com_docker_compose_service'] - target_label: service - - target_label: 'host' - replacement: '${HOSTNAME}' - pipeline_stages: - - match: - selector: '{container="zigbee2mqtt"} |= "MQTT publish"' - stages: - - regex: - expression: "topic '(?Pzigbee2mqtt\/(?P[^\/]+).*?)', payload '(?P.*?)'$" - - labels: - topic: - device: - payload: - - match: - selector: '{topic=~".*action$"}' - stages: - - labels: - action: "payload" - - match: - selector: '{container="zigbee2mqtt"} |= "occupancy"' - stages: - - json: - expressions: - occupancy: occupancy - source: payload - - labels: - occupancy: - - match: - selector: '{container="zigbee2mqtt"} |= "contact"' - stages: - - json: - expressions: - contact: contact - source: payload - - labels: - contact: \ No newline at end of file diff --git a/telegraf/telegraf.conf b/telegraf/telegraf.conf index 31bf920..eb6153b 100644 --- a/telegraf/telegraf.conf +++ b/telegraf/telegraf.conf @@ -136,11 +136,6 @@ ## configuring in multiple Swarm managers results in duplication of metrics. gather_services = false - ## Only collect metrics for these containers. Values will be appended to - ## container_name_include. - ## Deprecated (1.4.0), use container_name_include -# container_names = [] - ## Set the source tag for the metrics to the container ID hostname, eg first 12 chars source_tag = false @@ -155,27 +150,19 @@ # container_state_include = [] # container_state_exclude = [] + ## Objects to include for disk usage query + ## Allowed values are "container", "image", "volume" + ## When empty disk usage is excluded + storage_objects = ["container"] + ## Timeout for docker list, info, and stats commands timeout = "5s" - ## Whether to report for each container per-device blkio (8:0, 8:1...), - ## network (eth0, eth1, ...) and cpu (cpu0, cpu1, ...) stats or not. - ## Usage of this setting is discouraged since it will be deprecated in favor of 'perdevice_include'. - ## Default value is 'true' for backwards compatibility, please set it to 'false' so that 'perdevice_include' setting - ## is honored. -# perdevice = true - ## Specifies for which classes a per-device metric should be issued ## Possible values are 'cpu' (cpu0, cpu1, ...), 'blkio' (8:0, 8:1, ...) and 'network' (eth0, eth1, ...) ## Please note that this setting has no effect if 'perdevice' is set to 'true' perdevice_include = ["cpu", "blkio", "network"] - ## Whether to report for each container total blkio and network stats or not. - ## Usage of this setting is discouraged since it will be deprecated in favor of 'total_include'. - ## Default value is 'false' for backwards compatibility, please set it to 'true' so that 'total_include' setting - ## is honored. - total = false - ## Specifies for which classes a total metric should be issued. Total is an aggregated of the 'perdevice' values. ## Possible values are 'cpu', 'blkio' and 'network' ## Total 'cpu' is reported directly by Docker daemon, and 'network' and 'blkio' totals are aggregated by this plugin. @@ -188,7 +175,7 @@ docker_label_exclude = [] ## Which environment variables should we use as a tag - tag_env = ["JAVA_HOME", "HEAP_SIZE"] + tag_env = [] ## Optional TLS Config # tls_ca = "/etc/telegraf/ca.pem" @@ -196,3 +183,6 @@ # tls_key = "/etc/telegraf/key.pem" ## Use TLS but skip chain & host verification # insecure_skip_verify = false + + # Needed to silence a warning, but it's irrelevant for me + # skip_processors_after_aggregators = true