diff --git a/apps/meteor/app/api/server/api.ts b/apps/meteor/app/api/server/api.ts index 25de5a6eb2a6..7bb7f5af28ba 100644 --- a/apps/meteor/app/api/server/api.ts +++ b/apps/meteor/app/api/server/api.ts @@ -660,9 +660,13 @@ export class APIClass extends Restivus { if (span) { this.response.setHeader('X-Trace-Id', span.spanContext().traceId); } - return ( - (await DDP._CurrentInvocation.withValue(invocation as any, async () => originalAction.apply(this))) || API.v1.success() - ); + + const result = + (await DDP._CurrentInvocation.withValue(invocation as any, async () => originalAction.apply(this))) || API.v1.success(); + + span?.setAttribute('status', result.statusCode); + + return result; }, );