Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(remix): Add transaction source #5398

Merged
merged 1 commit into from Jul 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion 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 @@ -114,7 +117,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.setName(matches[matches.length - 1].id, 'route');
}

isBaseLocation = true;
Expand All @@ -138,6 +141,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 @@ -183,6 +183,9 @@ function wrapRequestHandler(origRequestHandler: RequestHandler): RequestHandler
tags: {
method: request.method,
},
metadata: {
source: 'url',
},
});

if (transaction) {
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/transaction.ts
Expand Up @@ -72,7 +72,7 @@ export interface Transaction extends TransactionContext, Span {
/**
* Set the name of the transaction
*/
setName(name: string): void;
setName(name: string, source?: TransactionMetadata['source']): void;

/**
* Set observed measurement for this transaction.
Expand Down