Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ae18128

Browse files
committed
adjust to trace origin scheme
1 parent 2b22edd commit ae18128

11 files changed

+16
-14
lines changed

‎packages/nextjs/src/common/captureRequestError.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function captureRequestError(error: unknown, request: RequestInfo, errorC
3838
captureException(error, {
3939
mechanism: {
4040
handled: false,
41-
type: 'nextjs.onRequestError',
41+
type: 'auto.function.nextjs.onRequestError',
4242
},
4343
});
4444

‎packages/nextjs/src/common/pages-router-instrumentation/_error.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export async function captureUnderscoreErrorException(contextOrProps: ContextOrP
4545
// is what passing a string to `captureException` will wind up doing)
4646
captureException(err || `_error.js called with falsy error (${err})`, {
4747
mechanism: {
48-
type: 'nextjs._error',
48+
type: 'auto.function.nextjs.underscoreError',
4949
handled: false,
5050
data: {
5151
function: '_error.getInitialProps',

‎packages/nextjs/src/common/pages-router-instrumentation/wrapApiHandlerWithSentry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export function wrapApiHandlerWithSentry(apiHandler: NextApiHandler, parameteriz
112112

113113
captureException(objectifiedErr, {
114114
mechanism: {
115-
type: 'nextjs.api',
115+
type: 'auto.http.nextjs.apiHandler',
116116
handled: false,
117117
data: {
118118
wrapped_handler: wrappingTarget.name,

‎packages/nextjs/src/common/pages-router-instrumentation/wrapPageComponentWithSentry.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function wrapPageComponentWithSentry(pageComponent: FunctionComponent | C
4848
captureException(e, {
4949
mechanism: {
5050
handled: false,
51-
type: 'nextjs.page.class',
51+
type: 'auto.function.nextjs.pageClass',
5252
},
5353
});
5454
throw e;
@@ -78,7 +78,7 @@ export function wrapPageComponentWithSentry(pageComponent: FunctionComponent | C
7878
captureException(e, {
7979
mechanism: {
8080
handled: false,
81-
type: 'nextjs.page.function',
81+
type: 'auto.function.nextjs.pageFunction',
8282
},
8383
});
8484
throw e;

‎packages/nextjs/src/common/utils/wrapperUtils.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function withErrorInstrumentation<F extends (...args: any[]) => any>(
2828
captureException(e, {
2929
// TODO: check if origFunction.name actually returns the correct name or minified garbage
3030
// in this case, we can add another argument to this wrapper with the respective function name
31-
mechanism: { handled: false, type: 'nextjs.wrapped', data: { function: origFunction.name } },
31+
mechanism: { handled: false, type: 'auto.function.nextjs.wrapped', data: { function: origFunction.name } },
3232
});
3333
throw e;
3434
}
@@ -103,7 +103,7 @@ export async function callDataFetcherTraced<F extends (...args: any[]) => Promis
103103
try {
104104
return await origFunction(...origFunctionArgs);
105105
} catch (e) {
106-
captureException(e, { mechanism: { handled: false, type: 'nextjs' } });
106+
captureException(e, { mechanism: { handled: false, type: 'auto.function.nextjs.dataFetcher' } });
107107
throw e;
108108
}
109109
}

‎packages/nextjs/src/common/withServerActionInstrumentation.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getClient,
88
getIsolationScope,
99
handleCallbackErrors,
10+
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
1011
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
1112
SPAN_STATUS_ERROR,
1213
startSpan,
@@ -116,6 +117,7 @@ async function withServerActionInstrumentationImplementation<A extends (...args:
116117
forceTransaction: true,
117118
attributes: {
118119
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
120+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nextjs.serverAction',
119121
},
120122
},
121123
async span => {
@@ -130,7 +132,7 @@ async function withServerActionInstrumentationImplementation<A extends (...args:
130132
captureException(error, {
131133
mechanism: {
132134
handled: false,
133-
type: 'nextjs.server-action',
135+
type: 'auto.function.nextjs.serverAction',
134136
},
135137
});
136138
}

‎packages/nextjs/src/common/wrapGenerationFunctionWithSentry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export function wrapGenerationFunctionWithSentry<F extends (...args: any[]) => a
144144
captureException(err, {
145145
mechanism: {
146146
handled: false,
147-
type: 'nextjs.generation-function',
147+
type: 'auto.function.nextjs.generationFunction',
148148
data: {
149149
function: generationFunctionIdentifier,
150150
},

‎packages/nextjs/src/common/wrapMiddlewareWithSentry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function wrapMiddlewareWithSentry<H extends EdgeRouteHandler>(
108108
error => {
109109
captureException(error, {
110110
mechanism: {
111-
type: 'nextjs.middleware',
111+
type: 'auto.function.nextjs.wrapMiddlewareWithSentry',
112112
handled: false,
113113
},
114114
});

‎packages/nextjs/src/common/wrapRouteHandlerWithSentry.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function wrapRouteHandlerWithSentry<F extends (...args: any[]) => any>(
9696
captureException(error, {
9797
mechanism: {
9898
handled: false,
99-
type: 'nextjs.route-handler',
99+
type: 'auto.function.nextjs.routeHandler',
100100
},
101101
});
102102
}

‎packages/nextjs/src/common/wrapServerComponentWithSentry.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
114114
name: `${componentType} Server Component (${componentRoute})`,
115115
attributes: {
116116
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',
117-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nextjs',
117+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.nextjs.serverComponent',
118118
'sentry.nextjs.ssr.function.type': componentType,
119119
'sentry.nextjs.ssr.function.route': componentRoute,
120120
},
@@ -136,7 +136,7 @@ export function wrapServerComponentWithSentry<F extends (...args: any[]) => any>
136136
captureException(error, {
137137
mechanism: {
138138
handled: false,
139-
type: 'nextjs.server-component',
139+
type: 'auto.function.nextjs.serverComponent',
140140
},
141141
});
142142
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /