Sourcegraph monitoring: setting up a Slack alert channel

  1. You need to access the Grafana instance running inside your Sourcegraph instance directly (as opposed to through the site admin Monitoring page). Please follow [these instructions](../monitoring_and_tracing.md#Accessing Grafana directly) to do that.

  2. You need to have Grafana admin privileges to set up a new alert channel. To do that append /login to the direct Grafana access URL you set up in step 1. If you are doing this the first time, use username/password admin/admin and then change to a password of your choice. Otherwise use your admin username/password combination.

  3. Click on the Bell icon on the left sidebar and select Notification channels.

  4. Click on Add Channel. and select Slack from the Type pulldown. Give the channel a name (this is to identify it in the Grafana alert channels list and does not specify to which Slack chnannel the alerts are going).

  5. In a separate browser tab go to https://api.slack.com/apps to create a new Slack App.

    1. Click Create an App button, give the new app a name and click Create App button.
    2. Click Incoming Webhooks and toggle Activate Incoming Webhooks to on.
    3. Click Add New Webhook to Workspace.
    4. Pick a channel where this Slack App will post and authorize.
    5. Copy the web hook.
  6. Paste the web hook into the channel form Url field.

  7. Test by clicking Send Test button. You should see a test alert in the Slack channel you selected when you created the web hook.

  8. If everything works, save your new alert channel.

Other alert channel types

Other alert channel types are configured in a way similar to the Slack alert channel type described above. Choose the appropriate channel type and provide the necessary information for that type.