This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 9562161613 [IOTDB-3433] add metric for cluster. (#6291)
9562161613 is described below
commit 956216161304be9ff89b473d230c9bc13aedbb38
Author: ZhangHongYin <[email protected]>
AuthorDate: Thu Jun 16 16:33:02 2022 +0800
[IOTDB-3433] add metric for cluster. (#6291)
Nice done
---
.../iotdb/confignode/manager/ConfigManager.java | 6 +
.../apache/iotdb/confignode/manager/Manager.java | 2 +
.../iotdb/confignode/manager/NodeManager.java | 4 +
.../iotdb/confignode/manager/PartitionManager.java | 4 +
.../iotdb/confignode/persistence/NodeInfo.java | 28 +
.../persistence/partition/PartitionInfo.java | 113 ++-
.../partition/StorageGroupPartitionTable.java | 85 ++-
.../iotdb/confignode/service/ConfigNode.java | 1 +
docs/UserGuide/Maintenance-Tools/Metric-Tool.md | 26 +-
docs/zh/UserGuide/Maintenance-Tools/Metric-Tool.md | 26 +-
...Apache IoTDB ConfigNode Dashboard v0.14.0.json} | 802 ++++++---------------
.../Apache IoTDB DataNode Dashboard v0.14.0.json} | 107 +--
.../Apache IoTDB Dashboard v0.13.1.json | 0
.../Apache IoTDB Dashboard v0.14.0.json | 0
.../iotdb/db/service/metrics/enums/Metric.java | 7 +-
15 files changed, 565 insertions(+), 646 deletions(-)
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
index 75a0f1f04f..cdf760114e 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/ConfigManager.java
@@ -664,4 +664,10 @@ public class ConfigManager implements Manager {
}
return noExistSg;
}
+
+ @Override
+ public void addMetrics() {
+ partitionManager.addMetrics();
+ nodeManager.addMetrics();
+ }
}
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
index df6b1593d5..a552b7f464 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/manager/Manager.java
@@ -220,4 +220,6 @@ public interface Manager {
TSStatus createFunction(String udfName, String className, List<String> uris);
TSStatus dropFunction(String udfName);
+
+ void addMetrics();
}
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/NodeManager.java
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/NodeManager.java
index 01894c9308..947bf88d68 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/NodeManager.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/NodeManager.java
@@ -179,6 +179,10 @@ public class NodeManager {
}
}
+ public void addMetrics() {
+ nodeInfo.addMetrics();
+ }
+
public List<TConfigNodeLocation> getOnlineConfigNodes() {
return nodeInfo.getOnlineConfigNodes();
}
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
index 767d186693..931f16841e 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/manager/PartitionManager.java
@@ -448,6 +448,10 @@ public class PartitionManager {
}
}
+ public void addMetrics() {
+ partitionInfo.addMetrics();
+ }
+
/**
* Get TSeriesPartitionSlot
*
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
index fd3a0db28d..583a45ad43 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/NodeInfo.java
@@ -31,6 +31,11 @@ import
org.apache.iotdb.confignode.consensus.request.read.GetDataNodeInfoReq;
import org.apache.iotdb.confignode.consensus.request.write.ApplyConfigNodeReq;
import org.apache.iotdb.confignode.consensus.request.write.RegisterDataNodeReq;
import org.apache.iotdb.confignode.consensus.response.DataNodeInfosResp;
+import org.apache.iotdb.db.service.metrics.MetricsService;
+import org.apache.iotdb.db.service.metrics.enums.Metric;
+import org.apache.iotdb.db.service.metrics.enums.Tag;
+import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
+import org.apache.iotdb.metrics.utils.MetricLevel;
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
@@ -104,6 +109,29 @@ public class NodeInfo implements SnapshotProcessor {
new
HashSet<>(ConfigNodeDescriptor.getInstance().getConf().getConfigNodeList());
}
+ public void addMetrics() {
+ if
(MetricConfigDescriptor.getInstance().getMetricConfig().getEnableMetric()) {
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.CONFIG_NODE.toString(),
+ MetricLevel.CORE,
+ onlineConfigNodes,
+ o -> getOnlineDataNodeCount(),
+ Tag.NAME.toString(),
+ "online");
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.DATA_NODE.toString(),
+ MetricLevel.CORE,
+ onlineDataNodes,
+ Map::size,
+ Tag.NAME.toString(),
+ "online");
+ }
+ }
+
/** @return true if the specific DataNode is now online */
public boolean isOnlineDataNode(TDataNodeLocation info) {
boolean result = false;
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
index bb22cf459e..c4cd418ec7 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
@@ -21,6 +21,7 @@ package org.apache.iotdb.confignode.persistence.partition;
import org.apache.iotdb.common.rpc.thrift.TConsensusGroupId;
import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
+import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.TRegionReplicaSet;
import org.apache.iotdb.common.rpc.thrift.TSStatus;
import org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
@@ -42,6 +43,11 @@ import
org.apache.iotdb.confignode.consensus.response.SchemaNodeManagementResp;
import org.apache.iotdb.confignode.consensus.response.SchemaPartitionResp;
import org.apache.iotdb.confignode.exception.StorageGroupNotExistsException;
import org.apache.iotdb.consensus.common.DataSet;
+import org.apache.iotdb.db.service.metrics.MetricsService;
+import org.apache.iotdb.db.service.metrics.enums.Metric;
+import org.apache.iotdb.db.service.metrics.enums.Tag;
+import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
+import org.apache.iotdb.metrics.utils.MetricLevel;
import org.apache.iotdb.rpc.TSStatusCode;
import org.apache.iotdb.tsfile.utils.Pair;
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
@@ -59,6 +65,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -98,6 +105,42 @@ public class PartitionInfo implements SnapshotProcessor {
this.deletedRegionSet = Collections.synchronizedSet(new HashSet<>());
}
+ public void addMetrics() {
+ if
(MetricConfigDescriptor.getInstance().getMetricConfig().getEnableMetric()) {
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.STORAGE_GROUP.toString(),
+ MetricLevel.CORE,
+ storageGroupPartitionTables,
+ o -> o.size() / 2,
+ Tag.NAME.toString(),
+ "number");
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.REGION.toString(),
+ MetricLevel.IMPORTANT,
+ this,
+ o -> o.updateRegionMetric(TConsensusGroupType.SchemaRegion),
+ Tag.NAME.toString(),
+ "total",
+ Tag.TYPE.toString(),
+ TConsensusGroupType.SchemaRegion.toString());
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.REGION.toString(),
+ MetricLevel.IMPORTANT,
+ this,
+ o -> o.updateRegionMetric(TConsensusGroupType.DataRegion),
+ Tag.NAME.toString(),
+ "total",
+ Tag.TYPE.toString(),
+ TConsensusGroupType.DataRegion.toString());
+ }
+ }
+
public int generateNextRegionGroupId() {
return nextRegionGroupId.getAndIncrement();
}
@@ -113,7 +156,9 @@ public class PartitionInfo implements SnapshotProcessor {
* @return SUCCESS_STATUS if the new StorageGroupPartitionInfo is created
successfully.
*/
public TSStatus setStorageGroup(SetStorageGroupReq req) {
- storageGroupPartitionTables.put(req.getSchema().getName(), new
StorageGroupPartitionTable());
+ String storageGroupName = req.getSchema().getName();
+ storageGroupPartitionTables.put(
+ storageGroupName, new StorageGroupPartitionTable(storageGroupName));
LOGGER.info("Successfully set StorageGroup: {}", req.getSchema());
@@ -487,6 +532,69 @@ public class PartitionInfo implements SnapshotProcessor {
return
storageGroupPartitionTables.get(storageGroup).getSortedRegionSlotsCounter(type);
}
+ /**
+ * Get total region number
+ *
+ * @param type SchemaRegion or DataRegion
+ * @return the number of SchemaRegion or DataRegion
+ */
+ public int getTotalRegionCount(TConsensusGroupType type) {
+ Set<RegionGroup> regionGroups = new HashSet<>();
+ for (Map.Entry<String, StorageGroupPartitionTable> entry :
+ storageGroupPartitionTables.entrySet()) {
+ regionGroups.addAll(entry.getValue().getRegion(type));
+ }
+ return regionGroups.size();
+ }
+
+ /**
+ * update region-related metric
+ *
+ * @param type SchemaRegion or DataRegion
+ * @return the number of SchemaRegion or DataRegion
+ */
+ private int updateRegionMetric(TConsensusGroupType type) {
+ Set<RegionGroup> regionGroups = new HashSet<>();
+ for (Map.Entry<String, StorageGroupPartitionTable> entry :
+ storageGroupPartitionTables.entrySet()) {
+ regionGroups.addAll(entry.getValue().getRegion(type));
+ }
+ int result = regionGroups.size();
+ // datanode location -> region number
+ Map<TDataNodeLocation, Integer> dataNodeLocationIntegerMap = new
HashMap<>();
+ for (RegionGroup regionGroup : regionGroups) {
+ TRegionReplicaSet regionReplicaSet = regionGroup.getReplicaSet();
+ List<TDataNodeLocation> dataNodeLocations =
regionReplicaSet.getDataNodeLocations();
+ for (TDataNodeLocation dataNodeLocation : dataNodeLocations) {
+ if (!dataNodeLocationIntegerMap.containsKey(dataNodeLocation)) {
+ dataNodeLocationIntegerMap.put(dataNodeLocation, 0);
+ }
+ dataNodeLocationIntegerMap.put(
+ dataNodeLocation, dataNodeLocationIntegerMap.get(dataNodeLocation)
+ 1);
+ }
+ }
+ for (Map.Entry<TDataNodeLocation, Integer> entry :
dataNodeLocationIntegerMap.entrySet()) {
+ TDataNodeLocation dataNodeLocation = entry.getKey();
+ String name =
+ "EndPoint("
+ + dataNodeLocation.getExternalEndPoint().ip
+ + ":"
+ + dataNodeLocation.getExternalEndPoint().port
+ + ")";
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateGauge(
+ Metric.REGION.toString(),
+ MetricLevel.IMPORTANT,
+ Tag.NAME.toString(),
+ name,
+ Tag.TYPE.toString(),
+ type.toString())
+ .set(dataNodeLocationIntegerMap.get(dataNodeLocation));
+ }
+ return result;
+ }
+
public boolean processTakeSnapshot(File snapshotDir) throws TException,
IOException {
File snapshotFile = new File(snapshotDir, snapshotFileName);
@@ -562,7 +670,8 @@ public class PartitionInfo implements SnapshotProcessor {
int length = ReadWriteIOUtils.readInt(fileInputStream);
for (int i = 0; i < length; i++) {
String storageGroup = ReadWriteIOUtils.readString(fileInputStream);
- StorageGroupPartitionTable storageGroupPartitionTable = new
StorageGroupPartitionTable();
+ StorageGroupPartitionTable storageGroupPartitionTable =
+ new StorageGroupPartitionTable(storageGroup);
storageGroupPartitionTable.deserialize(fileInputStream, protocol);
storageGroupPartitionTables.put(storageGroup,
storageGroupPartitionTable);
}
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
index 6384b52058..d46447c46d 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/StorageGroupPartitionTable.java
@@ -25,6 +25,11 @@ import
org.apache.iotdb.common.rpc.thrift.TSeriesPartitionSlot;
import org.apache.iotdb.common.rpc.thrift.TTimePartitionSlot;
import org.apache.iotdb.commons.partition.DataPartitionTable;
import org.apache.iotdb.commons.partition.SchemaPartitionTable;
+import org.apache.iotdb.db.service.metrics.MetricsService;
+import org.apache.iotdb.db.service.metrics.enums.Metric;
+import org.apache.iotdb.db.service.metrics.enums.Tag;
+import org.apache.iotdb.metrics.config.MetricConfigDescriptor;
+import org.apache.iotdb.metrics.utils.MetricLevel;
import org.apache.iotdb.tsfile.utils.Pair;
import org.apache.iotdb.tsfile.utils.ReadWriteIOUtils;
@@ -36,9 +41,11 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Comparator;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
+import java.util.Set;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
@@ -46,6 +53,9 @@ import java.util.concurrent.atomic.AtomicInteger;
public class StorageGroupPartitionTable {
private volatile boolean isPredeleted = false;
+ // The name of storage group
+ private String storageGroupName;
+
// Total number of SeriesPartitionSlots occupied by schema,
// determines whether a new Region needs to be created
private final AtomicInteger seriesPartitionSlotsCount;
@@ -61,7 +71,8 @@ public class StorageGroupPartitionTable {
// DataPartition
private final DataPartitionTable dataPartitionTable;
- public StorageGroupPartitionTable() {
+ public StorageGroupPartitionTable(String storageGroupName) {
+ this.storageGroupName = storageGroupName;
this.seriesPartitionSlotsCount = new AtomicInteger(0);
this.schemaRegionParticle = new AtomicBoolean(true);
@@ -70,6 +81,58 @@ public class StorageGroupPartitionTable {
this.schemaPartitionTable = new SchemaPartitionTable();
this.dataPartitionTable = new DataPartitionTable();
+
+ addMetrics();
+ }
+
+ private void addMetrics() {
+ if
(MetricConfigDescriptor.getInstance().getMetricConfig().getEnableMetric()) {
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.REGION.toString(),
+ MetricLevel.NORMAL,
+ this,
+ o -> o.getRegionCount(TConsensusGroupType.SchemaRegion),
+ Tag.NAME.toString(),
+ storageGroupName,
+ Tag.TYPE.toString(),
+ TConsensusGroupType.SchemaRegion.toString());
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.REGION.toString(),
+ MetricLevel.NORMAL,
+ this,
+ o -> o.getRegionCount(TConsensusGroupType.DataRegion),
+ Tag.NAME.toString(),
+ storageGroupName,
+ Tag.TYPE.toString(),
+ TConsensusGroupType.DataRegion.toString());
+ // TODO slot will be updated in the future
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.SLOT.toString(),
+ MetricLevel.NORMAL,
+ schemaPartitionTable,
+ o -> o.getSchemaPartitionMap().size(),
+ Tag.NAME.toString(),
+ storageGroupName,
+ Tag.TYPE.toString(),
+ "schemaSlotNumber");
+ MetricsService.getInstance()
+ .getMetricManager()
+ .getOrCreateAutoGauge(
+ Metric.SLOT.toString(),
+ MetricLevel.NORMAL,
+ dataPartitionTable,
+ o -> o.getDataPartitionMap().size(),
+ Tag.NAME.toString(),
+ storageGroupName,
+ Tag.TYPE.toString(),
+ "dataSlotNumber");
+ }
}
public boolean isPredeleted() {
@@ -101,6 +164,24 @@ public class StorageGroupPartitionTable {
return result;
}
+ /**
+ * Get regions currently owned by this StorageGroup
+ *
+ * @param type SchemaRegion or DataRegion
+ * @return The regions currently owned by this StorageGroup
+ */
+ public Set<RegionGroup> getRegion(TConsensusGroupType type) {
+ Set<RegionGroup> regionGroups = new HashSet<>();
+ regionInfoMap
+ .values()
+ .forEach(
+ regionGroup -> {
+ if (regionGroup.getId().getType().equals(type)) {
+ regionGroups.add(regionGroup);
+ }
+ });
+ return regionGroups;
+ }
/**
* Get the number of Regions currently owned by this StorageGroup
*
@@ -283,6 +364,7 @@ public class StorageGroupPartitionTable {
public void serialize(OutputStream outputStream, TProtocol protocol)
throws IOException, TException {
ReadWriteIOUtils.write(isPredeleted, outputStream);
+ ReadWriteIOUtils.write(storageGroupName, outputStream);
ReadWriteIOUtils.write(seriesPartitionSlotsCount.get(), outputStream);
ReadWriteIOUtils.write(regionInfoMap.size(), outputStream);
@@ -298,6 +380,7 @@ public class StorageGroupPartitionTable {
public void deserialize(InputStream inputStream, TProtocol protocol)
throws IOException, TException {
isPredeleted = ReadWriteIOUtils.readBool(inputStream);
+ storageGroupName = ReadWriteIOUtils.readString(inputStream);
seriesPartitionSlotsCount.set(ReadWriteIOUtils.readInt(inputStream));
int length = ReadWriteIOUtils.readInt(inputStream);
diff --git
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 753d45fac7..2895454c4f 100644
---
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -82,6 +82,7 @@ public class ConfigNode implements ConfigNodeMBean {
JMXService.registerMBean(this, mbeanName);
registerManager.register(MetricsService.getInstance());
+ configManager.addMetrics();
registerUdfServices();
configNodeRPCService.initSyncedServiceImpl(configNodeRPCServiceProcessor);
diff --git a/docs/UserGuide/Maintenance-Tools/Metric-Tool.md
b/docs/UserGuide/Maintenance-Tools/Metric-Tool.md
index 7768d5907c..8a8385aa37 100644
--- a/docs/UserGuide/Maintenance-Tools/Metric-Tool.md
+++ b/docs/UserGuide/Maintenance-Tools/Metric-Tool.md
@@ -103,10 +103,10 @@ Next, we will choose Prometheus format data as samples to
describe each kind of
#### 4.3.4. Cache
-| Metric | Tag | level |
Description |
Sample |
-| --------- | --------------------------------------- | --------- |
----------------------------------------------------------------------------- |
--------------------------- |
-| cache_hit | name="chunk/timeSeriesMeta/bloomFilter/SchemaCache" | important
| Cache hit ratio of chunk/timeSeriesMeta/SchemaCache and prevention ratio of
bloom filter | cache_hit{name="chunk",} 80 |
-| cache_total | name="StorageGroup/SchemaPartition/DataPartition",
type="hit/all" | important | The cache hit/all counts of
StorageGroup/SchemaPartition/DataPartition |
cache_total{name="DataPartition",type="all",} 801.0 |
+| Metric | Tag
| level | Description
| Sample
|
+| ----------- |
----------------------------------------------------------------- | --------- |
-----------------------------------------------------------------------------------------
| --------------------------------------------------- |
+| cache_hit | name="chunk/timeSeriesMeta/bloomFilter/SchemaCache"
| important | Cache hit ratio of chunk/timeSeriesMeta/SchemaCache and
prevention ratio of bloom filter | cache_hit{name="chunk",} 80
|
+| cache_total | name="StorageGroup/SchemaPartition/DataPartition",
type="hit/all" | important | The cache hit/all counts of
StorageGroup/SchemaPartition/DataPartition |
cache_total{name="DataPartition",type="all",} 801.0 |
#### 4.3.5. Business Data
@@ -117,12 +117,18 @@ Next, we will choose Prometheus format data as samples to
describe each kind of
#### 4.3.6. Cluster
-| Metric | Tag | level |
Description
| Sample
|
-| ------------------------- | ------------------------------- | --------- |
--------------------------------------------------------------------------------------------
| ----------------------------------------------------------------------------
|
-| cluster_node_leader_count | name="{{ip}}" | important |
The count of ```dataGroupLeader``` on each node, which reflects the
distribution of leaders | cluster_node_leader_count{name="127.0.0.1",} 2.0
|
-| cluster_uncommitted_log | name="{{ip_datagroupHeader}}" | important |
The count of ```uncommitted_log``` on each node in data groups it belongs to
|
cluster_uncommitted_log{name="127.0.0.1_Data-127.0.0.1-40010-raftId-0",} 0.0 |
-| cluster_node_status | name="{{ip}}" | important |
The current node status, 1=online 2=offline
| cluster_node_status{name="127.0.0.1",} 1.0
|
-| cluster_elect_total | name="{{ip}}",status="fail/win" | important |
The count and result (won or failed) of elections the node participated in.
| cluster_elect_total{name="127.0.0.1",status="win",} 1.0
|
+| Metric | Tag
| level | Description
| Sample
|
+| ------------------------- |
------------------------------------------------------------------ | ---------
|
--------------------------------------------------------------------------------------------
| ----------------------------------------------------------------------------
|
+| cluster_node_leader_count | name="{{ip}}"
| important | The count of ```dataGroupLeader``` on each
node, which reflects the distribution of leaders |
cluster_node_leader_count{name="127.0.0.1",} 2.0 |
+| cluster_uncommitted_log | name="{{ip_datagroupHeader}}"
| important | The count of ```uncommitted_log``` on each node
in data groups it belongs to |
cluster_uncommitted_log{name="127.0.0.1_Data-127.0.0.1-40010-raftId-0",} 0.0 |
+| cluster_node_status | name="{{ip}}"
| important | The current node status, 1=online 2=offline
|
cluster_node_status{name="127.0.0.1",} 1.0 |
+| cluster_elect_total | name="{{ip}}",status="fail/win"
| important | The count and result (won or failed) of
elections the node participated in. |
cluster_elect_total{name="127.0.0.1",status="win",} 1.0 |
+| config_node | name="online"
| core | The number of online confignodes
| config_node{name="online",} 3.0
|
+| data_node | name="online"
| core | The number of online datanodes
| data_node{name="online",} 3.0
|
+| partition_table | name="number"
| core | The number of partition table
| partition_table{name="number",}
2.0 |
+| region |
name="total/{{ip}}:{{port}}",type="SchemaRegion/DataRegion" | important
| The number of schemaRegion/dataRegion of cluster or specific node
| region{name="127.0.0.1:6671",type="DataRegion",} 10.0
|
+| region |
name="{{storageGroupName}}",type="SchemaRegion/DataRegion" | normal
| The number of DataRegion/SchemaRegion in storage group
| region{name="root.schema.sg1",type="DataRegion",} 14.0
|
+| slot |
name="{{storageGroupName}}",type="schemaSlotNumber/dataSlotNumber" | normal
| The number of dataSlot/schemaSlot in storage group
| slot{name="root.schema.sg1",type="schemaSlotNumber",} 2.0
|
### 4.4. IoTDB PreDefined Metrics Set
Users can modify the value of `predefinedMetrics` in the `iotdb-metric.yml`
file to enable the predefined set of metrics,now support `JVM`, `LOGBACK`,
`FILE`, `PROCESS`, `SYSYTEM`.
diff --git a/docs/zh/UserGuide/Maintenance-Tools/Metric-Tool.md
b/docs/zh/UserGuide/Maintenance-Tools/Metric-Tool.md
index 8d45736173..fbb8cf2d37 100644
--- a/docs/zh/UserGuide/Maintenance-Tools/Metric-Tool.md
+++ b/docs/zh/UserGuide/Maintenance-Tools/Metric-Tool.md
@@ -102,10 +102,10 @@ IoTDB对外提供JMX和Prometheus格式的监控指标,对于JMX,可以通
#### 4.3.4. 缓存
-| Metric | Tag | level | 说明
| 示例 |
-| --------- | --------------------------------------- | --------- |
------------------------------------------------ | --------------------------- |
-| cache_hit | name="chunk/timeSeriesMeta/bloomFilter/SchemaCache" | important
| chunk/timeSeriesMeta/SchemaCache缓存命中率,bloomFilter拦截率 |
cache_hit{name="chunk",} 80 |
-| cache_total | name="StorageGroup/SchemaPartition/DataPartition",
type="hit/all" | important | StorageGroup/SchemaPartition/DataPartition 的命中/总次数
| cache_total{name="DataPartition",type="all",} 801.0 |
+| Metric | Tag
| level | 说明 |
示例 |
+| ----------- |
----------------------------------------------------------------- | --------- |
------------------------------------------------------------ |
--------------------------------------------------- |
+| cache_hit | name="chunk/timeSeriesMeta/bloomFilter/SchemaCache"
| important | chunk/timeSeriesMeta/SchemaCache缓存命中率,bloomFilter拦截率 |
cache_hit{name="chunk",} 80 |
+| cache_total | name="StorageGroup/SchemaPartition/DataPartition",
type="hit/all" | important | StorageGroup/SchemaPartition/DataPartition 的命中/总次数
| cache_total{name="DataPartition",type="all",} 801.0 |
#### 4.3.5. 业务数据
@@ -115,12 +115,18 @@ IoTDB对外提供JMX和Prometheus格式的监控指标,对于JMX,可以通
#### 4.3.6. 集群
-| Metric | Tag | level | 说明
| 示例
|
-| ------------------------- | ------------------------------- | --------- |
------------------------------------------------------------- |
---------------------------------------------------------------------------- |
-| cluster_node_leader_count | name="{{ip}}" | important |
节点上```dataGroupLeader```的数量,用来观察leader是否分布均匀 |
cluster_node_leader_count{name="127.0.0.1",} 2.0 |
-| cluster_uncommitted_log | name="{{ip_datagroupHeader}}" | important |
节点```uncommitted_log```的数量 |
cluster_uncommitted_log{name="127.0.0.1_Data-127.0.0.1-40010-raftId-0",} 0.0 |
-| cluster_node_status | name="{{ip}}" | important |
节点状态,1=online 2=offline |
cluster_node_status{name="127.0.0.1",} 1.0 |
-| cluster_elect_total | name="{{ip}}",status="fail/win" | important |
节点参与选举的次数及结果 |
cluster_elect_total{name="127.0.0.1",status="win",} 1.0 |
+| Metric | Tag
| level | 说明
| 示例
|
+| ------------------------- |
------------------------------------------------------------------ | ---------
| ------------------------------------------------------------- |
---------------------------------------------------------------------------- |
+| cluster_node_leader_count | name="{{ip}}"
| important | 节点上```dataGroupLeader```的数量,用来观察leader是否分布均匀 |
cluster_node_leader_count{name="127.0.0.1",} 2.0 |
+| cluster_uncommitted_log | name="{{ip_datagroupHeader}}"
| important | 节点```uncommitted_log```的数量
|
cluster_uncommitted_log{name="127.0.0.1_Data-127.0.0.1-40010-raftId-0",} 0.0 |
+| cluster_node_status | name="{{ip}}"
| important | 节点状态,1=online 2=offline
| cluster_node_status{name="127.0.0.1",} 1.0
|
+| cluster_elect_total | name="{{ip}}",status="fail/win"
| important | 节点参与选举的次数及结果
| cluster_elect_total{name="127.0.0.1",status="win",} 1.0
|
+| config_node | name="online"
| core | 上线confignode的节点数量
| config_node{name="online",} 3.0
|
+| data_node | name="online"
| core | 上线datanode的节点数量
| data_node{name="online",} 3.0
|
+| partition_table | name="number"
| core | partition table表的个数
| partition_table{name="number",} 2.0
|
+| region |
name="total/{{ip}}:{{port}}",type="SchemaRegion/DataRegion" | important
| 全部或某个节点的schemaRegion/dataRegion个数 |
region{name="127.0.0.1:6671",type="DataRegion",} 10.0 |
+| region |
name="{{storageGroupName}}",type="SchemaRegion/DataRegion" | normal
| 存储组的DataRegion/Schema个数 |
region{name="root.schema.sg1",type="DataRegion",} 14.0 |
+| slot |
name="{{storageGroupName}}",type="schemaSlotNumber/dataSlotNumber" | normal
| 存储组的schemaSlot/dataSlot个数 |
slot{name="root.schema.sg1",type="schemaSlotNumber",} 2.0 |
### 4.4. IoTDB 预定义指标集
diff --git a/grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
b/grafana-metrics-example/cluster/Apache IoTDB ConfigNode Dashboard v0.14.0.json
similarity index 71%
copy from grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
copy to grafana-metrics-example/cluster/Apache IoTDB ConfigNode Dashboard
v0.14.0.json
index bd0025c983..484fb19b8a 100644
--- a/grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
+++ b/grafana-metrics-example/cluster/Apache IoTDB ConfigNode Dashboard
v0.14.0.json
@@ -23,6 +23,12 @@
"name": "Prometheus",
"version": "1.0.0"
},
+ {
+ "type": "panel",
+ "id": "stat",
+ "name": "Stat",
+ "version": ""
+ },
{
"type": "panel",
"id": "timeseries",
@@ -51,483 +57,18 @@
},
"description": "",
"editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": null,
- "iteration": 1650335659044,
- "links": [],
- "liveNow": false,
- "panels": [
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 0
- },
- "id": 38,
- "panels": [],
- "title": "Overview",
- "type": "row"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 1
- },
- "id": 36,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr": "quantity{instance=~\"$instance\"}",
- "interval": "",
- "legendFormat": "{{name}} number",
- "refId": "A"
- }
- ],
- "title": "The number of entity",
- "type": "timeseries"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 1
- },
- "id": 34,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr": "rate(quantity_total{instance=~\"$instance\"}[1m])",
- "interval": "1m",
- "legendFormat": "write point per minute",
- "refId": "A"
- }
- ],
- "title": "write point per minute",
- "type": "timeseries"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "bytes"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 9
- },
- "id": 32,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr": "mem{instance=~\"$instance\"}",
- "interval": "1m",
- "legendFormat": "{{name}}",
- "refId": "A"
- }
- ],
- "title": "storage group used memory",
- "type": "timeseries"
- },
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 17
- },
- "id": 30,
- "panels": [],
- "title": "Interface",
- "type": "row"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 18
- },
- "id": 24,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr": "rate(entry_seconds_count{instance=~\"$instance\"}[1m])",
- "interval": "1m",
- "legendFormat": "{{instance}}-{{name}}",
- "refId": "A"
- }
- ],
- "title": "The QPS of interface",
- "type": "timeseries"
- },
- {
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 18
- },
- "id": 26,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr":
"avg(rate(entry_seconds_sum{}[1m])/rate(entry_seconds_count{}[1m])) by
(name,instance)",
- "interval": "1m",
- "legendFormat": "{{instance}}-{{name}}",
- "refId": "A"
- }
- ],
- "title": "The time consumed of interface",
- "type": "timeseries"
- },
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 0,
+ "id": null,
+ "iteration": 1655363164080,
+ "links": [],
+ "liveNow": false,
+ "panels": [
{
"fieldConfig": {
"defaults": {
"color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
+ "mode": "thresholds"
},
"mappings": [],
"thresholds": {
@@ -538,29 +79,32 @@
"value": null
}
]
- },
- "unit": "percent"
+ }
},
"overrides": []
},
"gridPos": {
"h": 8,
- "w": 12,
+ "w": 24,
"x": 0,
- "y": 26
+ "y": 0
},
"id": 28,
"options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom"
+ "colorMode": "value",
+ "graphMode": "area",
+ "justifyMode": "auto",
+ "orientation": "auto",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
},
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
+ "textMode": "auto"
},
+ "pluginVersion": "8.4.2",
"targets": [
{
"datasource": {
@@ -568,27 +112,62 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr": "cache_hit",
+ "expr": "config_node{instance=~\"$instance\"}",
"interval": "",
- "legendFormat": "{{name}}",
+ "legendFormat": "Online ConfigNode",
"refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": true,
+ "expr": "data_node{instance=~\"$instance\"}",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Online DataNode",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": true,
+ "expr": "storage_group{instance=~\"$instance\"}",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Storage Group",
+ "refId": "E"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": true,
+ "expr": "sum(region{instance=~\"$instance\", name=\"total\"})",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "Total Region",
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": true,
+ "expr": "region{instance=~\"$instance\", name=\"total\"}",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "{{type}}",
+ "refId": "D"
}
],
- "title": "Cache hit rate",
- "type": "timeseries"
- },
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 34
- },
- "id": 22,
- "panels": [],
- "title": "Engine",
- "type": "row"
+ "title": "Overview",
+ "type": "stat"
},
{
"fieldConfig": {
@@ -645,9 +224,9 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 35
+ "y": 8
},
- "id": 18,
+ "id": 38,
"options": {
"legend": {
"calcs": [],
@@ -666,13 +245,13 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr": "queue{instance=~\"$instance\"}",
- "interval": "1m",
- "legendFormat": "{{name}}-{{status}}",
+ "expr": "sum(region{instance=~\"${instance}\",
name=~\"EndPoint.*\"}) by (name)",
+ "interval": "",
+ "legendFormat": "{{name}}",
"refId": "A"
}
],
- "title": "Task number(pending and active)",
+ "title": "Total Region on Node",
"type": "timeseries"
},
{
@@ -716,10 +295,13 @@
{
"color": "green",
"value": null
+ },
+ {
+ "color": "red",
+ "value": 80
}
]
- },
- "unit": "s"
+ }
},
"overrides": []
},
@@ -727,9 +309,9 @@
"h": 8,
"w": 12,
"x": 12,
- "y": 35
+ "y": 8
},
- "id": 20,
+ "id": 32,
"options": {
"legend": {
"calcs": [],
@@ -748,28 +330,15 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr":
"rate(cost_task_seconds_sum{instance=~\"$instance\"}[10m])/rate(cost_task_seconds_count{instance=~\"$instance\"}[10m])",
- "interval": "1m",
- "legendFormat": "{{instance}}-{{name}}",
+ "expr": "region{instance=~\"${instance}\", name=~\"EndPoint.*\"}",
+ "interval": "",
+ "legendFormat": "{{name}}-{{type}}",
"refId": "A"
}
],
- "title": "The time consumed of task(pending and active)",
+ "title": "Region on Node",
"type": "timeseries"
},
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 43
- },
- "id": 16,
- "panels": [],
- "title": "System",
- "type": "row"
- },
{
"fieldConfig": {
"defaults": {
@@ -813,8 +382,7 @@
"value": null
}
]
- },
- "unit": "bytes"
+ }
},
"overrides": []
},
@@ -822,9 +390,9 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 44
+ "y": 16
},
- "id": 12,
+ "id": 35,
"options": {
"legend": {
"calcs": [],
@@ -843,25 +411,13 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr": "file_size{instance=~\"$instance\"}",
- "interval": "1m",
- "legendFormat": "{{instance}}-{{name}}",
+ "expr": "region{instance=~\"${instance}\", name!=\"total\",
name!~\"EndPoint.*\"}",
+ "interval": "",
+ "legendFormat": "{{name}}-{{type}}",
"refId": "A"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr": "sum(file_size{instance=~\"$instance\"})",
- "hide": false,
- "interval": "1m",
- "legendFormat": "total size of file",
- "refId": "B"
}
],
- "title": "The size of file",
+ "title": "Region on StorageGroup",
"type": "timeseries"
},
{
@@ -905,6 +461,10 @@
{
"color": "green",
"value": null
+ },
+ {
+ "color": "red",
+ "value": 80
}
]
}
@@ -915,9 +475,9 @@
"h": 8,
"w": 12,
"x": 12,
- "y": 44
+ "y": 16
},
- "id": 14,
+ "id": 37,
"options": {
"legend": {
"calcs": [],
@@ -936,27 +496,28 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr": "file_count{instance=~\"$instance\"}",
+ "expr": "slot{instance=~\"$instance\"}",
"interval": "",
- "legendFormat": "{{name}}",
+ "legendFormat": "{{name}}-{{type}}",
"refId": "A"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "${DS_PROMETHEUS}"
- },
- "exemplar": true,
- "expr": "sum(file_count{instance=~\"$instance\"})",
- "hide": false,
- "interval": "",
- "legendFormat": "total number of file",
- "refId": "B"
}
],
- "title": "The number of file",
+ "title": "Slot In Storage Group",
"type": "timeseries"
},
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 24
+ },
+ "id": 16,
+ "panels": [],
+ "title": "System",
+ "type": "row"
+ },
{
"fieldConfig": {
"defaults": {
@@ -1008,7 +569,7 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 52
+ "y": 25
},
"id": 10,
"options": {
@@ -1102,7 +663,7 @@
"h": 8,
"w": 12,
"x": 12,
- "y": 52
+ "y": 25
},
"id": 8,
"options": {
@@ -1196,7 +757,7 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 60
+ "y": 33
},
"id": 6,
"options": {
@@ -1326,7 +887,7 @@
"h": 8,
"w": 12,
"x": 12,
- "y": 60
+ "y": 33
},
"id": 4,
"options": {
@@ -1407,7 +968,7 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 68
+ "y": 41
},
"id": 2,
"options": {
@@ -1448,14 +1009,101 @@
],
"title": "The number of Java thread",
"type": "timeseries"
+ },
+ {
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "drawStyle": "line",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green",
+ "value": null
+ },
+ {
+ "color": "red",
+ "value": 80
+ }
+ ]
+ },
+ "unit": "s"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 41
+ },
+ "id": 26,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom"
+ },
+ "tooltip": {
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "targets": [
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": true,
+ "expr":
"avg(rate(entry_seconds_sum{}[1m])/rate(entry_seconds_count{}[1m])) by
(name,instance)",
+ "interval": "1m",
+ "legendFormat": "{{instance}}-{{name}}",
+ "refId": "A"
+ }
+ ],
+ "title": "The time consumed of interface",
+ "type": "timeseries"
}
],
- "refresh": false,
+ "refresh": "",
"schemaVersion": 35,
"style": "dark",
"tags": [
"Apache-IoTDB",
- "v0.14.0"
+ "ConfigNode",
+ "0.14.0"
],
"templating": {
"list": [
@@ -1506,7 +1154,7 @@
]
},
"time": {
- "from": "now-2d",
+ "from": "now-6h",
"to": "now"
},
"timepicker": {
@@ -1520,8 +1168,8 @@
]
},
"timezone": "browser",
- "title": "Apache IoTDB Dashboard",
- "uid": "TbEVYRw7k",
- "version": 2,
+ "title": "Apache IoTDB ConfigNode Dashboard",
+ "uid": "TbEVYRw7g",
+ "version": 16,
"weekStart": ""
}
\ No newline at end of file
diff --git a/grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
b/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard v0.14.0.json
similarity index 97%
copy from grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
copy to grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard
v0.14.0.json
index bd0025c983..e64d0376c3 100644
--- a/grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
+++ b/grafana-metrics-example/cluster/Apache IoTDB DataNode Dashboard
v0.14.0.json
@@ -54,7 +54,7 @@
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
- "iteration": 1650335659044,
+ "iteration": 1655343436644,
"links": [],
"liveNow": false,
"panels": [
@@ -495,6 +495,19 @@
"title": "The time consumed of interface",
"type": "timeseries"
},
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 26
+ },
+ "id": 22,
+ "panels": [],
+ "title": "Engine",
+ "type": "row"
+ },
{
"fieldConfig": {
"defaults": {
@@ -536,10 +549,13 @@
{
"color": "green",
"value": null
+ },
+ {
+ "color": "red",
+ "value": 80
}
]
- },
- "unit": "percent"
+ }
},
"overrides": []
},
@@ -547,9 +563,9 @@
"h": 8,
"w": 12,
"x": 0,
- "y": 26
+ "y": 27
},
- "id": 28,
+ "id": 18,
"options": {
"legend": {
"calcs": [],
@@ -568,28 +584,15 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr": "cache_hit",
- "interval": "",
- "legendFormat": "{{name}}",
+ "expr": "queue{instance=~\"$instance\"}",
+ "interval": "1m",
+ "legendFormat": "{{name}}-{{status}}",
"refId": "A"
}
],
- "title": "Cache hit rate",
+ "title": "Task number(pending and active)",
"type": "timeseries"
},
- {
- "collapsed": false,
- "gridPos": {
- "h": 1,
- "w": 24,
- "x": 0,
- "y": 34
- },
- "id": 22,
- "panels": [],
- "title": "Engine",
- "type": "row"
- },
{
"fieldConfig": {
"defaults": {
@@ -631,23 +634,20 @@
{
"color": "green",
"value": null
- },
- {
- "color": "red",
- "value": 80
}
]
- }
+ },
+ "unit": "s"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
- "x": 0,
- "y": 35
+ "x": 12,
+ "y": 27
},
- "id": 18,
+ "id": 20,
"options": {
"legend": {
"calcs": [],
@@ -666,13 +666,13 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr": "queue{instance=~\"$instance\"}",
+ "expr":
"rate(cost_task_seconds_sum{instance=~\"$instance\"}[10m])/rate(cost_task_seconds_count{instance=~\"$instance\"}[10m])",
"interval": "1m",
- "legendFormat": "{{name}}-{{status}}",
+ "legendFormat": "{{instance}}-{{name}}",
"refId": "A"
}
],
- "title": "Task number(pending and active)",
+ "title": "The time consumed of task(pending and active)",
"type": "timeseries"
},
{
@@ -710,6 +710,8 @@
}
},
"mappings": [],
+ "max": 1,
+ "min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
@@ -719,17 +721,17 @@
}
]
},
- "unit": "s"
+ "unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
- "x": 12,
+ "x": 0,
"y": 35
},
- "id": 20,
+ "id": 40,
"options": {
"legend": {
"calcs": [],
@@ -741,6 +743,7 @@
"sort": "none"
}
},
+ "pluginVersion": "8.4.2",
"targets": [
{
"datasource": {
@@ -748,13 +751,26 @@
"uid": "${DS_PROMETHEUS}"
},
"exemplar": true,
- "expr":
"rate(cost_task_seconds_sum{instance=~\"$instance\"}[10m])/rate(cost_task_seconds_count{instance=~\"$instance\"}[10m])",
- "interval": "1m",
- "legendFormat": "{{instance}}-{{name}}",
+ "expr": "avg(cache_total{instance=~\"$instance\", type=\"hit\"}) by
(name) / avg(cache_total{instance=~\"$instance\", type=\"all\"}) by (name)",
+ "format": "time_series",
+ "interval": "",
+ "legendFormat": "{{name}}",
"refId": "A"
+ },
+ {
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${DS_PROMETHEUS}"
+ },
+ "exemplar": true,
+ "expr": "cache_hit{instance=~\"$instance\"} / 100",
+ "hide": false,
+ "interval": "",
+ "legendFormat": "{{name}}",
+ "refId": "B"
}
],
- "title": "The time consumed of task(pending and active)",
+ "title": "Cache hit rate",
"type": "timeseries"
},
{
@@ -1455,7 +1471,8 @@
"style": "dark",
"tags": [
"Apache-IoTDB",
- "v0.14.0"
+ "DataNode",
+ "0.14.0"
],
"templating": {
"list": [
@@ -1506,7 +1523,7 @@
]
},
"time": {
- "from": "now-2d",
+ "from": "now-6h",
"to": "now"
},
"timepicker": {
@@ -1520,8 +1537,8 @@
]
},
"timezone": "browser",
- "title": "Apache IoTDB Dashboard",
- "uid": "TbEVYRw7k",
- "version": 2,
+ "title": "Apache IoTDB DataNode Dashboard",
+ "uid": "TbEVYRw7m",
+ "version": 13,
"weekStart": ""
}
\ No newline at end of file
diff --git a/grafana-metrics-example/Apache IoTDB Dashboard v0.13.1.json
b/grafana-metrics-example/standalone/Apache IoTDB Dashboard v0.13.1.json
similarity index 100%
rename from grafana-metrics-example/Apache IoTDB Dashboard v0.13.1.json
rename to grafana-metrics-example/standalone/Apache IoTDB Dashboard v0.13.1.json
diff --git a/grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
b/grafana-metrics-example/standalone/Apache IoTDB Dashboard v0.14.0.json
similarity index 100%
rename from grafana-metrics-example/Apache IoTDB Dashboard v0.14.0.json
rename to grafana-metrics-example/standalone/Apache IoTDB Dashboard v0.14.0.json
diff --git
a/server/src/main/java/org/apache/iotdb/db/service/metrics/enums/Metric.java
b/server/src/main/java/org/apache/iotdb/db/service/metrics/enums/Metric.java
index 6d798dfd6b..18247db4d4 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/metrics/enums/Metric.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/metrics/enums/Metric.java
@@ -54,7 +54,12 @@ public enum Metric {
SYS_FREE_SWAP_SPACE_SIZE,
SYS_COMMITTED_VM_SIZE,
SYS_DISK_TOTAL_SPACE,
- SYS_DISK_FREE_SPACE;
+ SYS_DISK_FREE_SPACE,
+ CONFIG_NODE,
+ DATA_NODE,
+ STORAGE_GROUP,
+ REGION,
+ SLOT;
@Override
public String toString() {