Breadcrumbs Come to Node.js

Last year we announced a major new Sentry feature, breadcrumbs, supported by our biggest client libraries with one notable omission: Node.js.

This wasn’t an oversight. Node’s asynchronous nature and cooperative concurrency made breadcrumbs tricky to implement properly. To make it happen, we went back to the drawing board and reworked the Node client library’s internals and API, resulting in:

  • Proper asynchronous context tracking — think thread-local storage, but in a way that fits Node’s concurrency model
  • Callbacks better following Node’s “errback” convention and firing more intuitively
  • An API more closely resembling that of our browser JavaScript client; if you’ve used Raven-js before, Raven-node should feel familiar

But the most exciting part is that our Node client joins our browser JavaScript, Python, and PHP clients in having automatic breadcrumb support!

What are Breadcrumbs?

Breadcrumbs are a trail of events that occurred in your application leading up to a captured error. They can be as simple as generic logging messages, or they can contain rich metadata about the state of your application: network requests, database queries, UI events, navigation changes, or even earlier occurring errors.

Breadcrumbs

Breadcrumbs can be incredibly helpful in reproducing the steps that led to the error you’re debugging. They add critical context to errors that a stack trace alone can’t provide. Once you use them, you won’t go back.

Getting Started

Get the latest version of Raven-node, 1.1.1:

$ npm install raven@1.1.1

Import and initialize the client library with automatic breadcrumbs enabled:

var Raven = require('raven');
Raven.config('your-dsn').install({
  autoBreadcrumbs: true
});

Without any further setup, we’ll now automatically record a handful of useful breadcrumbs:

  • HTTP(S) requests via Node’s core modules
  • Log statements via console.log, console.warn, etc
  • PostgreSQL queries via the pg module

You can record your own custom breadcrumbs, too. In the example Express app below, a breadcrumb is captured to record the results of a cookie parsing step:

app.use(Raven.requestHandler());

// custom Express middleware
app.use(function (req, res, next) {
  // grab cookie headers, do some parsing
  Raven.captureBreadcrumb({
    message: 'Parsed cookie',
    category: 'log',
    data: {
      cookie: parsedCookie
    }
  });
  next();
});

app.get('/', function (req, res, next) {
  // do some route handling, knowing that if an exception happens here,
  // your parsed cookie breadcrumb will be associated with it in Sentry
});

app.use(Raven.errorHandler());

The Node client library’s Express middleware ensures that breadcrumbs captured in a route handler or middleware are associated with the correct request. You might use your own breadcrumbs to track major steps in your request handling pipeline, or to associate data that’s particularly useful for debugging.

For a more detailed summary of recent changes, take a look at the forum post announcement. Our Node client docs have also been updated to reflect the recent API changes and our new recommended usage patterns.

Looking Forward

Breadcrumbs for Node.js are still in the early phase, so we’re looking for feedback and suggestions on anything that we can make better or more useful. Our current plans are to tie automatic breadcrumbs into more database drivers and to eventually enable automatic breadcrumbs by default.

If you have feedback or run into trouble, let us know by posting on our forum or opening an issue on the raven-node GitHub repository.


Filtering Errors from Legacy Browsers

Older browser versions are well known for producing quirky errors that developers prefer to ignore. These errors are a distraction from the real bugs that need to be fixed, and can slowly eat away at your Sentry event quota if you don’t intend to fix them. Sentry provides controls that allow you to filter out these errors so you keep the noise down and don’t waste time and money tracking them.

Filter Legacy Browsers

Sentry previously let you toggle a single setting to filter out our recommended collection of legacy browser versions. Based on frequent requests, we’ve now added more granular customization so you can filter the specific browsers you do and do not want to pay attention to. When you use these filters, the discarded events will not count towards your event quota.

You can enable legacy browser filters in the inbound filters section of your project settings. We hope this feature helps you focus on the browser errors that are most important to you and your team!


Welcome Sam Warburg

We are excited to welcome Sam Warburg to our growth team.

Sam joins Sentry from Dropbox, where he was an early scaler on the enterprise sales team helping customers sync stuff to the cloud. At Sentry, Sam will help drive all things business and focus on delighting customers. When Sam’s not in the office, you can find him on a walk or at the park with his wife and one-year old daughter beat-bo’ing.


Looking Back on 2016

2016 was a big year for Sentry. It continued a test to see if we could turn a small idea into a big vision. Just a year prior there were only two of us with an overwhelming audience to support. We finally started to consider the potential and with that vision, began making our first hires. The last year was a continuation of that expedition. We built the team to an amazing 25 people while growing our footprint by an order of magnitude. Hundreds of thousands of developers have put their trust in Sentry to help them continuously ship software. The future is all about more of the past and executing on the trust you’ve given us.

Our 2015 post-mortem focused on the raw numbers — users, events, infrastructure stats, repo commits and contributors, and our team. This year we want to share more about the work we did to achieve these numbers.

Our mission has always been to help product teams ship more — quickly and safely — and to support our mission we needed more expertise in the many platforms developers use. That meant nearly tripling engineering, focusing on core product, supporting new languages, and scaling our operations. We also started building out the business side of Sentry - growth, marketing, finance, and customer ops teams are here to ensure that our customer experience is just as good as our product experience.

Keeping with our mission, our product team’s goal this year was simple: refine and iterate on what makes Sentry great. That included an overhaul of our alerts with the introduction of Workflow Notifications, enhancing events via Breadcrumbs and User Feedback, and improvements to privacy and security with Multi-Factor Auth and Privacy Shield. We also put a significant focus on JavaScript and PHP support, as well as launching the first end-to-end open source iOS Crash Reporting.

This year we mature as an organization, bringing important new challenges for the team. A key example of that is our recently launched billing model, the first major change to our business in half a decade. We’ve built Sentry as a developer-first business, and that means being ethical, fair, and accessible. Our approach to revenue – and your business – is no different. It builds on an absolute critical part of our core beliefs: everyone should be able to use Sentry, whether it’s for your side projects or your business. The first major change to our company drives that belief forward as much as ever.

While our mission stays the same, our ambitions are constantly advancing. We want to help great teams ship great software. To do that, we have to not only challenge how we build software, but also challenge the status quo. As we go into the next year we’re continuing to evaluate what Sentry has been and what it needs to be. We have lots of things in store for the coming months both for big and small teams, and we hope you’re as excited to see them as we are to share them.


A new pricing model

When we tell people that Sentry is completely open source, they usually follow up: Then why would I pay for your hosted service? Why not just host it myself? For our customers, the reasons vary—supporting open source, no setup, high availability, automatic upgrades, support, security—but they sum up to one idea: It’s easier.

Today, we add one more idea: It costs less.

We’re discarding our old, arbitrarily-capped plans and moving to a single, usage-based plan. The base price is $12/month and includes every feature, unlimited projects, unlimited users, and email support. You start at 50,000 events/month and for more events, you can either pay per event or prepay for discounts of up to 70%. Finally, you can stay on budget by setting your own spending caps or per-minute rate limits. This new pricing is available now to all new customers and will be rolled out to existing customers over the next few months.

We want our hosted service to be such good value, you’d be irresponsible to host it yourself. Achieving this required us to discard made-up caps and pare our pricing model down to its fundamentals: the underlying infrastructure cost of processing events. Price scales with event volume and gently curves down as we share our economies of scale by giving you better discounts. Even for bootstrapped startups, getting started with our hosted service is now cheaper (and by far easier) than hosting Sentry yourself on DigitalOcean, Google Compute Engine, or Amazon Web Services1.

Sentry pricing versus competitors

200 400 600 800 1000 1200 1400 1600 1800 2000 2200 2400 2600 2800 3000 $0.00 $250.00 $500.00 $750.00 $1,000.00 Event volume (in thousands of events/month)

When we set out to turn Sentry into a business, we stayed open source because we believe developers deserve flexibility and transparency in their infrastructure tools. With this new pricing model, we hope to provide that same flexibility and transparency in your billing. Check out our pricing page for details, including a pricing calculator for estimating your bill. If you have questions, you can look over our pricing FAQ or email us at hello@sentry.io.

P.S. If you’re still hellbent on forking and running an error reporting server yourself, maybe it’s time you considered a full-time job at Sentry.


  1. Minimum recommended specifications for Sentry server: 2GB RAM for web process, worker process, RabbitMQ, Redis, Postgres, email server. Comparison pricing uses Sentry annual plan, GCE 30% sustained used discounts, and AWS 1-year all upfront reserved instance discounts.

    Monthly cost of self-hosting versus hosted Sentry

    $20.00

    $15.50

    $12.42

    $12.00


    Digital Ocean

    GCE

    AWS

    Sentry paid plan

    • DigitalOcean (2GB RAM droplet): $20.00

    • GCE g1-small (shared vCPU, 1.7GB RAM, 10GB persistent SSD) $15.50

    • AWS t2.small (1 vCPU, 2GB RAM, 10GB EBS gp2 SSD) $12.42

    • Sentry paid plan: $12.00