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

feat(react-router): Add sentryHandleRequest #15787

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from

Conversation

chargome
Copy link
Member

WIP

  • Adds a sentryHandleRequest method that instruments the default exported handleRequest in entry.server.tsx
  • If available, stores the parameterized route on a given trace context of a span (the default http integration marks all as e.g. GET *)
  • Registers a preprocessEvent callback on the node client for updating the http.route attribute and the transaction name

closes #15517

@chargome chargome self-assigned this Mar 23, 2025
const activeSpan = getActiveSpan();
if (activeSpan) {
const rootSpan = getRootSpan(activeSpan);
rootSpan.setAttribute(SENTRY_PARAMETERIZED_ROUTE, parameterizedPath);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we don't update the name of the root span here directly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this, but it got overwritten somehow

@lforst lforst assigned lforst and unassigned chargome Mar 26, 2025
@lforst
Copy link
Member

lforst commented Mar 31, 2025

I don't understand why http.route gets overridden with * majorly cursed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RR7] Instrument handleRequest hook
2 participants