taosKeeper

Introduction

taosKeeper is a tool for TDengine that exports monitoring metrics. With taosKeeper, you can easily monitor the operational status of your TDengine deployment. taosKeeper uses the TDengine REST API. It is not necessary to install TDengine Client to use taosKeeper.

Installation

Methods of installing taosKeeper:

  • You can compile taosKeeper separately and install it. Please refer to the taosKeeper repository for details. —> You can compile taosKeeper separately and install it. Please refer to the taosKeeper repository for details.

Run

Configuration and running methods

taosKeeper needs to be executed on the terminal of the operating system, it supports three configuration methods: Command-line arguments, environment variable and configuration file. The precedence of those is Command-line, environment variable and configuration file.

Make sure that the TDengine cluster is running correctly before running taosKeeper. Ensure that the monitoring service in TDengine has been started. For more information, see TDengine Monitoring Configuration.

Command-Line Parameters

You can use command-line parameters to run taosKeeper and control its behavior:

  1. $ taosKeeper

Environment variable

You can use Environment variable to run taosKeeper and control its behavior:

  1. $ export TAOS_KEEPER_TDENGINE_HOST=192.168.64.3
  2. $ taoskeeper

you can run taoskeeper -h for more detail.

Configuration File

You can quickly launch taosKeeper with the following commands. If you do not specify a configuration file, /etc/taos/keeper.toml is used by default. If this file does not specify configurations, the default values are used.

  1. $ taoskeeper -c <keeper config file>

Sample configuration files

  1. # enable debug in gin framework
  2. debug = false
  3. # listen to server port, default 6043
  4. port = 6043
  5. # set log level to panic, error, info, debug, or trace
  6. loglevel = "info"
  7. # set pool size
  8. gopoolsize = 50000
  9. # query rotation period for TDengine monitoring data
  10. RotationInterval = "15s"
  11. [tdengine]
  12. host = "127.0.0.1"
  13. port = 6041
  14. username = "root"
  15. password = "taosdata"
  16. # set taosAdapter to monitor
  17. [taosAdapter]
  18. address = ["127.0.0.1:6041","192.168.1.95:6041"]
  19. [metrics]
  20. # monitoring metric prefix
  21. prefix = "taos"
  22. # cluster data identifier
  23. cluster = "production"
  24. # database to store monitoring data
  25. database = "log"
  26. # standard tables to monitor
  27. tables = ["normal_table"]

Obtain Monitoring Metrics

taosKeeper records monitoring metrics generated by TDengine in a specified database and provides an interface through which you can export the data.

View Monitoring Results

  1. $ taos
  2. # the log database is used in this example
  3. > use log;
  4. > select * from cluster_info limit 1;

Example result set:

  1. ts | first_ep | first_ep_dnode_id | version | master_uptime | monitor_interval | dbs_total | tbs_total | stbs_total | dnodes_total | dnodes_alive | mnodes_total | mnodes_alive | vgroups_total | vgroups_alive | vnodes_total | vnodes_alive | connections_total | protocol | cluster_id |
  2. ===============================================================================================================================================================================================================================================================================================================================================================================
  3. 2022-08-16 17:37:01.629 | hlb:6030 | 1 | 3.0.0.0 | 0.27250 | 15 | 2 | 27 | 38 | 1 | 1 | 1 | 1 | 4 | 4 | 4 | 4 | 14 | 1 | 5981392874047724755 |
  4. Query OK, 1 rows in database (0.036162s)

Export Monitoring Metrics

  1. $ curl http://127.0.0.1:6043/metrics

Sample result set (excerpt):

  1. # HELP taos_cluster_info_connections_total
  2. # TYPE taos_cluster_info_connections_total counter
  3. taos_cluster_info_connections_total{cluster_id="5981392874047724755"} 16
  4. # HELP taos_cluster_info_dbs_total
  5. # TYPE taos_cluster_info_dbs_total counter
  6. taos_cluster_info_dbs_total{cluster_id="5981392874047724755"} 2
  7. # HELP taos_cluster_info_dnodes_alive
  8. # TYPE taos_cluster_info_dnodes_alive counter
  9. taos_cluster_info_dnodes_alive{cluster_id="5981392874047724755"} 1
  10. # HELP taos_cluster_info_dnodes_total
  11. # TYPE taos_cluster_info_dnodes_total counter
  12. taos_cluster_info_dnodes_total{cluster_id="5981392874047724755"} 1
  13. # HELP taos_cluster_info_first_ep
  14. # TYPE taos_cluster_info_first_ep gauge
  15. taos_cluster_info_first_ep{cluster_id="5981392874047724755",value="hlb:6030"} 1