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 @@ -140,10 +140,10 @@ mod tests {
140140 fn on_end ( & self , span : SpanData ) {
141141 // Fixed: Context::current() no longer panics from Drop
142142 // See https://github.com/open-telemetry/opentelemetry-rust/issues/2871
143- let current_cx = Context :: current ( ) ;
143+ Context :: current ( ) ;
144144
145- // IMPORTANT NOTE: The context returned here is the PARENT context,
146- // NOT the span's context (which has already been popped from the stack) .
145+ // IMPORTANT NOTE: The context returned here is whatever context happens
146+ // to be current at this moment, which may be unrelated to the span being ended .
147147 // The span's baggage was extracted in on_start and stored as attributes.
148148
149149 // Verify: on_start stored the baggage as an attribute
@@ -153,16 +153,6 @@ mod tests {
153153 . any( |kv| kv. key. as_str( ) == "bag-key" ) ,
154154 "Baggage should have been stored as span attribute in on_start"
155155 ) ;
156-
157- // The current context's baggage is the parent's baggage (if any)
158- println ! (
159- "on_end: parent context baggage = {:?}" ,
160- current_cx
161- . baggage( )
162- . iter( )
163- . map( |( k, _) | k)
164- . collect:: <Vec <_>>( )
165- ) ;
166156 }
167157
168158 fn force_flush ( & self ) -> crate :: error:: OTelSdkResult {
You can’t perform that action at this time.
0 commit comments