-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subscriber: fix span data for new, exit, and close events (#1334)
* subscriber: fix span data for new, exit, and close events New, exit and close span events are generated while the current context is set to either `None` or the parent span of the span the event relates to. This causes spans data to be absent from the JSON output in the case of the `None`, or causes the span data to reference the parent's span data. Changing the way the current span is determined allows the correct span to be identified for these events. Trying to access the events `.parent()` allows access of the correct span for the `on_event` actions, while using `.current_span()` works for normal events. Ref: #1032 * Fix style * subscriber: improve test for #1333 Based on feedback by @hawkw, I've improved the test for #1333 to parse the json output. This is more specifc for the bug and allows easier testing of the different span `on_events`. Ref: #1333 (review) * subscriber: improve #1334 tests covering all span states Use the `on_records` test method check all events have the correct context as described in the PR. * Apply suggestions from code review Co-authored-by: Eliza Weisman <eliza@buoyant.io>
- Loading branch information
Showing
1 changed file
with
99 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters