Skip to content

Commit

Permalink
Fixed: OpenTracing not continuing context properly
Browse files Browse the repository at this point in the history
  • Loading branch information
delner committed Sep 22, 2022
1 parent 01bfa08 commit a1b5e9e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/datadog/opentracer/tracer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,10 @@ def start_span(
tags: tags || {}
)

# Build or extend the OpenTracer::SpanContext
span_context = if parent_span_context
SpanContextFactory.clone(span_context: parent_span_context)
else
SpanContextFactory.build(datadog_context: datadog_context)
end
span_context = SpanContextFactory.build(
datadog_context: datadog_context || datadog_tracer.send(:call_context),
baggage: parent_span_context ? parent_span_context.baggage.dup : {}
)

# Wrap the Datadog span and OpenTracer::Span context in a OpenTracer::Span
Span.new(datadog_span: datadog_span, span_context: span_context)
Expand Down

0 comments on commit a1b5e9e

Please sign in to comment.