Closed jahvi closed 3 years ago
A possibility is to follow along with https://docs.logrocket.com/docs/sentry and replacing the setExtra with setContext https://docs.sentry.io/platforms/javascript/enriching-events/context/#structured-context
This way you'd get a new fieldset with a Logrocket
heading and under this heading you can push any logrocket information.
It would be a nice addition
After some investigation this is not a problem with this module but the Sentry JS SDK itself. To summarise you can't use setContext
or setExtra
asynchronously with transactions.
This means it doesn't work for JS errors that trigger on page load but it works with errors that trigger afterwards (like AJAX requests, etc).
What we did was going the other way around, save the Sentry traceId
in LogRocket
so when an error is reported in Sentry we can find the session in LogRocket by filtering this value.
Do you want to request a feature or report a bug? Bug
Bug: What is the current behavior? The LogRocket sessionUrl does not show in Sentry's issue report when LogRocket is configured.
Bug: What is the expected behavior? The LogRocket sessionUrl should show in Sentry's issue report when LogRocket is configured.
Bug: What is the proposed solution? I'm not sure to be honest, here's a few things I tried but didn't help:
setContext
instead sincesetExtra
was deprecated.setTag("sessionUrl", sessionUrl)
.5.30.0
version of the JS SDK instead of5.28.0
.I can confirm LogRocket works as expected and the URL does get generated (I added a
console.log(sessionUrl)
and visiting the logged URL does show the session replay fine). I'm not sure if this is an issue with the module or LogRocket/Sentry.What is the version of Magento and of Sentry extension you are using? Always use the latest version of the extension one before opening a bug issue.
Magento 2.4.1 Module 2.5.0