-
Notifications
You must be signed in to change notification settings - Fork 36
Recording an error may carry attributes #90
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
Conversation
3e69c53
to
f418abb
Compare
**Motivation:** It can be used to attach more information bout the error, like its stacktrace and similar information. This is also supported by the otel spec, so we're aligning closer with it here. **Modifications:** Change the recordError to accept optional span attributes **Result:** more powerful record error API
f418abb
to
387bf2f
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.
Thanks for tackling this 👍
XCTAssertTrue(endedSpan != nil) | ||
XCTAssertEqual(endedSpan!.recordedErrors.count, 1) | ||
let error = endedSpan!.recordedErrors.first!.0 | ||
XCTAssertEqual(error as! ExampleSpanError, errorToThrow) | ||
let attrs = endedSpan!.recordedErrors.first!.1 | ||
XCTAssertEqual(attrs, attrsForError) |
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.
Do we want to use XCTUnwrap
here instead of the force unwraps?
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.
Meh, tbh I don't mind those !
, thank you for the review!
Co-authored-by: Moritz Lang <[email protected]>
Co-authored-by: Moritz Lang <[email protected]>
Motivation:
It can be used to attach more information bout the error, like its stacktrace and similar information.
This is also supported by the otel spec, so we're aligning closer with it here.
Modifications:
Change the recordError to accept optional span attributes
Result:
more powerful record error API
resolves #45