MySQL and Slack: Database Connection Pool Alert Template

A scheduled workflow that watches your MySQL connection and lock metrics and pings Slack the moment the pool nears saturation.

What It Builds

A Schedule trigger runs every few minutes and a MySQL Connector node in Direct mode queries live connection counts and lock waits. A Condition node compares those figures against your thresholds, and when the pool is close to full a Slack Connector node posts an alert to your on-call channel. Spojit keeps the check quiet until something actually crosses the line.

The Prompt

Paste this into Miraxa and it builds the workflow, connecting the tools for you:

Build a workflow that runs every 2 minutes, queries my MySQL database for the current number of active connections, the max connections setting, and the count of waiting lock requests, and if active connections exceed 80 percent of the max or there are more than 5 lock waits, posts a warning to the #db-oncall Slack channel with the current connection count, the limit, and the percentage used.

Connectors Used

  • Schedule trigger - runs the check on a fixed cron interval in your timezone.
  • MySQL - reads connection and lock metrics with a Direct-mode query.
  • Slack - posts the saturation alert to your chosen channel.

Customize It

Change the run interval, the 80 percent threshold, the 5 lock-wait limit, the target metrics, and the #db-oncall channel directly in the prompt so the template fits your database without a second pass.

Tips

  • Use a read-only MySQL user; the query only needs to read status counters.
  • Keep the MySQL node in Direct mode for a fast, predictable query with no AI cost.
  • Tighten the interval and threshold gradually so you alert early without crying wolf.

Related

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.