Skip to content

Commit 2c6683f

Browse files
authored
ref(remix): Add transaction source (#5398)
1 parent 014fcf0 commit 2c6683f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/remix/src/performance/client.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export function remixRouterInstrumentation(useEffect: UseEffect, useLocation: Us
6666
name: initPathName,
6767
op: 'pageload',
6868
tags: DEFAULT_TAGS,
69+
metadata: {
70+
source: 'url',
71+
},
6972
});
7073
}
7174

@@ -114,7 +117,7 @@ export function withSentry<P extends Record<string, unknown>, R extends React.FC
114117

115118
_useEffect(() => {
116119
if (activeTransaction && matches && matches.length) {
117-
activeTransaction.setName(matches[matches.length - 1].id);
120+
activeTransaction.setName(matches[matches.length - 1].id, 'route');
118121
}
119122

120123
isBaseLocation = true;
@@ -138,6 +141,9 @@ export function withSentry<P extends Record<string, unknown>, R extends React.FC
138141
name: matches[matches.length - 1].id,
139142
op: 'navigation',
140143
tags: DEFAULT_TAGS,
144+
metadata: {
145+
source: 'route',
146+
},
141147
});
142148
}
143149
}, [location]);

packages/remix/src/utils/instrumentServer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ function wrapRequestHandler(origRequestHandler: RequestHandler): RequestHandler
183183
tags: {
184184
method: request.method,
185185
},
186+
metadata: {
187+
source: 'url',
188+
},
186189
});
187190

188191
if (transaction) {

packages/types/src/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface Transaction extends TransactionContext, Span {
7272
/**
7373
* Set the name of the transaction
7474
*/
75-
setName(name: string): void;
75+
setName(name: string, source?: TransactionMetadata['source']): void;
7676

7777
/**
7878
* Set observed measurement for this transaction.

0 commit comments

Comments
 (0)