11. Метрики

От каждого узла можно получить метрики в формате Prometheus.

По-умолчанию порт метрик находится на 5030.

Путь к метрикам /metrics

Например http://localhost:5030/metrics

# HELP cook_node_info Misc node info
# TYPE cook_node_info gauge
cook_node_info {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", mode="slave", api_url="http://127.0.0.1:5031"} 1
# HELP cook_rdb_info Misc RDB info
# TYPE cook_rdb_info gauge
cook_rdb_info {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", rdb_endpoint="127.0.0.1/3051", rdb_host="127.0.0.1", rdb_port="3051", rdb_aux_port="3060", rdb_version="5.0.0.0"} 1
# HELP cook_rdb_pending_restart RDB pending restart
# TYPE cook_rdb_pending_restart gauge
cook_rdb_pending_restart {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_master Is cook node master
# TYPE cook_master gauge
cook_master {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_restrict_master Node is restricted to be master
# TYPE cook_restrict_master gauge
cook_restrict_master {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", reason=""} 0
# HELP cook_sync_node Is cook this node in sync replication
# TYPE cook_sync_node gauge
cook_sync_node {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 1
# HELP cook_in_sync Is cook this synced
# TYPE cook_in_sync gauge
cook_in_sync {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 1
# HELP cook_maintenance Node in maintenance mode
# TYPE cook_maintenance gauge
cook_maintenance {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_priority Node priority
# TYPE cook_priority gauge
cook_priority {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_allow_failover Node allowed to be failover master
# TYPE cook_allow_failover gauge
cook_allow_failover {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 1
# HELP cook_database_generation Database generation
# TYPE cook_database_generation counter
cook_database_generation {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1"} 1
cook_database_generation {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2"} 1
# HELP cook_database_sequence Database sequence
# TYPE cook_database_sequence counter
cook_database_sequence {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1"} 0
cook_database_sequence {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2"} 0
# HELP cook_database_mode Database mode
# TYPE cook_database_mode gauge
cook_database_mode {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1", mode="slave"} 1
cook_database_mode {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2", mode="slave"} 1
# HELP cook_database_master_guid Database master guid
# TYPE cook_database_master_guid gauge
cook_database_master_guid {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1", master_guid="ED881F74-47E6-49BC-BA72-4B18FEE7B7B6"} 1
cook_database_master_guid {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2", master_guid="991F93A9-FB00-4B4C-9D50-197D5AE09212"} 1
# HELP cook_database_initializing Database initializing
# TYPE cook_database_initializing gauge
cook_database_initializing {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1", progress="0", progress_total="0"} 0
cook_database_initializing {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2", progress="0", progress_total="0"} 0
# HELP cook_database_in_sync Is database in sync
# TYPE cook_database_in_sync gauge
cook_database_in_sync {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1"} 1
cook_database_in_sync {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2"} 1
# HELP cook_database_replication_status
# TYPE cook_database_replication_status gauge
cook_database_replication_status {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb", alias="testdb1", path="/tmp/cook/sync_node1/database1.fdb", dsn="127.0.0.1/3051:testdb1"} 2
cook_database_replication_status {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e", alias="testdb2", path="/tmp/cook/sync_node1/database2.fdb", dsn="127.0.0.1/3051:testdb2"} 2
# HELP cook_uptime Cook node uptime in seconds
# TYPE cook_uptime counter
cook_uptime {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 355
# HELP cook_step_time Cook node step time in seconds
# TYPE cook_step_time gauge
cook_step_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0.3469202518463135
# HELP cook_cooldown_time Cook node cooldown time in seconds
# TYPE cook_cooldown_time gauge
cook_cooldown_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 4.684876918792725
# HELP cook_load_cluster_time Cook node time to query cluster
# TYPE cook_load_cluster_time gauge
cook_load_cluster_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0.000762939453125
# HELP cook_update_node_time Cook node time to update node info in cluster
# TYPE cook_update_node_time gauge
cook_update_node_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0.1535017490386963
# HELP cook_data_state_obtain_time Cook node time to query RDB server
# TYPE cook_data_state_obtain_time gauge
cook_data_state_obtain_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0.003656148910522461
# HELP cook_archives_receive_time Time of receiving archive for database with specified guid
# TYPE cook_archives_receive_time gauge
cook_archives_receive_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="491a3e52-41e6-461b-9b10-aa7e2f8ea1bb"} -1
cook_archives_receive_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru", guid="8d20765b-3510-4582-8e63-e9272e6d493e"} -1
# HELP cook_last_sweep Cook last sweep timestamp
# TYPE cook_last_sweep gauge
cook_last_sweep {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_last_sweep_count Cook count of last swept logs
# TYPE cook_last_sweep_count gauge
cook_last_sweep_count {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_last_sweep_found_count Cook count of found logs during sweep
# TYPE cook_last_sweep_found_count gauge
cook_last_sweep_found_count {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} 0
# HELP cook_last_sweep_time Cook time of last logs sweeping
# TYPE cook_last_sweep_time gauge
cook_last_sweep_time {cluster_name="testcluster", node_name="node1.cook.red-soft.ru"} -1