Skip to content
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

span exception stack trace should be recorded as event #971

Closed
jrozentur opened this issue Aug 6, 2020 · 2 comments
Closed

span exception stack trace should be recorded as event #971

jrozentur opened this issue Aug 6, 2020 · 2 comments
Assignees
Labels
backlog bug Something isn't working

Comments

@jrozentur
Copy link

Describe your environment
python 3.7, jaeger

Steps to reproduce
When exception is thrown out of code surrounded by a span, use_span() sets status to error. This does not get one any troubleshooting info and does not correlate with logs...

E.g. the span may have captured events or log statements PRECEDING the exception, but not the exception itself. You only have a chance to log that exception when it is caught, but this is when the span originating the exception is closed already, so this info is in the wrong place and can only go into a parent span, potentially many levels up from the source of issue

What is the expected behavior?
span.record_error() called in use_span() on error, so that error info is captured together with relevant preceding steps. Also possibly logger.exception() called in the same place. Or let it be configurable - what is done on error may depend on error type and origin

What is the actual behavior?
Simplistic error=true event set, which actually makes more sense on the parent spans leading to an exception (which is the way it is now) but not on the span that caused the exception

Additional context
There are two ways to correlate with logs: 1) capture normal log statements as events 2) put span context into each log statement. I can use neither to associate error log with originating span: there is no log statement till the span is closed; there is no event either

@jrozentur jrozentur added the bug Something isn't working label Aug 6, 2020
@codeboten codeboten self-assigned this Aug 6, 2020
srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this issue Nov 1, 2020
…emetry#971)

* Add link to OpenTelemetry registry for compatible exporters

* Add link to OpenTelemetry registry for compatible exporters
@github-actions
Copy link

github-actions bot commented Apr 9, 2021

This issue was marked stale due to lack of activity. It will be closed in 30 days.

@codeboten
Copy link
Contributor

This was fixed with #1365, record_exception is now called from use_span

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants