fluentd
fluentd copied to clipboard
Always record worker_id in @FLUENT_LOG
Problem
Fluentd is very incosintent about metadata annotation for @FLUENT_LOG
.
Sometimes it shows the worker's ID as part of log records, and sometimes it won't:
2022-10-17 09:59:13.754376201 +0900 fluent.info: {"pid":75192,"ppid":75186,"worker":0,"message":"starting fluentd worker pid=75192 ppid=75186 worker=0"}
2022-10-17 09:59:13.754640834 +0900 fluent.info: {"worker":0,"message":"fluentd worker is now running worker=0"}
2022-10-17 09:59:16.736660074 +0900 fluent.debug: {"message":"fluentd main process get SIGINT"}
2022-10-17 09:59:17.263191871 +0900 fluent.debug: {"message":"fluentd main process get SIGTERM"}
2022-10-17 09:59:17.263328204 +0900 fluent.debug: {"message":"getting start to shutdown main process"}
This makes the monitoring unnecessarily hard. For example, we sometimes cannot decide which worker emitted a paritcular error.
How to reproduce the issue
- Prepare the following configuration:
<label @FLUENT_LOG> <match fluent.**> @type stdout </match> </label>
- Run Fluentd with
fluentd -c fluentd.conf -v
- Check the log lines coming from
@FLUENT_LOG
.
Desired Behavior
- Fluentd should always make it clear which message comes from which worker.