|
1 | 1 | /* eslint-disable @sentry-internal/sdk/no-optional-chaining */ |
2 | | -import { getCurrentScope, startSpan } from '@sentry/core'; |
| 2 | +import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getCurrentScope, startSpan } from '@sentry/core'; |
3 | 3 | import { captureException } from '@sentry/node'; |
4 | | -import type { TransactionContext } from '@sentry/types'; |
| 4 | +import type { StartSpanOptions, TransactionContext } from '@sentry/types'; |
5 | 5 | import { addNonEnumerableProperty, objectify } from '@sentry/utils'; |
6 | 6 | import type { LoadEvent, ServerLoadEvent } from '@sveltejs/kit'; |
7 | 7 |
|
@@ -65,9 +65,11 @@ export function wrapLoadWithSentry<T extends (...args: any) => any>(origLoad: T) |
65 | 65 |
|
66 | 66 | const routeId = event.route && event.route.id; |
67 | 67 |
|
68 | | - const traceLoadContext: TransactionContext = { |
| 68 | + const traceLoadContext: StartSpanOptions = { |
69 | 69 | op: 'function.sveltekit.load', |
70 | | - origin: 'auto.function.sveltekit', |
| 70 | + attributes: { |
| 71 | + [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.sveltekit', |
| 72 | + }, |
71 | 73 | name: routeId ? routeId : event.url.pathname, |
72 | 74 | status: 'ok', |
73 | 75 | metadata: { |
@@ -132,9 +134,11 @@ export function wrapServerLoadWithSentry<T extends (...args: any) => any>(origSe |
132 | 134 | const { dynamicSamplingContext, traceparentData, propagationContext } = getTracePropagationData(event); |
133 | 135 | getCurrentScope().setPropagationContext(propagationContext); |
134 | 136 |
|
135 | | - const traceLoadContext: TransactionContext = { |
| 137 | + const traceLoadContext: StartSpanOptions = { |
136 | 138 | op: 'function.sveltekit.server.load', |
137 | | - origin: 'auto.function.sveltekit', |
| 139 | + attributes: { |
| 140 | + [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.sveltekit', |
| 141 | + }, |
138 | 142 | name: routeId ? routeId : event.url.pathname, |
139 | 143 | status: 'ok', |
140 | 144 | metadata: { |
|
0 commit comments