fix(plugin-server): fixes timing for instrumented queries (#40990)

This commit is contained in:
Nick Best
2025-11-06 11:19:22 -08:00
committed by GitHub
parent 69c9b6e6c7
commit 691335bfad

View File

@@ -58,7 +58,7 @@ export function withTracingSpan<T>(
/**
* Wraps a function in an OpenTelemetry tracing span and logs the execution time as a summary metric.
*/
export function withSpan<T>(
export async function withSpan<T>(
tracer: Tracer | string,
name: string,
attrs: Attributes,
@@ -72,7 +72,7 @@ export function withSpan<T>(
.startTimer()
try {
return withTracingSpan(tracer, name, attrs, fn)
return await withTracingSpan(tracer, name, attrs, fn)
} finally {
stopTimer()
}