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

feat(nestjs): Update scope transaction name with parameterized route #11510

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Apr 9, 2024

This PR adds scope transactionName updating to our NestJS instrumentation. Similarly to Hapi and Fastify, we can use a framework-native component, an Interceptor, to assign the parameterized route.

The interesting part is that adding the interceptor almost wouldn't have been necessary: NestJS is built on top of express and apparently also allows to swap out express with Fastify or other frameworks. This causes our/Otel's express instrumentation to be initialized on app startup, already giving us a parameterized route via the express layer.

However, there's the use case of users disabling the express integration in which case I'd argue, the NestJS integration should still set the transactionName. Also, double-setting the name doesn't matter either so we're good.

ref #10846

@Lms24 Lms24 self-assigned this Apr 9, 2024
@Lms24 Lms24 merged commit 0896e4f into develop Apr 9, 2024
78 checks passed
@Lms24 Lms24 deleted the lms/feat-nestjs-update-scope-transactionName branch April 9, 2024 15:32
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
…etsentry#11510)

This PR adds scope transactionName updating to our NestJS
instrumentation. Similarly to Hapi and Fastify, we can use a
framework-native component, an Interceptor, to assign the parameterized
route.

ref getsentry#10846
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.

2 participants