pagerduty and sentry email integration

When adding a new generic email integration into PagerDuty, you are greeted with the following defaults:

Screenshot from 2015-12-15 13:54:18

If you are integrating with Sentry, then this default behavior will quickly annoy you because you will get a brand new PagerDuty incident each time someone makes a comment on the Sentry report.

Luckily, you can easily write rudimentary email filters in PagerDuty, but what to filter on?

It turns out that Sentry includes a plaintext section in the mails they send out, and there seems to be at least one regularly occurring pattern in new Sentry event mails, namely the string:

A new event has been recorded in Sentry:

Armed with this knowledge, we can write a simple PagerDuty filter so that new Sentry events create new PagerDuty incidents, but comments on existing Sentry events are ignored.

Screenshot from 2015-12-15 10:51:51

Things that make me sad:

  • no pre-canned Sentry integration in PagerDuty
  • PagerDuty email filters only work on subject line, body, and sender; why can’t I filter on the message headers?
  • Sentry includes an “ID” + a unique event identifier in their email, but only in the mail on the first event; on subsequent mails, the unique identifier is no longer present, which prevents me from writing a better filter in PagerDuty that could theoretically find the unique identifier and link followup emails together

So, I guess we are still stuck with “parsing email bodies as an API” 1990s Linux-landia. Won’t some nice VC throw a few hundred $million at this sure-to-be-a-unicorn market?