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

[@sentry/tracing] Express route tracing #2972

Merged
merged 6 commits into from
Oct 19, 2020
Merged

[@sentry/tracing] Express route tracing #2972

merged 6 commits into from
Oct 19, 2020

Conversation

xr0master
Copy link
Contributor

Should add the ability to track express routes. What methods to track is set through options.
By default, methods are ignored.

Example:

  integrations: [
    // enable HTTP calls tracing
    new Sentry.Integrations.Http({ tracing: true }),
    // enable Express.js middleware tracing
    new Tracing.Integrations.Express({ app, methods: ['get', 'post'] }),
  ],
  tracesSampleRate: 1.0,

This PR is relevant to: #2968

@kamilogorek
Copy link
Contributor

kamilogorek commented Oct 16, 2020

Thanks for the PR, looks good! However, I think it should be possible to reuse the very same function for all possible router methods.

@xr0master
Copy link
Contributor Author

the use function is not a router method, so I hesitated to add it or not... I left it aside.
But I agree that it is possible to rewrite the code a bit to use the same logic.

@xr0master
Copy link
Contributor Author

With a new commit, the same logic was used.
use method has remained on the sidelines for now, it's easier to separate it from route methods. But if there is a goal to reduce the size, then we can use one function and inject the use method in the constructor.

@xr0master
Copy link
Contributor Author

Or use can work exactly like a route method, but then there is a chance that developers will forget to add this method or methods and Performance will be empty. But may be nothing wrong here.

@kamilogorek kamilogorek merged commit 57eaded into getsentry:master Oct 19, 2020
@kamilogorek
Copy link
Contributor

Thanks! :)

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 this pull request may close these issues.

None yet

2 participants