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

Wrong transaction name if multiple routers match #6004

Closed
3 tasks done
Martomate opened this issue Oct 20, 2022 · 1 comment · Fixed by #6253
Closed
3 tasks done

Wrong transaction name if multiple routers match #6004

Martomate opened this issue Oct 20, 2022 · 1 comment · Fixed by #6253

Comments

@Martomate
Copy link

Martomate commented Oct 20, 2022

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.16.0

Framework Version

No response

Link to Sentry event

No response

Steps to Reproduce

My code looks roughly like this:

const app = express()

const APIv1 = Router()
APIv1.post('/test', ...)

const root = Router()

// Here's the important part
app.use('/api', root)
app.use('/api/v1', APIv1)

I then send POST /api/v1/test

Expected Result

The transaction name (in the Performance tab) should be POST /api/v1/test/

Actual Result

The transaction name is POST /api/api/v1/test/

It works if I swap the order of the routers:

app.use('/api/v1', APIv1)
app.use('/api', root)

This worked as expected in previous versions (at least in 6.17.8 but not in 7.13.0).

@Lms24
Copy link
Member

Lms24 commented Oct 21, 2022

Hi @Martomate thanks for reporting! Looks like our routing parameterization which we more or less fundamentally changed in #5450 has an issue then. I'll backlog this for now as we're very busy at the moment.

PRs are welcome as always, in case anyone wants to take a look at this.

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

Successfully merging a pull request may close this issue.

4 participants