Skip to content

Commit 6999a67

Browse files
committed
remove updateSpanName
1 parent a215c8c commit 6999a67

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

packages/nuxt/src/runtime/plugins/route-detector.server.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getActiveSpan, getRootSpan, logger, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, updateSpanName } from '@sentry/core';
1+
import { getActiveSpan, getRootSpan, logger, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';
22
import { defineNuxtPlugin } from 'nuxt/app';
33
import type { NuxtPage } from 'nuxt/schema';
44
import { extractParametrizedRouteFromContext } from '../utils/route-extraction';
@@ -32,18 +32,19 @@ export default defineNuxtPlugin(nuxtApp => {
3232
if (activeSpan && routeInfo.parametrizedRoute) {
3333
const rootSpan = getRootSpan(activeSpan);
3434

35-
if (rootSpan) {
36-
const method = ssrContext?.event?._method || 'GET';
37-
const parametrizedTransactionName = `${method.toUpperCase()} ${routeInfo.parametrizedRoute}`;
35+
if (!rootSpan) {
36+
return;
37+
}
3838

39-
logger.log('Updating root span name to:', parametrizedTransactionName);
40-
updateSpanName(rootSpan, parametrizedTransactionName);
39+
const method = ssrContext?.event?._method || 'GET';
40+
const parametrizedTransactionName = `${method.toUpperCase()} ${routeInfo.parametrizedRoute}`;
4141

42-
rootSpan.setAttributes({
43-
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
44-
'http.route': routeInfo.parametrizedRoute,
45-
});
46-
}
42+
logger.log('Matched parametrized server route:', parametrizedTransactionName);
43+
44+
rootSpan.setAttributes({
45+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',
46+
'http.route': routeInfo.parametrizedRoute,
47+
});
4748
}
4849
});
4950
});

0 commit comments

Comments
 (0)