mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
fix(plugin-server): fixes timing for instrumented queries (#40990)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user