Webhook/endpoint to create "incidents" in the system on-demand
Why do we need this ?
Currently the system relies on reverted PRs for CFR/MTTR data, only. With support for webhooks, we might be able to link a variety of third party incident management solutions to Middleware for better Dora metrics reporting.
Should be straight-forward enough.
@jayantbh could please assign this issue to me, i would like to build this feature.
@jayantbh I was researching the webhook implementation and just need a quick clarification: what specific fields/parameters should we expect from third-party systems for each incident? (I'm thinking incident ID, severity, description, detected timestamp).
https://github.com/middlewarehq/middleware/issues/562#issuecomment-2397665815
Please check out the guidelines in this issue. These two issues are very similar in implementation and would largely use the similar services and APIs that one of these issue end up implementing. So before we begin the implementation it is better to have the approach well discussed and documented here. This is a rather challenging and time taking task.
As for the what request body we want from the user, you can read through the incident service to get a better understanding of our system.
@xyfer17 @divyanshu-dj ^ the linked comment will offer much needed context.
@jayantbh @adnanhashmi09 Why use webhooks and not through rest api provided by incident management solutions?
A simple set of CRUD api endpoints for incidents would be highly beneficial for creating integrations into middleware. Linear B offers something similar: https://docs.linearb.io/api-incidents/ Many similarly for tracking deployments.
We plan to introduce webhooks first, allowing users to integrate their incident providers without requiring us to support each integration individually. Users can send data to us via the webhook—the same data we would otherwise fetch from the incident providers' REST APIs.