trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

[TRI-2668] logger.trace should have the output as attributes

Open matt-aitken opened this issue 1 year ago • 3 comments

If you return data from logger.trace it should appear in the OTEL attributes from the span.

const bar = await logger.trace('key', async() => { return foo });

The same as we do for attempts.

TRI-2668

matt-aitken avatar Jun 09 '24 10:06 matt-aitken

@matt-aitken I would like to give it a attempt

vr-varad avatar Jul 27 '24 09:07 vr-varad

Hi there, this is affecting us pretty much currently, since it's hard to debug complex runs when something goes wrong without having the context of what the data response was.

Would love to create a PR, just not sure where to start/what would have to be changed to archive this.

madebyfabian avatar Aug 21 '24 18:08 madebyfabian

We need to assign the result here, then set the result on span before returning the result. https://github.com/triggerdotdev/trigger.dev/blob/7ce8bd1acd9702ef576252d968956556f297e4a9/packages/core/src/v3/tracer.ts#L133

matt-aitken avatar Apr 02 '25 08:04 matt-aitken