MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getTransactionName

Function getTransactionName

packages/remix/src/utils/utils.ts:121–135  ·  view source on GitHub ↗
(routes: AgnosticRouteObject[], url: URL)

Source from the content-addressed store, hash-verified

119 * Get transaction name from routes and url
120 */
121export function getTransactionName(routes: AgnosticRouteObject[], url: URL): [string, TransactionSource] {
122 const matches = matchServerRoutes(routes, url.pathname);
123 const match = matches && getRequestMatch(url, matches);
124
125 if (match === null) {
126 return [url.pathname, 'url'];
127 }
128
129 const routeId = match.route.id || 'no-route-id';
130
131 // Convert route ID to parameterized path (e.g., "routes/users.$id" -> "/users/:id")
132 // This is a pure string transformation that works without the Vite plugin manifest
133 const parameterizedPath = convertRemixRouteIdToPath(routeId);
134 return [parameterizedPath, 'route'];
135}
136
137/**
138 * Creates routes from the server route manifest

Callers 3

utils.test.tsFile · 0.90
updateSpanWithRouteFunction · 0.90
wrapRequestHandlerFunction · 0.90

Calls 1

Tested by

no test coverage detected