Which TiDB monitoring metric shows active sessions for each node?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidb哪个监控指标看每个节点的活动会话

| username: 路在何chu

【TiDB Usage Environment】Production Environment /4013
【Reproduction Path】What operations were performed to encounter the issue
Monitoring metrics to view active sessions
【Encountered Issue: Issue Phenomenon and Impact】

Functionality similar to this statement: select count(*) from information_schema.processlist where command<>‘Sleep’;

| username: tidb菜鸟一只 | Original post link

The later versions of the dashboard have it.

| username: 小龙虾爱大龙虾 | Original post link

In the performance_overview of Grafana, there is a Connection Count, which includes statistics on the number of active sessions. This feature is only available in higher versions; version 4 does not have it.

| username: 路在何chu | Original post link

Alright, there are no plans to upgrade at the moment.

| username: zhanggame1 | Original post link

The connection count and processlist are very different. What does this connection count refer to?

| username: dba远航 | Original post link

In lower versions, you can only check through the command you mentioned.

| username: madcoder | Original post link

Without monitoring, just consider using netstat to check directly; first check which ports the process has, then check which connections are established with the ports, and finally write a bash script :sweat_smile:

| username: TiDBer_JUi6UvZm | Original post link

It is recommended to upgrade to a version with a graphical interface for monitoring as soon as possible.