@@ -139,20 +139,10 @@ export function startTrace<T>(
139139 config = { } as traceConfig ;
140140 }
141141
142- let parentSpanId : string | undefined ;
143- if ( debugTraces ) {
144- const parentSpan = trace . getActiveSpan ( ) ;
145- parentSpanId = parentSpan ?. spanContext ( ) ! . spanId ;
146- }
147-
148142 return getTracer ( config . opts ?. tracerProvider ) . startActiveSpan (
149143 SPAN_NAMESPACE_PREFIX + '.' + spanNameSuffix ,
150144 { kind : SpanKind . CLIENT } ,
151145 span => {
152- if ( debugTraces ) {
153- patchSpanEndForDebugging ( span , spanNameSuffix , parentSpanId ) ;
154- }
155-
156146 span . setAttribute ( SEMATTRS_DB_SYSTEM , 'spanner' ) ;
157147 span . setAttribute ( ATTR_OTEL_SCOPE_NAME , TRACER_NAME ) ;
158148 span . setAttribute ( ATTR_OTEL_SCOPE_VERSION , TRACER_VERSION ) ;
@@ -309,23 +299,3 @@ class noopSpan implements Span {
309299 return this ;
310300 }
311301}
312-
313- function patchSpanEndForDebugging (
314- span : Span ,
315- spanNameSuffix : string ,
316- parentSpanId : string | undefined
317- ) {
318- console . trace (
319- `\x1b[33m${ spanNameSuffix } .start id=${ span . spanContext ( ) . spanId } with parentSpanId: ${ parentSpanId } \x1b[00m`
320- ) ;
321- const origSpanEnd = span . end ;
322- const wrapSpanEnd = function ( this : Span ) {
323- console . trace (
324- `\x1b[35m${ spanNameSuffix } .end() id=${ span . spanContext ( ) . spanId } with parentSpanId: ${ parentSpanId } \x1b[00m`
325- ) ;
326- return origSpanEnd . apply ( this ) ;
327- } ;
328- Object . defineProperty ( span , 'end' , {
329- value : wrapSpanEnd ,
330- } ) ;
331- }
0 commit comments