* Wraps the span's `end()` method so that numeric timestamps passed in seconds * are converted to milliseconds before reaching OTel's native `Span.end()`.
(span: Span)
| 222 | * are converted to milliseconds before reaching OTel's native `Span.end()`. |
| 223 | */ |
| 224 | function patchSpanEnd(span: Span): void { |
| 225 | const originalEnd = span.end.bind(span); |
| 226 | span.end = (endTime?: TimeInput) => { |
| 227 | return originalEnd(typeof endTime === 'number' ? ensureTimestampInMilliseconds(endTime) : endTime); |
| 228 | }; |
| 229 | } |
| 230 | |
| 231 | function getContext(scope: Scope | undefined, forceTransaction: boolean | undefined): Context { |
| 232 | const ctx = getContextForScope(scope); |
no test coverage detected