diff --git a/services/logging/docker-compose.yml.j2 b/services/logging/docker-compose.yml.j2 index 0fa34c0e..19b29b0a 100644 --- a/services/logging/docker-compose.yml.j2 +++ b/services/logging/docker-compose.yml.j2 @@ -18,7 +18,7 @@ services: memory: 300M cpus: "0.1" networks: - graylog: + logging: aliases: - mongo # needed because of graylog configuration @@ -46,7 +46,7 @@ services: memory: 1G cpus: "0.1" networks: - graylog: + logging: # Graylog: https://hub.docker.com/r/graylog/graylog/ graylog: image: graylog/graylog:6.0.5 @@ -71,12 +71,18 @@ services: networks: public: monitoring: - graylog: + logging: aliases: - graylog ports: - - 12201:12201/udp - - 12202:12202/udp + - target: 12201 + published: 12203 + protocol: udp + mode: host + - target: 12202 + published: 12202 + protocol: udp + mode: host deploy: replicas: 1 restart_policy: @@ -100,19 +106,23 @@ services: - traefik.http.middlewares.graylog_replace_regex.replacepathregex.replacement=/$${1} - traefik.http.routers.graylog.middlewares=ops_whitelist_ips@swarm, ops_gzip@swarm, graylog_replace_regex vector: - image: timberio/vector:0.49.X-debian + image: timberio/vector:0.50.X-debian ports: - - "12200:12201/udp" # GELF input + - target: 12201 + published: 12201 + protocol: udp + mode: host volumes: - /var/run/docker.sock:/var/run/docker.sock:ro environment: - VECTOR_CONFIG=/etc/vector/vector.yaml - VECTOR_LOG=info + - VECTOR_LOG_DESTINATION=${VECTOR_LOG_DESTINATION} configs: - source: vector_config target: /etc/vector/vector.yaml deploy: - replicas: 0 + replicas: 1 resources: limits: cpus: "1.0" @@ -121,11 +131,15 @@ services: memory: 256M labels: [] networks: - - monitoring - - graylog + logging: loki: - image: grafana/loki:3.5.4 + image: grafana/loki:3.5.7 + ports: + - target: 3100 + published: 12204 + protocol: tcp + mode: host configs: - source: loki_config target: /etc/loki/loki.yaml @@ -141,7 +155,7 @@ services: deploy: placement: constraints: [] - replicas: 0 + replicas: 1 restart_policy: condition: any delay: 5s @@ -172,7 +186,7 @@ volumes: graylog_journal: networks: - graylog: + logging: public: external: true name: ${PUBLIC_NETWORK} diff --git a/services/logging/template.env b/services/logging/template.env index cb34724b..3878dc1d 100644 --- a/services/logging/template.env +++ b/services/logging/template.env @@ -24,3 +24,4 @@ S3_FORCE_PATH_STYLE_LOKI=${S3_FORCE_PATH_STYLE_LOKI} S3_REGION_LOKI=${S3_REGION_LOKI} S3_SECRET_KEY_LOKI=${S3_SECRET_KEY_LOKI} STORAGE_DOMAIN=${STORAGE_DOMAIN} +VECTOR_LOG_DESTINATION=${VECTOR_LOG_DESTINATION} diff --git a/services/logging/vector.yaml b/services/logging/vector.yaml index 16ddf97d..5a12f0c0 100644 --- a/services/logging/vector.yaml +++ b/services/logging/vector.yaml @@ -58,7 +58,7 @@ sinks: loki: type: loki inputs: ["process_logs"] - endpoint: "http://loki:3100" + endpoint: "http://${VECTOR_LOG_DESTINATION:?err}:12204" encoding: codec: json labels: @@ -76,7 +76,7 @@ sinks: graylog: type: socket inputs: ["process_logs"] - address: "logging_graylog:12201" + address: "${VECTOR_LOG_DESTINATION:?err}:12203" mode: udp encoding: codec: gelf