-
Notifications
You must be signed in to change notification settings - Fork 42
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 errors to spans #1260
Add errors to spans #1260
Conversation
bbe18db
to
3f2babc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few minor comments. @inancgumus, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the overall PR 👍
I have some wonderings:
- Why is
SpanRecordError
exported? - Can we use the existing error? Is there a reason for repurposing a new error message? Should we repurpose the original error and directly use it instead?
- Weak suggestion: Can we register span errors in the mapping layer (instead of intermingling or handling them into the core logic)?
d8958ec
to
3ddc39e
Compare
3f2babc
to
ecb98a9
Compare
|
👍
Sure. I mean this (using the existing error message): err := errors.New("existing browser context must be closed before creating a new one")
spanRecordError(span, err)
return nil, err Instead of: err := errors.New("existing browser context must be closed before creating a new one")
spanRecordError(span, "browserContext already exists", err)
return nil, err In the current version, there are two error messages:
I thought maybe we could use a single error message. If the existing error messages are too verbose, we could repurpose them to be compatible with span error messages. Keeping the error messages consistent will prevent confusion in the future and also lead to less code.
|
This will help avoid overriding the original error if that was not intended and can avoid bugs when we forget tot return once an error occurs.
c0c2a6e
to
8b9e130
Compare
I see now. Adding a description of the error seems to be a requirement when recording the error in the span:
Any other options? |
Yes, but the description doesn't have to be a different error. For example. |
It seems that the description of the error is mostly just the error itself according to other services we've looked at.
Nice find, if that's what they're doing then I will do the same 👍 Changed in 2207e4b |
What?
Adding errors to the API spans that currently exist.
Why?
When a user views the traces for the test, it's useful to see whether an error occurred and in which API call. This will help highlight spans where errors occurred and therefore caused the test iteration to fail.
Checklist
Related PR(s)/Issue(s)
#1249