-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
filter_ecs: new filter for AWS ECS Metadata #5898
Conversation
Running on an instance inside of an ECS cluster:
The first container is part of an ECS Task. The filter's use case is to attach metadata to its logs. I could set up Fluent Bit to actually collect its logs, but for testing, the easiest thing to do is to set a config to mimic a tag coming from a real task:
Even though we use dummy input, the tag and ECS_Tag_Prefix configured makes filter think the logs are coming from the task:
No leaks:
|
b3cda9e
to
ebfee60
Compare
101cc03
to
8943809
Compare
Doc PR: fluent/fluent-bit-docs#925 |
|
Signed-off-by: Wesley Pettit <[email protected]>
9200384
to
be080bd
Compare
784ce47
to
dd081a2
Compare
dd081a2
to
f9874dd
Compare
Signed-off-by: Wesley Pettit <[email protected]>
f9874dd
to
ddcd65b
Compare
… not from a task The filter is built primarily for a daemon deployment mode where Fluent Bit runs once per node/instance and collects all log files on that host. The filter can attach metadata to these logs. But- what if there is a container running on the host that is not part of an ECS Task? Json-file log driver files are written to disk with only the container ID to distinguish where they came from. So the daemon would still collect logs from containers not part of a task and there is no easy way to ignore those logs. Without this patch, in that case, the Fluent Bit output would be spammed with constant errors from this filter. This patch suppresses failures after 2 failed attempts. Signed-off-by: Wesley Pettit <[email protected]>
Signed-off-by: Wesley Pettit [email protected]
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
Documentation
filter_ecs: new filter for AWS ECS Metadata fluent-bit-docs#925
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.