Add docker_log monitoring to telegraf
This commit is contained in:
parent
253206da97
commit
a90840b1dc
8 changed files with 58 additions and 13 deletions
|
@ -25,3 +25,9 @@ compose_file_volumes:
|
|||
services:
|
||||
app:
|
||||
volumes: "{{ compose.volumes }}"
|
||||
|
||||
compose_file_monitoring_label:
|
||||
services:
|
||||
app:
|
||||
labels:
|
||||
com.influxdata.telegraf.enable: true
|
||||
|
|
|
@ -15,6 +15,7 @@ svc:
|
|||
|
||||
compose:
|
||||
watchtower: true
|
||||
monitoring: true
|
||||
image: joohoi/acme-dns
|
||||
volumes:
|
||||
- ./config:/etc/acme-dns:ro
|
||||
|
|
|
@ -26,7 +26,10 @@ compose:
|
|||
watchtower: true
|
||||
image: ghcr.io/coder/coder:latest
|
||||
env: true
|
||||
group_add:
|
||||
- "972" # docker group on host
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
file:
|
||||
services:
|
||||
app:
|
||||
group_add:
|
||||
- "972" # docker group on host
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
|
||||
[[inputs.prometheus]]
|
||||
urls = [
|
||||
{%- for url in svc.prometheus.urls -%}
|
||||
"{{ url }}",
|
||||
{%- endfor -%}
|
||||
{%- for url in svc.prometheus.urls -%}
|
||||
"{{ url }}",
|
||||
{%- endfor -%}
|
||||
]
|
||||
|
||||
bearer_token_string = "{{ svc.prometheus.bearer_token }}"
|
||||
|
@ -30,3 +30,11 @@
|
|||
ignored_databases = ["postgres", "template0", "template1"]
|
||||
prepared_statements = true
|
||||
|
||||
[[inputs.docker_log]]
|
||||
endpoint = "{{ svc.docker_log.endpoint }}"
|
||||
|
||||
docker_label_include = [
|
||||
"com.influxdata.telegraf.enable"
|
||||
]
|
||||
|
||||
source_tag = {{ svc.docker_log.source_tag|lower }}
|
||||
|
|
|
@ -18,12 +18,38 @@ svc:
|
|||
host: "{{ postgres.host }}"
|
||||
port: "{{ postgres.port }}"
|
||||
database: "telegraf"
|
||||
docker_log:
|
||||
endpoint: "unix:///var/run/docker.sock"
|
||||
# from_beginning: false
|
||||
# timeout: "5s"
|
||||
|
||||
# container_name_include: []
|
||||
# container_name_exclude: []
|
||||
|
||||
# docker_label_include: []
|
||||
# docker_label_exclude: []
|
||||
|
||||
## Set the source tag for the metrics to the container ID hostname, eg first 12 chars
|
||||
source_tag: false
|
||||
|
||||
## Optional TLS Config
|
||||
# tls_ca: "/etc/telegraf/ca.pem"
|
||||
# tls_cert: "/etc/telegraf/cert.pem"
|
||||
# tls_key: "/etc/telegraf/key.pem"
|
||||
## Use TLS but skip chain & host verification
|
||||
# insecure_skip_verify: false
|
||||
|
||||
compose:
|
||||
watchtower: false
|
||||
image: telegraf:1.28
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
|
||||
file:
|
||||
services:
|
||||
app:
|
||||
user: telegraf
|
||||
group_add:
|
||||
- "972" # docker group on host
|
||||
volumes:
|
||||
data:
|
||||
|
|
|
@ -26,10 +26,10 @@ compose:
|
|||
- app:/var/www/html:ro
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf
|
||||
file:
|
||||
app:
|
||||
depends_on:
|
||||
- tt-rss
|
||||
services:
|
||||
app:
|
||||
depends_on:
|
||||
- tt-rss
|
||||
tt-rss:
|
||||
image: cthulhoo/ttrss-fpm-pgsql-static
|
||||
restart: always
|
||||
|
|
|
@ -9,4 +9,8 @@
|
|||
{%- set compose_file = compose_file | combine(compose_file_volumes, recursive=True) -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- if compose.monitoring | default(False) -%}
|
||||
{%- set compose_file = compose_file | combine(compose_file_monitoring_label, recursive=True) -%}
|
||||
{%- endif -%}
|
||||
|
||||
{{ compose_file | to_nice_yaml }}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
FROM ubuntu
|
||||
FROM restic/restic
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt update -y \
|
||||
&& apt install -y curl restic
|
||||
RUN apk add curl
|
||||
|
|
Reference in a new issue