UNPKG

@sentry/nextjs

Version:
22 lines (19 loc) • 669 B
import { SENTRY_OP, SENTRY_SEGMENT_NAME_SOURCE } from '@sentry/conventions/attributes'; import { spanToStaticSpanJSON } from '@sentry/core'; function createLiveRootSpanAdapter(span) { const attributes = spanToStaticSpanJSON(span).data; return { attributes, getName: () => spanToStaticSpanJSON(span).description, setName: (name) => { const source = attributes[SENTRY_SEGMENT_NAME_SOURCE]; span.updateName(name); span.setAttribute(SENTRY_SEGMENT_NAME_SOURCE, source); }, setOp: (op) => { span.setAttribute(SENTRY_OP, op); } }; } export { createLiveRootSpanAdapter }; //# sourceMappingURL=liveRootSpanAdapter.js.map