@@ -51,7 +51,7 @@ def test_malformed_headers(self):
51
51
malformed_parent_id_key : self .serialized_parent_id ,
52
52
},
53
53
)
54
- ).get_context ()
54
+ ).get_span_context ()
55
55
56
56
self .assertNotEqual (context .trace_id , int (self .serialized_trace_id ))
57
57
self .assertNotEqual (context .span_id , int (self .serialized_parent_id ))
@@ -64,7 +64,7 @@ def test_missing_trace_id(self):
64
64
}
65
65
66
66
ctx = FORMAT .extract (get_as_list , carrier )
67
- span_context = get_current_span (ctx ).get_context ()
67
+ span_context = get_current_span (ctx ).get_span_context ()
68
68
self .assertEqual (span_context .trace_id , trace_api .INVALID_TRACE_ID )
69
69
70
70
def test_missing_parent_id (self ):
@@ -74,12 +74,12 @@ def test_missing_parent_id(self):
74
74
}
75
75
76
76
ctx = FORMAT .extract (get_as_list , carrier )
77
- span_context = get_current_span (ctx ).get_context ()
77
+ span_context = get_current_span (ctx ).get_span_context ()
78
78
self .assertEqual (span_context .span_id , trace_api .INVALID_SPAN_ID )
79
79
80
80
def test_context_propagation (self ):
81
81
"""Test the propagation of Datadog headers."""
82
- parent_context = get_current_span (
82
+ parent_span_context = get_current_span (
83
83
FORMAT .extract (
84
84
get_as_list ,
85
85
{
@@ -89,31 +89,31 @@ def test_context_propagation(self):
89
89
FORMAT .ORIGIN_KEY : self .serialized_origin ,
90
90
},
91
91
)
92
- ).get_context ()
92
+ ).get_span_context ()
93
93
94
94
self .assertEqual (
95
- parent_context .trace_id , int (self .serialized_trace_id )
95
+ parent_span_context .trace_id , int (self .serialized_trace_id )
96
96
)
97
97
self .assertEqual (
98
- parent_context .span_id , int (self .serialized_parent_id )
98
+ parent_span_context .span_id , int (self .serialized_parent_id )
99
99
)
100
- self .assertEqual (parent_context .trace_flags , constants .AUTO_KEEP )
100
+ self .assertEqual (parent_span_context .trace_flags , constants .AUTO_KEEP )
101
101
self .assertEqual (
102
- parent_context .trace_state .get (constants .DD_ORIGIN ),
102
+ parent_span_context .trace_state .get (constants .DD_ORIGIN ),
103
103
self .serialized_origin ,
104
104
)
105
- self .assertTrue (parent_context .is_remote )
105
+ self .assertTrue (parent_span_context .is_remote )
106
106
107
107
child = trace ._Span (
108
108
"child" ,
109
109
trace_api .SpanContext (
110
- parent_context .trace_id ,
110
+ parent_span_context .trace_id ,
111
111
trace_api .RandomIdsGenerator ().generate_span_id (),
112
112
is_remote = False ,
113
- trace_flags = parent_context .trace_flags ,
114
- trace_state = parent_context .trace_state ,
113
+ trace_flags = parent_span_context .trace_flags ,
114
+ trace_state = parent_span_context .trace_state ,
115
115
),
116
- parent = parent_context ,
116
+ parent = parent_span_context ,
117
117
)
118
118
119
119
child_carrier = {}
@@ -136,7 +136,7 @@ def test_context_propagation(self):
136
136
137
137
def test_sampling_priority_auto_reject (self ):
138
138
"""Test sampling priority rejected."""
139
- parent_context = get_current_span (
139
+ parent_span_context = get_current_span (
140
140
FORMAT .extract (
141
141
get_as_list ,
142
142
{
@@ -145,20 +145,22 @@ def test_sampling_priority_auto_reject(self):
145
145
FORMAT .SAMPLING_PRIORITY_KEY : str (constants .AUTO_REJECT ),
146
146
},
147
147
)
148
- ).get_context ()
148
+ ).get_span_context ()
149
149
150
- self .assertEqual (parent_context .trace_flags , constants .AUTO_REJECT )
150
+ self .assertEqual (
151
+ parent_span_context .trace_flags , constants .AUTO_REJECT
152
+ )
151
153
152
154
child = trace ._Span (
153
155
"child" ,
154
156
trace_api .SpanContext (
155
- parent_context .trace_id ,
157
+ parent_span_context .trace_id ,
156
158
trace_api .RandomIdsGenerator ().generate_span_id (),
157
159
is_remote = False ,
158
- trace_flags = parent_context .trace_flags ,
159
- trace_state = parent_context .trace_state ,
160
+ trace_flags = parent_span_context .trace_flags ,
161
+ trace_state = parent_span_context .trace_state ,
160
162
),
161
- parent = parent_context ,
163
+ parent = parent_span_context ,
162
164
)
163
165
164
166
child_carrier = {}
0 commit comments