blob: 012f21eff8d3101f5ca961c7d089a56d54c1cd2e [file] [log] [blame]
import{_ as e,c as o,b as a,o as d}from"./app-DLxi_e3x.js";const n={};function s(r,t){return d(),o("div",null,t[0]||(t[0]=[a(`<h4 id="_4-2-10-query-planning" tabindex="-1"><a class="header-anchor" href="#_4-2-10-query-planning"><span>4.2.10. Query Planning</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>query_plan_cost</td><td>stage=&quot;analyzer&quot;</td><td>Timer</td><td>The query statement analysis time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage=&quot;logical_planner&quot;</td><td>Timer</td><td>The query logical plan planning time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage=&quot;distribution_planner&quot;</td><td>Timer</td><td>The query distribution plan planning time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage=&quot;partition_fetcher&quot;</td><td>Timer</td><td>The partition information fetching time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage=&quot;schema_fetcher&quot;</td><td>Timer</td><td>The schema information fetching time-consuming</td></tr></tbody></table><h4 id="_4-2-11-plan-dispatcher" tabindex="-1"><a class="header-anchor" href="#_4-2-11-plan-dispatcher"><span>4.2.11. Plan Dispatcher</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>dispatcher</td><td>stage=&quot;wait_for_dispatch&quot;</td><td>Timer</td><td>The distribution plan dispatcher time-consuming</td></tr><tr><td>dispatcher</td><td>stage=&quot;dispatch_read&quot;</td><td>Timer</td><td>The distribution plan dispatcher time-consuming (only query)</td></tr></tbody></table><h4 id="_4-2-12-query-resource" tabindex="-1"><a class="header-anchor" href="#_4-2-12-query-resource"><span>4.2.12. Query Resource</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>query_resource</td><td>type=&quot;sequence_tsfile&quot;</td><td>Rate</td><td>The access frequency of sequence tsfiles</td></tr><tr><td>query_resource</td><td>type=&quot;unsequence_tsfile&quot;</td><td>Rate</td><td>The access frequency of unsequence tsfiles</td></tr><tr><td>query_resource</td><td>type=&quot;flushing_memtable&quot;</td><td>Rate</td><td>The access frequency of flushing memtables</td></tr><tr><td>query_resource</td><td>type=&quot;working_memtable&quot;</td><td>Rate</td><td>The access frequency of working memtables</td></tr></tbody></table><h4 id="_4-2-13-data-exchange" tabindex="-1"><a class="header-anchor" href="#_4-2-13-data-exchange"><span>4.2.13. Data Exchange</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>data_exchange_cost</td><td>operation=&quot;source_handle_get_tsblock&quot;, type=&quot;local/remote&quot;</td><td>Timer</td><td>The time-consuming that source handles receive TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation=&quot;source_handle_deserialize_tsblock&quot;, type=&quot;local/remote&quot;</td><td>Timer</td><td>The time-consuming that source handles deserialize TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation=&quot;sink_handle_send_tsblock&quot;, type=&quot;local/remote&quot;</td><td>Timer</td><td>The time-consuming that sink handles send TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation=&quot;send_new_data_block_event_task&quot;, type=&quot;server/caller&quot;</td><td>Timer</td><td>The RPC time-consuming that sink handles send TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation=&quot;get_data_block_task&quot;, type=&quot;server/caller&quot;</td><td>Timer</td><td>The RPC time-consuming that source handles receive TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation=&quot;on_acknowledge_data_block_event_task&quot;, type=&quot;server/caller&quot;</td><td>Timer</td><td>The RPC time-consuming that source handles ack received TsBlock</td></tr><tr><td>data_exchange_count</td><td>name=&quot;send_new_data_block_num&quot;, type=&quot;server/caller&quot;</td><td>Histogram</td><td>The number of sent TsBlocks by sink handles</td></tr><tr><td>data_exchange_count</td><td>name=&quot;get_data_block_num&quot;, type=&quot;server/caller&quot;</td><td>Histogram</td><td>The number of received TsBlocks by source handles</td></tr><tr><td>data_exchange_count</td><td>name=&quot;on_acknowledge_data_block_num&quot;, type=&quot;server/caller&quot;</td><td>Histogram</td><td>The number of acknowledged TsBlocks by source handles</td></tr></tbody></table><h4 id="_4-2-14-query-task-schedule" tabindex="-1"><a class="header-anchor" href="#_4-2-14-query-task-schedule"><span>4.2.14. Query Task Schedule</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>driver_scheduler</td><td>name=&quot;ready_queued_time&quot;</td><td>Timer</td><td>The queuing time of ready queue</td></tr><tr><td>driver_scheduler</td><td>name=&quot;block_queued_time&quot;</td><td>Timer</td><td>The queuing time of blocking queue</td></tr><tr><td>driver_scheduler</td><td>name=&quot;ready_queue_task_count&quot;</td><td>AutoGauge</td><td>The number of tasks queued in the ready queue</td></tr><tr><td>driver_scheduler</td><td>name=&quot;block_queued_task_count&quot;</td><td>AutoGauge</td><td>The number of tasks queued in the blocking queue</td></tr></tbody></table><h4 id="_4-2-15-query-execution" tabindex="-1"><a class="header-anchor" href="#_4-2-15-query-execution"><span>4.2.15. Query Execution</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>query_execution</td><td>stage=&quot;local_execution_planner&quot;</td><td>Timer</td><td>The time-consuming of operator tree construction</td></tr><tr><td>query_execution</td><td>stage=&quot;query_resource_init&quot;</td><td>Timer</td><td>The time-consuming of query resource initialization</td></tr><tr><td>query_execution</td><td>stage=&quot;get_query_resource_from_mem&quot;</td><td>Timer</td><td>The time-consuming of query resource memory query and construction</td></tr><tr><td>query_execution</td><td>stage=&quot;driver_internal_process&quot;</td><td>Timer</td><td>The time-consuming of driver execution</td></tr><tr><td>query_execution</td><td>stage=&quot;wait_for_result&quot;</td><td>Timer</td><td>The time-consuming of getting query result from result handle</td></tr><tr><td>operator_execution_cost</td><td>name=&quot;{operator_name}&quot;</td><td>Timer</td><td>The operator execution time</td></tr><tr><td>operator_execution_count</td><td>name=&quot;{operator_name}&quot;</td><td>Counter</td><td>The number of operator calls (counted by the number of next method calls)</td></tr><tr><td>aggregation</td><td>from=&quot;raw_data&quot;</td><td>Timer</td><td>The time-consuming of performing an aggregation calculation from a batch of raw data</td></tr><tr><td>aggregation</td><td>from=&quot;statistics&quot;</td><td>Timer</td><td>The time-consuming of updating an aggregated value with statistics</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;load_timeseries_metadata&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of loading TimeseriesMetadata</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;read_timeseries_metadata&quot;, type=&quot;&quot;, from=&quot;cache/file&quot;</td><td>Timer</td><td>The time-consuming of reading TimeseriesMetadata of a tsfile</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;timeseries_metadata_modification&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;null&quot;</td><td>Timer</td><td>The time-consuming of filtering TimeseriesMetadata by mods</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;load_chunk_metadata_list&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of loading ChunkMetadata list</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;chunk_metadata_modification&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of filtering ChunkMetadata by mods</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;chunk_metadata_filter&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of filtering ChunkMetadata by query filter</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;construct_chunk_reader&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of constructing ChunkReader</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;read_chunk&quot;, type=&quot;&quot;, from=&quot;cache/file&quot;</td><td>Timer</td><td>The time-consuming of reading Chunk</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;init_chunk_reader&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of initializing ChunkReader (constructing PageReader)</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;build_tsblock_from_page_reader&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;mem/disk&quot;</td><td>Timer</td><td>The time-consuming of constructing Tsblock from PageReader</td></tr><tr><td>series_scan_cost</td><td>stage=&quot;build_tsblock_from_merge_reader&quot;, type=&quot;aligned/non_aligned&quot;, from=&quot;null&quot;</td><td>Timer</td><td>The time-consuming of constructing Tsblock from MergeReader (handling overlapping data)</td></tr></tbody></table><h4 id="_4-2-16-schema-engine" tabindex="-1"><a class="header-anchor" href="#_4-2-16-schema-engine"><span>4.2.16 Schema Engine</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>schema_engine</td><td>name=&quot;schema_region_total_mem_usage&quot;</td><td>AutoGauge</td><td>Memory usgae for all SchemaRegion</td></tr><tr><td>schema_engine</td><td>name=&quot;schema_region_mem_capacity&quot;</td><td>AutoGauge</td><td>Memory capacity for all SchemaRegion</td></tr><tr><td>schema_engine</td><td>name=&quot;schema_engine_mode&quot;</td><td>Gauge</td><td>Mode of SchemaEngine</td></tr><tr><td>schema_engine</td><td>name=&quot;schema_region_consensus&quot;</td><td>Gauge</td><td>Consensus protocol of SchemaRegion</td></tr><tr><td>schema_engine</td><td>name=&quot;schema_region_number&quot;</td><td>AutoGauge</td><td>Number of SchemaRegion</td></tr><tr><td>quantity</td><td>name=&quot;template_series_cnt&quot;</td><td>AutoGauge</td><td>Number of template series</td></tr><tr><td>schema_region</td><td>name=&quot;schema_region_mem_usage&quot;, region=&quot;SchemaRegion[{regionId}]&quot;</td><td>AutoGauge</td><td>Memory usgae for each SchemaRegion</td></tr><tr><td>schema_region</td><td>name=&quot;schema_region_series_cnt&quot;, region=&quot;SchemaRegion[{regionId}]&quot;</td><td>AutoGauge</td><td>Number of total timeseries for each SchemaRegion</td></tr><tr><td>schema_region</td><td>name=&quot;activated_template_cnt&quot;, region=&quot;SchemaRegion[{regionId}]&quot;</td><td>AutoGauge</td><td>Number of Activated template for each SchemaRegion</td></tr><tr><td>schema_region</td><td>name=&quot;template_series_cnt&quot;, region=&quot;SchemaRegion[{regionId}]&quot;</td><td>AutoGauge</td><td>Number of template series for each SchemaRegion</td></tr></tbody></table><h4 id="_4-2-17-write-performance" tabindex="-1"><a class="header-anchor" href="#_4-2-17-write-performance"><span>4.2.17 Write Performance</span></a></h4><table><thead><tr><th>Metric</th><th style="text-align:left;">Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>wal_node_num</td><td style="text-align:left;">name=&quot;wal_nodes_num&quot;</td><td>AutoGauge</td><td>Num of WALNode</td></tr><tr><td>wal_cost</td><td style="text-align:left;">stage=&quot;make_checkpoint&quot; type=&quot;&lt;checkpoint_type&gt;&quot;</td><td>Timer</td><td>Time cost of make checkpoints for all checkpoint type</td></tr><tr><td>wal_cost</td><td style="text-align:left;">type=&quot;serialize_one_wal_info_entry&quot;</td><td>Timer</td><td>Time cost of serialize one WALInfoEntry</td></tr><tr><td>wal_cost</td><td style="text-align:left;">stage=&quot;sync_wal_buffer&quot; type=&quot;&lt;force_flag&gt;&quot;</td><td>Timer</td><td>Time cost of sync WALBuffer</td></tr><tr><td>wal_buffer</td><td style="text-align:left;">name=&quot;used_ratio&quot;</td><td>Histogram</td><td>Used ratio of WALBuffer</td></tr><tr><td>wal_cost</td><td style="text-align:left;">stage=&quot;serialize_wal_entry&quot; type=&quot;serialize_wal_entry_total&quot;</td><td>Timer</td><td>Time cost of WALBuffer serialize task</td></tr><tr><td>wal_node_info</td><td style="text-align:left;">name=&quot;effective_info_ratio&quot; type=&quot;&lt;wal_node_id&gt;&quot;</td><td>Histogram</td><td>Effective info ratio of WALNode</td></tr><tr><td>wal_node_info</td><td style="text-align:left;">name=&quot;oldest_mem_table_ram_when_cause_snapshot&quot; type=&quot;&lt;wal_node_id&gt;&quot;</td><td>Histogram</td><td>Ram of oldest memTable when cause snapshot</td></tr><tr><td>wal_node_info</td><td style="text-align:left;">name=&quot;oldest_mem_table_ram_when_cause_flush&quot; type=&quot;&lt;wal_node_id&gt;&quot;</td><td>Histogram</td><td>Ram of oldest memTable when cause flush</td></tr><tr><td>flush_sub_task_cost</td><td style="text-align:left;">type=&quot;sort_task&quot;</td><td>Timer</td><td>Time cost of sort series in flush sort stage</td></tr><tr><td>flush_sub_task_cost</td><td style="text-align:left;">type=&quot;encoding_task&quot;</td><td>Timer</td><td>Time cost of sub encoding task in flush encoding stage</td></tr><tr><td>flush_sub_task_cost</td><td style="text-align:left;">type=&quot;io_task&quot;</td><td>Timer</td><td>Time cost of sub io task in flush io stage</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage=&quot;write_plan_indices&quot;</td><td>Timer</td><td>Time cost of write plan indices</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage=&quot;sort&quot;</td><td>Timer</td><td>Time cost of flush sort stage</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage=&quot;encoding&quot;</td><td>Timer</td><td>Time cost of flush encoding stage</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage=&quot;io&quot;</td><td>Timer</td><td>Time cost of flush io stage</td></tr><tr><td>pending_flush_task</td><td style="text-align:left;">type=&quot;pending_task_num&quot;</td><td>AutoGauge</td><td>Num of pending flush task num</td></tr><tr><td>pending_flush_task</td><td style="text-align:left;">type=&quot;pending_sub_task_num&quot;</td><td>AutoGauge</td><td>Num of pending flush sub task num</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name=&quot;mem_table_size&quot; region=&quot;DataRegion[&lt;data_region_id&gt;]&quot;</td><td>Histogram</td><td>Size of flushing memTable</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name=&quot;total_point_num&quot; region=&quot;DataRegion[&lt;data_region_id&gt;]&quot;</td><td>Histogram</td><td>Point num of flushing memTable</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name=&quot;series_num&quot; region=&quot;DataRegion[&lt;data_region_id&gt;]&quot;</td><td>Histogram</td><td>Series num of flushing memTable</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name=&quot;avg_series_points_num&quot; region=&quot;DataRegion[&lt;data_region_id&gt;]&quot;</td><td>Histogram</td><td>Point num of flushing memChunk</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name=&quot;tsfile_compression_ratio&quot; region=&quot;DataRegion[&lt;data_region_id&gt;]&quot;</td><td>Histogram</td><td>TsFile Compression ratio of flushing memTable</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name=&quot;flush_tsfile_size&quot; region=&quot;DataRegion[&lt;data_region_id&gt;]&quot;</td><td>Histogram</td><td>TsFile size of flushing memTable</td></tr></tbody></table><h3 id="_4-3-normal-level-metrics" tabindex="-1"><a class="header-anchor" href="#_4-3-normal-level-metrics"><span>4.3. Normal level Metrics</span></a></h3><h4 id="_4-3-1-cluster" tabindex="-1"><a class="header-anchor" href="#_4-3-1-cluster"><span>4.3.1. Cluster</span></a></h4><table><thead><tr><th>Metric</th><th>Tags</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>region</td><td>name=&quot;{DatabaseName}&quot;,type=&quot;SchemaRegion/DataRegion&quot;</td><td>AutoGauge</td><td>The number of DataRegion/SchemaRegion of database in specific node</td></tr><tr><td>slot</td><td>name=&quot;{DatabaseName}&quot;,type=&quot;schemaSlotNumber/dataSlotNumber&quot;</td><td>AutoGauge</td><td>The number of DataSlot/SchemaSlot of database in specific node</td></tr></tbody></table><h3 id="_4-4-all-metric" tabindex="-1"><a class="header-anchor" href="#_4-4-all-metric"><span>4.4. All Metric</span></a></h3><p>Currently there is no All level metrics, and it will continue to be added in the future.</p><h2 id="_5-how-to-get-these-metrics" tabindex="-1"><a class="header-anchor" href="#_5-how-to-get-these-metrics"><span>5. How to get these metrics?</span></a></h2><p>The relevant configuration of the metric module is in <code>conf/iotdb-{datanode/confignode}.properties</code>, and all<br> configuration items support hot loading through the <code>load configuration</code> command.</p><h3 id="_5-1-jmx" tabindex="-1"><a class="header-anchor" href="#_5-1-jmx"><span>5.1. JMX</span></a></h3><p>For metrics exposed externally using JMX, you can view them through Jconsole. After entering the Jconsole monitoring<br> page, you will first see an overview of various running conditions of IoTDB. Here you can see heap memory information,<br> thread information, class information, and the server&#39;s CPU usage.</p><h4 id="_5-1-1-obtain-metric-data" tabindex="-1"><a class="header-anchor" href="#_5-1-1-obtain-metric-data"><span>5.1.1. Obtain metric data</span></a></h4><p>After connecting to JMX, you can find the &quot;MBean&quot; named &quot;org.apache.iotdb.metrics&quot; through the &quot;MBeans&quot; tab, and you can<br> view the specific values of all monitoring metrics in the sidebar.</p><img style="width:100%;max-width:800px;max-height:600px;margin-left:auto;margin-right:auto;display:block;" alt="metric-jmx" src="https://alioss.timecho.com/docs/img/github/204018765-6fda9391-ebcf-4c80-98c5-26f34bd74df0.png"><h4 id="_5-1-2-get-other-relevant-data" tabindex="-1"><a class="header-anchor" href="#_5-1-2-get-other-relevant-data"><span>5.1.2. Get other relevant data</span></a></h4><p>After connecting to JMX, you can find the &quot;MBean&quot; named &quot;org.apache.iotdb.service&quot; through the &quot;MBeans&quot; tab, as shown in<br> the image below, to understand the basic status of the service</p><p><img style="width:100%;max-width:800px;max-height:600px;margin-left:auto;margin-right:auto;display:block;" src="https://alioss.timecho.com/docs/img/github/149951720-707f1ee8-32ee-4fde-9252-048caebd232e.png"> <br></p><p>In order to improve query performance, IOTDB caches ChunkMetaData and TsFileMetaData. Users can use MXBean and expand<br> the sidebar <code>org.apache.iotdb.db.service</code> to view the cache hit ratio:</p><img style="width:100%;max-width:800px;max-height:600px;margin-left:auto;margin-right:auto;display:block;" src="https://alioss.timecho.com/docs/img/github/112426760-73e3da80-8d73-11eb-9a8f-9232d1f2033b.png"><h3 id="_5-2-prometheus" tabindex="-1"><a class="header-anchor" href="#_5-2-prometheus"><span>5.2. Prometheus</span></a></h3><h4 id="_5-2-1-the-mapping-from-metric-type-to-prometheus-format" tabindex="-1"><a class="header-anchor" href="#_5-2-1-the-mapping-from-metric-type-to-prometheus-format"><span>5.2.1. The mapping from metric type to prometheus format</span></a></h4><blockquote><p>For metrics whose Metric Name is name and Tags are K1=V1, ..., Kn=Vn, the mapping is as follows, where value is a<br> specific value</p></blockquote><table><thead><tr><th>Metric Type</th><th>Mapping</th></tr></thead><tbody><tr><td>Counter</td><td>name_total{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value</td></tr><tr><td>AutoGauge、Gauge</td><td>name{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value</td></tr><tr><td>Histogram</td><td>name_max{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name_sum{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name_count{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, quantile=&quot;0.5&quot;} value <br> name{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, quantile=&quot;0.99&quot;} value</td></tr><tr><td>Rate</td><td>name_total{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name_total{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, rate=&quot;m1&quot;} value <br> name_total{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, rate=&quot;m5&quot;} value <br> name_total{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, rate=&quot;m15&quot;} value <br> name_total{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, rate=&quot;mean&quot;} value</td></tr><tr><td>Timer</td><td>name_seconds_max{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name_seconds_sum{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name_seconds_count{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;} value <br> name_seconds{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, quantile=&quot;0.5&quot;} value <br> name_seconds{cluster=&quot;clusterName&quot;, nodeType=&quot;nodeType&quot;, nodeId=&quot;nodeId&quot;, k1=&quot;V1&quot;, ..., Kn=&quot;Vn&quot;, quantile=&quot;0.99&quot;} value</td></tr></tbody></table><h4 id="_5-2-2-config-file" tabindex="-1"><a class="header-anchor" href="#_5-2-2-config-file"><span>5.2.2. Config File</span></a></h4><ol><li>Taking DataNode as an example, modify the iotdb-datanode.properties configuration file as follows:</li></ol><div class="language-properties line-numbers-mode" data-highlighter="prismjs" data-ext="properties" data-title="properties"><pre><code><span class="line"><span class="token key attr-name">dn_metric_reporter_list</span><span class="token punctuation">=</span><span class="token value attr-value">PROMETHEUS</span></span>
<span class="line"><span class="token key attr-name">dn_metric_level</span><span class="token punctuation">=</span><span class="token value attr-value">CORE</span></span>
<span class="line"><span class="token key attr-name">dn_metric_prometheus_reporter_port</span><span class="token punctuation">=</span><span class="token value attr-value">9091</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Then you can get metrics data as follows</p><ol start="2"><li>Start IoTDB DataNodes</li><li>Open a browser or use <code>curl</code> to visit <code>http://servier_ip:9091/metrics</code>, you can get the following metric<br> data:</li></ol><div class="language-text line-numbers-mode" data-highlighter="prismjs" data-ext="text" data-title="text"><pre><code><span class="line">...</span>
<span class="line"># HELP file_count</span>
<span class="line"># TYPE file_count gauge</span>
<span class="line">file_count{name=&quot;wal&quot;,} 0.0</span>
<span class="line">file_count{name=&quot;unseq&quot;,} 0.0</span>
<span class="line">file_count{name=&quot;seq&quot;,} 2.0</span>
<span class="line">...</span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h4 id="_5-2-3-prometheus-grafana" tabindex="-1"><a class="header-anchor" href="#_5-2-3-prometheus-grafana"><span>5.2.3. Prometheus + Grafana</span></a></h4><p>As shown above, IoTDB exposes monitoring metrics data in the standard Prometheus format to the outside world. Prometheus<br> can be used to collect and store monitoring indicators, and Grafana can be used to visualize monitoring indicators.</p><p>The following picture describes the relationships among IoTDB, Prometheus and Grafana</p><figure><img src="https://alioss.timecho.com/docs/img/UserGuide/System-Tools/Metrics/iotdb_prometheus_grafana.png" alt="iotdb_prometheus_grafana" tabindex="0" loading="lazy"><figcaption>iotdb_prometheus_grafana</figcaption></figure><ol><li>Along with running, IoTDB will collect its metrics continuously.</li><li>Prometheus scrapes metrics from IoTDB at a constant interval (can be configured).</li><li>Prometheus saves these metrics to its inner TSDB.</li><li>Grafana queries metrics from Prometheus at a constant interval (can be configured) and then presents them on the<br> graph.</li></ol><p>So, we need to do some additional works to configure and deploy Prometheus and Grafana.</p><p>For instance, you can config your Prometheus as follows to get metrics data from IoTDB:</p><div class="language-yaml line-numbers-mode" data-highlighter="prismjs" data-ext="yml" data-title="yml"><pre><code><span class="line"><span class="token key atrule">job_name</span><span class="token punctuation">:</span> pull<span class="token punctuation">-</span>metrics</span>
<span class="line"><span class="token key atrule">honor_labels</span><span class="token punctuation">:</span> <span class="token boolean important">true</span></span>
<span class="line"><span class="token key atrule">honor_timestamps</span><span class="token punctuation">:</span> <span class="token boolean important">true</span></span>
<span class="line"><span class="token key atrule">scrape_interval</span><span class="token punctuation">:</span> 15s</span>
<span class="line"><span class="token key atrule">scrape_timeout</span><span class="token punctuation">:</span> 10s</span>
<span class="line"><span class="token key atrule">metrics_path</span><span class="token punctuation">:</span> /metrics</span>
<span class="line"><span class="token key atrule">scheme</span><span class="token punctuation">:</span> http</span>
<span class="line"><span class="token key atrule">follow_redirects</span><span class="token punctuation">:</span> <span class="token boolean important">true</span></span>
<span class="line"><span class="token key atrule">static_configs</span><span class="token punctuation">:</span></span>
<span class="line"> <span class="token punctuation">-</span> <span class="token key atrule">targets</span><span class="token punctuation">:</span></span>
<span class="line"> <span class="token punctuation">-</span> localhost<span class="token punctuation">:</span><span class="token number">9091</span></span>
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The following documents may help you have a good journey with Prometheus and Grafana.</p><p><a href="https://prometheus.io/docs/prometheus/latest/getting_started/" target="_blank" rel="noopener noreferrer">Prometheus getting_started</a></p><p><a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config" target="_blank" rel="noopener noreferrer">Prometheus scrape metrics</a></p><p><a href="https://grafana.com/docs/grafana/latest/getting-started/getting-started/" target="_blank" rel="noopener noreferrer">Grafana getting_started</a></p><p><a href="https://prometheus.io/docs/visualization/grafana/#grafana-support-for-prometheus" target="_blank" rel="noopener noreferrer">Grafana query metrics from Prometheus</a></p><h4 id="_5-2-4-apache-iotdb-dashboard" tabindex="-1"><a class="header-anchor" href="#_5-2-4-apache-iotdb-dashboard"><span>5.2.4. Apache IoTDB Dashboard</span></a></h4><p><code>Apache IoTDB Dashboard</code> is available as a supplement to IoTDB Enterprise Edition, designed for unified centralized operations and management. With it, multiple clusters can be monitored through a single panel. You can access the Dashboard&#39;s Json file by contacting Commerce.</p><figure><img src="https://alioss.timecho.com/docs/img/UserGuide/System-Tools/Metrics/dashboard.png" alt="Apache IoTDB Dashboard" tabindex="0" loading="lazy"><figcaption>Apache IoTDB Dashboard</figcaption></figure><h3 id="_5-3-iotdb" tabindex="-1"><a class="header-anchor" href="#_5-3-iotdb"><span>5.3. IoTDB</span></a></h3><h4 id="_5-3-1-iotdb-mapping-relationship-of-metrics" tabindex="-1"><a class="header-anchor" href="#_5-3-1-iotdb-mapping-relationship-of-metrics"><span>5.3.1. IoTDB mapping relationship of metrics</span></a></h4><blockquote><p>For metrics whose Metric Name is name and Tags are K1=V1, ..., Kn=Vn, the mapping is as follows, taking root.__<br> system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code> as an example by default</p></blockquote><table><thead><tr><th>Metric Type</th><th>Mapping</th></tr></thead><tbody><tr><td>Counter</td><td>root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.value</td></tr><tr><td>AutoGauge、Gauge</td><td>root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.value</td></tr><tr><td>Histogram</td><td>root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.count <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.max <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.sum <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p0 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p50 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p75 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p99 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p999</td></tr><tr><td>Rate</td><td>root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.count <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.mean <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.m1 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.m5 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.m15</td></tr><tr><td>Timer</td><td>root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.count <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.max <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.mean <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.sum <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p0 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p50 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p75 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p99 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.p999 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.m1 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.m5 <br> root.__system.metric.<code>clusterName</code>.<code>nodeType</code>.<code>nodeId</code>.name.<code>K1=V1</code>...<code>Kn=Vn</code>.m15</td></tr></tbody></table><h4 id="_5-3-2-obtain-metrics" tabindex="-1"><a class="header-anchor" href="#_5-3-2-obtain-metrics"><span>5.3.2. Obtain metrics</span></a></h4><p>According to the above mapping relationship, related IoTDB query statements can be formed to obtain metrics</p>`,65)]))}const c=e(n,[["render",s],["__file","Metric-Tool.html.vue"]]),u=JSON.parse('{"path":"/UserGuide/V1.1.x/Monitor-Alert/Metric-Tool.html","title":"","lang":"en-US","frontmatter":{"description":"Along with IoTDB running, we hope to observe the status of IoTDB, so as to troubleshoot system problems or discover potential system risks in time. A series of metrics that can ...","head":[["link",{"rel":"alternate","hreflang":"zh-cn","href":"https://iotdb.apache.org/zh/UserGuide/V1.1.x/Monitor-Alert/Metric-Tool.html"}],["meta",{"property":"og:url","content":"https://iotdb.apache.org/UserGuide/V1.1.x/Monitor-Alert/Metric-Tool.html"}],["meta",{"property":"og:site_name","content":"IoTDB Website"}],["meta",{"property":"og:description","content":"Along with IoTDB running, we hope to observe the status of IoTDB, so as to troubleshoot system problems or discover potential system risks in time. A series of metrics that can ..."}],["meta",{"property":"og:type","content":"article"}],["meta",{"property":"og:image","content":"https://alioss.timecho.com/docs/img/UserGuide/System-Tools/Metrics/iotdb_prometheus_grafana.png"}],["meta",{"property":"og:locale","content":"en-US"}],["meta",{"property":"og:locale:alternate","content":"zh-CN"}],["meta",{"property":"og:updated_time","content":"2024-05-09T10:21:49.000Z"}],["meta",{"property":"article:modified_time","content":"2024-05-09T10:21:49.000Z"}],["script",{"type":"application/ld+json"},"{\\"@context\\":\\"https://schema.org\\",\\"@type\\":\\"Article\\",\\"headline\\":\\"\\",\\"image\\":[\\"https://alioss.timecho.com/docs/img/UserGuide/System-Tools/Metrics/iotdb_prometheus_grafana.png\\",\\"https://alioss.timecho.com/docs/img/UserGuide/System-Tools/Metrics/dashboard.png\\"],\\"dateModified\\":\\"2024-05-09T10:21:49.000Z\\",\\"author\\":[]}"]]},"headers":[{"level":2,"title":"1. When to use metric framework?","slug":"_1-when-to-use-metric-framework","link":"#_1-when-to-use-metric-framework","children":[]},{"level":2,"title":"2. Who will use metric framework?","slug":"_2-who-will-use-metric-framework","link":"#_2-who-will-use-metric-framework","children":[]},{"level":2,"title":"3. What is metrics?","slug":"_3-what-is-metrics","link":"#_3-what-is-metrics","children":[{"level":3,"title":"3.1. Key Concept","slug":"_3-1-key-concept","link":"#_3-1-key-concept","children":[]},{"level":3,"title":"3.2. External data format for metrics","slug":"_3-2-external-data-format-for-metrics","link":"#_3-2-external-data-format-for-metrics","children":[]}]},{"level":2,"title":"4. The detail of metrics","slug":"_4-the-detail-of-metrics","link":"#_4-the-detail-of-metrics","children":[{"level":3,"title":"4.1. Core level metrics","slug":"_4-1-core-level-metrics","link":"#_4-1-core-level-metrics","children":[]},{"level":3,"title":"4.2. Important level metrics","slug":"_4-2-important-level-metrics","link":"#_4-2-important-level-metrics","children":[]},{"level":3,"title":"4.3. Normal level Metrics","slug":"_4-3-normal-level-metrics","link":"#_4-3-normal-level-metrics","children":[]},{"level":3,"title":"4.4. All Metric","slug":"_4-4-all-metric","link":"#_4-4-all-metric","children":[]}]},{"level":2,"title":"5. How to get these metrics?","slug":"_5-how-to-get-these-metrics","link":"#_5-how-to-get-these-metrics","children":[{"level":3,"title":"5.1. JMX","slug":"_5-1-jmx","link":"#_5-1-jmx","children":[]},{"level":3,"title":"5.2. Prometheus","slug":"_5-2-prometheus","link":"#_5-2-prometheus","children":[]},{"level":3,"title":"5.3. IoTDB","slug":"_5-3-iotdb","link":"#_5-3-iotdb","children":[]}]}],"git":{"createdTime":1688958677000,"updatedTime":1715250109000,"contributors":[{"name":"CritasWang","email":"critas@outlook.com","commits":1},{"name":"wanghui42","email":"105700158+wanghui42@users.noreply.github.com","commits":1}]},"readingTime":{"minutes":17.2,"words":5161},"filePathRelative":"UserGuide/V1.1.x/Monitor-Alert/Metric-Tool.md","localizedDate":"July 10, 2023","autoDesc":true}');export{c as comp,u as data};