Parent is now always passed in via Context, intead of Span or SpanContext (#1146)
Co-authored-by: Diego Hurtado <ocelotl@users.noreply.github.com>
This commit is contained in:
parent
9eb4469d83
commit
fd65ab29cb
|
|
@ -34,7 +34,7 @@ with tracer.start_as_current_span("foo") as foo:
|
|||
foo.set_attribute("my_atribbute", True)
|
||||
foo.add_event("event in foo", {"name": "foo1"})
|
||||
with tracer.start_as_current_span(
|
||||
"bar", links=[trace.Link(foo.get_context())]
|
||||
"bar", links=[trace.Link(foo.get_span_context())]
|
||||
) as bar:
|
||||
time.sleep(0.2)
|
||||
bar.set_attribute("speed", 100.0)
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ def _translate_to_jaeger(spans: Span):
|
|||
jaeger_spans = []
|
||||
|
||||
for span in spans:
|
||||
ctx = span.get_context()
|
||||
ctx = span.get_span_context()
|
||||
trace_id = ctx.trace_id
|
||||
span_id = ctx.span_id
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ class TestJaegerSpanExporter(unittest.TestCase):
|
|||
span_context = trace_api.SpanContext(
|
||||
trace_id, span_id, is_remote=False
|
||||
)
|
||||
parent_context = trace_api.SpanContext(
|
||||
parent_span_context = trace_api.SpanContext(
|
||||
trace_id, parent_id, is_remote=False
|
||||
)
|
||||
other_context = trace_api.SpanContext(
|
||||
|
|
@ -190,13 +190,13 @@ class TestJaegerSpanExporter(unittest.TestCase):
|
|||
trace._Span(
|
||||
name=span_names[0],
|
||||
context=span_context,
|
||||
parent=parent_context,
|
||||
parent=parent_span_context,
|
||||
events=(event,),
|
||||
links=(link,),
|
||||
kind=trace_api.SpanKind.CLIENT,
|
||||
),
|
||||
trace._Span(
|
||||
name=span_names[1], context=parent_context, parent=None
|
||||
name=span_names[1], context=parent_span_context, parent=None
|
||||
),
|
||||
trace._Span(
|
||||
name=span_names[2], context=other_context, parent=None
|
||||
|
|
|
|||
Loading…
Reference in New Issue