Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix the parental relationship for follows_from reference
  • Loading branch information
robertsben committed Oct 5, 2021
commit 9a057ed739ea94ec2b1324f0297db0b480b2a911
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
([#2145](https://github.com/open-telemetry/opentelemetry-python/pull/2145))
- Add `schema_url` to `TracerProvider.get_tracer`
([#2154](https://github.com/open-telemetry/opentelemetry-python/pull/2154))
- Fix parental trace relationship for opentracing `follows_from` reference
()

## [1.5.0-0.24b0](https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.5.0-0.24b0) - 2021-08-26

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def start_active_span(

current_span = get_current_span()

if child_of is None and current_span is not INVALID_SPAN_CONTEXT:
if child_of is None and current_span.get_span_context() is not INVALID_SPAN_CONTEXT:
child_of = SpanShim(None, None, current_span)

span = self.start_span(
Expand Down Expand Up @@ -649,12 +649,18 @@ def start_span(
if isinstance(parent, OtelSpanContext):
parent = NonRecordingSpan(parent)

parent_span_context = set_span_in_context(parent)

links = []
valid_links = []
if references:
for ref in references:
links.append(Link(ref.referenced_context.unwrap()))
if ref.referenced_context.unwrap() is not INVALID_SPAN_CONTEXT:
valid_links.append(ref)

if valid_links and parent is None:
parent = NonRecordingSpan(valid_links[0].referenced_context.unwrap())

parent_span_context = set_span_in_context(parent)

# The OpenTracing API expects time values to be `float` values which
# represent the number of seconds since the epoch. OpenTelemetry
Expand Down