-
Notifications
You must be signed in to change notification settings - Fork 651
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
Record exception on context manager exit #1162
Conversation
fc94cd4
to
7351f4b
Compare
c343f53
to
75e46c9
Compare
ccac4bb
to
5c04297
Compare
694b26c
to
f5abcd5
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.
The goal looks great! +1 to add this convenience.
I think we should re-examine adding that field to the span though. See my comment above.
29f7ef6
to
2222d26
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.
One minor question (incongruent default value from "record_exception") but looking really good!
...pentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py
Show resolved
Hide resolved
5a72598
to
7e30859
Compare
...pentelemetry-instrumentation-requests/src/opentelemetry/instrumentation/requests/__init__.py
Show resolved
Hide resolved
7e30859
to
cf94b05
Compare
This updates the tracer context manager to automatically record exceptions as events on exit if an exception was raised within the context manager's context.
cf94b05
to
57a01cd
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.
Great, thanks!
Description
This updates the tracer context manager to record exceptions automatically on
exit if an exception was raised within the context manager's context.
This should be helpful in some situations when manually instrumenting apps. For example,
it can help record any uncaught/unexpected exceptions which one would expect from a tracing
system. This can also be helpful in simplifying auto-instrumentations. I think this should be the
default behavior but happy to hear other thoughts. Otel spec does not say anything about this and leaves span creation/activation to each language implementation. Both OpenTracing and OpenCensus did it AFAICT:
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: