Skip to content
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

Preserve the dedicated stack trace object all the way to encoder #1373

Open
oakad opened this issue Oct 11, 2023 · 2 comments
Open

Preserve the dedicated stack trace object all the way to encoder #1373

oakad opened this issue Oct 11, 2023 · 2 comments

Comments

@oakad
Copy link

oakad commented Oct 11, 2023

Right now, when stack trace is requested (via an annotation on a level enabler or via an explicit field) it is simply formatted into a largish string and treated like a simple string field. However, stack traces these days can be subject to analysis by automatic tooling and otherwise manipulated.

I think it will be beneficial to:

  1. Make stacktrace.Stack object publicly visible
  2. Modify the explicit Stack field to carry that object and not a string
  3. Provide a dedicated exporter method to handle the stacktrace.Stack object. The default encoder can keep using the default formatter, whereupon user provided encoder can do something more advanced

To my opinion, implementing this improvement is easy and seamless for most users. It will also allow for much safer processing of stacks in the log analysis systems as users will have the choice to supply their own encoders which can encode stack traces in analysis friendly way.

@abhinav
Copy link
Collaborator

abhinav commented Oct 11, 2023

Hey @oakad, thanks for filing this.
This is not an unreasonable idea, but we'd need to think on the design end of this more.
We can't just swap out the type of the Stack field because that's a breaking change.

There's also an active PR right now (#1371) to support changing how stack traces are encoded.
If we decide to do this, that will also affect that PR.

@oakad
Copy link
Author

oakad commented Oct 12, 2023

One may easily argue that stack traces are the most import pieces of info error log messages carry. So any improvement over the present basic encoding will be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants