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

LogRocket sessionUrl not set #72

Closed
jahvi opened this issue Jan 17, 2021 · 2 comments
Closed

LogRocket sessionUrl not set #72

jahvi opened this issue Jan 17, 2021 · 2 comments

Comments

@jahvi
Copy link

jahvi commented Jan 17, 2021

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.

Screenshot 2021-01-17 at 12 58 06

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:

  • Using setContext instead since setExtra was deprecated.
  • Adding it as a tag with setTag("sessionUrl", sessionUrl).
  • Using the latest 5.30.0 version of the JS SDK instead of 5.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

@indykoning
Copy link
Member

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

@jahvi
Copy link
Author

jahvi commented Mar 6, 2021

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.

@jahvi jahvi closed this as completed Mar 6, 2021
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

No branches or pull requests

2 participants