File tree Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Expand file tree Collapse file tree 2 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -165,10 +165,21 @@ impl traces::HostSpan for InstanceState {
165
165
166
166
async fn set_status (
167
167
& mut self ,
168
- _resource : Resource < traces:: Span > ,
169
- _status : traces:: Status ,
168
+ resource : Resource < traces:: Span > ,
169
+ status : traces:: Status ,
170
170
) -> Result < ( ) > {
171
- todo ! ( )
171
+ if let Some ( guest_span) = self
172
+ . state
173
+ . write ( )
174
+ . unwrap ( )
175
+ . guest_spans
176
+ . get_mut ( resource. rep ( ) )
177
+ {
178
+ guest_span. inner . set_status ( status. into ( ) ) ;
179
+ Ok ( ( ) )
180
+ } else {
181
+ Err ( anyhow ! ( "BUG: cannot find resource in table" ) )
182
+ }
172
183
}
173
184
174
185
async fn update_name ( & mut self , resource : Resource < traces:: Span > , name : String ) -> Result < ( ) > {
Original file line number Diff line number Diff line change @@ -311,4 +311,16 @@ mod observe {
311
311
) )
312
312
}
313
313
}
314
+
315
+ impl From < traces:: Status > for opentelemetry:: trace:: Status {
316
+ fn from ( status : traces:: Status ) -> Self {
317
+ match status {
318
+ traces:: Status :: Unset => Self :: Unset ,
319
+ traces:: Status :: Ok => Self :: Ok ,
320
+ traces:: Status :: Error ( s) => Self :: Error {
321
+ description : s. into ( ) ,
322
+ } ,
323
+ }
324
+ }
325
+ }
314
326
}
You can’t perform that action at this time.
0 commit comments