[instrumentation/errortrace] Improve error stack traces#3709
Merged
Conversation
hannahkm
commented
Jul 1, 2025
hannahkm
commented
Jul 1, 2025
hannahkm
commented
Jul 1, 2025
kakkoyun
reviewed
Jul 2, 2025
hannahkm
commented
Jul 3, 2025
| return New(format) | ||
| case 1: | ||
| if _, ok := a[0].(*TracerError); ok { | ||
| format = strings.Replace(format, "%w", "%v", 1) |
Contributor
Author
There was a problem hiding this comment.
According to the fmt documentation, "%w" is synonymous with "%v" aside from providing wrapping around errors.
kakkoyun
reviewed
Jul 17, 2025
kakkoyun
left a comment
Member
There was a problem hiding this comment.
Looking great!
I have added some suggestions.
| case *errortrace.TracerError: | ||
| // instrumentation/errortrace approach | ||
| s.setMeta(ext.ErrorDetails, fmt.Sprintf("%+v", v)) | ||
| if !cfg.noDebugStack { |
Member
There was a problem hiding this comment.
[No need to handle in this PR] We need to propagate this flag to the instrumentation/errortrace, so that we don't attempt any stack capture.
Co-authored-by: Kemal Akkoyun <[email protected]>
Co-authored-by: Kemal Akkoyun <[email protected]>
kakkoyun
approved these changes
Jul 17, 2025
kakkoyun
reviewed
Jul 17, 2025
Member
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
7 tasks
7 tasks
This was referenced Sep 2, 2025
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Introduces a new errortrace package, which will set up the foundation for improving our error stack traces.
Motivation
Currently, errors on spans trace back to the
SetTagandsetTagErrorfunctions in the tracer, since that is where we identify the error and put it onto the span as a tag and/or metric. However, the error does not originate from those functions. To avoid confusion and to improve debugging in the Datadog UI, we want to fix our error stack traces to accurately represent where errors are coming from.This PR is the second step in a series of PRs to fix stack traces. Previous PRs include work to set up new join points in Orchestrion.
LANGPLAT-160
Reviewer's Checklist
golangci-lint runlocally.Unsure? Have a question? Request a review!