Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS metadata fails when container tag is overriden #9028

Open
RaJiska opened this issue Jul 1, 2024 · 0 comments
Open

ECS metadata fails when container tag is overriden #9028

RaJiska opened this issue Jul 1, 2024 · 0 comments

Comments

@RaJiska
Copy link

RaJiska commented Jul 1, 2024

Bug Report

Describe the bug
ECS metadata plugins fails to retrieve task details when the tag is overridden (by default the container ID) for something custom.

To Reproduce
Config file:

[SERVICE]
  daemon    Off
  log_level info
  flush     30

[INPUT]
  Name   forward
  Listen 0.0.0.0
  Port   ${AGENT_PORT}

[FILTER]
  Name                           ecs
  Match                          ecs.*
  ADD ecs_cluster                $ClusterName
  ADD ecs_task_id                $TaskID
  ADD ecs_container_name         $ECSContainerName
  ADD ecs_task_definition_family $TaskDefinitionFamily
  ADD ecs_task_id                $TaskID

[OUTPUT]
  Name  stdout
  Match ecs.*

Container sending logs started with the following command:

docker run --rm -it --log-driver=fluentd --log-opt fluentd-address=localhost:24224 --log-opt "tag=ecs.test123456" alpine echo lol

Resulting in the following errors from fluentbit:

[2024/07/01 09:38:49] [ warn] [filter:ecs:ecs.1] Failed to get metadata from /v1/tasks?dockerid=ecs.test1234, will retry
[2024/07/01 09:38:49] [ info] [filter:ecs:ecs.1] Requesting metadata from ECS Agent introspection endpoint failed for tag ecs.test123456

Expected behavior
Fluent-bit ECS filter should not retrieve the container ID from the tag. I am not aware of the internals, but I believe there must be another way to retrieve the container ID as it is available through the container_id key regardless.

Your Environment

  • Version used: fluent/fluent-bit:3.0.7
  • Configuration: Described above
  • Environment name and version (e.g. Kubernetes? What version?): docker
  • Filters and plugins: ecs

Additional context
I'd like to supply a custom tag to have a different logic depending of the container and log types it ships to fluentbit. The ECS metadata filter does not work when supplying my own tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant