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

Generated transaction name is wrong with express nested routers #2708

Closed
1 of 5 tasks
paullaffitte opened this issue Jun 30, 2020 · 1 comment · Fixed by #2714
Closed
1 of 5 tasks

Generated transaction name is wrong with express nested routers #2708

paullaffitte opened this issue Jun 30, 2020 · 1 comment · Fixed by #2714

Comments

@paullaffitte
Copy link

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

5.18.1

Description

Using express routers a middlewares, sentry create a transaction name including only the path in the last router.

Here is an example:

const express = require('express');
const Sentry = require('@sentry/node');

const app = express();
Sentry.init({ dsn: 'secret' });

const subRouter = express.Router();

subRouter.get('throw-new-error', (req, res) => {
  throw new Error('An error');
});

app.use(Sentry.Handlers.requestHandler());
app.use('/sub', subRouter);
app.use(Sentry.Handlers.errorHandler());

app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
});

So here, when I GET /sub/throw-new-error, the transaction name will be GET|/throw-new-error instead of GET|/sub/throw-new-error.

@HazAT
Copy link
Member

HazAT commented Jul 1, 2020

Thanks, we will fix this.

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 a pull request may close this issue.

2 participants