-
Notifications
You must be signed in to change notification settings - Fork 624
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
Not properly set status on exception #377
Comments
Hello @GoPavel I just checked out the latest master code and ran this test case specifically with
I even inspected Please let us know this:
Thanks! |
Sorry, we have a misunderstanding. I should have made more effort to explain the problem. I find a bug with setting span status. Specifically, when I use def test_error_status_modified(self, tracer):
try:
# with trace.start_span("root") as root # OLD equivalent
with trace.start_as_current_span("root") as root: # NEW
raise Exception("unknown")
except Exception: # pylint: disable=broad-except
pass
# root.status.canonical_code is StatusCanonicalCode.OK !!!
self.assertIs(root.status.canonical_code, StatusCanonicalCode.UNKNOWN) # Assertion Failed
self.assertEqual(root.status.description, "Exception: unknown") The test above fail because Now correct using try:
with trace.start_as_current_span("root") as root:
with root: # WORKAROUND!!!
raise Exception("unknown")
except Exception: # pylint: disable=broad-except
pass I think it's a mistake and |
Ah, much clearer now, thanks! 👍 I'll get to work on this right away. |
Exception handling from PR#297 have misbehavior in straightforward case:
I find that Span's method
__exist__
can set status on exception, but it is not used here.The text was updated successfully, but these errors were encountered: