We used the instructions on GitHub https://github.com/xmatters/xm-labs-sentry to set up the Sentry integration. I am not familiar with Sentry at all and do not have access to it, so am relying on our Sentry admin. She has created several test alerts and most of them have been received by xMatters. I can see the payloads. A couple of alerts were not received. I do not know exactly what she is doing and do not know why some alerts are not received. For the ones that make it to xMatters, the payloads do not have all of the fields the xMatters script is looking for. One alert had a huge payload. The header did not include the name 'sentry-hook-resource' so there was nothing in the output fields. Another alert did include 'sentry-hook-resource' but the value was 'issue'. The script is looking for 'event_alert'. The payload was much smaller and did not include most of the fields the script is looking for.
So is this a problem with the Sentry set up? Is she not creating the right type of alert? Does the xMatters script need to be modified because it is outdated? She said Sentry has changed a bit from the time the documentation was written, and their webhook is now considered legacy.
Comments
Please sign in to leave a comment.
Hi Julia, some of the links to the Sentry documentation in the GitHub instructions are outdated - I'll see about getting them updated.
My first question is what types of events in Sentry do you want to trigger alerts in xMatters? There are a number of payloads Sentry can send, including, event_alert, issue, and metric_alert. You're right that the Inbound from Sentry trigger only supports event alerts (though we do have another trigger for metric alerts).
The alert with a huge payload sounds like an event_alert, though I don't know why it's not sending the 'sentry-hook-resource' header if that's the case. Looking at the structure of the event_alert payload in the Sentry docs - https://docs.sentry.io/product/integrations/integration-platform/webhooks/#payload-1 - does that look like what you're receiving?
Can you confirm if your Sentry admin has set up an Internal Integration - https://docs.sentry.io/product/integrations/integration-platform/#webhooks - and that the integration is added to any alert rules that should trigger a notification in xMatters?
However, it sounds like you're also getting an 'Issue' payload, which isn't supported by the github integration out of the box. If you want to alert on issues, you'd need to create a copy of the Inbound from Sentry trigger and edit the outputs and script to provide the information you need in the xMatters alert. For example, removing the URLs (since they're not available in the issue payload) and changing
to
And replacing 'timestamp' with 'firstSeen' or 'lastSeen', etc.
Thank you for your response. The large payload I received does not look like the payload in the documentation. It looks like what I pasted below. I have forwarded your response to our Sentry admin so she can verify her setup.
I think she was using the wrong token for that payload. She sent me a new token. But still some alerts are not being received. When verifying the setup, she noticed 2 check boxes in the webhooks section. She can check the issue box but not the error box. It says "Your organization does not have access to the error subscription resource." Would this cause event_alert to not be received? Why would we not have access to that resource?
Digging into their documentation, I think I can at least see why you're getting the message around the "error subscription resource". It sounds like a licensing issue. On the Webhooks page, in the Error section near the bottom, it mentions that's only available for Business plans and above. I'll see if I can get you some more information on why it's not sending event alerts.
Our Sentry admin thinks they need to be on the business plan in order for this integration to work but that doesn't make sense to me. The script is looking for “event_alert” in the Sentry-Hook-Resource field. This is different from “error” (the type of alert available for business plans) so I don’t think upgrading is necessary. I don’t know why the integration only includes event_alert unless that should be available for all types of plans. There must be some other reason why event_alert is not getting created and sent to xMatters.
Anyway, they are on the team plan so metric alerts should work. I found this documentation about metric alerts https://help.xmatters.com/ondemand/xmodwelcome/flowdesigner/sentry-steps.htm so I will work on that type of alert and hope it's what they want.