diff --git a/js/util.ts b/js/util.ts index 3dcb19a..1a2f186 100644 --- a/js/util.ts +++ b/js/util.ts @@ -13,7 +13,11 @@ export function currentSpanTraced( if (globalThis.__inherited_braintrust_state) { const currentSpan = globalThis.__inherited_braintrust_state.currentSpan.getStore(); - return currentSpan.traced(name, (span: any) => callback(span.log), args); + return currentSpan.traced( + name, + (span: any) => callback(span.log.bind(span)), + args + ); } else { return callback(() => {}); }