-
Notifications
You must be signed in to change notification settings - Fork 357
Fail span if error tag is true #140
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
Fail span if error tag is true #140
Conversation
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 the PR!
However, the statement "decide if and only if the application considers the operation represented by the Span to have failed" is incorrect.
The exact wording from the specification for the error tag is "true if and only if the application considers the operation represented by the Span to have failed". This simply means that the error tag must not be set to true if the Span hasn't failed.
Since the backend relies on the error field and not the error tag, it should only be used by users who want to use the OpenTracing API.
The following should happen in the formatter when the error tag is set to true:
- Set the
errorfield to 1 on the Span since this is the value that is actually used by the backend to classify errors. - Discard the
errortag since it' redundant after setting theerrorfield and has no added value at this point.
For other use cases the current behavior is correct.
|
Thanks for the comments @rochdev! please correct me if i get it wrong, what opentracing only specifies the value of In this case, will my first commit be good enough then? |
|
Yes, the first commit would indeed be the correct way to solve this issue. |
- following opentracing standard, error tag should be true if the span has failed - discard the tag in meta since the backend relies on the error flag
d4bd00d to
4328053
Compare
|
comments addressed with description updated. |
rochdev
left a comment
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.
LGTM, will be in next release. Thanks @jizhang27!
Context
From opentracing spec,
errortag should berespected to "decide if and only if the application considers the operation represented by the Span to have failed".true if and only if the application considers the operation represented by the Span to have failedCurrently we are relying on those three tags instead: ['error.type', 'error.msg', 'error.stack'].
reference
Approach
Set error flag to 1 if error tag is true. Also, skip writing it to meta since the error flag (not the tag) is used to classify the error.
TODO
Closes #139