Skip to content

Conversation

@enixsoft
Copy link
Contributor

I found out the automatic transaction creation only happens when Sentry patches the http and https node modules. However, this patch is only applied after those modules are referenced in the application. In my project I had a preload file that used axios, and this alone has been triggering the module patch. Without this patch, you do not get the automatic transaction. So to make sure it's applied for everyone, let's do the import in the provider.

@enixsoft
Copy link
Contributor Author

enixsoft commented Mar 31, 2025

@RomainLanz
I found out that when you have multiple imports of the http and https modules (they get imported by axios), the module patching happens again and then you'll receive duplicate transactions and duplicate events from the same exact request. Hoping to resolve this in Sentry: getsentry/sentry-javascript#15830 but it's likely we'll need changes in this package as well.

@enixsoft
Copy link
Contributor Author

@RomainLanz

Sentry developers have fixed the issue with duplicated transactions in the version 9.16.0

This PR can be merged now, I have tested this using a patch and it seems to work fine.

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.

1 participant