[TRI-2668] logger.trace should have the output as attributes
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.
@matt-aitken I would like to give it a attempt
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.
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