pluralsh / plural

Enterprise Kubernetes management, accelerated. 🚀
https://www.plural.sh
Other
1.36k stars 64 forks source link

Slack For Incident Notifications #212

Open michaeljguarino opened 2 years ago

michaeljguarino commented 2 years ago

Use Case

We currently have a generic webhook systems incidents send to, which can be picked up by n8n or zapier for further integrations, but we should add first-order support for slack (and perhaps mattermost/teams?) since it'll be so useful

Ideas of Implementation


Message from the maintainers:

Excited about this feature? Give it a :thumbsup:. We factor engagement into prioritization.

gittysachin commented 2 years ago

Yes @michaeljguarino, we can start with the public slack app. We can add authentication to it as well. We can trigger the slack webhook from n8n as well but I have a few questions -

  1. should we be storing the event first in the database (queue where we keep track of all the messages sent or yet to be delivered) before/after sending the message?
  2. Is this feature going to be the only slack/teams message that gets delivered to users/channels or there's a set of slack/teams command we'll introduce that will enable users who have the slack/teams app integrated into their workspace, that will enable bi-directional communication (probably returning some data or approving something as per the slack/teams command request)?
michaeljguarino commented 2 years ago

The webhook system does persist into the database and retry so that should help with that. My thought was there should be webhook types for standard formats like slack, teams, etc and we add logic to change the way the event is delivered there from simply serializing the object to for instance generating a slack message using their block system

gittysachin commented 2 years ago

Yes @michaeljguarino, slack messages using blockit builder (blocks system) and similarly for teams (using adaptive cards designer) messages are doable.

michaeljguarino commented 2 years ago

With slack, you can set the webhook endpoint to an incoming webhook which doesn't need a secret, so that seems doable, we might need to store auth secrets for others though.

Ideally we make the big destinations like slack as first class citizens, then have generic webhooks for the rest of the usecase.

The eligible events are implemented here: https://github.com/pluralsh/plural/blob/master/apps/core/lib/core/pubsub/protocols/deliverable.ex and of course we can add others. We'll need to improve the payload function to support the various webhook types basically