Keymetrics issues tutorial

Once your bucket is correctly linked to your server, you should have a similar view in your dashboard:

The errors count is 0, this means your application didn’t have any exception yet ! Lets see how that works.

Exceptions monitoring

As many of Keymetrics features, the issues reporting requires PMX to be installed on your project.

There are two ways to get errors reported in Keymetrics, catching uncaught exceptions and report custom ones. Let’s review them.

Catch uncaught exceptions

Let’s consider the following snippet somewhere in your code:

throw new Error("error message")

When pmx is correctly setup, it catches it and here is what happens:

It sends a notification to keymetrics, the error is then saved and increases the error count displayed on the dashboard:

A red counter also appears on the left-side menu when expanded:

The error is described in the issues tab:

If the email alerts are on for the exceptions alert (under the “Alerts” tab), an email is sent to you when the exception occurs for the first time. Otherwise it just increments the counters.

Custom issues

You can also emit your own issues using pmx.notify(). Given the following snippets:

pmx.notify(new Error('This is an error'));
pmx.notify({ success : false });

Here is what you will see in your “Issues” tab when both happen:

Bonus: Express middleware

pmx also comes with its own express middleware. All you need to do is to add the following line:


after the routes declaration.

Source map support

To enable the source map support you need to upgrade PM2 (