Linkerd2: Add option for logging in json format

Created on 12 Mar 2019  ·  9Comments  ·  Source: linkerd/linkerd2

Feature Request

Add the option for all the stack components to log in JSON format

What problem are you trying to solve?

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.

How should the problem be solved?

ENV variable to enable logging in JSON format. Should be a non-default option as there may be performance penalties enabling it.

Any alternatives you've considered?

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)

How would users interact with this feature?

Log normalization makes searching (in our case using the ELK stack) easier and more consistent.

arecontroller areproxy rfc

All 9 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

coleca picture coleca  ·  4Comments

alpeb picture alpeb  ·  3Comments

skalinets picture skalinets  ·  3Comments

adleong picture adleong  ·  4Comments

ihcsim picture ihcsim  ·  4Comments