Skip to content

[Bug]: Prometheus and Dashboard report incorrect number of active MQTT/WSS clients compared to vmq-admin #2471

@ronielli

Description

@ronielli

Environment

  • VerneMQ Version: 2.1.1
  • OS: Debion

When using VerneMQ with MQTT over WebSockets (WSS), the Web Dashboard and Prometheus metrics report an incorrect number of active clients, while vmq-admin session show correctly lists all online sessions.

This causes confusion when monitoring client connections, especially in production environments where Prometheus/Grafana are used as the main observability tools.

Current Behavior

When using VerneMQ with MQTT over WebSockets (WSS), the Web Dashboard and Prometheus metrics report an incorrect number of online clients.

Even with multiple clients actively connected and visible via:

vmq-admin session show

the following metrics report lower values (usually 1):

  • vernemq_total_active_connections
  • vernemq_active_mqtt_connections
  • vernemq_active_mqttws_connections

The Web Dashboard also shows fewer online clients than actually connected.

Example (actual):

vmq-admin session show -> 3 online clients
Prometheus / Dashboard -> 1 online client

Image Image Image

Expected behaviour

The number of online MQTT/WSS clients reported by:

  • Web Dashboard
  • Prometheus metrics

should match the actual number of active MQTT sessions shown by:

vmq-admin session show

Example (expected):

vmq-admin session show -> 4 online clients
Prometheus / Dashboard -> 4 online clients

HELP vernemq_active_mqttws_connections The number of active MQTT WS(S) connections.

TYPE vernemq_active_mqttws_connections gauge

vernemq_active_mqttws_connections{node="[email protected]"} 3
vernemq_total_active_connections{node="[email protected]"} 1

Configuration, logs, error output, etc.

Code of Conduct

  • I agree to follow the VerneMQ's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions