File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -732,9 +732,9 @@ fn op_otel_instrumentation_scope_enter(
732
732
733
733
#[ op2( fast) ]
734
734
fn op_otel_instrumentation_scope_enter_builtin ( state : & mut OpState ) {
735
- state . put ( InstrumentationScope (
736
- BUILT_IN_INSTRUMENTATION_SCOPE . get ( ) . unwrap ( ) . clone ( ) ,
737
- ) ) ;
735
+ if let Some ( scope ) = BUILT_IN_INSTRUMENTATION_SCOPE . get ( ) {
736
+ state . put ( InstrumentationScope ( scope . clone ( ) ) ) ;
737
+ }
738
738
}
739
739
740
740
#[ op2( fast) ]
@@ -749,6 +749,9 @@ fn op_otel_log(
749
749
let Some ( Processors { logs, .. } ) = OTEL_PROCESSORS . get ( ) else {
750
750
return ;
751
751
} ;
752
+ let Some ( instrumentation_scope) = BUILT_IN_INSTRUMENTATION_SCOPE . get ( ) else {
753
+ return ;
754
+ } ;
752
755
753
756
// Convert the integer log level that ext/console uses to the corresponding
754
757
// OpenTelemetry log severity.
@@ -776,10 +779,7 @@ fn op_otel_log(
776
779
) ;
777
780
}
778
781
779
- logs. emit (
780
- & mut log_record,
781
- BUILT_IN_INSTRUMENTATION_SCOPE . get ( ) . unwrap ( ) ,
782
- ) ;
782
+ logs. emit ( & mut log_record, instrumentation_scope) ;
783
783
}
784
784
785
785
fn owned_string < ' s > (
Original file line number Diff line number Diff line change @@ -220,6 +220,7 @@ function submitSpan(
220
220
startTime : number ,
221
221
endTime : number ,
222
222
) {
223
+ if ( ! TRACING_ENABLED ) return ;
223
224
if ( ! ( traceFlags & TRACE_FLAG_SAMPLED ) ) return ;
224
225
225
226
// TODO(@lucacasonato): `resource` is ignored for now, should we implement it?
You can’t perform that action at this time.
0 commit comments