From 5e4803854bb8506f343bbf45202d721f6eb77790 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Mon, 21 Jul 2025 12:47:45 +0200 Subject: [PATCH 1/5] feat(astro): Server Request Route Parametrization --- .../astro-5/tests/tracing.dynamic.test.ts | 4 +- .../tests/tracing.serverIslands.test.ts | 2 +- .../astro-5/tests/tracing.static.test.ts | 2 +- packages/astro/src/integration/index.ts | 53 +++++++++++++++++-- packages/astro/src/integration/types.ts | 21 ++++++++ packages/astro/src/server/middleware.ts | 12 ++++- 6 files changed, 86 insertions(+), 8 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts index 9315d3d3ea84..9be5512d700d 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts @@ -245,7 +245,7 @@ test.describe('nested SSR routes (client, server, server request)', () => { // Server HTTP request transaction - should be parametrized (todo: currently not parametrized) expect(serverHTTPServerRequestTxn).toMatchObject({ - transaction: 'GET /api/user/myUsername123.json', // todo: should be parametrized to 'GET /api/user/[userId].json' + transaction: 'GET /api/user/[userId].json', transaction_info: { source: 'route' }, contexts: { trace: { @@ -294,7 +294,7 @@ test.describe('nested SSR routes (client, server, server request)', () => { }); expect(serverPageRequestTxn).toMatchObject({ - transaction: 'GET /catchAll/[path]', + transaction: 'GET /catchAll/[...path]', transaction_info: { source: 'route' }, contexts: { trace: { diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts index fc396999d76e..dda88afe4714 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.serverIslands.test.ts @@ -63,7 +63,7 @@ test.describe('tracing in static routes with server islands', () => { ]), ); - expect(baggageMetaTagContent).toContain('sentry-transaction=GET%20%2Fserver-island%2F'); // URL-encoded for 'GET /test-static/' + expect(baggageMetaTagContent).toContain('sentry-transaction=GET%20%2Fserver-island'); // URL-encoded for 'GET /server-island' expect(baggageMetaTagContent).toContain('sentry-sampled=true'); const serverIslandEndpointTxn = await serverIslandEndpointTxnPromise; diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.static.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.static.test.ts index 9db35c72a47d..90b26fb645e9 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.static.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.static.test.ts @@ -53,7 +53,7 @@ test.describe('tracing in static/pre-rendered routes', () => { type: 'transaction', }); - expect(baggageMetaTagContent).toContain('sentry-transaction=GET%20%2Ftest-static%2F'); // URL-encoded for 'GET /test-static/' + expect(baggageMetaTagContent).toContain('sentry-transaction=GET%20%2Ftest-static'); // URL-encoded for 'GET /test-static' expect(baggageMetaTagContent).toContain('sentry-sampled=true'); await page.waitForTimeout(1000); // wait another sec to ensure no server transaction is sent diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index 28092cad84be..27eb980e4263 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -1,14 +1,17 @@ -import { consoleSandbox } from '@sentry/core'; +import { readFileSync, writeFileSync } from 'node:fs'; +import { consoleSandbox, debug } from '@sentry/core'; import { sentryVitePlugin } from '@sentry/vite-plugin'; -import type { AstroConfig, AstroIntegration } from 'astro'; +import type { AstroConfig, AstroIntegration, RoutePart } from 'astro'; import * as fs from 'fs'; import * as path from 'path'; import { buildClientSnippet, buildSdkInitFileImportSnippet, buildServerSnippet } from './snippets'; -import type { SentryOptions } from './types'; +import type { IntegrationResolvedRoute, SentryOptions } from './types'; const PKG_NAME = '@sentry/astro'; export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { + let sentryServerInitPath: string | undefined; + return { name: PKG_NAME, hooks: { @@ -134,6 +137,8 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { injectScript('page-ssr', buildServerSnippet(options || {})); } + sentryServerInitPath = pathToServerInit; + // Prevent Sentry from being externalized for SSR. // Cloudflare like environments have Node.js APIs are available under `node:` prefix. // Ref: https://developers.cloudflare.com/workers/runtime-apis/nodejs/ @@ -165,6 +170,48 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { }); } }, + + // @ts-expect-error - This hook is available in Astro 5 + 'astro:routes:resolved': ({ routes }: { routes: IntegrationResolvedRoute[] }) => { + if (!sentryServerInitPath) { + return; + } + + /** + * Astro lowercases the parametrized route. Joining segments manually is recommended to get the correct casing of the routes. + * Recommendation in comment: https://github.com/withastro/astro/issues/13885#issuecomment-2934203029 + * Function Reference: https://github.com/joanrieu/astro-typed-links/blob/b3dc12c6fe8d672a2bc2ae2ccc57c8071bbd09fa/package/src/integration.ts#L16 + */ + const joinSegments = (segments: RoutePart[][]): string => { + const parthArray = segments.map(segment => + segment.map(routePart => (routePart.dynamic ? `[${routePart.content}]` : routePart.content)).join(''), + ); + + return `/${parthArray.join('/')}`; + }; + + try { + const serverInitContent = readFileSync(sentryServerInitPath, 'utf8'); + + const updatedServerInitContent = `${serverInitContent}\nglobalThis["__sentryRouteInfo"] = ${JSON.stringify( + routes.map(route => { + return { + ...route, + patternCaseSensitive: joinSegments(route.segments), // Store parametrized routes with correct casing on `globalThis` to be able to use them on the server during runtime + patternRegex: route.patternRegex.source, // using `source` to be able to serialize the regex + }; + }), + null, + 2, + )};`; + + writeFileSync(sentryServerInitPath, updatedServerInitContent, 'utf8'); + + debug.log('Successfully added route pattern information to Sentry server file:', sentryServerInitPath); + } catch (error) { + debug.warn(`Failed to write to sentry client init file at ${sentryServerInitPath}:`, error); + } + }, }, }; }; diff --git a/packages/astro/src/integration/types.ts b/packages/astro/src/integration/types.ts index 08a8635889fe..4caa90e24fbf 100644 --- a/packages/astro/src/integration/types.ts +++ b/packages/astro/src/integration/types.ts @@ -1,4 +1,5 @@ import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { InjectedRoute, RouteData } from 'astro'; type SdkInitPaths = { /** @@ -224,3 +225,23 @@ export type SentryOptions = SdkInitPaths & debug?: boolean; // eslint-disable-next-line deprecation/deprecation } & DeprecatedRuntimeOptions; + +/** + * Inline type for official `IntegrationResolvedRoute` (only available after Astro v5) + * The type includes more properties, but we only need some of them. + * + * @see https://github.com/withastro/astro/blob/04e60119afee668264a2ff6665c19a32150f4c91/packages/astro/src/types/public/integrations.ts#L287 + */ +export type IntegrationResolvedRoute = InjectedRoute & { + patternRegex: RouteData['pattern']; + segments: RouteData['segments']; +}; + +/** + * Internal type for Astro routes, as we store an additional `patternCaseSensitive` property alongside the + * lowercased parametrized `pattern` of each Astro route. + */ +export type ResolvedRouteWithCasedPattern = IntegrationResolvedRoute & { + patternRegex: string; // RegEx gets stringified + patternCaseSensitive: string; +}; diff --git a/packages/astro/src/server/middleware.ts b/packages/astro/src/server/middleware.ts index fb2f2e572fa4..ec1cac13cb2c 100644 --- a/packages/astro/src/server/middleware.ts +++ b/packages/astro/src/server/middleware.ts @@ -23,6 +23,7 @@ import { withIsolationScope, } from '@sentry/node'; import type { APIContext, MiddlewareResponseHandler } from 'astro'; +import type { ResolvedRouteWithCasedPattern } from '../integration/types'; type MiddlewareOptions = { /** @@ -95,6 +96,9 @@ async function instrumentRequest( addNonEnumerableProperty(locals, '__sentry_wrapped__', true); } + const storedBuildTimeRoutes = (globalThis as unknown as { __sentryRouteInfo?: ResolvedRouteWithCasedPattern[] }) + ?.__sentryRouteInfo; + const isDynamicPageRequest = checkIsDynamicPageRequest(ctx); const request = ctx.request; @@ -128,7 +132,13 @@ async function instrumentRequest( } try { - const interpolatedRoute = interpolateRouteFromUrlAndParams(ctx.url.pathname, ctx.params); + const contextWithRoutePattern = ctx as Parameters[0] & { routePattern?: string }; + const rawRoutePattern = contextWithRoutePattern.routePattern; + + const foundRoute = storedBuildTimeRoutes?.find(route => route.pattern === rawRoutePattern); + + const interpolatedRoute = + foundRoute?.patternCaseSensitive || interpolateRouteFromUrlAndParams(ctx.url.pathname, ctx.params); const source = interpolatedRoute ? 'route' : 'url'; // storing res in a variable instead of directly returning is necessary to // invoke the catch block if next() throws From abf9b5f58a39ac8aca7cf06878175b80cbd64b47 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Mon, 21 Jul 2025 13:02:58 +0200 Subject: [PATCH 2/5] refactor functions --- packages/astro/src/integration/index.ts | 74 +++++++++++++------------ 1 file changed, 40 insertions(+), 34 deletions(-) diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index 27eb980e4263..7e58ebdd9e1f 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -177,40 +177,7 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { return; } - /** - * Astro lowercases the parametrized route. Joining segments manually is recommended to get the correct casing of the routes. - * Recommendation in comment: https://github.com/withastro/astro/issues/13885#issuecomment-2934203029 - * Function Reference: https://github.com/joanrieu/astro-typed-links/blob/b3dc12c6fe8d672a2bc2ae2ccc57c8071bbd09fa/package/src/integration.ts#L16 - */ - const joinSegments = (segments: RoutePart[][]): string => { - const parthArray = segments.map(segment => - segment.map(routePart => (routePart.dynamic ? `[${routePart.content}]` : routePart.content)).join(''), - ); - - return `/${parthArray.join('/')}`; - }; - - try { - const serverInitContent = readFileSync(sentryServerInitPath, 'utf8'); - - const updatedServerInitContent = `${serverInitContent}\nglobalThis["__sentryRouteInfo"] = ${JSON.stringify( - routes.map(route => { - return { - ...route, - patternCaseSensitive: joinSegments(route.segments), // Store parametrized routes with correct casing on `globalThis` to be able to use them on the server during runtime - patternRegex: route.patternRegex.source, // using `source` to be able to serialize the regex - }; - }), - null, - 2, - )};`; - - writeFileSync(sentryServerInitPath, updatedServerInitContent, 'utf8'); - - debug.log('Successfully added route pattern information to Sentry server file:', sentryServerInitPath); - } catch (error) { - debug.warn(`Failed to write to sentry client init file at ${sentryServerInitPath}:`, error); - } + includeRouteDataToConfigFile(sentryServerInitPath, routes); }, }, }; @@ -318,3 +285,42 @@ export function getUpdatedSourceMapSettings( return { previousUserSourceMapSetting, updatedSourceMapSetting }; } + +/** + * Join Astro route segments into a case-sensitive single path string. + * + * Astro lowercases the parametrized route. Joining segments manually is recommended to get the correct casing of the routes. + * Recommendation in comment: https://github.com/withastro/astro/issues/13885#issuecomment-2934203029 + * Function Reference: https://github.com/joanrieu/astro-typed-links/blob/b3dc12c6fe8d672a2bc2ae2ccc57c8071bbd09fa/package/src/integration.ts#L16 + */ +function joinRouteSegments(segments: RoutePart[][]): string { + const parthArray = segments.map(segment => + segment.map(routePart => (routePart.dynamic ? `[${routePart.content}]` : routePart.content)).join(''), + ); + + return `/${parthArray.join('/')}`; +} + +function includeRouteDataToConfigFile(sentryInitPath: string, routes: IntegrationResolvedRoute[]): void { + try { + const serverInitContent = readFileSync(sentryInitPath, 'utf8'); + + const updatedServerInitContent = `${serverInitContent}\nglobalThis["__sentryRouteInfo"] = ${JSON.stringify( + routes.map(route => { + return { + ...route, + patternCaseSensitive: joinRouteSegments(route.segments), // Store parametrized routes with correct casing on `globalThis` to be able to use them on the server during runtime + patternRegex: route.patternRegex.source, // using `source` to be able to serialize the regex + }; + }), + null, + 2, + )};`; + + writeFileSync(sentryInitPath, updatedServerInitContent, 'utf8'); + + debug.log('Successfully added route pattern information to Sentry config file:', sentryInitPath); + } catch (error) { + debug.warn(`Failed to write to Sentry config file at ${sentryInitPath}:`, error); + } +} From 3a36e1af2f98dad89251b8e574a67d469e57ed43 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Mon, 21 Jul 2025 14:46:51 +0200 Subject: [PATCH 3/5] add test, some refactoring and fixes --- .../src/pages/user-page/settings.astro | 7 +++ .../astro-5/tests/tracing.dynamic.test.ts | 52 ++++++++++++++++++ packages/astro/src/integration/index.ts | 53 +++++++++---------- packages/astro/src/integration/types.ts | 10 ++-- packages/astro/src/server/middleware.ts | 11 ++-- 5 files changed, 98 insertions(+), 35 deletions(-) create mode 100644 dev-packages/e2e-tests/test-applications/astro-5/src/pages/user-page/settings.astro diff --git a/dev-packages/e2e-tests/test-applications/astro-5/src/pages/user-page/settings.astro b/dev-packages/e2e-tests/test-applications/astro-5/src/pages/user-page/settings.astro new file mode 100644 index 000000000000..8260e632c07b --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/astro-5/src/pages/user-page/settings.astro @@ -0,0 +1,7 @@ +--- +import Layout from '../../layouts/Layout.astro'; +--- + + +

User Settings

+
diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts index 9be5512d700d..2d322d8c10c1 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts @@ -312,3 +312,55 @@ test.describe('nested SSR routes (client, server, server request)', () => { }); }); }); + +// Case for `user-page/[id]` vs. `user-page/settings` static routes +test.describe('parametrized vs static paths', () => { + test('should use static route name for static route in parametrized path', async ({ page }) => { + const clientPageloadTxnPromise = waitForTransaction('astro-5', txnEvent => { + return txnEvent?.transaction?.startsWith('/user-page/') ?? false; + }); + + const serverPageRequestTxnPromise = waitForTransaction('astro-5', txnEvent => { + return txnEvent?.transaction?.startsWith('GET /user-page/') ?? false; + }); + + await page.goto('/user-page/settings'); + + const clientPageloadTxn = await clientPageloadTxnPromise; + const serverPageRequestTxn = await serverPageRequestTxnPromise; + + expect(clientPageloadTxn).toMatchObject({ + transaction: '/user-page/settings', // todo: parametrize to '/catchAll/[...path]' + transaction_info: { source: 'url' }, + contexts: { + trace: { + op: 'pageload', + origin: 'auto.pageload.browser', + data: { + 'sentry.op': 'pageload', + 'sentry.origin': 'auto.pageload.browser', + 'sentry.source': 'url', + }, + }, + }, + }); + + expect(serverPageRequestTxn).toMatchObject({ + transaction: 'GET /user-page/settings', + transaction_info: { source: 'route' }, + contexts: { + trace: { + op: 'http.server', + origin: 'auto.http.astro', + data: { + 'sentry.op': 'http.server', + 'sentry.origin': 'auto.http.astro', + 'sentry.source': 'route', + url: expect.stringContaining('/user-page/settings'), + }, + }, + }, + request: { url: expect.stringContaining('/user-page/settings') }, + }); + }); +}); diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index 7e58ebdd9e1f..432eccec2d42 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -12,6 +12,8 @@ const PKG_NAME = '@sentry/astro'; export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { let sentryServerInitPath: string | undefined; + let didSaveRouteData = false; + return { name: PKG_NAME, hooks: { @@ -171,13 +173,34 @@ export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { } }, - // @ts-expect-error - This hook is available in Astro 5 + // @ts-expect-error - This hook is available in Astro 5+ 'astro:routes:resolved': ({ routes }: { routes: IntegrationResolvedRoute[] }) => { - if (!sentryServerInitPath) { + if (!sentryServerInitPath || didSaveRouteData) { return; } - includeRouteDataToConfigFile(sentryServerInitPath, routes); + try { + const serverInitContent = readFileSync(sentryServerInitPath, 'utf8'); + + const updatedServerInitContent = `${serverInitContent}\nglobalThis["__sentryRouteInfo"] = ${JSON.stringify( + routes.map(route => { + return { + ...route, + patternCaseSensitive: joinRouteSegments(route.segments), // Store parametrized routes with correct casing on `globalThis` to be able to use them on the server during runtime + patternRegex: route.patternRegex.source, // using `source` to be able to serialize the regex + }; + }), + null, + 2, + )};`; + + writeFileSync(sentryServerInitPath, updatedServerInitContent, 'utf8'); + + didSaveRouteData = true; // Prevents writing the file multiple times during runtime + debug.log('Successfully added route pattern information to Sentry config file:', sentryServerInitPath); + } catch (error) { + debug.warn(`Failed to write to Sentry config file at ${sentryServerInitPath}:`, error); + } }, }, }; @@ -300,27 +323,3 @@ function joinRouteSegments(segments: RoutePart[][]): string { return `/${parthArray.join('/')}`; } - -function includeRouteDataToConfigFile(sentryInitPath: string, routes: IntegrationResolvedRoute[]): void { - try { - const serverInitContent = readFileSync(sentryInitPath, 'utf8'); - - const updatedServerInitContent = `${serverInitContent}\nglobalThis["__sentryRouteInfo"] = ${JSON.stringify( - routes.map(route => { - return { - ...route, - patternCaseSensitive: joinRouteSegments(route.segments), // Store parametrized routes with correct casing on `globalThis` to be able to use them on the server during runtime - patternRegex: route.patternRegex.source, // using `source` to be able to serialize the regex - }; - }), - null, - 2, - )};`; - - writeFileSync(sentryInitPath, updatedServerInitContent, 'utf8'); - - debug.log('Successfully added route pattern information to Sentry config file:', sentryInitPath); - } catch (error) { - debug.warn(`Failed to write to Sentry config file at ${sentryInitPath}:`, error); - } -} diff --git a/packages/astro/src/integration/types.ts b/packages/astro/src/integration/types.ts index 4caa90e24fbf..aed2b7e1d193 100644 --- a/packages/astro/src/integration/types.ts +++ b/packages/astro/src/integration/types.ts @@ -1,5 +1,5 @@ import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; -import type { InjectedRoute, RouteData } from 'astro'; +import type { RouteData } from 'astro'; type SdkInitPaths = { /** @@ -227,12 +227,16 @@ export type SentryOptions = SdkInitPaths & } & DeprecatedRuntimeOptions; /** - * Inline type for official `IntegrationResolvedRoute` (only available after Astro v5) + * Routes inside 'astro:routes:resolved' hook (Astro v5+) + * + * Inline type for official `IntegrationResolvedRoute`. * The type includes more properties, but we only need some of them. * * @see https://github.com/withastro/astro/blob/04e60119afee668264a2ff6665c19a32150f4c91/packages/astro/src/types/public/integrations.ts#L287 */ -export type IntegrationResolvedRoute = InjectedRoute & { +export type IntegrationResolvedRoute = { + isPrerendered: RouteData['prerender']; + pattern: RouteData['route']; patternRegex: RouteData['pattern']; segments: RouteData['segments']; }; diff --git a/packages/astro/src/server/middleware.ts b/packages/astro/src/server/middleware.ts index ec1cac13cb2c..ec9b8cd2f82f 100644 --- a/packages/astro/src/server/middleware.ts +++ b/packages/astro/src/server/middleware.ts @@ -132,14 +132,15 @@ async function instrumentRequest( } try { + // `routePattern` is available after Astro 5 const contextWithRoutePattern = ctx as Parameters[0] & { routePattern?: string }; const rawRoutePattern = contextWithRoutePattern.routePattern; - const foundRoute = storedBuildTimeRoutes?.find(route => route.pattern === rawRoutePattern); - const interpolatedRoute = + const parametrizedRoute = foundRoute?.patternCaseSensitive || interpolateRouteFromUrlAndParams(ctx.url.pathname, ctx.params); - const source = interpolatedRoute ? 'route' : 'url'; + + const source = parametrizedRoute ? 'route' : 'url'; // storing res in a variable instead of directly returning is necessary to // invoke the catch block if next() throws @@ -158,12 +159,12 @@ async function instrumentRequest( attributes['http.fragment'] = ctx.url.hash; } - isolationScope?.setTransactionName(`${method} ${interpolatedRoute || ctx.url.pathname}`); + isolationScope?.setTransactionName(`${method} ${parametrizedRoute || ctx.url.pathname}`); const res = await startSpan( { attributes, - name: `${method} ${interpolatedRoute || ctx.url.pathname}`, + name: `${method} ${parametrizedRoute || ctx.url.pathname}`, op: 'http.server', }, async span => { From 78dff8a8ea7accd40ec8007054ae9b70819b9947 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Mon, 21 Jul 2025 14:48:07 +0200 Subject: [PATCH 4/5] delete line --- packages/astro/src/integration/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index 432eccec2d42..69564fcc6535 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -11,7 +11,6 @@ const PKG_NAME = '@sentry/astro'; export const sentryAstro = (options: SentryOptions = {}): AstroIntegration => { let sentryServerInitPath: string | undefined; - let didSaveRouteData = false; return { From 94e18a7a13a6a0500fc386b64edbcdd8299acf09 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Mon, 21 Jul 2025 14:50:36 +0200 Subject: [PATCH 5/5] remove outdated comments --- .../test-applications/astro-5/tests/tracing.dynamic.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts index 2d322d8c10c1..8267adcb4ea9 100644 --- a/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts +++ b/dev-packages/e2e-tests/test-applications/astro-5/tests/tracing.dynamic.test.ts @@ -243,7 +243,7 @@ test.describe('nested SSR routes (client, server, server request)', () => { }, }); - // Server HTTP request transaction - should be parametrized (todo: currently not parametrized) + // Server HTTP request transaction expect(serverHTTPServerRequestTxn).toMatchObject({ transaction: 'GET /api/user/[userId].json', transaction_info: { source: 'route' }, @@ -330,7 +330,7 @@ test.describe('parametrized vs static paths', () => { const serverPageRequestTxn = await serverPageRequestTxnPromise; expect(clientPageloadTxn).toMatchObject({ - transaction: '/user-page/settings', // todo: parametrize to '/catchAll/[...path]' + transaction: '/user-page/settings', transaction_info: { source: 'url' }, contexts: { trace: {