MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / patchSpanEnd

Function patchSpanEnd

packages/opentelemetry/src/trace.ts:224–229  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

222 * are converted to milliseconds before reaching OTel's native `Span.end()`.
223 */
224function 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
231function getContext(scope: Scope | undefined, forceTransaction: boolean | undefined): Context {
232 const ctx = getContextForScope(scope);

Callers 2

_startSpanFunction · 0.70
startInactiveSpanFunction · 0.70

Calls 2

bindMethod · 0.80

Tested by

no test coverage detected