Skip to content

Commit ba4a5e7

Browse files
authored
fix(remix): Strip query params from transaction names (#5368)
1 parent 1e3ba37 commit ba4a5e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/remix/src/utils/instrumentServer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { captureException, configureScope, getCurrentHub, startTransaction } from '@sentry/node';
22
import { getActiveTransaction } from '@sentry/tracing';
3-
import { addExceptionMechanism, fill, loadModule, logger } from '@sentry/utils';
3+
import { addExceptionMechanism, fill, loadModule, logger, stripUrlQueryAndFragment } from '@sentry/utils';
44

55
// Types vendored from @remix-run/server-runtime@1.6.0:
66
// https://github.com/remix-run/remix/blob/f3691d51027b93caa3fd2cdfe146d7b62a6eb8f2/packages/remix-server-runtime/server.ts
@@ -134,7 +134,7 @@ function wrapRequestHandler(origRequestHandler: RequestHandler): RequestHandler
134134
return async function (this: unknown, request: Request, loadContext?: unknown): Promise<Response> {
135135
const currentScope = getCurrentHub().getScope();
136136
const transaction = startTransaction({
137-
name: request.url,
137+
name: stripUrlQueryAndFragment(request.url),
138138
op: 'http.server',
139139
tags: {
140140
method: request.method,

0 commit comments

Comments
 (0)