5 ways to reduce noise when logging your JavaScript exceptions

Posted by Daniel Steuernol on August 16, 2016 · poweruser, tutorial, javascript

 

Power User Series is a series in which we give you the tips, tricks and tutorials to get the most value from Rollbar and help you and your team become power users.


Developing and maintaing user facing software is a challenge and a very distracting one at that. :-) Often times it can be difficult trying to stay focused on what matters most. It can be hard to tell what's really broken and why, with dozens of alerts notifiying you every other minute. Volatile... The client-side being one of the most volatile of them all. 

When we attempt to capture errors in this environment we can very quickly get overwhelmed by lots and lots of noise. This noise is typically generated from many different places. Some examples would be old outdated browsers, browser extensions, third-party scripts, bots, spiders, etc. Rollbar's JavaScript error monitoring supports many different ways of reducing this noise so you can be more proactive in what and how you're collecting your JavaScript exceptions.

 

1. Ignore noisy errors on the client-side

Rollbar.js supports the ability to ignore errors on the client-side. This option is really great because you have access to the entire payload and can filter by any value in it. By doing this the error will never be sent to the Rollbar API. This is supported via the checkIgnore configuration option.

var _rollbarConfig = {
    ...
    checkIgnore: function(isUncaught, args, payload) {
        // Code here to determine whether or not to send the payload
        // to the Rollbar API
    }
    ...
};

 

Let's break down the function value. First the parameters passed to the function.

1. isUncaught : This is true if the error bubbled up to window.onerror or false if this came from one of the Rollbar.js logging methods

2. args : This is the args passed to the Rollbar.js logging method. If the error is uncaught and is from an unhandled rejection, the args parameter contains the Promise object.

3. payload : This is the payload that will be sent to the Rollbar API. You can use anything in the payload to conditionally filter these errors out.

To have Rollbar.js ignored the payload here, return true from the function, otherwise return false to continue processing and have the error sent to the Rollbar API.

 

Read More


Client-side error handling in Angular

Posted by Mike Smith on July 25, 2016 · javascript, angular, tutorial

 

AngularJS is a popular open-source JavaScript MVC framework that lets you build highly structured, testable, and maintainable front-end applications. Angular is most commonly used on single-page applications. Stable and reliable single page applications depend on solid client-side error logging tools and techniques. But, getting the right exception data and context isn't always easy. We're going to dive into how to capture, handle and debug Angular errors.

 

Error Logging in Angular with $exceptionHandler

Uncaught exceptions in AngularJS are all funneled through the $exceptionHandler service. Fantastic! This service is very simple by design. When unmodified, $exceptionHandler sends all uncaught exceptions to the $log.error service. The $log.error service passes the error through to the client's console.

Here is the structure for an $exceptionHandler call:

$exceptionHandler(exception, [cause]);


What is this? When we call $exceptionHandler, we can pass two arguments:

  • exception: The exception associated with the error the application encountered.
  • [cause]: Additional context about the cause of the exception.

The second argument, cause, is entirely optional. It can be helpful when writing exception handlers or adding external handling functionality.

 

Extended $exceptionHandler

If we let $exceptionHandler simply run on its own and logging uncaught exceptions to the console in production isn't very useful. Fortunately, Angular has a handful of ways to extend $exceptionHandler to take more action and gather more context when errors occur.

 

Basic Configuration

Here is the basic configuration setup for handling with $exceptionHandler:

angular.module('exceptionOverride', []).factory('$exceptionHandler',
  function() {}
);

 

Read More



Two-Factor Authentication now available for all users

Posted by Jesse Gibbs on June 23, 2016

 

We’re excited to introduce Two-Factor Authentication (2FA) in Rollbar as an optional extra layer of security on every user’s account. 2FA reduces your risk of having your account hacked through phishing, credential exploitation or other remote attacks.

We highly recommend enabling Two-Factor Authentication for your entire team. It’s easy to setup (and free)!

To enable 2FA, go to your user settings page and click Enable under Two-Factor Authentication. Then scan the QR code, and enter in your two-factor authentication verification token from an authentication app of your choice. One of the more popular authentication apps is Google Authenticator (available free for iOS and Android). Once you're all setup, you’ll be prompted for your token whenever you log in.

 

Read More


Exception monitoring for production environments

Posted by Hemant Jain on June 6, 2016

 

Hemant Jain is the founder and owner of Rapidera Technologies, a full-service software development shop and happy Rollbar customer. He and his team focus a lot on modern software delivery techniques and tools. Prior to Rapidera, he managed large enterprise development projects.


Tools like Rollbar have changed the way development teams are recording and managing their exceptions. What used to be a very personal developer-by-developer activity can now be a team-wide tool for greater transparency, and increased application quality.

But many still treat exception monitoring as a developer activity, and they are not leveraging its benefits across all environments, from development to stage and integration, to systems testing and production. In this post and another on QA environments, I will review why exception monitoring in all environments is so beneficial, and some best practices for setting it up.

We are trying to standardize with Rollbar for exception monitoring across environments and clients. It helps our clients have visibility and thus better input into the application and development processes, and it’s a good way for us to ensure quality prior to delivering releases to customers.

But even after release, the tool has been extremely useful for the following reasons:

 

1. It is needed to support CD and canary releases:

More and more we are asked to consider using continuous delivery (CD) and canary release processes. While in many cases it is not possible or a good fit, when we do get an opportunity to implement CD, exception monitoring is the only way to support it, because code goes from developer to source repo and directly to prod as long as the basic tests show up green. We know very little about the code, and do not have the eyeballs on exceptions that we normally would. This way, an exception in prod is just one more trigger to let us know that a release should be rolled back. We do the same for our server monitoring, so of course we should as well with code. We also use it to help with more supporting data in A/B testing of releases.

 

2. We cannot always ensure environment parity:

We do our best to ensure parity between all environments, but it’s simply not possible. Different applications have different requirements in terms of infrastructure. Our development environment is fairly static, and it is local. Production can be on different configurations, and even different clouds. So we are dealing with a hybrid scenario where for each client the production environment is unique. These variables can easily cause issues where the differences in the production environment compared to dev causes issues in code—things such as a mismatch on frameworks and other artifacts. When this happens, sometimes exception monitoring is the only way to know.

 

3. It is a Key Performance Indicator - accountability all the way to production:

I believe that all developers have increasing responsibility for what happens in production. But in our case, because we own the development processes of our clients, there is no question our developers are accountable for code quality all the way up to production. And the analytics we receive from Rollbar help us gauge how well our Dev groups are doing with code quality, where it matters the most—the user. This allows us to quantify the impact directly and leave no question as to how what happens in Dev impacts users.

 

Read More


Using Rollbar to unravel existing Laravel applications

Posted by Zachary Flower on May 24, 2016

 

Zachary Flower (@zachflower) is a freelance web developer, writer, and polymath. From building projects for the NSA to creating features for companies like Name.com and Buffer. Zach has always advocated for the use of well established third-party and open source services and solutions to improve the efficiency and reliability of a development project.


About 6 months ago I inherited a project (let’s call it Project Mayhem) that was grossly neglected by the original developer. I won’t go into too many details, but let’s just say that I’ve seen spaghetti with more order than this codebase had. No unit tests, no documentation, illogical architecture, and an expecting client… I felt like I was literally living in one of those nightmares where I’m late for the final exam in a class I passed a decade ago.

The icing on this terrible cake was that I also inherited the hosting and was graciously provided with absolutely no specs in order to replicate the previous production environment. I was flying blind, and if it weren’t for Rollbar's php error logging tools, this project would have crashed and burned long before I could make any meaningful changes to it. I was able to manage and prioritize exceptions as they happened, which gave me the information I needed to build out a proper hosting architecture and quickly fix existing issues in the codebase.

 

 

 

Read More


Streamline monitoring with Rollbar & Datadog

Posted by Mike Smith on April 25, 2016

Good news! We’ve recently released a new integration with Datadog to help extend your error monitoring options. Datadog is a leading cloud monitoring solution that brings metrics from all of your apps, tools & services (like Rollbar) into one place. Now Rollbar and Datadog users can syndicate exceptions, errors and code deployments as 'Events’ within Datadog (example below). 

 

 

Read More


6 ways to improve error grouping in Rollbar

Posted by Chris Pfohl on April 11, 2016 · poweruser

 

Power User Series is a series in which we give you the tips, tricks and tutorials to get the most value from Rollbar and help you and your team become power users.


You're two weeks into using Rollbar. You've watched in amazement as issue after issue comes in without a single customer complaint to accompany them. How did you ever find errors before!?

Now that your unresolved errors have drastically decreased, you've started to notice a handful of Rollbar items that all seem to be exactly the same issue. Maybe you've been notified that your UI has exceeded the maximum call stack when calling a particular function. And in one case you found out that your database is actually missing several columns which got grouped into a single error.

 

What's a new Rollbar user to do? Here's 6 steps to help you improve your error grouping in Rollbar:

 

1. Learn how Rollbar groups items.

The Rollbar grouping algorithm attempts to be as smart as possible by grouping items by root cause. Error type items are grouped by a combination of platform, environment, error class, and stack trace information. Message type items are grouped by message text after stripping out certain number-like and date-like portions of the message.

 

2. Customize your error grouping.

Custom grouping enables you to decide exactly how Rollbar will group your items. You can alter the title, change the fingerprinting (and therefore the grouping), and use any data you send to us to make it work!

 

3. Make sure you're setting the server root.

Before grouping by filename, Rollbar will strip off whatever you're sending in the server root segment. This means that you can host the code from varying locations, but still get the same grouping, no matter where on the system you host your code. Each notifier allows setting this in its own way. Check out the docs for your notifier to learn how!

 

Read More


Meet the Rollbar team IRL at these upcoming events

Posted by Mike Smith on March 25, 2016

Rollbar is hitting the road. Catch one (or more) or our team members at the following events in the next few months. We welcome the opportunity to talk to you about your projects, answer your questions and share some Rollbar swag. If you see us at an event, please stop by and say "Hi.”

 

Lone Star PHP

Where: Dallas, Texas   /  When: Fri, April 8 to Sat, April 9

The Lone Star PHP Conference brings together great PHP speakers and topics into a fantastic two-day event that is 'clap, clap, clap' deep in the heart of Texas. Catch me, Mike Smith (and local Texan) handing out Rollbar swag and making friends. ;)

 

EmberConf

Where: Portland, Oregon  /  When: Tues, March 29 to Wed, March 30

EmberConf is the flagship event of the Ember community. It’s two days of sessions, talks, and good times with the Ember Core Team and community members from around the world. Our CEO and Co-founder Brian Rue will be there, so say hi if you happen to see anyone in a Rollbar shirt.

 

Ruby On Ales

Where: Bend, Oregon  /  When: Thurs, March 31 to Fri, April 1

We’re ending our tour of Oregon at this years Ruby on Ales event. Ruby on Ales is a two-day single track Ruby conference, with a super cool name. It is two full days of presentations, networking and good ole fashion community fellowship.

 

Read More


Query Rollbar data directly from our API

Posted by Chris Pfohl on February 15, 2016

Good news for RQL users. Until recently RQL usage was limited to the Rollbar interface. That's no longer a problem. Now you can access RQL directly from our API.

We like to believe that our interface provides just about everything you need to discover, investigate and resolve errors in your software. That being said, we know that everyone's needs are not the same. So, we created the Rollbar Query Language (RQL for short) to give Rollbar users more controls over their data. Many of our users have grown to depend on RQL for getting their day to day work done.

Read More