fix(log-drain): send Coolify labels to Fluent Bit drains

Containers without the Coolify default variables sent no project,
environment, or service to the drain. The fluentd driver now also sends
the Coolify container labels; the built-in configs use them as a
fallback and add coolify.service_name.

Closes #8415

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-11-03 22:42:37 +01:00
co-authored by Claude Opus 5.5
parent b83b97f7e6
commit 8d07d178f0
7 changed files with 99 additions and 21 deletions
+3 -1
View File
@@ -4621,8 +4621,10 @@ function generate_fluentd_configuration(): array
'fluentd-address' => 'tcp://127.0.0.1:24224',
'fluentd-async' => 'true',
'fluentd-sub-second-precision' => 'true',
// env vars are used in the LogDrain configurations
// The env vars exist only when the resource includes the Coolify default variables.
'env' => 'COOLIFY_APP_NAME,COOLIFY_PROJECT_NAME,COOLIFY_SERVER_IP,COOLIFY_ENVIRONMENT_NAME',
// Every Coolify container has these labels. Docker skips a label that a container does not have.
'labels' => 'coolify.projectName,coolify.environmentName,coolify.resourceName,coolify.serviceName',
],
];
}