Slack

Integrate Slack with Middleware to deliver alert notifications directly to your team's channels or threads. When OpsAI's automation is enabled, get root cause analysis posted directly in the same thread and ask OpsAI follow-up questions without leaving Slack.

What You Get#

  • Alert delivery from Middleware: Choose different Slack channels for each alert rule. For example, send infrastructure alerts to #ops-alerts and APM alerts to #backend-alerts.
  • Channel or thread delivery: Keep related alerts and discussions grouped together.
  • Automated root cause analysis: For OpsAI-enabled projects, root cause analysis and suggested remediation are posted as threaded replies under the original alert.
  • Two-way conversations with OpsAI: Mention @Middleware inside an OpsAI incident thread to ask a follow-up question. OpsAI posts its response back in the same thread.

Prerequisites#

Before connecting Slack, make sure you have:

  1. A Middleware account with admin access.
  2. A Slack workspace where you have permission to install apps. Depending on your workspace settings, Slack admin approval may be required.
  3. To use the "ask OpsAI a follow-up question" feature, OpsAI auto-investigation must be enabled for the relevant project. Go to SettingsOpsAIAuto Investigation.

During installation, Slack will display the permissions requested by the Middleware app. These typically include:

  • chat:write — Post messages as the app.
  • channels:read/groups:read — Read the channel list so you can select a destination when configuring alert rules.
  • app_mentions:read — Detect when you mention @Middleware inside an OpsAI incident thread.
  • assistant:write — Display a live status indicator while OpsAI processes your follow-up question.

Setup#

Follow these steps to connect Slack to your Middleware account:

  • Log in to Middleware and go to IntegrationsSlack.
  • Click the Install Slack button:
    Slack Install
  • Click Connect Slack and allow the requested permissions in Slack. If your workspace has app approvals enabled, a Slack admin may need to approve the app.
    Slack Install Redirect

Return to IntegrationsSlack in Middleware to verify that the installation shows as Connected.

Tip: To deliver alerts to private channels, the Slack bot must be a member of that channel. After connecting Slack, invite the bot to each private channel where you want to receive alerts (see instructions below).

Configure Alerts to a Slack Channel#

  1. In Middleware, open AlertsRules.

  2. Create a new alert rule or edit an existing one.

  3. Go to Aggregation & Medium, choose Slack, and select the channel where you want to receive notifications.

    Slack Alert Creation
  4. (Optional) Choose “Send in thread” to keep related alerts grouped under a parent message.

  5. Save the rule.

Message Content (what your team will see)#

Middleware includes the essential context responders need to investigate an alert quickly:

  • Alert name and severity
  • Service / environment / resource (when available)
  • Short description and relevant attributes
  • Direct link to the alert in Middleware for additional context

(Exact fields depend on the alert type and rule configuration.)

Ask OpsAI Follow-Up Questions in Slack#

When OpsAI investigates an incident and posts its findings (root cause analysis and suggested fix) into a Slack thread, you can continue the investigation directly from Slack without opening Middleware.

How it works:

  1. OpsAI posts its root cause analysis as a threaded reply under the original alert.

  2. Reply in that same thread and mention the app @Middleware with your question - for example, @Middleware can you make a PR to resolve this?

  3. While OpsAI investigates, you'll see a native spinner status next to the app's name in the thread.

  4. OpsAI's answer is posted back as a reply in the same thread once it's ready.

    Slack OpsAI Reply

Good to know:

  • Follow-up questions only work inside incident threads created by OpsAI. Mentioning the app in a regular alert notification thread or a new Slack message will not trigger a response.
  • OpsAI responds only when @Middleware is explicitly mentioned. It does not read or react to every message in the thread.
  • If the incident is older than your account's data retention window or there is no longer an active OpsAI investigation associated with the thread, the app will notify you.
  • If your account has reached its OpsAI usage limit, you'll receive a message explaining that the request cannot be processed.

To configure the complete workflow, including enabling Auto Investigation for a source, automatically receiving RCA in Slack, and asking follow-up questions, see Auto Investigation in OpsAI Settings.

Private Channels & Inviting the Bot#

Slack only allows apps to post in private channels when the app user (bot) has been explicitly invited.

You can invite the Middleware bot by:

  • Typing /invite @Middleware inside the private channel.
  • Going to ChannelIntegrationsAdd an app and selecting Middleware.

After inviting the bot, return to Middleware and refresh the channel list if the private channel does not appear immediately.

Test Your Connection#

To verify the integration:

  • Create a temporary alert rule with a benign condition, or use a test/preview action if available in the Alerts UI.
  • Send the alert to a non-critical channel such as #alerts-sandbox.
  • Confirm that the Slack message arrives successfully.
  • Verify that the link in the alert opens the corresponding alert in Middleware.

FAQs#

Does OpsAI reply to every message in the thread?

No. OpsAI only responds when you explicitly mention @Middleware. Other messages in the thread are ignored.

Can I ask OpsAI a question in a direct message instead of a channel thread?

Not currently. Follow-up questions are supported only inside Slack incident threads created by OpsAI.

The spinner indicator disappeared before I got an answer - did my question get lost?

No. Slack may dismiss the indicator if another message is posted in the thread while OpsAI is still working. Your request will continue processing, and OpsAI will post its response when it is ready.

Why isn't OpsAI responding when I mention it?

A few things to check:

  • The thread must be one that OpsAI itself created for an incident, not a regular alert-rule notification thread.
  • OpsAI auto-investigation must be enabled for the relevant project.
  • Your Slack connection may need to be reconnected to grant newer permissions. Check Integrations in MiddlewareSlack for a reconnect prompt.
    Slack Reconnect

Can multiple people ask OpsAI questions in the same thread?

Yes, but OpsAI processes one question at a time per thread. If another question is sent while the first is still being processed, wait for the first response before sending the next one.

Troubleshooting#

“I can’t see some channels in the picker”

  • For private channels, invite the Middleware bot first, then return to the alert rule and refresh the channel list.

“Message not delivered” or bot says not_in_channel

  • The bot is not a member of that channel. Invite it with /invite @<Middleware Bot> and retry.

“Integrations menu is missing” in Middleware

  • Your Middleware role may not have the required installation permissions. Ask an administrator to grant the appropriate permission under SettingsRoles.

“We post a lot of alerts—will Slack rate-limit us?”

  • Slack applies rate limits to message posting. If you expect a high volume of alerts, consider routing high-volume rules to separate channels, reducing unnecessary alerts, or using threaded replies where appropriate.

“OpsAI isn't replying when I mention it in a thread”

  • See the FAQ above, confirm that it's an OpsAI-created incident thread, that OpsAI is enabled for the project, and that your Slack connection is up to date.

Security & permissions (quick reference)#

Middleware follows a least-privilege approach. Slack displays all requested scopes during installation.

  • chat:write — Allows Middleware to post messages as the app.
  • channels:read/groups:read — Provides read-only access to the channel list so you can select alert destinations.
  • app_mentions:read — Detects when @Middleware is explicitly mentioned so the follow-up question can be sent to OpsAI.
  • assistant:write — Displays the native status indicator while OpsAI processes a follow-up question.

Middleware does not read general channel history or unrelated message content. The app processes message text when @Middleware is explicitly mentioned within a supported OpsAI incident thread.

For private channels, the Middleware app must be explicitly invited before it can access or post to the channel.

Need assistance or want to learn more about Middleware? Get in touch with us via our Contact Us or join our Slack channel.