Add the option for all the stack components to log in JSON format
In trying to do log normalization across our stack, disparate logging formats cause extra work on the parsing end. Having all logging in JSON greatly simplifies the need to parse logs into a common format.
ENV variable to enable logging in JSON format. Should be a non-default option as there may be performance penalties enabling it.
Current way to is parse log formats to a normalized format at the receiving end (logstash in my case), which involves thing like rename fields to a common format such as severity for instance, and making sure this field value is also common, such as "error" instead of "ERR!" (which is used by the linkerd-proxy)
Log normalization makes searching (in our case using the ELK stack) easier and more consistent.
See also #2157, #56
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions.
The tracing-subscriber crate, which the proxy uses to format its logs, has a Json event formatter that we could sub in pretty easily to output logs in JSON.
We'd definitely want to make this a configuration option of some kind (env var?), of course, because I think many folks would agree that the current output format is much more human readable when you're _not_ aggregating logs. :)
We'd definitely want to make this a configuration option of some kind (env var?), of course, because I think many folks would agree that the current output format is much more human readable when you're _not_ aggregating logs. :)
💯
LINKERD_PROXY_LOG_FORMAT environment variable
--proxy-log-format CLI flag
config.linkerd.io/proxy-log-format annotation
Plus one for this!
This should be pretty straightforward to implement, so if anyone is interested in working on it (and getting the opportunity to make a proxy contribution), let me know — I'd be happy to provide pointers!
🙋♂️
I believe wiring the option through as an annotation/CLI command is still necessary?
🙋♂️
https://github.com/linkerd/linkerd2/pull/4620 in progress