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.
When the SpanProcessor closes a span, before this commit, it would call
span.close()
, which would call theappsignal_close_span
function in the extension, which would override the end time passed as an argument when callingcreateOpenTelemetrySpan
.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 callsappsignal_close_span_with_timestamp
instead. This function already existed in the extension, but a NAPI bridge for it needed to be created.