Opslane Slack Bot Introduction

Opslane connects to your Slack workspace and listens for incoming alerts. When it detects an alert, it will:

  • Analyze the alert using AI
  • Provide contextual information
  • Suggest potential actions
  • Respond in the message thread with insights

Setting up

Authorization

You must be an admin of the Slack workspace to set up the Opslane Slack bot.

  1. Go to https://api.slack.com/apps and sign in.
  2. Click the Create New App button in the top right.
  3. Select From an app manifest option.
  1. Choose your workspace from the dropdown and click Next.
  2. Select the “JSON” tab and paste the following manifest:

Replace xxx.ngrok.io with your external facing URL.

{
    "display_information": {
        "name": "Opslane"
    },
    "features": {
        "bot_user": {
            "display_name": "Opslane",
            "always_online": false
        },
        "slash_commands": [
            {
                "command": "/opslane",
                "url": "https://xxx.ngrok.io/slack/events",
                "description": "Opslane slash command",
                "usage_hint": "[query]",
                "should_escape": false
            }
        ]
    },
    "oauth_config": {
        "scopes": {
            "bot": [
                "app_mentions:read",
                "channels:history",
                "channels:read",
                "chat:write",
                "commands",
                "files:write",
                "groups:read",
                "mpim:read",
                "users:read"
            ]
        }
    },
    "settings": {
        "event_subscriptions": {
            "request_url": "https://xxx.ngrok.io/slack/events",
            "bot_events": [
                "member_joined_channel",
                "message.channels"
            ]
        },
        "interactivity": {
            "is_enabled": true,
            "request_url": "https://xxx.ngrok.io/slack/events"
        },
        "org_deploy_enabled": false,
        "socket_mode_enabled": false,
        "token_rotation_enabled": false
    }
}
  1. Click Next, then Create.
  2. Under the Basic Information, click on Show for the Signing Secret and save it in your .env file under SLACK_SIGNING_SECRET.
  1. Navigate to OAuth & Permissions under the Features section.
  2. Click Install to Workspace and allow the app.
  3. Copy the Bot User OAuth Token and save it in .env and assign to SLACK_BOT_TOKEN.

Configuring Opslane

  1. Update the follow env vars in .env:
SLACK_WORKSPACE=yourworkspace
SLACK_CHANNELS=alerts,dd-alerts

SLACK_WORKSPACE refers to the workspace name of your Slack installation. SLACK_CHANNELS refers to the channels where you receive your alerts.

  1. Add the Opslane bot to the channel where you receive your alerts by inviting (@opslane) to those channels.