fix: Restore colored logs, strip ANSI escape codes in Vector agent#1237
fix: Restore colored logs, strip ANSI escape codes in Vector agent#1237sbernauer wants to merge 4 commits into
Conversation
|
This needs to work outside of Vector as well for those not using Vector and I don't think this necessarily does. The reason is that we receive support tickets with stuff like this attached: I assume this is kubectl logs or something similar. |
NickLarsenNZ
left a comment
There was a problem hiding this comment.
I'm happy with this if @lfrancke is.
|
I'm not, see: #1237 (comment) |
I think I understand what you mean... We offer vector side car (@sbernauer fixed it for that case). But if they are using a privileged container to scrape pod logs from the host (otel-collector, alloy, fluent-bit, etc...) then it doesn't solve it for them.
I assume it would display fine, unless they pipe it through something that can't handle it. |
|
I would say this needs a lot more investigation:
|
|
Yes. And that's time I don't want us to spend right now, sorry. |
Description
Different take on #1183
I (once again) run into this when a customer screenshared an operator log and we just saw a big wall of (white) text. Previously I was able to tell immediately if everything is green or not.
To improve this I need to understand the motivation behind the change in #1183.
I assume it is the following, but please correct me if I'm wrong:
containerdebug runs in the product container and produces ANSI codes. When ingesting that into the vector agent they are kept and end up in OpenSearch/Graylog.
I propose to leave the logs colored (the operators as well as the various tools such as containerdebug or cert-tools). Vector has a built-in function, using that we can strip the ANSI escape codes in the vector sidecar, so they don't end up in OpenSearch/Graylog/whatever.
Testing
I tested this using the
loggingdemo and inspecting thepreparecontainer of trino, as it's cert-tools uses ANSI stuff.This PR worked perfectly fine, colored output in k9s and no weird characters in OpenSearch.
This solution also has the benefit that it works for all tools and not only for the stackable-specifc ones using stackable-telemetry.
Definition of Done Checklist
Author
Reviewer
Acceptance