| 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="analyzer"</td><td>Timer</td><td>The query statement analysis time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage="logical_planner"</td><td>Timer</td><td>The query logical plan planning time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage="distribution_planner"</td><td>Timer</td><td>The query distribution plan planning time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage="partition_fetcher"</td><td>Timer</td><td>The partition information fetching time-consuming</td></tr><tr><td>query_plan_cost</td><td>stage="schema_fetcher"</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="wait_for_dispatch"</td><td>Timer</td><td>The distribution plan dispatcher time-consuming</td></tr><tr><td>dispatcher</td><td>stage="dispatch_read"</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="sequence_tsfile"</td><td>Rate</td><td>The access frequency of sequence tsfiles</td></tr><tr><td>query_resource</td><td>type="unsequence_tsfile"</td><td>Rate</td><td>The access frequency of unsequence tsfiles</td></tr><tr><td>query_resource</td><td>type="flushing_memtable"</td><td>Rate</td><td>The access frequency of flushing memtables</td></tr><tr><td>query_resource</td><td>type="working_memtable"</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="source_handle_get_tsblock", type="local/remote"</td><td>Timer</td><td>The time-consuming that source handles receive TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation="source_handle_deserialize_tsblock", type="local/remote"</td><td>Timer</td><td>The time-consuming that source handles deserialize TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation="sink_handle_send_tsblock", type="local/remote"</td><td>Timer</td><td>The time-consuming that sink handles send TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation="send_new_data_block_event_task", type="server/caller"</td><td>Timer</td><td>The RPC time-consuming that sink handles send TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation="get_data_block_task", type="server/caller"</td><td>Timer</td><td>The RPC time-consuming that source handles receive TsBlock</td></tr><tr><td>data_exchange_cost</td><td>operation="on_acknowledge_data_block_event_task", type="server/caller"</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="send_new_data_block_num", type="server/caller"</td><td>Histogram</td><td>The number of sent TsBlocks by sink handles</td></tr><tr><td>data_exchange_count</td><td>name="get_data_block_num", type="server/caller"</td><td>Histogram</td><td>The number of received TsBlocks by source handles</td></tr><tr><td>data_exchange_count</td><td>name="on_acknowledge_data_block_num", type="server/caller"</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="ready_queued_time"</td><td>Timer</td><td>The queuing time of ready queue</td></tr><tr><td>driver_scheduler</td><td>name="block_queued_time"</td><td>Timer</td><td>The queuing time of blocking queue</td></tr><tr><td>driver_scheduler</td><td>name="ready_queue_task_count"</td><td>AutoGauge</td><td>The number of tasks queued in the ready queue</td></tr><tr><td>driver_scheduler</td><td>name="block_queued_task_count"</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="local_execution_planner"</td><td>Timer</td><td>The time-consuming of operator tree construction</td></tr><tr><td>query_execution</td><td>stage="query_resource_init"</td><td>Timer</td><td>The time-consuming of query resource initialization</td></tr><tr><td>query_execution</td><td>stage="get_query_resource_from_mem"</td><td>Timer</td><td>The time-consuming of query resource memory query and construction</td></tr><tr><td>query_execution</td><td>stage="driver_internal_process"</td><td>Timer</td><td>The time-consuming of driver execution</td></tr><tr><td>query_execution</td><td>stage="wait_for_result"</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="{operator_name}"</td><td>Timer</td><td>The operator execution time</td></tr><tr><td>operator_execution_count</td><td>name="{operator_name}"</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="raw_data"</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="statistics"</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="load_timeseries_metadata", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of loading TimeseriesMetadata</td></tr><tr><td>series_scan_cost</td><td>stage="read_timeseries_metadata", type="", from="cache/file"</td><td>Timer</td><td>The time-consuming of reading TimeseriesMetadata of a tsfile</td></tr><tr><td>series_scan_cost</td><td>stage="timeseries_metadata_modification", type="aligned/non_aligned", from="null"</td><td>Timer</td><td>The time-consuming of filtering TimeseriesMetadata by mods</td></tr><tr><td>series_scan_cost</td><td>stage="load_chunk_metadata_list", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of loading ChunkMetadata list</td></tr><tr><td>series_scan_cost</td><td>stage="chunk_metadata_modification", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of filtering ChunkMetadata by mods</td></tr><tr><td>series_scan_cost</td><td>stage="chunk_metadata_filter", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of filtering ChunkMetadata by query filter</td></tr><tr><td>series_scan_cost</td><td>stage="construct_chunk_reader", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of constructing ChunkReader</td></tr><tr><td>series_scan_cost</td><td>stage="read_chunk", type="", from="cache/file"</td><td>Timer</td><td>The time-consuming of reading Chunk</td></tr><tr><td>series_scan_cost</td><td>stage="init_chunk_reader", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of initializing ChunkReader (constructing PageReader)</td></tr><tr><td>series_scan_cost</td><td>stage="build_tsblock_from_page_reader", type="aligned/non_aligned", from="mem/disk"</td><td>Timer</td><td>The time-consuming of constructing Tsblock from PageReader</td></tr><tr><td>series_scan_cost</td><td>stage="build_tsblock_from_merge_reader", type="aligned/non_aligned", from="null"</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="schema_region_total_mem_usage"</td><td>AutoGauge</td><td>Memory usgae for all SchemaRegion</td></tr><tr><td>schema_engine</td><td>name="schema_region_mem_capacity"</td><td>AutoGauge</td><td>Memory capacity for all SchemaRegion</td></tr><tr><td>schema_engine</td><td>name="schema_engine_mode"</td><td>Gauge</td><td>Mode of SchemaEngine</td></tr><tr><td>schema_engine</td><td>name="schema_region_consensus"</td><td>Gauge</td><td>Consensus protocol of SchemaRegion</td></tr><tr><td>schema_engine</td><td>name="schema_region_number"</td><td>AutoGauge</td><td>Number of SchemaRegion</td></tr><tr><td>quantity</td><td>name="template_series_cnt"</td><td>AutoGauge</td><td>Number of template series</td></tr><tr><td>schema_region</td><td>name="schema_region_mem_usage", region="SchemaRegion[{regionId}]"</td><td>AutoGauge</td><td>Memory usgae for each SchemaRegion</td></tr><tr><td>schema_region</td><td>name="schema_region_series_cnt", region="SchemaRegion[{regionId}]"</td><td>AutoGauge</td><td>Number of total timeseries for each SchemaRegion</td></tr><tr><td>schema_region</td><td>name="activated_template_cnt", region="SchemaRegion[{regionId}]"</td><td>AutoGauge</td><td>Number of Activated template for each SchemaRegion</td></tr><tr><td>schema_region</td><td>name="template_series_cnt", region="SchemaRegion[{regionId}]"</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="wal_nodes_num"</td><td>AutoGauge</td><td>Num of WALNode</td></tr><tr><td>wal_cost</td><td style="text-align:left;">stage="make_checkpoint" type="<checkpoint_type>"</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="serialize_one_wal_info_entry"</td><td>Timer</td><td>Time cost of serialize one WALInfoEntry</td></tr><tr><td>wal_cost</td><td style="text-align:left;">stage="sync_wal_buffer" type="<force_flag>"</td><td>Timer</td><td>Time cost of sync WALBuffer</td></tr><tr><td>wal_buffer</td><td style="text-align:left;">name="used_ratio"</td><td>Histogram</td><td>Used ratio of WALBuffer</td></tr><tr><td>wal_cost</td><td style="text-align:left;">stage="serialize_wal_entry" type="serialize_wal_entry_total"</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="effective_info_ratio" type="<wal_node_id>"</td><td>Histogram</td><td>Effective info ratio of WALNode</td></tr><tr><td>wal_node_info</td><td style="text-align:left;">name="oldest_mem_table_ram_when_cause_snapshot" type="<wal_node_id>"</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="oldest_mem_table_ram_when_cause_flush" type="<wal_node_id>"</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="sort_task"</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="encoding_task"</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="io_task"</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="write_plan_indices"</td><td>Timer</td><td>Time cost of write plan indices</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage="sort"</td><td>Timer</td><td>Time cost of flush sort stage</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage="encoding"</td><td>Timer</td><td>Time cost of flush encoding stage</td></tr><tr><td>flush_cost</td><td style="text-align:left;">stage="io"</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="pending_task_num"</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="pending_sub_task_num"</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="mem_table_size" region="DataRegion[<data_region_id>]"</td><td>Histogram</td><td>Size of flushing memTable</td></tr><tr><td>flushing_mem_table_status</td><td style="text-align:left;">name="total_point_num" region="DataRegion[<data_region_id>]"</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="series_num" region="DataRegion[<data_region_id>]"</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="avg_series_points_num" region="DataRegion[<data_region_id>]"</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="tsfile_compression_ratio" region="DataRegion[<data_region_id>]"</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="flush_tsfile_size" region="DataRegion[<data_region_id>]"</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="{DatabaseName}",type="SchemaRegion/DataRegion"</td><td>AutoGauge</td><td>The number of DataRegion/SchemaRegion of database in specific node</td></tr><tr><td>slot</td><td>name="{DatabaseName}",type="schemaSlotNumber/dataSlotNumber"</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'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 "MBean" named "org.apache.iotdb.metrics" through the "MBeans" 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 "MBean" named "org.apache.iotdb.service" through the "MBeans" 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="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value</td></tr><tr><td>AutoGauge、Gauge</td><td>name{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value</td></tr><tr><td>Histogram</td><td>name_max{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name_sum{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name_count{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", quantile="0.5"} value <br> name{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", quantile="0.99"} value</td></tr><tr><td>Rate</td><td>name_total{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name_total{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", rate="m1"} value <br> name_total{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", rate="m5"} value <br> name_total{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", rate="m15"} value <br> name_total{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", rate="mean"} value</td></tr><tr><td>Timer</td><td>name_seconds_max{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name_seconds_sum{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name_seconds_count{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn"} value <br> name_seconds{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", quantile="0.5"} value <br> name_seconds{cluster="clusterName", nodeType="nodeType", nodeId="nodeId", k1="V1", ..., Kn="Vn", quantile="0.99"} 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="wal",} 0.0</span> |
| <span class="line">file_count{name="unseq",} 0.0</span> |
| <span class="line">file_count{name="seq",} 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'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}; |