Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

EMQX Enterprise MQTT Broker Connected Clients and Session Sentinel

Monitors EMQX MQTT broker for active connected IoT client surges and connection limit exhaustion.

Categories
CloudInfrastructure

How it works

This workflow connects to the EMQX HTTP API (/api/v5/stats) using API keys to monitor active MQTT client connections (connections.count) and session channels. In large-scale IoT fleets (smart vehicles, industrial telemetry, smart meters), fleet reboot storms or misconfigured keepalive intervals cause millions of devices to reconnect concurrently. When connections reach operating system file descriptor limits (nofile) or Erlang BEAM process table ceilings (+P), EMQX drops incoming TCP and TLS handshakes. This workflow tracks connected client counts and alerts IoT infrastructure teams before broker rejection occurs.

What you get

  • Real-time visibility into global IoT client connection counts on EMQX.
  • Prevents device connection drops and IoT fleet data blackouts.
  • Quantitative metrics on active connections and session channel volume.

Who it's for

  • IoT Platform Engineers and Connected Fleet Operations Specialists.
  • SREs maintaining mission-critical MQTT broker clusters.

Why orchestrate this with Kestra

  • Continuous Fleet Health Auditing: Periodically polls MQTT broker stats automatically.
  • Decoupled Architecture: Connects to standard REST APIs without intrusive local agents.
  • Direct Team Alerts: Delivers notifications with connection counts directly to Slack.

Prerequisites

  • EMQX cluster with HTTP API enabled (default port 18083).
  • Secrets EMQX_API_KEY, EMQX_SECRET_KEY, and SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import the blueprint.
  2. Input EMQX API URL and connection threshold.
  3. Run the workflow to inspect connected client counts.

How to extend

  • Query /api/v5/metrics for messages.dropped to detect discarded MQTT messages.
  • Automatically scale up EMQX node count via Kubernetes operator when connection volumes rise.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.