-
Notifications
You must be signed in to change notification settings - Fork 49
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
Support UUID in Log Stream and Group templates #108
Comments
CC @davidnewhall for comment (not asking you to implement this) |
Thinking about this some more, the main use case I know for this is when folks are running in ECS but their logs don't come from stdout and so the metadata FireLens provides is not useful. I think it'd be good to just build ECS metadata injection into this plugin, since the upstream fluent bit ECS Metadata filter will take some time to build. In the meantime we can fairly quickly just add special variables |
Actually, let's do |
I feel like as long as we "know the app is running in ECS" (and why wouldn't it be?) then pulling the ECS meta data (arn, id, cluster name) seems like a decent path forward to finding a unique bit of data. Creating many log streams inside one group seems perfectly normal and desirable when you have many tasks running. I can totally stand behind that ideal. Generating and using random UUIDs may work in some cases too, but I fear opening that can of worms; I believe folks would try it, get confused and post questions asking how it works and how they make it work differently. I just think an initial implementation of randomness like that would be poorly-received. I could be wrong, but as a 20+ year programmer that's the feeling I get. Do let me know if I provided useful insight and if you have any more questions. Good luck! |
One of the key limitations of CloudWatch is that each logging agent must write logs to a unique log stream- if multiple agents are concurrently writing to a single log stream you will soon get sequence token errors.
In most cases, the tag, or some field in the logs can be used to uniquely identify each instance.
However, there are some niche cases where this is not the case:
application.log
andservice.log
. Also, for the sake of argument, assume you have no access to an instance ID or unique host name in Fluent Bit. There's nothing for each Fluent Bit instance to use to uniquely identify itself and write to a unique log streamThose cases are a bit contrived... but I do think this problem of "nothing uniquely identifies each fluent bit to allow it to create a different log stream" is a real problem. Not a common problem, but something worth solving if there's a simple solution.
One possible solution is to support a new special template,
$(uuid)
which would add a UUID to your log stream or group.The Fluentd S3 plugin has this feature: https://github.com/fluent/fluent-plugin-s3
The text was updated successfully, but these errors were encountered: