Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Sentry's JavaScript Issues Offer Video That Shows Errors in the Browser

DZone's Guide to

Sentry's JavaScript Issues Offer Video That Shows Errors in the Browser

Sentry and SessionStack have joined forces combining advanced error tracking with video recording to offer full-blown context around how an error occurred.

· Web Dev Zone
Free Resource

Tips, tricks and tools for creating your own data-driven app, brought to you in partnership with Qlik.

Sentry

Sentry’s error tracking helps you log issues in web and mobile apps. With Sentry you can:

  • View code in stack traces.
  • See the error’s URL, parameters, and session information.
  • Filter noisy traces with the app, framework, and raw error views.
  • Get each error’s history of events and user interactions.

Sentry tracks errors in all major languages like JavaScript, PHP, Python, and Ruby.

SessionStack

SessionStack will re-create the user actions that led to an error and take the guesswork out of debugging for you. It will be continuously collecting details about all user actions, UI changes, page loads and browser info in the background while your web app is running. When your application crashes SessionStack will immediately notify you. It will recreate the collected user data as a video for you to see how the user got the error, complemented with a timeline with the stack traces of JavaScript errors, details of failed network requests, and debug messages that came up during the user session.

Integrating SessionStack is as simple as placing a lightweight JavaScript snippet in your web app (single-page applications including). SessionStack works on any web app regardless of what platform, framework, or language you use.

Sentry + SessionStack = Reproduce Issues Faster

Sentry and SessionStack partnered to offer full-blown context around how an error occurred. The two solutions now integrate to help you speed up debugging and focus on what you like doing: coding. If you are a Sentry user now you can complement your error reports with SessionStack’s visual recreation of user actions for every single issue in your web app. All you need to do to get going with it is follow the four simple steps below to integrate your Sentry project with SessionStack.

Image title

This is where the SessionStack user session recording can be found in your Sentry account.

How to Get Started

Are you a Sentry user? Here’s how to take advantage of this integration:

Step 1: Go register a free SessionStack account and add your web app.

Creating a new SessionStack app


Step 2: To integrate SessionStack, add the JavaScript snippet in the head element of your web app. An additional snippet will be needed to associate each Sentry event with its respective SessionStack user session at the correct time.

<!-- Begin SessionStack-Sentry code -->
<script type="text/javascript">
    sessionstack("getSessionId",function(s){s&&Raven.setDataCallback(function(t){return t
    .contexts=t.contexts||{},t.contexts.sessionstack={session_id:s,timestamp:(new Date).
    getTime()},t})});
</script>
<!-- End SessionStack-Sentry code -->


Step 3: Create a SessionStack API token which will be used in the next step to setup the integration from within your Sentry account.

SessionStack tokens


Step 4: Find the SessionStack plugin in your Sentry project settings and click on Configure plugin. Enter your SessionStack account email, the API Token you just created, and the ID of the website.

Configuring the SessionStack plugin within Sentry


That’s it! Now you’ll find the SessionStack play session button in your Sentry error reports.

The video will start playing 5 seconds before the event has occurred so you can see the user actions that lead to the error. This is the basic integration.

A SessionStack video of a JavaScript wrror within Sentry


Explore data-driven apps with less coding and query writing, brought to you in partnership with Qlik.

Topics:
javascript ,debug ,web dev ,error handling

Published at DZone with permission of Antonia Bozhkova, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}