Skip to content

Commit

Permalink
ref(remix): Add transaction source
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed Jul 8, 2022
1 parent aeac69d commit 397c160
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/remix/src/performance/client.tsx
Expand Up @@ -66,6 +66,9 @@ export function remixRouterInstrumentation(useEffect: UseEffect, useLocation: Us
name: initPathName,
op: 'pageload',
tags: DEFAULT_TAGS,
metadata: {
source: 'url',
},
});
}

Expand Down Expand Up @@ -115,6 +118,7 @@ export function withSentry<P extends Record<string, unknown>, R extends React.FC
_useEffect(() => {
if (activeTransaction && matches && matches.length) {
activeTransaction.setName(matches[matches.length - 1].id);
activeTransaction.setMetadata({ source: 'route' });
}

isBaseLocation = true;
Expand All @@ -138,6 +142,9 @@ export function withSentry<P extends Record<string, unknown>, R extends React.FC
name: matches[matches.length - 1].id,
op: 'navigation',
tags: DEFAULT_TAGS,
metadata: {
source: 'route',
},
});
}
}, [location]);
Expand Down
3 changes: 3 additions & 0 deletions packages/remix/src/utils/instrumentServer.ts
Expand Up @@ -182,6 +182,9 @@ function wrapRequestHandler(origRequestHandler: RequestHandler): RequestHandler
tags: {
method: request.method,
},
metadata: {
source: 'url',
},
});

if (transaction) {
Expand Down

0 comments on commit 397c160

Please sign in to comment.