File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
opentelemetry-sdk/src/trace Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -141,10 +141,10 @@ mod tests {
141141 fn on_end ( & self , span : SpanData ) {
142142 // Fixed: Context::current() no longer panics from Drop
143143 // See https://github.com/open-telemetry/opentelemetry-rust/issues/2871
144- let current_cx = Context :: current ( ) ;
144+ Context :: current ( ) ;
145145
146- // IMPORTANT NOTE: The context returned here is the PARENT context,
147- // NOT the span's context (which has already been popped from the stack) .
146+ // IMPORTANT NOTE: The context returned here is whatever context happens
147+ // to be current at this moment, which may be unrelated to the span being ended .
148148 // The span's baggage was extracted in on_start and stored as attributes.
149149
150150 // Verify: on_start stored the baggage as an attribute
@@ -154,16 +154,6 @@ mod tests {
154154 . any( |kv| kv. key. as_str( ) == "bag-key" ) ,
155155 "Baggage should have been stored as span attribute in on_start"
156156 ) ;
157-
158- // The current context's baggage is the parent's baggage (if any)
159- println ! (
160- "on_end: parent context baggage = {:?}" ,
161- current_cx
162- . baggage( )
163- . iter( )
164- . map( |( k, _) | k)
165- . collect:: <Vec <_>>( )
166- ) ;
167157 }
168158
169159 fn force_flush ( & self ) -> crate :: error:: OTelSdkResult {
You can’t perform that action at this time.
0 commit comments