Skip to main content

TDengine Monitoring

After TDengine is started, it automatically writes monitoring data including CPU, memory and disk usage, bandwidth, number of requests, disk I/O speed, slow queries, into a designated database at a predefined interval through taosKeeper. Additionally, some important system operations, like logon, create user, drop database, and alerts and warnings generated in TDengine are written into the log database too. A system operator can view the data in log database from TDengine CLI or from a web console.

The collection of the monitoring information is enabled by default, but can be disabled by parameter monitor in the configuration file.

TDinsight

TDinsight is a complete solution which uses the monitoring database log mentioned previously, and Grafana, to monitor a TDengine cluster.

A script TDinsight.sh is provided to deploy TDinsight automatically.

Download TDinsight.sh with the below command:

wget https://github.com/taosdata/grafanaplugin/raw/master/dashboards/TDinsight.sh
chmod +x TDinsight.sh

Prepare:

  1. TDengine Server

    • The URL of REST service: for example http://localhost:6041 if TDengine is deployed locally
    • User name and password
  2. Grafana Alert Notification

You can use below command to setup Grafana alert notification.

An existing Grafana Notification Channel can be specified with parameter -E, the notifier uid of the channel can be obtained by curl -u admin:admin localhost:3000/api/alert-notifications |jq

./TDinsight.sh -a http://localhost:6041 -u root -p taosdata -E <notifier uid>

Launch TDinsight.sh with the command above and restart Grafana, then open Dashboard http://localhost:3000/d/tdinsight.

log database

The data of tdinsight dashboard is stored in log database (default. You can change it in taoskeeper's config file. For more infrmation, please reference to taoskeeper document). The taoskeeper will create log database on taoskeeper startup.

taosd_cluster_basic table

taosd_cluster_basic table contains cluster basic information.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
first_epVARCHARfirst ep of cluster
first_ep_dnode_idINTdnode id or first_ep
cluster_versionVARCHARtdengine version. such as: 3.0.4.0
cluster_idVARCHARTAGcluster id

taosd_cluster_info table

taosd_cluster_info table contains cluster information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
cluster_uptimeDOUBLEseconds of master's uptime
dbs_totalDOUBLEtotal number of databases in cluster
tbs_totalDOUBLEtotal number of tables in cluster
stbs_totalDOUBLEtotal number of stables in cluster
dnodes_totalDOUBLEtotal number of dnodes in cluster
dnodes_aliveDOUBLEtotal number of dnodes in ready state
mnodes_totalDOUBLEtotal number of mnodes in cluster
mnodes_aliveDOUBLEtotal number of mnodes in ready state
vgroups_totalDOUBLEtotal number of vgroups in cluster
vgroups_aliveDOUBLEtotal number of vgroups in ready state
vnodes_totalDOUBLEtotal number of vnode in cluster
vnodes_aliveDOUBLEtotal number of vnode in ready state
connections_totalDOUBLEtotal number of connections to cluster
topics_totalDOUBLEtotal number of topics in cluster
streams_totalDOUBLEtotal number of streams in cluster
grants_expire_timeDOUBLEtime until grants expire in seconds
grants_timeseries_usedDOUBLEtimeseries used
grants_timeseries_totalDOUBLEtotal timeseries
cluster_idVARCHARTAGcluster id

taosd_vgroups_info table

taosd_vgroups_info table contains vgroups information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
tables_numDOUBLEnumber of tables per vgroup
statusDOUBLEstatus, value range:unsynced = 0, ready = 1
vgroup_idVARCHARTAGvgroup id
database_nameVARCHARTAGdatabase for the vgroup
cluster_idVARCHARTAGcluster id

taosd_dnodes_info table

taosd_dnodes_info table contains dnodes information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
uptimeDOUBLEdnode uptime in seconds
cpu_engineDOUBLEcpu usage of tdengine. read from /proc/<taosd_pid>/stat
cpu_systemDOUBLEcpu usage of server. read from /proc/stat
cpu_coresDOUBLEcpu cores of server
mem_engineDOUBLEmemory usage of tdengine. read from /proc/<taosd_pid>/status
mem_freeDOUBLEavailable memory on the server in KB
mem_totalDOUBLEtotal memory of server in KB
disk_usedDOUBLEusage of data dir in bytes
disk_totalDOUBLEthe capacity of data dir in bytes
system_net_inDOUBLEnetwork throughput rate in byte/s. read from /proc/net/dev
system_net_outDOUBLEnetwork throughput rate in byte/s. read from /proc/net/dev
io_readDOUBLEio throughput rate in byte/s. read from /proc/<taosd_pid>/io
io_writeDOUBLEio throughput rate in byte/s. read from /proc/<taosd_pid>/io
io_read_diskDOUBLEio throughput rate of disk in byte/s. read from /proc/<taosd_pid>/io
io_write_diskDOUBLEio throughput rate of disk in byte/s. read from /proc/<taosd_pid>/io
vnodes_numDOUBLEnumber of vnodes per dnode
mastersDOUBLEnumber of master vnodes
has_mnodeDOUBLEif the dnode has mnode, value range:include=1, not_include=0
has_qnodeDOUBLEif the dnode has qnode, value range:include=1, not_include=0
has_snodeDOUBLEif the dnode has snode, value range:include=1, not_include=0
has_bnodeDOUBLEif the dnode has bnode, value range:include=1, not_include=0
error_log_countDOUBLEerror count
info_log_countDOUBLEinfo count
debug_log_countDOUBLEdebug count
trace_log_countDOUBLEtrace count
dnode_idVARCHARTAGdnode id
dnode_epVARCHARTAGdnode endpoint
cluster_idVARCHARTAGcluster id

taosd_dnodes_status table

taosd_dnodes_status table contains dnodes information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
statusDOUBLEdnode status, value range:ready=1,offline =0
dnode_idVARCHARTAGdnode id
dnode_epVARCHARTAGdnode endpoint
cluster_idVARCHARTAGcluster id

taosd_dnodes_log_dir table

log_dir table contains log directory information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
availDOUBLEavailable space for log directory in bytes
usedDOUBLEused space for data directory in bytes
totalDOUBLEtotal space for data directory in bytes
nameVARCHARTAGlog directory. default is /var/log/taos/
dnode_idVARCHARTAGdnode id
dnode_epVARCHARTAGdnode endpoint
cluster_idVARCHARTAGcluster id

taosd_dnodes_data_dir table

taosd_dnodes_data_dir table contains data directory information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
availDOUBLEavailable space for data directory in bytes
usedDOUBLEused space for data directory in bytes
totalDOUBLEtotal space for data directory in bytes
levelVARCHARTAGlevel for multi-level storage
nameVARCHARTAGdata directory. default is /var/lib/taos
dnode_idVARCHARTAGdnode id
dnode_epVARCHARTAGdnode endpoint
cluster_idVARCHARTAGcluster id

taosd_mnodes_info table

taosd_mnodes_info table contains mnode information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
roleDOUBLEthe role of mnode. value range:offline = 0,follower = 100,candidate = 101,leader = 102,error = 103,learner = 104
mnode_idVARCHARTAGmaster node id
mnode_epVARCHARTAGmaster node endpoint
cluster_idVARCHARTAGcluster id

taosd_vnodes_role table

taosd_vnodes_role table contains vnode role information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
roleDOUBLErole. value range:offline = 0,follower = 100,candidate = 101,leader = 102,error = 103,learner = 104
vgroup_idVARCHARTAGvgroup id
database_nameVARCHARTAGdatabase for the vgroup
dnode_idVARCHARTAGdnode id
cluster_idVARCHARTAGcluster id

taosd_sql_req table

taosd_sql_req tables contains taosd sql records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
countDOUBLEsql count
resultVARCHARTAGsql execution result,value range: Success, Failed
usernameVARCHARTAGuser name who executed the sql
sql_typeVARCHARTAGsql type,value range:inserted_rows
dnode_idVARCHARTAGdnode id
dnode_epVARCHARTAGdnode endpoint
vgroup_idVARCHARTAGdnode id
cluster_idVARCHARTAGcluster id

taos_sql_req 表

taos_sql_req tables contains taos sql records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
countDOUBLEsql count
resultVARCHARTAGsql execution result,value range: Success, Failed
usernameVARCHARTAGuser name who executed the sql
sql_typeVARCHARTAGsql type,value range:select, insert,delete
cluster_idVARCHARTAGcluster id

taos_slow_sql 表

taos_slow_sql ables contains taos slow sql records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
countDOUBLEsql count
resultVARCHARTAGsql execution result,value range: Success, Failed
usernameVARCHARTAGuser name who executed the sql
durationVARCHARTAGsql execution duration,value range:3-10s,10-100s,100-1000s,1000s-
cluster_idVARCHARTAGcluster id

keeper_monitor table

keeper_monitor table contains keeper monitor information records.

fieldtypeis_tagcomment
tsTIMESTAMPtimestamp
cpuFLOATcpu usage
memFLOATmemory usage
identifyNCHARTAG

taosadapter_restful_http_request_total table

taosadapter_restful_http_request_total table contains taosadapter rest request information record. The timestamp column of this table is _ts.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
gaugeDOUBLEmetric value
client_ipNCHARTAGclient ip
endpointNCHARTAGtaosadpater endpoint
request_methodNCHARTAGrequest method
request_uriNCHARTAGrequest uri
status_codeNCHARTAGstatus code

taosadapter_restful_http_request_fail table

taosadapter_restful_http_request_fail table contains taosadapter failed rest request information record. The timestamp column of this table is _ts.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
gaugeDOUBLEmetric value
client_ipNCHARTAGclient ip
endpointNCHARTAGtaosadpater endpoint
request_methodNCHARTAGrequest method
request_uriNCHARTAGrequest uri
status_codeNCHARTAGstatus code

taosadapter_restful_http_request_in_flight table

taosadapter_restful_http_request_in_flight table contains taosadapter rest request information record in real time. The timestamp column of this table is _ts.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
gaugeDOUBLEmetric value
endpointNCHARTAGtaosadpater endpoint

taosadapter_restful_http_request_summary_milliseconds table

taosadapter_restful_http_request_summary_milliseconds table contains the summary or rest information record. The timestamp column of this table is _ts.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
countDOUBLE
sumDOUBLE
0.5DOUBLE
0.9DOUBLE
0.99DOUBLE
0.1DOUBLE
0.2DOUBLE
endpointNCHARTAGtaosadpater endpoint
request_methodNCHARTAGrequest method
request_uriNCHARTAGrequest uri

taosadapter_system_mem_percent table

taosadapter_system_mem_percent table contains taosadapter memory usage information. The timestamp of this table is _ts.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
gaugeDOUBLEmetric value
endpointNCHARTAGtaosadpater endpoint

taosadapter_system_cpu_percent table

taosadapter_system_cpu_percent table contains taosadapter cup usage information. The timestamp of this table is _ts.

fieldtypeis_tagcomment
_tsTIMESTAMPtimestamp
gaugeDOUBLEmertic value
endpointNCHARTAGtaosadpater endpoint