File tree 3 files changed +11
-1
lines changed
propagator/opentelemetry-propagator-ot-trace
src/opentelemetry/propagators/ot_trace
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [ Unreleased] ( https://github.com/open-telemetry/opentelemetry-python-contrib/compare/v0.200...HEAD )
8
8
9
+ ### Changed
10
+ - ` opentelemetry-propagator-ot-trace ` Use ` TraceFlags ` object in ` extract `
11
+ ([ #472 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/472 ) )
12
+
9
13
### Added
10
14
- Move ` opentelemetry-instrumentation ` from core repository
11
15
([ #465 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/465 ) )
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,9 @@ 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 , TraceFlags
253
+ )
251
254
252
255
def test_extract_trace_id_span_id_sampled_false (self ):
253
256
"""Test valid trace_id, span_id and sampled false"""
@@ -268,6 +271,9 @@ def test_extract_trace_id_span_id_sampled_false(self):
268
271
self .assertEqual (hex (span_context .span_id )[2 :], "e457b5a2e4d86bd1" )
269
272
self .assertTrue (span_context .is_remote )
270
273
self .assertEqual (span_context .trace_flags , TraceFlags .DEFAULT )
274
+ self .assertIsInstance (
275
+ get_current_span ().get_span_context ().trace_flags , TraceFlags
276
+ )
271
277
272
278
def test_extract_malformed_trace_id (self ):
273
279
"""Test extraction with malformed trace_id"""
You can’t perform that action at this time.
0 commit comments