@@ -57,14 +57,15 @@ pub struct InstanceState {
57
57
impl SelfInstanceBuilder for InstanceState { }
58
58
59
59
impl InstanceState {
60
+ /// TODO comment
60
61
pub fn get_observe_context ( & self ) -> ObserveContext {
61
62
ObserveContext {
62
63
state : self . state . clone ( ) ,
63
64
}
64
65
}
65
66
}
66
67
67
- /// Internal state of the observe host component .
68
+ /// Internal state of the observe factor .
68
69
pub ( crate ) struct State {
69
70
/// A resource table that holds the guest spans.
70
71
pub guest_spans : table:: Table < GuestSpan > ,
@@ -83,14 +84,16 @@ pub struct GuestSpan {
83
84
pub inner : opentelemetry_sdk:: trace:: Span ,
84
85
}
85
86
87
+ /// TODO comment
86
88
pub struct ObserveContext {
87
89
pub ( crate ) state : Arc < RwLock < State > > ,
88
90
}
89
91
90
92
impl ObserveContext {
91
93
/// TODO comment
92
94
/// Make sure to mention this should only be called from an instrumented function in a factor.
93
- pub fn reparent_tracing_span_this_was_lanns_idea ( & self ) {
95
+ /// Make sure this is called before any awaits
96
+ pub fn reparent_tracing_span ( & self ) {
94
97
// TODO: Move this duplicate logic into its own impl
95
98
let state = self . state . read ( ) . unwrap ( ) ;
96
99
if state. active_spans . is_empty ( ) {
@@ -110,5 +113,4 @@ impl ObserveContext {
110
113
}
111
114
}
112
115
113
- // TODO(Caleb): Reorder things
114
116
// TODO(Caleb): Make otel a workspace dependency
0 commit comments