-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.119.0
Framework Version
Express 4.18.2
Link to Sentry event
Reproduction Example/SDK Setup
import {init, Integrations, Handlers as SentryHandlers} from '@sentry/node';
import {ProfilingIntegration} from '@sentry/profiling-node';
import express from 'express';
const app = express();
init({
dsn: process.env.SENTRY_DSN,
environment: 'development',
integrations: [
new Integrations.Http({tracing: true}),
new Integrations.Express({app}),
new ProfilingIntegration(),
],
});
app.use(SentryHandlers.requestHandler());
app.use(SentryHandlers.tracingHandler());
app.use(
// /\/(?!foo)/, // ✅ parsed as [GET /debug-sentry/:test]
// /\/((?!foo).)/, // ❌ parsed as [GET /:0/debug-sentry/:test]
/\/((?!foo).)*/, // ❌ parsed as [GET /debug-sentry/hell:0/debug-sentry/:test]
(req, res, next) => {
next();
},
);
app.get('/debug-sentry/:test', (req, res) => {
throw new Error('My first Sentry error!');
});
// The error handler must be registered before any other error middleware and after all controllers
app.use(SentryHandlers.errorHandler());
app.listen(3000);
console.log('Server listening on port 3000');
Steps to Reproduce
Run above code in a single file. Then curl http://localhost:3000/debug-sentry/hello
Expected Result
All are parsed as GET /debug-sentry/:test
Actual Result
Metadata
Metadata
Assignees
Labels
Projects
Status
No status