We are announcing our first open source package! With it, you can export issues from a Sentry project as a CSV.


When managing a system of any sort of complexity, monitoring becomes very important. Otherwise, one runs the risk of being overrun by errors, and losing the trust of your customers by being unable to solve their issues in a timely manner. At SparkMeter, we make extensive use of Sentry - it’s compatible with virtually every framework and stack we use, provides a great level of insight into errors, and has a capable rules system for routing errors, pushing notifications, and viewing aggregate stats.

Of course, all systems start simple… until they’re not. Sometimes that simple cron script morphs into a extremely popular microservice, and the seams start to show. In these cases, monitoring most likely wasn’t baked in from the get-go. Easy enough, just add Sentry, right?

Sure.

All of a sudden, your previously-peaceful #alerts Slack channel is overrun with alerts from this new system. A random sampling of the errors reveals that they run the gamut - from the serious to the erroneous. The correct thing to do here is not to turn off the notifications (although, temporarily silencing them is encouraged to avoid notification fatigue), but to address the root cause. Fixes for these errors could entail instructing Sentry to always ignore that class of error, fixing an underlying application bug, or changing your application to not trigger the error handler when it doesn’t need to.

Unfortunately, Sentry doesn’t provide a good interface for this sort of issue triage. When we encountered this very challenge, we turned to the most common catch-all interface for collaboration at our disposal - a spreadsheet. With a shared document, we can track all the errors from our new system over a period of time, perform root cause analysis, and determine the resolution (e.g, code change, configuration change, bug fix).

The challenge that we faced - how do we go from Sentry to a spreadsheet? Unfortunately, there was no “Download issues as a spreadsheet” option in the Sentry UI… but they offer an API! So we rolled up our sleeves, put on some jams, and sentry2csv (our first open-source project!) was born 🎉.

As the name suggests, by plugging in a Sentry API token and project information, one can dump all their issues into a Comma-Separated Values (CSV) file, which can then be imported into a multitude of spreadsheeting and data science tools.

Utilizing the Sentry API was fairly straightforward, with slight wrinkle: Sentry has the notion of events and issues. Events are individual signals (e.g., the occurrence of an error) that can be associated with at least one or more events, while issues are automatic groupings of similar events based on a set of rules. Since issues contain a basic set of event attributes, not all event fields are available in that object. Unfortunately, that included a field that mattered to us. Thus, the concept of “enrichments” was introduced. When supplied with the path to a value and a unique name for the field, sentry2csv can augment an issue with a field from the most recent event rolled up into the issue.

With the output of sentry2csv, we were able to wrangle the new system into our platform, quell the notification noise, and fix a few bugs along the way.

SparkMeter is currently hiring for a several developer roles. Head over to our Jobs page to apply!