zabbix_export: version: '6.0' date: '2021-12-16T07:40:23Z' groups: - uuid: 748ad4d098d447d492bb935c907f652f name: Templates/Databases templates: - uuid: 3a0bbbb2ec0a4c58bba3ba3a3d6ce660 template: 'TiDB TiKV by HTTP' name: 'TiDB TiKV by HTTP' description: | The template to monitor TiKV server of TiDB cluster by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. Don't forget to change the macros {$TIKV.URL}, {$TIKV.PORT}. Template `TiDB TiKV by HTTP` — collects metrics by HTTP agent from TiKV /metrics endpoint. You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback Template tooling version used: 0.40 groups: - name: Templates/Databases items: - uuid: 449a7ba908884db3af4ec8ccc0d7ea43 name: 'TiKV: Scheduler: High priority commands total, rate' type: DEPENDENT key: tikv.commands_pri.high.rate delay: '0' history: 7d value_type: FLOAT description: 'Total count of high priority commands per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_commands_pri_total" && @.labels.priority == "high")].value.first()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: b5ce79ee79804e76bb7b91e17915159c name: 'TiKV: Scheduler: Low priority commands total, rate' type: DEPENDENT key: tikv.commands_pri.low.rate delay: '0' history: 7d value_type: FLOAT description: 'Total count of low priority commands per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_commands_pri_total" && @.labels.priority == "low")].value.first()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: df3fa02457ac47168fad251727b300ff name: 'TiKV: Scheduler: Normal priority commands total, rate' type: DEPENDENT key: tikv.commands_pri.normal.rate delay: '0' history: 7d value_type: FLOAT description: 'Total count of normal priority commands per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_commands_pri_total" && @.labels.priority == "normal")].value.first()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: dbf8288b5cab4e8a95b5e7c4355676bd name: 'TiKV: Coprocessor: Requests, rate' type: DEPENDENT key: tikv.coprocessor_request.rate delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of coprocessor requests per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_request_duration_seconds_count")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: d6185382a1974b9194e68bea4f14eb75 name: 'TiKV: Coprocessor: Errors, rate' type: DEPENDENT key: tikv.coprocessor_request_error.rate delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of push down request error per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_request_error")].value.sum()' error_handler: DISCARD_VALUE - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' triggers: - uuid: 31eca27ff6ce4ed78ee428ed3b8d8806 expression: 'min(/TiDB TiKV by HTTP/tikv.coprocessor_request_error.rate,5m)>{$TIKV.COPOCESSOR.ERRORS.MAX.WARN}' name: 'TiKV: Too many coprocessor request error (over {$TIKV.COPOCESSOR.ERRORS.MAX.WARN} in 5m)' priority: WARNING - uuid: 237f6ba2973e472d8c20de1d61b4695c name: 'TiKV: Coprocessor: RocksDB ops, rate' type: DEPENDENT key: tikv.coprocessor_rocksdb_perf.rate delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of RocksDB internal operations from PerfContext per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_rocksdb_perf")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 5567ebf02fb6441dbb6672e1bc77b3ab name: 'TiKV: Coprocessor: Response size, rate' type: DEPENDENT key: tikv.coprocessor_scan_keys.rate delay: '0' history: 7d value_type: FLOAT units: Bps description: 'The total size of coprocessor response per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_response_bytes")].value.first()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: a76665b7a9924f8cbd4a455bc248d790 name: 'TiKV: CPU util' type: DEPENDENT key: tikv.cpu.util delay: '0' history: 7d value_type: FLOAT units: '%' description: 'The CPU usage ratio on TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_thread_cpu_seconds_total")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' - type: MULTIPLIER parameters: - '100' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 4558a5a11c304584bf24a7c3d2eace23 name: 'TiKV: Bytes read' type: DEPENDENT key: tikv.engine_flow_bytes.read delay: '0' history: 7d value_type: FLOAT units: Bps description: 'The total bytes of read in TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_engine_flow_bytes" && @.labels.db == "kv" && @.labels.type =~ "bytes_read|iter_bytes_read")].value.sum()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 0d44c3c9a7f34905b0404ae39a3bc881 name: 'TiKV: Bytes write' type: DEPENDENT key: tikv.engine_flow_bytes.write delay: '0' history: 7d value_type: FLOAT units: Bps description: 'The total bytes of write in TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_engine_flow_bytes" && @.labels.db == "kv" && @.labels.type == "wal_file_bytes")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: f79d5daea61842b18e39c7289657ddf5 name: 'TiKV: Store size' type: DEPENDENT key: tikv.engine_size delay: '0' history: 7d value_type: FLOAT units: B description: 'The storage size of TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_engine_size_bytes")].value.sum()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 418bcc8c0bc440468efe833bef02929d name: 'TiKV: Get instance metrics' type: HTTP_AGENT key: tikv.get_metrics history: '0' trends: '0' value_type: TEXT description: 'Get TiKV instance metrics.' preprocessing: - type: CHECK_NOT_SUPPORTED parameters: - '' - type: PROMETHEUS_TO_JSON parameters: - '' url: '{$TIKV.URL}:{$TIKV.PORT}/metrics' tags: - tag: Application value: 'Zabbix raw items' - uuid: fed3db7222fa41a8bf51d2ad860a22d4 name: 'TiKV: Total query, rate' type: DEPENDENT key: tikv.grpc_msg.rate delay: '0' history: 7d value_type: FLOAT units: Ops description: 'The total QPS in TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_grpc_msg_duration_seconds_count")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: c68db41c184d44d98445cc66489ef39c name: 'TiKV: Total query errors, rate' type: DEPENDENT key: tikv.grpc_msg_fail.rate delay: '0' history: 7d value_type: FLOAT units: Ops description: 'The total number of gRPC message handling failure per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_grpc_msg_fail_total")].value.sum()' error_handler: DISCARD_VALUE - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 7afa5147a1e247a5b8914d8739d31f15 name: 'TiKV: Server: failure messages total, rate' type: DEPENDENT key: tikv.messages.failure.rate delay: '0' history: 7d value_type: FLOAT description: 'Total number of reporting failure messages per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_server_report_failure_msg_total")].value.sum()' error_handler: DISCARD_VALUE - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: e6137dd87faa496497b23cadaa37dca9 name: 'TiKV: Regions, count' type: DEPENDENT key: tikv.region_count delay: '0' history: 7d description: 'The number of regions collected in TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_raftstore_region_count" && @.labels.type == "region" )].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 2ab7643435794ec6b5a2c3eb1dd7e913 name: 'TiKV: Regions, leader' type: DEPENDENT key: tikv.region_leader delay: '0' history: 7d description: 'The number of leaders in TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_raftstore_region_count" && @.labels.type == "leader" )].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 1c480fa23eaa42bcb367bb5afdcb65b9 name: 'TiKV: RSS memory usage' type: DEPENDENT key: tikv.rss_bytes delay: '0' history: 7d value_type: FLOAT units: B description: 'Resident memory size in bytes.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "process_resident_memory_bytes")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 62f856cf22804262aef64e9369049332 name: 'TiKV: Scheduler: Commands total, rate' type: DEPENDENT key: tikv.scheduler_commands.rate delay: '0' history: 7d value_type: FLOAT description: 'Total number of commands per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_stage_total")].value.sum()' error_handler: CUSTOM_VALUE error_handler_params: '0' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 8b7c2dc8c60e491db76cafd2d0e1234b name: 'TiKV: Snapshot: Pending tasks' type: DEPENDENT key: tikv.scheduler_contex delay: '0' history: 7d description: 'The number of tasks currently running by the worker or pending.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_worker_pending_task_total")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' triggers: - uuid: be07ed23d6e040bd90866a4981d3c712 expression: 'min(/TiDB TiKV by HTTP/tikv.scheduler_contex,5m)>{$TIKV.PENDING_COMMANDS.MAX.WARN}' name: 'TiKV: Too many pending commands (over {$TIKV.PENDING_COMMANDS.MAX.WARN} for 5m)' priority: AVERAGE - uuid: f26874f910e34933983685ae43a90bee expression: 'min(/TiDB TiKV by HTTP/tikv.scheduler_contex,5m)>{$TIKV.PENDING_TASKS.MAX.WARN}' name: 'TiKV: Too many pending commands (over {$TIKV.PENDING_TASKS.MAX.WARN} for 5m)' priority: AVERAGE - uuid: 8f5c9d2b9eca4a489d764420ee06e4b6 name: 'TiKV: Scheduler: Busy, rate' type: DEPENDENT key: tikv.scheduler_too_busy.rate delay: '0' history: 7d value_type: FLOAT description: 'The total count of too busy schedulers per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_too_busy_total")].value.sum()' error_handler: DISCARD_VALUE - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 0a2d0a119bcd406aadfc5c014186c5d3 name: 'TiKV: Snapshot: Applying' type: DEPENDENT key: tikv.snapshot.applying delay: '0' history: 7d description: 'The total amount of raftstore snapshot traffic.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_raftstore_snapshot_traffic_total" && @.labels.type == "applying")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 58559be859d64887a1b919e36aa1e336 name: 'TiKV: Snapshot: Receiving' type: DEPENDENT key: tikv.snapshot.receiving delay: '0' history: 7d description: 'The total amount of raftstore snapshot traffic.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_raftstore_snapshot_traffic_total" && @.labels.type == "receiving")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 0ae6a2024ed3488498e22bc542d27619 name: 'TiKV: Snapshot: Sending' type: DEPENDENT key: tikv.snapshot.sending delay: '0' history: 7d description: 'The total amount of raftstore snapshot traffic.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_raftstore_snapshot_traffic_total" && @.labels.type == "sending")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: ce31318a420d40668e62a47fe19d3d40 name: 'TiKV: Storage: commands total, rate' type: DEPENDENT key: tikv.storage_command.rate delay: '0' history: 7d value_type: FLOAT description: 'Total number of commands received per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_storage_command_total")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: fbfaa0d967c049c0a1bbcec5afea4bf2 name: 'TiKV: Available size' type: DEPENDENT key: tikv.store_size.available delay: '0' history: 7d value_type: FLOAT units: B description: 'The available capacity of TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_store_size_bytes" && @.labels.type == "available")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 1e0c1c071b604e77998797c2f9d41dfc name: 'TiKV: Capacity size' type: DEPENDENT key: tikv.store_size.capacity delay: '0' history: 7d value_type: FLOAT units: B description: 'The capacity size of TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_store_size_bytes" && @.labels.type == "capacity")].value.first()' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: f2632dbd773140398a7d61608d85f392 name: 'TiKV: Uptime' type: DEPENDENT key: tikv.uptime delay: '0' history: 7d value_type: FLOAT units: uptime description: 'The runtime of each TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name=="process_start_time_seconds")].value.first()' - type: JAVASCRIPT parameters: - | //use boottime to calculate uptime return (Math.floor(Date.now()/1000)-Number(value)); master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' triggers: - uuid: ca06602fa0b64a2ba0c51ed4835c52b2 expression: 'last(/TiDB TiKV by HTTP/tikv.uptime)<10m' name: 'TiKV: has been restarted (uptime < 10m)' priority: INFO description: 'Uptime is less than 10 minutes' manual_close: 'YES' discovery_rules: - uuid: f1c7de94679e40a4ac6f569e05ad61d0 name: 'Coprocessor metrics discovery' type: DEPENDENT key: tikv.coprocessor.discovery delay: '0' description: 'Discovery coprocessor metrics.' item_prototypes: - uuid: ecbe08549fef42d5aad0369e861b4c20 name: 'TiKV: Coprocessor: {#REQ_TYPE} requests, rate' type: DEPENDENT key: 'tikv.coprocessor_request.rate[{#REQ_TYPE}]' delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of coprocessor requests per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_request_duration_seconds_count" && @.labels.req == "{#REQ_TYPE}")].value.first()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 08060401409b4fff97430c595fec7b82 name: 'TiKV: Coprocessor: {#REQ_TYPE} errors, rate' type: DEPENDENT key: 'tikv.coprocessor_request_error.rate[{#REQ_TYPE}]' delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of push down request error per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_request_error" && @.labels.req == "{#REQ_TYPE}")].value.first()' error_handler: DISCARD_VALUE - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: bff6ee970f7349edba6cac1cd0da70ed name: 'TiKV: Coprocessor: {#REQ_TYPE} RocksDB ops, rate' type: DEPENDENT key: 'tikv.coprocessor_rocksdb_perf.rate[{#REQ_TYPE}]' delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of RocksDB internal operations from PerfContext per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_rocksdb_perf" && @.labels.req == "{#REQ_TYPE}")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' - uuid: 8ef93de8a25b4f35b2e54f6ced4a5bd2 name: 'TiKV: Coprocessor: {#REQ_TYPE} scan keys, rate' type: DEPENDENT key: 'tikv.coprocessor_scan_keys.rate[{#REQ_TYPE}]' delay: '0' history: 7d value_type: FLOAT units: Ops description: 'Total number of scan keys observed per request per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_scan_keys_count" && @.labels.req == "{#REQ_TYPE}")].value.first()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' master_item: key: tikv.get_metrics preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_coprocessor_request_duration_seconds_count")]' - type: JAVASCRIPT parameters: - | output = JSON.parse(value).map(function(item){ return { "{#REQ_TYPE}": item.labels.req, }}) return JSON.stringify({"data": output}) - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h - uuid: 39e4031ee41143ed9d0c84492f817125 name: 'QPS metrics discovery' type: DEPENDENT key: tikv.qps.discovery delay: '0' description: 'Discovery QPS metrics.' item_prototypes: - uuid: 3b1d1b10cee6465c822152072189ebbe name: 'TiKV: Query: {#TYPE}, rate' type: DEPENDENT key: 'tikv.grpc_msg.rate[{#TYPE}]' delay: '0' history: 7d value_type: FLOAT units: Ops description: 'The QPS per command in TiKV instance.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_grpc_msg_duration_seconds_count" && @.labels.type == "{#TYPE}")].value.first()' error_handler: CUSTOM_VALUE master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' master_item: key: tikv.get_metrics preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_grpc_msg_duration_seconds_count")]' - type: JAVASCRIPT parameters: - | output = JSON.parse(value).map(function(item){ return { "{#TYPE}": item.labels.type, }}) return JSON.stringify({"data": output}) - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h - uuid: 7168e631146546129284cbf9c52b2025 name: 'Scheduler metrics discovery' type: DEPENDENT key: tikv.scheduler.discovery delay: '0' description: 'Discovery scheduler metrics.' item_prototypes: - uuid: c4f902a0be5444b2babb1775b89a6827 name: 'TiKV: Scheduler: commands {#STAGE}, rate' type: DEPENDENT key: 'tikv.scheduler_stage.rate[{#STAGE}]' delay: '0' history: 7d value_type: FLOAT description: 'Total number of commands on each stage per second.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_stage_total" && @.labels.stage == "{#STAGE}")].value.sum()' error_handler: CUSTOM_VALUE error_handler_params: '0' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' master_item: key: tikv.get_metrics preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_scheduler_stage_total")]' - type: JAVASCRIPT parameters: - | var lookup = {}, result = []; JSON.parse(value).forEach(function (item) { var stage = item.labels.stage; if (!(lookup[stage])) { lookup[stage] = 1; result.push({ "{#STAGE}": stage }); } }) return JSON.stringify(result); - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h - uuid: 5ebd2e2131ab4a9f8ca63f0e490b04a3 name: 'Server errors discovery' type: DEPENDENT key: tikv.server_report_failure.discovery delay: '0' description: 'Discovery server errors metrics.' item_prototypes: - uuid: 064e74b5484e42e4acf3122c8ead4826 name: 'TiKV: Store_id {#STORE_ID}: failure messages "{#TYPE}", rate' type: DEPENDENT key: 'tikv.messages.failure.rate[{#STORE_ID},{#TYPE}]' delay: '0' history: 7d value_type: FLOAT description: 'Total number of reporting failure messages. The metric has two labels: type and store_id. type represents the failure type, and store_id represents the destination peer store id.' preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_server_report_failure_msg_total" && @.labels.store_id == "{#STORE_ID}" && @.labels.type == "{#TYPE}")].value.sum()' - type: CHANGE_PER_SECOND parameters: - '' master_item: key: tikv.get_metrics tags: - tag: Application value: 'TiKV node' trigger_prototypes: - uuid: 1f65b64824d64852aaa609df5f3e27fd expression: 'min(/TiDB TiKV by HTTP/tikv.messages.failure.rate[{#STORE_ID},{#TYPE}],5m)>{$TIKV.STORE.ERRORS.MAX.WARN}' name: 'TiKV: Store_id {#STORE_ID}: Too many failure messages "{#TYPE}" (over {$TIKV.STORE.ERRORS.MAX.WARN} in 5m)' discover: NO_DISCOVER priority: WARNING description: 'Indicates that the remote TiKV cannot be connected.' master_item: key: tikv.get_metrics preprocessing: - type: JSONPATH parameters: - '$[?(@.name == "tikv_server_report_failure_msg_total")]' error_handler: DISCARD_VALUE - type: JAVASCRIPT parameters: - | output = JSON.parse(value).map(function(item){ return { "{#STORE_ID}": item.labels.store_id, "{#TYPE}": item.labels.type, }}) return JSON.stringify({"data": output}) - type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 1h overrides: - name: 'Too many unreachable messages trigger' step: '1' filter: conditions: - macro: '{#TYPE}' value: unreachable formulaid: A operations: - operationobject: TRIGGER_PROTOTYPE operator: LIKE value: 'Too many failure messages' status: ENABLED discover: DISCOVER macros: - macro: '{$TIKV.COPOCESSOR.ERRORS.MAX.WARN}' value: '1' description: 'Maximum number of coprocessor request errors' - macro: '{$TIKV.PENDING_COMMANDS.MAX.WARN}' value: '1' description: 'Maximum number of pending commands' - macro: '{$TIKV.PENDING_TASKS.MAX.WARN}' value: '1' description: 'Maximum number of tasks currently running by the worker or pending' - macro: '{$TIKV.PORT}' value: '20180' description: 'The port of TiKV server metrics web endpoint' - macro: '{$TIKV.STORE.ERRORS.MAX.WARN}' value: '1' description: 'Maximum number of failure messages' - macro: '{$TIKV.URL}' value: localhost description: 'TiKV server URL' graphs: - uuid: cdca8a2bb2bb486da8c57740acc431d6 name: 'TiKV: Scheduler priority commands rate' graph_items: - color: 1A7C11 item: host: 'TiDB TiKV by HTTP' key: tikv.commands_pri.normal.rate - sortorder: '1' color: 2774A4 item: host: 'TiDB TiKV by HTTP' key: tikv.commands_pri.high.rate - sortorder: '2' color: F63100 item: host: 'TiDB TiKV by HTTP' key: tikv.commands_pri.low.rate - uuid: 93a38153ed8b44a49849cb1f920f50a4 name: 'TiKV: Snapshot state count' graph_items: - color: 1A7C11 item: host: 'TiDB TiKV by HTTP' key: tikv.snapshot.applying - sortorder: '1' color: 2774A4 item: host: 'TiDB TiKV by HTTP' key: tikv.snapshot.receiving - sortorder: '2' color: F63100 item: host: 'TiDB TiKV by HTTP' key: tikv.snapshot.sending