fluent / fluent/fluentd

Always record worker_id in @FLUENT_LOG

Open
#3,919 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Ruby
Stars
13.6k
Forks
1.4k
Avg merge
1d 3h
Merged PRs (30d)
20

Description

**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:
```xml


@type stdout


```
* 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.