Skip to content

Commit 70840bd

Browse files
✨ Add: vector.dev log aggregator (removes fluentd) (#1209)
* wip * Add csi-s3 and have portainer use it * Change request @Hrytsuk 1GB max portainer volume size * Arch Linux Certificates Customization * Fix pgsql exporter failure * [Kubernetes] Introduce on-prem persistent Storage (Longhorn) 🎉 (#979) * Introduce longhorn chart * Further longhorn configuration * Longhorn: further settings configuration * Fix longhorn configuration bugs Extra: introduce longhorn pv vales for portainer * Add comment for deletion longhorn * Further longhorn configuration * Add README.md for Longhorn wit FAQ * Update Longhorn readme * Update readme * Futher LH configuration * Update LH's Readme * Update Longhorn Readme * Improve LH's Readme * LH: Reduce reserved default disk space to 5% Since we use a dedicated disk for LH, we can go ahead with 5% * Use values to set Longhorn storage class * Update LH's Readme * LH Readme: add requirements reference * PR Review: bring back portainer s3 pv * LH: decrease portinaer volume size * Experimental: Try to add tracing to simcore-traefik on master * Fixes ITISFoundation/osparc-simcore#7363 * Arch Linux Certificates Customization - 2 * Change fluentd for fluentbit * fix * Switch fluentbit for vectordev * fix * fix --------- Co-authored-by: Dustin Kaiser <[email protected]> Co-authored-by: YH <[email protected]>
1 parent 8913dc7 commit 70840bd

File tree

10 files changed

+121
-210
lines changed

10 files changed

+121
-210
lines changed

services/logging/docker-compose.aws.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
constraints:
1616
- node.labels.logging==true
1717

18-
fluentd:
18+
vector:
1919
deploy:
2020
placement:
2121
constraints:

services/logging/docker-compose.dalco.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
constraints:
1818
- node.labels.logging==true
1919

20-
fluentd:
20+
vector:
2121
deploy:
2222
placement:
2323
constraints:

services/logging/docker-compose.local.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ services:
1414
placement:
1515
constraints: []
1616

17-
fluentd:
17+
vector:
1818
deploy:
1919
placement:
2020
constraints: []

services/logging/docker-compose.master.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ services:
1717
constraints:
1818
- node.labels.logging==true
1919

20-
fluentd:
20+
vector:
2121
deploy:
2222
placement:
2323
constraints:

services/logging/docker-compose.yml.j2

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ services:
5151
graylog:
5252
image: graylog/graylog:6.0.5
5353
init: true
54-
# user: "1000:1001"
5554
configs:
5655
- source: graylog_config
5756
target: /files/osparc-custom-content-pack-v2.json
@@ -76,7 +75,7 @@ services:
7675
aliases:
7776
- graylog
7877
ports:
79-
- 12201:12201/udp
78+
- 12200:12201/udp
8079
- 12202:12202/udp
8180
deploy:
8281
replicas: 1
@@ -100,42 +99,29 @@ services:
10099
- traefik.http.middlewares.graylog_replace_regex.replacepathregex.regex=^/graylog/?(.*)$$
101100
- traefik.http.middlewares.graylog_replace_regex.replacepathregex.replacement=/$${1}
102101
- traefik.http.routers.graylog.middlewares=ops_whitelist_ips@swarm, ops_gzip@swarm, graylog_replace_regex
103-
fluentd:
104-
image: itisfoundation/fluentd:v1.16.9-1.0
105-
configs:
106-
- source: fluentd_config
107-
target: /fluentd/etc/fluent.conf
108-
environment:
109-
- GRAYLOG_HOST=graylog
110-
- GRAYLOG_PORT=12201
111-
- LOKI_URL=http://loki:3100
112-
- FLUENTD_HOSTNAME={% raw %}{{.Node.Hostname}}{% endraw %}
102+
vector:
103+
image: timberio/vector:0.49.X-debian
113104
ports:
114-
- "24224:24224/tcp"
105+
- "12201:12201/udp" # GELF input
106+
volumes:
107+
- /var/run/docker.sock:/var/run/docker.sock:ro
108+
environment:
109+
- VECTOR_CONFIG=/etc/vector/vector.yaml
110+
- VECTOR_LOG=info
111+
configs:
112+
- source: vector_config
113+
target: /etc/vector/vector.yaml
115114
deploy:
116-
#mode: global # Run on all nodes
117-
restart_policy:
118-
condition: on-failure
119115
resources:
120116
limits:
121-
cpus: '1.0'
122-
memory: 1G
123-
reservations:
124-
cpus: '0.5'
117+
cpus: "1.0"
125118
memory: 512M
126-
update_config:
127-
parallelism: 1
128-
delay: 10s
129-
order: start-first
119+
reservations:
120+
memory: 256M
121+
labels: []
130122
networks:
131123
- monitoring
132124
- graylog
133-
healthcheck:
134-
test: ["CMD", "curl", "-f", "http://0.0.0.0:24220/api/plugins"]
135-
interval: 30s
136-
timeout: 10s
137-
retries: 3
138-
start_period: 40s
139125

140126
loki:
141127
image: grafana/loki:3.5.4
@@ -196,9 +182,9 @@ configs:
196182
graylog_config:
197183
name: ${STACK_NAME}_graylog_config_{{ "./data/contentpacks/osparc-custom-content-pack-v2.json" | sha256file | substring(0,10) }}
198184
file: ./data/contentpacks/osparc-custom-content-pack-v2.json
199-
fluentd_config:
200-
name: ${STACK_NAME}_fluentd_config_{{ "./fluentd/fluent.conf" | sha256file | substring(0,10) }}
201-
file: ./fluentd/fluent.conf
185+
vector_config:
186+
name: ${STACK_NAME}_vector_config_{{ "./vector.yaml" | sha256file | substring(0,10) }}
187+
file: ./vector.yaml
202188
loki_config:
203189
name: ${STACK_NAME}_loki_config_{{ "./loki.yaml" | sha256file | substring(0,10) }}
204190
file: ./loki.yaml

services/logging/fluentd/Dockerfile

Lines changed: 0 additions & 28 deletions
This file was deleted.

services/logging/fluentd/Makefile

Lines changed: 0 additions & 9 deletions
This file was deleted.

services/logging/fluentd/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

services/logging/fluentd/fluent.conf

Lines changed: 0 additions & 131 deletions
This file was deleted.

services/logging/vector.yaml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Vector configuration to replace Fluent Bit
2+
# Ingests GELF logs from Docker daemon and forwards to Loki and Graylog
3+
4+
sources:
5+
# Receive GELF messages from Docker containers via UDP
6+
docker_gelf:
7+
type: socket
8+
address: "0.0.0.0:12201"
9+
mode: udp
10+
decoding:
11+
codec: gelf
12+
framing:
13+
method: chunked_gelf
14+
# Auto-detect compression (gzip, zlib, or uncompressed)
15+
decompression: Auto
16+
17+
transforms:
18+
# Process and enrich the logs
19+
process_logs:
20+
type: remap
21+
inputs: ["docker_gelf"]
22+
source: |
23+
if !exists(.host) {
24+
.host = get_hostname!()
25+
}
26+
27+
# Map short_message to message for Loki compatibility
28+
if exists(.short_message) {
29+
.message = .short_message
30+
}
31+
32+
# Handle container name - GELF uses _container_name (with underscore prefix)
33+
if exists(._container_name) {
34+
.container_name = ._container_name
35+
} else {
36+
.container_name = "unknown"
37+
}
38+
39+
# Handle container ID
40+
if exists(._container_id) {
41+
.container_id = ._container_id
42+
} else {
43+
.container_id = "unknown"
44+
}
45+
46+
# Handle image name
47+
if exists(._image_name) {
48+
.image_name = ._image_name
49+
} else {
50+
.image_name = "unknown"
51+
}
52+
53+
# Add processing metadata
54+
.processed_by = "vector"
55+
56+
sinks:
57+
# Send to Loki
58+
loki:
59+
type: loki
60+
inputs: ["process_logs"]
61+
endpoint: "http://loki:3100"
62+
encoding:
63+
codec: json
64+
labels:
65+
job: "docker"
66+
source: "vector"
67+
# Simple field references - defaults are set in transform above
68+
host: "{{ host }}"
69+
container_name: "{{ container_name }}"
70+
# Remove label fields from the log line to avoid duplication
71+
remove_label_fields: true
72+
healthcheck:
73+
enabled: true
74+
75+
# Send to Graylog via GELF over UDP (not TCP with framing)
76+
graylog:
77+
type: socket
78+
inputs: ["process_logs"]
79+
address: "logging_graylog:12201"
80+
mode: udp
81+
encoding:
82+
codec: gelf
83+
healthcheck:
84+
enabled: true
85+
86+
# Temporary: Output to console for debugging
87+
#console_debug:
88+
# type: console
89+
# inputs: ["process_logs"]
90+
# encoding:
91+
# codec: json
92+
93+
# Global configuration
94+
api:
95+
enabled: true
96+
address: "0.0.0.0:8686"
97+
98+
data_dir: "/var/lib/vector"

0 commit comments

Comments
 (0)