Skip to content

set the span id as parent id when errors happen in spans #669

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

Merged
merged 3 commits into from
Dec 16, 2019

Conversation

beniwohli
Copy link
Contributor

What does this pull request do?

If available, sets the error.parent_id to span.id

We need to handle a few different cases. When the exception
is captured inside the span, we can get the span from the
execution context.

More complicated is the case when the exception isn't handled
inside the span. In this case, the span is already ended when
the exception is handled, and not available in the execution
context. To work around this, we need to store the span ID
as an attribute of the exception value, where we can grab
it when the exception is captured later on. This isn't
supper pretty, but works.

Why is it important?

Using this information, the UI can show exceptions and logs
directly in the span object.

@beniwohli beniwohli marked this pull request as ready for review December 13, 2019 09:03
@beniwohli beniwohli requested a review from basepi December 13, 2019 09:15
@beniwohli beniwohli merged commit 5c04ce4 into elastic:master Dec 16, 2019
@beniwohli beniwohli deleted the span_id_on_errors branch December 16, 2019 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants