Skip to content

[@sentry/tracing] Express custom middleware detection #2968

Closed
@xr0master

Description

@xr0master

Package + Version

@sentry/tracing 5.25.0

Description

The Performance is great at catching request, but does not detect custom middleware at all. I saw in the documentation how to manually add spans, but how to automate the process? How was express.json tagged as middleware/jsonParser?

Here is init

app.use(Sentry.Handlers.requestHandler());
app.use(Sentry.Handlers.tracingHandler());
app.use(express.json({limit: '25mb'}));
app.use(Sentry.Handlers.errorHandler());

This is an example with several custom middleware.

app.post('/api/send,
  UserController.isAuthenticated,
  SendEmailController.send,
  UserController.saveUserInCache,
);

Unfortunately, these middleware are not included in the report.
image

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions