appsignal / appsignal-nodejs

🟩 AppSignal for Node.js
https://www.appsignal.com/nodejs/
MIT License
28 stars 9 forks source link

Pass timestamp on OpenTelemetry span close #1064

Closed unflxw closed 2 months ago

unflxw commented 2 months ago

When the SpanProcessor closes a span, before this commit, it would call span.close(), which would call the appsignal_close_span function in the extension, which would override the end time passed as an argument when calling createOpenTelemetrySpan.

To fix this, pass the end time provided by OpenTelemetry again to span.close() when closing the span, re-wiring it so that, if a timestamp is passed, it calls appsignal_close_span_with_timestamp instead. This function already existed in the extension, but a NAPI bridge for it needed to be created.

luismiramirez commented 2 months ago

Related intercom conversation: https://app.intercom.com/a/inbox/yzor8gyw/inbox/conversation/16410700333561

unflxw commented 2 months ago

@luismiramirez Thank you! :)