File tree 2 files changed +9
-1
lines changed
propagator/opentelemetry-propagator-ot-trace
src/opentelemetry/propagators/ot_trace
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ def extract(
85
85
trace_id = int (traceid , 16 ),
86
86
span_id = int (spanid , 16 ),
87
87
is_remote = True ,
88
- trace_flags = traceflags ,
88
+ trace_flags = TraceFlags ( traceflags ) ,
89
89
)
90
90
),
91
91
context ,
Original file line number Diff line number Diff line change @@ -248,6 +248,10 @@ def test_extract_trace_id_span_id_sampled_true(self):
248
248
self .assertEqual (hex (span_context .span_id )[2 :], "e457b5a2e4d86bd1" )
249
249
self .assertTrue (span_context .is_remote )
250
250
self .assertEqual (span_context .trace_flags , TraceFlags .SAMPLED )
251
+ self .assertIsInstance (
252
+ get_current_span ().get_span_context ().trace_flags ,
253
+ TraceFlags
254
+ )
251
255
252
256
def test_extract_trace_id_span_id_sampled_false (self ):
253
257
"""Test valid trace_id, span_id and sampled false"""
@@ -268,6 +272,10 @@ def test_extract_trace_id_span_id_sampled_false(self):
268
272
self .assertEqual (hex (span_context .span_id )[2 :], "e457b5a2e4d86bd1" )
269
273
self .assertTrue (span_context .is_remote )
270
274
self .assertEqual (span_context .trace_flags , TraceFlags .DEFAULT )
275
+ self .assertIsInstance (
276
+ get_current_span ().get_span_context ().trace_flags ,
277
+ TraceFlags
278
+ )
271
279
272
280
def test_extract_malformed_trace_id (self ):
273
281
"""Test extraction with malformed trace_id"""
You can’t perform that action at this time.
0 commit comments