How is my JavaScript Doing?

Rate this content
Bookmark

In this session, I’ll surface relevant context regarding crashes and performance issues in my JS-web-app. I’ll cover how to investigate errors and pinpoint where slowness is introduced.

This talk has been presented at DevOps.js Conf 2021, check out the latest edition of this Tech Conference.

FAQ

Sentry is a tool that monitors JavaScript applications, identifying when they are broken or slow. It provides detailed information on errors and performance issues, allowing developers to understand and address problems efficiently.

To integrate Sentry into a JavaScript application, you can use a CDN include, or install it via Yarn or NPM. After installation, initialize Sentry in your application using the Sentry.init function. Additionally, enable browser tracing and release health for comprehensive monitoring.

Sentry offers error tracking, performance monitoring, and release health tracking for JavaScript applications. It automatically de-obfuscates errors, aggregates data, and provides insights into the root causes of issues. Sentry also supports tracing performance issues to understand front-end and back-end delays.

Sentry automates the error detection and reporting process, providing developers with immediate notifications and detailed error information including the stack trace and the commit that caused the error. This allows developers to quickly assign and resolve issues without extensive debugging.

Sentry's performance monitoring tools help identify slowdowns in JavaScript applications, pinpointing whether issues are on the front-end, back-end, or related to HTTP requests. This enables developers to optimize application performance and improve user experience.

Yes, Sentry provides aggregate impact data showing how many users are affected by specific errors, which can help developers prioritize fixes based on the severity and reach of issues.

Release health tracking in Sentry monitors the stability and crash-free sessions of application releases. It is crucial for understanding the quality of new releases and ensuring that new features do not degrade the application's performance or user experience.

Yes, Sentry is currently offering three free months for new users. This promotion can be accessed by using a specific code provided on Sentry's website.

Neil Manvar
Neil Manvar
8 min
01 Jul, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Neil Manvar from Sentry discusses monitoring JS applications in deployed environments, focusing on error tracking and performance analysis. He explains how Sentry works, including its SDK integration and automatic error notification. The talk also covers analyzing errors and performance issues, and the benefits of integrating Sentry into applications. The summary concludes with a mention of a promotional offer for three free months of Sentry.

1. Introduction to Monitoring JS Applications

Short description:

Neil Manvar, Solutions Engineering Manager at Sentry, discusses monitoring JS applications in deployed environments. JavaScript is complex, especially on the client side. Sentry provides insights into broken or slow JS apps, with relevant data and information. Two journeys, errors and performance, will be explored and debugged.

Hi, my name is Neil Manvar, and I am a Solutions Engineering Manager at Sentry. Today, I'm going to be talking about how we can monitor our JS applications to figure out how they're behaving in the deployed environments and act on that information and go from there.

First, JavaScript is complicated, right? Since it runs in the browser, it's obfuscated, and when something goes wrong, whether it's an error or a slowdown, we don't always have the information that we need. At the same time, we're putting more and more and more of these applications out there, and we're trying to iterate on them faster and faster because that's how business is done, through the application layer now, and that's where more and more of the logic is going to live. And we are going to be iterating on this logic continuously.

Applications are growing more complex as well. It's not just back-ends and microservices, but there's more happening in the front end, there's more heavy lifting happening, and we're even doing things like micro front-ends to break these things out. And when things go wrong, it's a problem for everyone. Developers are being taken away from the things that they need to do, work on new features, and then fighting this fire. Customers are potentially going to customer, and metrics are being affected as well, right? For off-steam, it's the mean times for detection and remediation. Developers want to focus on the quality of the code, and the efficiency at which they can put it out. And the product team is looking at all of this in a big picture. Where revenue is affected, they want to get out all the new features at the appropriate time, and when velocity is compromised. So that's an issue.

So what can we do about it in the context of JavaScript applications? We have all the other monitoring regarding our infrastructure, but application stuff, especially when it's running on the client side, is very lacking. That's where Sentry's going to come in. It's going to tell you when your JS app is broken, when it's slow, and exactly why that is happening, and all of the relevant data and information regarding that. I'm going to take you through two journeys, errors and performance, and we'll go ahead and debug these things.

2. How Sentry Works

Short description:

Integrating Sentry's SDK is straightforward. Enable browser tracing, release health, and auto session tracking. With Sentry, errors are automatically notified and de-obfuscated. The Sentry issue provides detailed information, including the stack trace. De-obfuscated code shows exactly what went wrong. Sentry also shows the commit that caused the error.

But first, how does Sentry work? You integrate our SDK. It's super straightforward. So for JavaScript, you can do CDN include, or Yarn add, or NPM install, and then Sentry.init. And then for tracing or performance, we want to enable the browser tracing piece and the appropriate sample rate. And the last piece is that we also want to enable release health, which is going to be enabled by default. But you would do auto session tracking truth to explicitly enable it.

So I already have this set up in my app, which I'll show you shortly, but the configuration here is such, and I'm also uploading source maps to Sentry. So now let me just go cause an error. So here, let's check out. Looks like something went wrong. And if I wasn't using Sentry, I may or may not even have this information. And you can see it's obfuscated out to have to reproduce and debug and go from there. But since I am using Sentry, what's going to happen? And you can see this just came in. I'm automatically notified something is broken. And here is all of the appropriate information.

So what I'm looking at here is the Sentry issue and this will tell me the who, what, when, where, why of the error. Sentry will automatically de-obfuscate these errors and aggregate accordingly. So let's take a look. Looks like we got a 500 that happened 70,000 times affecting 33K users. It's been flaring up over the last 30 days. Looks like it's happening on these two browsers. Affecting these customers and production on this release. So I can understand the aggregate impact of this error and the data from there and I can see the event specific data right within here. All the attributes, most notably the stack trace.

So what you would have seen in the browser looked a little bit something like this. Sentry de-obfuscated it and then showed you the relevant frames and the context lines so we can see exactly what went wrong in the code. Looks like we didn't get a 200 from the back end, so an error was thrown. Then it looks like the customer was adding a bunch of things to the cart, clicked the checkout button, our back end returned with a 500 which bubbled up to window.onerror, and all the other information the SDK deems useful, they'll attach and you can custom attach as well. The point being is now I know the who, what, when, where and why right when it happened, I didn't have to go querying around or asking around and we don't just stop there. We'll even show you the commit that caused the error.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Levelling up Monorepos with npm Workspaces
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Levelling up Monorepos with npm Workspaces
Top Content
NPM workspaces help manage multiple nested packages within a single top-level package, improving since the release of NPM CLI 7.0. You can easily add dependencies to workspaces and handle duplications. Running scripts and orchestration in a monorepo is made easier with NPM workspaces. The npm pkg command is useful for setting and retrieving keys and values from package.json files. NPM workspaces offer benefits compared to Lerna and future plans include better workspace linking and adding missing features.
Automating All the Code & Testing Things with GitHub Actions
React Advanced Conference 2021React Advanced Conference 2021
19 min
Automating All the Code & Testing Things with GitHub Actions
Top Content
We will learn how to automate code and testing with GitHub Actions, including linting, formatting, testing, and deployments. Automating deployments with scripts and Git hooks can help avoid mistakes. Popular CI-CD frameworks like Jenkins offer powerful orchestration but can be challenging to work with. GitHub Actions are flexible and approachable, allowing for environment setup, testing, deployment, and custom actions. A custom AppleTools Eyes GitHub action simplifies visual testing. Other examples include automating content reminders for sharing old content and tutorials.
Fine-tuning DevOps for People over Perfection
DevOps.js Conf 2022DevOps.js Conf 2022
33 min
Fine-tuning DevOps for People over Perfection
Top Content
DevOps is a journey that varies for each company, and remote work makes transformation challenging. Pull requests can be frustrating and slow, but success stories like Mateo Colia's company show the benefits of deploying every day. Challenges with tools and vulnerabilities require careful consideration and prioritization. Investing in documentation and people is important for efficient workflows and team growth. Trust is more important than excessive control when deploying to production.
Why is CI so Damn Slow?
DevOps.js Conf 2022DevOps.js Conf 2022
27 min
Why is CI so Damn Slow?
Slow CI has a negative impact on productivity and finances. Debugging CI workflows and tool slowness is even worse. Dependencies impact CI and waiting for NPM or YARN is frustrating. The ideal CI job involves native programs for static jobs and lightweight environments for dynamic jobs. Improving formatter performance and linting is a priority. Performance optimization and fast tools are essential for CI and developers using slower hardware.
The Zen of Yarn
DevOps.js Conf 2022DevOps.js Conf 2022
31 min
The Zen of Yarn
Let's talk about React and TypeScript, Yarn's philosophy and long-term relevance, stability and error handling in Yarn, Yarn's behavior and open source sustainability, investing in maintenance and future contributors, contributing to the JavaScript ecosystem, open-source contribution experience, maintaining naming consistency in large projects, version consistency and strictness in Yarn, and Yarn 4 experiments for performance improvement.
Atomic Deployment for JS Hipsters
DevOps.js Conf 2024DevOps.js Conf 2024
25 min
Atomic Deployment for JS Hipsters
This Talk discusses atomic deployment for JavaScript and TypeScript, focusing on automated deployment processes, Git hooks, and using hard links to copy changes. The speaker demonstrates setting up a bare repository, configuring deployment variables, and using the post-receive hook to push changes to production. They also cover environment setup, branch configuration, and the build process. The Talk concludes with tips on real use cases, webhooks, and wrapping the deployment process.

Workshops on related topic

Deploying React Native Apps in the Cloud
React Summit 2023React Summit 2023
88 min
Deploying React Native Apps in the Cloud
WorkshopFree
Cecelia Martinez
Cecelia Martinez
Deploying React Native apps manually on a local machine can be complex. The differences between Android and iOS require developers to use specific tools and processes for each platform, including hardware requirements for iOS. Manual deployments also make it difficult to manage signing credentials, environment configurations, track releases, and to collaborate as a team.
Appflow is the cloud mobile DevOps platform built by Ionic. Using a service like Appflow to build React Native apps not only provides access to powerful computing resources, it can simplify the deployment process by providing a centralized environment for managing and distributing your app to multiple platforms. This can save time and resources, enable collaboration, as well as improve the overall reliability and scalability of an app.
In this workshop, you’ll deploy a React Native application for delivery to Android and iOS test devices using Appflow. You’ll also learn the steps for publishing to Google Play and Apple App Stores. No previous experience with deploying native applications is required, and you’ll come away with a deeper understanding of the mobile deployment process and best practices for how to use a cloud mobile DevOps platform to ship quickly at scale.
MERN Stack Application Deployment in Kubernetes
DevOps.js Conf 2022DevOps.js Conf 2022
152 min
MERN Stack Application Deployment in Kubernetes
Workshop
Joel Lord
Joel Lord
Deploying and managing JavaScript applications in Kubernetes can get tricky. Especially when a database also has to be part of the deployment. MongoDB Atlas has made developers' lives much easier, however, how do you take a SaaS product and integrate it with your existing Kubernetes cluster? This is where the MongoDB Atlas Operator comes into play. In this workshop, the attendees will learn about how to create a MERN (MongoDB, Express, React, Node.js) application locally, and how to deploy everything into a Kubernetes cluster with the Atlas Operator.
Azure Static Web Apps (SWA) with Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
13 min
Azure Static Web Apps (SWA) with Azure DevOps
WorkshopFree
Juarez Barbosa Junior
Juarez Barbosa Junior
Azure Static Web Apps were launched earlier in 2021, and out of the box, they could integrate your existing repository and deploy your Static Web App from Azure DevOps. This workshop demonstrates how to publish an Azure Static Web App with Azure DevOps.
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
DevOps.js Conf 2022DevOps.js Conf 2022
163 min
How to develop, build, and deploy Node.js microservices with Pulumi and Azure DevOps
Workshop
Alex Korzhikov
Andrew Reddikh
2 authors
The workshop gives a practical perspective of key principles needed to develop, build, and maintain a set of microservices in the Node.js stack. It covers specifics of creating isolated TypeScript services using the monorepo approach with lerna and yarn workspaces. The workshop includes an overview and a live exercise to create cloud environment with Pulumi framework and Azure services. The sessions fits the best developers who want to learn and practice build and deploy techniques using Azure stack and Pulumi for Node.js.