Skip to content

Commit f78e959

Browse files
committed
Change fluentd for fluentbit
1 parent 038be52 commit f78e959

File tree

10 files changed

+65
-196
lines changed

10 files changed

+65
-196
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+
fluentbit:
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+
fluentbit:
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+
fluentbit:
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+
fluentbit:
2121
deploy:
2222
placement:
2323
constraints:

services/logging/docker-compose.yml.j2

Lines changed: 20 additions & 19 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,20 +99,18 @@ 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
102+
fluentbit:
103+
image: cr.fluentbit.io/fluent/fluent-bit:4.0.9
105104
configs:
106-
- source: fluentd_config
107-
target: /fluentd/etc/fluent.conf
105+
- source: fluentbit_config
106+
target: /fluent-bit/etc/fluent-bit.conf
108107
environment:
109108
- GRAYLOG_HOST=graylog
110109
- GRAYLOG_PORT=12201
111-
- LOKI_URL=http://loki:3100
112-
- FLUENTD_HOSTNAME={% raw %}{{.Node.Hostname}}{% endraw %}
110+
- LOKI_HOST=loki
113111
ports:
114-
- "24224:24224/tcp"
112+
- "12201:12201/udp"
115113
deploy:
116-
#mode: global # Run on all nodes
117114
restart_policy:
118115
condition: on-failure
119116
resources:
@@ -127,15 +124,19 @@ services:
127124
parallelism: 1
128125
delay: 10s
129126
order: start-first
127+
labels:
128+
- traefik.enable=true
129+
- traefik.docker.network=${PUBLIC_NETWORK}
130+
- traefik.http.services.fluentbit.loadbalancer.server.port=2020
131+
- traefik.http.routers.fluentbit.rule=Host(`${MONITORING_DOMAIN}`) && PathPrefix(`/fluentbit`)
132+
- traefik.http.routers.fluentbit.entrypoints=https
133+
- traefik.http.routers.fluentbit.tls=true
134+
- traefik.http.middlewares.fluentbit_replace_regex.replacepathregex.regex=^/fluentbit/?(.*)$$
135+
- traefik.http.middlewares.fluentbit_replace_regex.replacepathregex.replacement=/$${1}
136+
- traefik.http.routers.fluentbit.middlewares=ops_whitelist_ips@swarm, ops_gzip@swarm, fluentbit_replace_regex
130137
networks:
131138
- monitoring
132139
- 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
139140

140141
loki:
141142
image: grafana/loki:3.5.4
@@ -196,9 +197,9 @@ configs:
196197
graylog_config:
197198
name: ${STACK_NAME}_graylog_config_{{ "./data/contentpacks/osparc-custom-content-pack-v2.json" | sha256file | substring(0,10) }}
198199
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
200+
fluentbit_config:
201+
name: ${STACK_NAME}_fluentbit_config_{{ "./fluentbit/fluentbit.conf" | sha256file | substring(0,10) }}
202+
file: ./fluentbit/fluentbit.conf
202203
loki_config:
203204
name: ${STACK_NAME}_loki_config_{{ "./loki.yaml" | sha256file | substring(0,10) }}
204205
file: ./loki.yaml
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[SERVICE]
2+
Flush 1
3+
Daemon off
4+
Log_Level info
5+
HTTP_Server On
6+
HTTP_Listen 0.0.0.0
7+
HTTP_Port 2020
8+
9+
# Receive GELF messages from Docker containers
10+
[INPUT]
11+
Name udp
12+
Listen 0.0.0.0
13+
Port 12201
14+
Format json
15+
Chunk_Size 8192
16+
17+
# Copy mandatory `short_message`, which is the only thing docker sends, to the `message` field as well to avoid confusion
18+
[FILTER]
19+
Name modify
20+
Match *
21+
Copy short_message message
22+
23+
# Output to Loki with Docker host hostname and container metadata
24+
[OUTPUT]
25+
Name loki
26+
Match *
27+
Host ${LOKI_HOST}
28+
Port 3100
29+
Labels job=docker
30+
Label_keys $host,$container_name
31+
Line_format json
32+
33+
# Output to Graylog (GELF format - direct passthrough)
34+
[OUTPUT]
35+
Name gelf
36+
Match *
37+
Host ${GRAYLOG_HOST}
38+
Port ${GRAYLOG_PORT}
39+
Mode udp
40+
Gelf_Host_Key host
41+
Gelf_Short_Message_Key short_message

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.

0 commit comments

Comments
 (0)