Skip to content

Transaction route names showing up incorrectly as ' GET /api/api/api ' in Sentry performance monitoring #6097

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

Closed
3 tasks done
lesliewu1 opened this issue Oct 31, 2022 · 1 comment
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@lesliewu1
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/node

SDK Version

7.15

Framework Version

No response

Link to Sentry event

https://sentry.io/organizations/vontive/performance/summary/?environment=prod&project=1297687&query=transaction.duration%3A%3C15m&referrer=performance-transaction-summary&statsPeriod=14d&transaction=GET+%2Fapi%2Fapi%2Fapi&unselectedSeries=p100%28%29

Steps to Reproduce

  1. Mount multiple routers with the same prefix to the same express app. For example app.use(‘/’api’, ROUTER1); app.use(‘‘/’api’, ROUTER2)
    ROUTER1, ROUTER2 are two different routers say
    ROUTER1:
    GET /route1
    ROUTER2
    GET /route2
  2. Setup Sentry tracing following the docs: https://docs.sentry.io/platforms/node/guides/express/performance/
  3. Hit some routes that were registered using the multiple prefix registration from step 1
  4. Observe Performance Monitoring transaction route names in Sentry

Expected Result

Performance > Transaction Summary shows transaction URLS with /api/route1 and /api/route2
GET /api/schema/:entity

image

Actual Result

Performance > Transaction Summary shows transaction URLS with /api/api and /api/api
GET /api/api/api

image

Proposed workaround:

  • Consolidate to a single app.use(‘/api’, CONSOLIDATED_ROUTER)
  • Where CONSOLIDATED_ROUTER is:
  • const CONSOLIDATED_ROUTER = express.Router();
  • CONSOLIDATED_ROUTER.use(ROUTER1, ROUTER2);
  • app.use(‘api/’, CONSOLIDATED_ROUTER)
@AbhiPrasad
Copy link
Member

Hey @lesliewu1, this seems to be a duplicate of #6004, so closing this in favour of that.

If you have any ideas for improvements here, PRs are welcome, otherwise we are backlogging this issue.

@AbhiPrasad AbhiPrasad closed this as not planned Won't fix, can't repro, duplicate, stale Oct 31, 2022
@AbhiPrasad AbhiPrasad added the Package: node Issues related to the Sentry Node SDK label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
None yet
Development

No branches or pull requests

2 participants