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

Add causal chain to the stack string #52

Merged
merged 4 commits into from
Mar 12, 2024

Conversation

cstorey-monzo
Copy link
Contributor

@cstorey-monzo cstorey-monzo commented Mar 12, 2024

I've been chasing down a bunch of errors in tests where (*terrors.Error).StackString() was empty, which isn't convenient, so I've added the causal chain into the stack trace. Without this, even a single usage of terrors.Augment() would mean that stack traces would be blank (this might be why I've seen a bunch of blank stacktraces in Kibana, too).

terr = tcause
} else {
break
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind adding some comments here or updating the function comment?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do you think we need to worry about the performance here if we have a really long call stack? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't quite sure what you were going for with the comments, so I've just followed the inferred intent of the original.

And for performance; granted, there is a risk of poor performance in extreme circumstances. But on the other hand, I feel like the usage of strings.Buffer over repeated use of fmt.Sprintf() is enough of a net win to outweigh any downside in most circumstances.

alinbalutoiu
alinbalutoiu previously approved these changes Mar 12, 2024
@franzbecker
Copy link

Just asking:

❓ Will this yield to new duplicate Sentry issues (if changing the stack trace)?

@cstorey-monzo
Copy link
Contributor Author

Will this yield to new duplicate Sentry issues (if changing the stack trace)?

Possibly. I'll try to remember to post a quick heads-up in #backend-announcements, or similar.

@cstorey-monzo cstorey-monzo merged commit 073654f into master Mar 12, 2024
2 checks passed
@cstorey-monzo
Copy link
Contributor Author

For the record, I don't think it will have any impact on sentry reports.

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

Successfully merging this pull request may close these issues.

3 participants