Metric Module
In this project, we provide the metrics interface and its default implementation
The built-in implementation supports the following reporters
The acquisition system consists of following four parts.
Configure the metrics module through iotdb-system.properties. The main options supported by the current code are listed below.
| properties | meaning | example |
|---|---|---|
dn(cn)_metric_reporter_list | Reporter list. The current implementation supports JMX, PROMETHEUS and IOTDB. | JMX,PROMETHEUS |
dn(cn)_metric_level | Initial metric level. | OFF, CORE, IMPORTANT, NORMAL, ALL |
cn_metric_prometheus_reporter_port | Prometheus HTTP port for ConfigNode. | 9091 |
dn_metric_prometheus_reporter_port | Prometheus HTTP port for DataNode. | 9092 |
More details, see the User Guide and the iotdb-system.properties.template file.
MetricService is registered as an IService in both DataNode and ConfigNode modules. Enable it with dn(cn)_enable_metric=true.MetricService.getInstance(), for example:MetricService.getInstance().count(1, "operation_count", MetricLevel.IMPORTANT, "name", operation.getName());
addMetricSet(IMetricSet) and removeMetricSet(IMetricSet).AbstractMetricManager.Reporter for a general reporter.JmxReporter if you need JMX registration. The built-in JMX domain is org.apache.iotdb.metrics.MetricService directly loads IoTDBMetricManager, IoTDBJmxReporter, PrometheusReporter and IoTDBSessionReporter in loadManager() and loadReporter().src/main/resources/META-INF/services/org.apache.iotdb.metrics.AbstractMetricManagersrc/main/resources/META-INF/services/org.apache.iotdb.metrics.reporter.JmxReporter