Skip to content

Commit 7bfdf80

Browse files
committed
fix more tests
1 parent 34becef commit 7bfdf80

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/nextjs/src/common/wrapApiHandlerWithSentry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '@sentry/core';
1010
import { consoleSandbox, isString, logger, objectify, stripUrlQueryAndFragment } from '@sentry/utils';
1111

12+
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
1213
import type { AugmentedNextApiRequest, AugmentedNextApiResponse, NextApiHandler } from './types';
1314
import { platformSupportsStreaming } from './utils/platformSupportsStreaming';
1415
import { flushQueue } from './utils/responseEnd';
@@ -108,9 +109,9 @@ export function withSentry(apiHandler: NextApiHandler, parameterizedRoute?: stri
108109
...transactionContext,
109110
name: `${reqMethod}${reqPath}`,
110111
op: 'http.server',
111-
origin: 'auto.http.nextjs',
112112
attributes: {
113113
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
114+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.nextjs',
114115
},
115116
metadata: {
116117
// eslint-disable-next-line deprecation/deprecation

packages/sveltekit/src/server/load.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* eslint-disable @sentry-internal/sdk/no-optional-chaining */
22
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getCurrentScope, startSpan } from '@sentry/core';
33
import { captureException } from '@sentry/node';
4-
import type { StartSpanOptions, TransactionContext } from '@sentry/types';
54
import { addNonEnumerableProperty, objectify } from '@sentry/utils';
65
import type { LoadEvent, ServerLoadEvent } from '@sveltejs/kit';
76

7+
import type { TransactionContext } from '@sentry/types';
88
import type { SentryWrappedFlag } from '../common/utils';
99
import { isHttpError, isRedirect } from '../common/utils';
1010
import { flushIfServerless, getTracePropagationData } from './utils';
@@ -65,7 +65,7 @@ export function wrapLoadWithSentry<T extends (...args: any) => any>(origLoad: T)
6565

6666
const routeId = event.route && event.route.id;
6767

68-
const traceLoadContext: StartSpanOptions = {
68+
const traceLoadContext: TransactionContext = {
6969
op: 'function.sveltekit.load',
7070
attributes: {
7171
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.sveltekit',
@@ -134,7 +134,7 @@ export function wrapServerLoadWithSentry<T extends (...args: any) => any>(origSe
134134
const { dynamicSamplingContext, traceparentData, propagationContext } = getTracePropagationData(event);
135135
getCurrentScope().setPropagationContext(propagationContext);
136136

137-
const traceLoadContext: StartSpanOptions = {
137+
const traceLoadContext: TransactionContext = {
138138
op: 'function.sveltekit.server.load',
139139
attributes: {
140140
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.sveltekit',

0 commit comments

Comments
 (0)