Compare commits

..
Author SHA1 Message Date
a-little-fool f92df320ff update download page 2025-07-05 10:13:18 +08:00
252 changed files with 4800 additions and 11793 deletions
-19
View File
@@ -6,7 +6,6 @@
"files": [
"README.md",
"README_CN.md",
"README_JP.md"
"home/src/pages/team/index.jsx"
],
"imageSize": 100,
@@ -2505,24 +2504,6 @@
"code",
"test"
]
},
{
"login": "RainBondsongyg",
"name": "songyg",
"avatar_url": "https://avatars.githubusercontent.com/u/94501396?v=4",
"profile": "https://github.com/RainBondsongyg",
"contributions": [
"doc"
]
},
{
"login": "lx1229",
"name": "Liuxin",
"avatar_url": "https://avatars.githubusercontent.com/u/44620005?v=4",
"profile": "https://github.com/lx1229",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
-2
View File
@@ -527,8 +527,6 @@ Thanks to these wonderful people, welcome to join us:
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xiaomizhou2"><img src="https://avatars.githubusercontent.com/u/47807926?v=4?s=100" width="100px;" alt="zhangyaxi"/><br /><sub><b>zhangyaxi</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=xiaomizhou2" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=xiaomizhou2" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RainBondsongyg"><img src="https://avatars.githubusercontent.com/u/94501396?v=4?s=100" width="100px;" alt="songyg"/><br /><sub><b>songyg</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=RainBondsongyg" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lx1229"><img src="https://avatars.githubusercontent.com/u/44620005?v=4?s=100" width="100px;" alt="Liuxin"/><br /><sub><b>Liuxin</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lx1229" title="Code">💻</a></td>
</tr>
</tbody>
</table>
+2 -4
View File
@@ -37,7 +37,7 @@
-`Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模板 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需简单配置即可快速适配一款 `K8s``Docker` 等新的监控类型吗?
- 兼容 `Prometheus` 的系统生态并且更多,只需页面操作就可以监控 `Prometheus` 所能监控的。
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
- 灵活的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱` 等方式消息及时送达。
- 自由的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱` 等方式消息及时送达。
- 提供强大的状态页构建能力,轻松向用户传达您产品服务的实时状态。
@@ -126,7 +126,7 @@
- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。
- `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主 HertzBeat 服务的对外 IP。
- `-e MANAGER_HOST=127.0.0.1` : 配置连接主 HertaBeat 服务的对外 IP。
- `-e MANAGER_PORT=1158` : 配置连接主 HertzBeat 服务的对外端口,默认1158。
@@ -525,8 +525,6 @@ Thanks these wonderful people, welcome to join us:
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xiaomizhou2"><img src="https://avatars.githubusercontent.com/u/47807926?v=4?s=100" width="100px;" alt="zhangyaxi"/><br /><sub><b>zhangyaxi</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=xiaomizhou2" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=xiaomizhou2" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RainBondsongyg"><img src="https://avatars.githubusercontent.com/u/94501396?v=4?s=100" width="100px;" alt="songyg"/><br /><sub><b>songyg</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=RainBondsongyg" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lx1229"><img src="https://avatars.githubusercontent.com/u/44620005?v=4?s=100" width="100px;" alt="Liuxin"/><br /><sub><b>Liuxin</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lx1229" title="Code">💻</a></td>
</tr>
</tbody>
</table>
-6
View File
@@ -525,12 +525,6 @@ Thanks these wonderful people, welcome to join us:
<td align="center" valign="top" width="14.28%"><a href="https://github.com/boyucjz"><img src="https://avatars.githubusercontent.com/u/18730041?v=4?s=100" width="100px;" alt="boyucjz"/><br /><sub><b>boyucjz</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=boyucjz" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Cyanty"><img src="https://avatars.githubusercontent.com/u/153884653?v=4?s=100" width="100px;" alt="Cyanty"/><br /><sub><b>Cyanty</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=Cyanty" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=Cyanty" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/KevinLLF"><img src="https://avatars.githubusercontent.com/u/85452733?v=4?s=100" width="100px;" alt="Jay丿167"/><br /><sub><b>Jay丿167</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=KevinLLF" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Duansg"><img src="https://avatars.githubusercontent.com/u/112607719?v=4?s=100" width="100px;" alt="Duansg"/><br /><sub><b>Duansg</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=Duansg" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/xiaomizhou2"><img src="https://avatars.githubusercontent.com/u/47807926?v=4?s=100" width="100px;" alt="zhangyaxi"/><br /><sub><b>zhangyaxi</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=xiaomizhou2" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=xiaomizhou2" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/RainBondsongyg"><img src="https://avatars.githubusercontent.com/u/94501396?v=4?s=100" width="100px;" alt="songyg"/><br /><sub><b>songyg</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=RainBondsongyg" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lx1229"><img src="https://avatars.githubusercontent.com/u/44620005?v=4?s=100" width="100px;" alt="Liuxin"/><br /><sub><b>Liuxin</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lx1229" title="Code">💻</a></td>
</tr>
</tbody>
</table>
@@ -17,9 +17,6 @@
package org.apache.hertzbeat.alert.calculate;
import com.google.common.collect.Table;
import com.google.common.collect.Tables;
import org.apache.commons.lang3.StringUtils;
import org.apache.hertzbeat.alert.dao.SingleAlertDao;
import org.apache.hertzbeat.alert.util.AlertUtil;
import org.apache.hertzbeat.common.constants.CommonConstants;
@@ -27,6 +24,7 @@ import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -35,83 +33,49 @@ import java.util.concurrent.ConcurrentHashMap;
@Component
public class AlarmCacheManager {
private static final String CUSTOM_FIRING_ROW_KEY = "CUSTOM_FIRING_";
/**
* The alarm in the process is triggered
* rowKey - define id
* columnKey - labels fingerprint
* key - labels fingerprint
*/
private final Table<String, String, SingleAlert> pendingAlertMap;
private final Map<String, SingleAlert> pendingAlertMap;
/**
* The not recover alert
* rowKey - define id
* columnKey - labels fingerprint
* key - labels fingerprint
*/
private final Table<String, String, SingleAlert> firingAlertMap;
private final Map<String, SingleAlert> firingAlertMap;
public AlarmCacheManager(SingleAlertDao singleAlertDao) {
this.pendingAlertMap = Tables.newCustomTable(new ConcurrentHashMap<>(8), ConcurrentHashMap::new);
this.firingAlertMap = Tables.newCustomTable(new ConcurrentHashMap<>(8), ConcurrentHashMap::new);
this.pendingAlertMap = new ConcurrentHashMap<>(8);
this.firingAlertMap = new ConcurrentHashMap<>(8);
List<SingleAlert> singleAlerts = singleAlertDao.querySingleAlertsByStatus(CommonConstants.ALERT_STATUS_FIRING);
for (SingleAlert singleAlert : singleAlerts) {
String fingerprint = AlertUtil.calculateFingerprint(singleAlert.getLabels());
String defineId = singleAlert.getLabels().get(CommonConstants.LABEL_DEFINE_ID);
if (StringUtils.isBlank(defineId)) {
defineId = getCustomKey(fingerprint);
}
singleAlert.setId(null);
this.firingAlertMap.put(defineId, fingerprint, singleAlert);
this.firingAlertMap.put(fingerprint, singleAlert);
}
}
public void putPending(Long defineId, String fingerPrint, SingleAlert alert) {
this.pendingAlertMap.put(String.valueOf(defineId), fingerPrint, alert);
public void putPending(String fingerPrint, SingleAlert alert) {
this.pendingAlertMap.put(fingerPrint, alert);
}
public SingleAlert getPending(Long defineId, String fingerPrint) {
return this.pendingAlertMap.get(String.valueOf(defineId), fingerPrint);
public SingleAlert getPending(String fingerPrint) {
return this.pendingAlertMap.get(fingerPrint);
}
public void removePending(Long defineId, String fingerPrint) {
this.pendingAlertMap.remove(String.valueOf(defineId), fingerPrint);
}
public void putFiring(Long defineId, String fingerPrint, SingleAlert alert) {
this.firingAlertMap.put(String.valueOf(defineId), fingerPrint, alert);
public SingleAlert removePending(String fingerPrint) {
return this.pendingAlertMap.remove(fingerPrint);
}
public void putFiring(String fingerPrint, SingleAlert alert) {
this.firingAlertMap.put(getCustomKey(fingerPrint), fingerPrint, alert);
}
public SingleAlert getFiring(Long defineId, String fingerPrint) {
SingleAlert singleAlert = this.firingAlertMap.get(String.valueOf(defineId), fingerPrint);
if (null != singleAlert) {
return singleAlert;
}
return getFiring(fingerPrint);
}
public SingleAlert removeFiring(Long defineId, String fingerPrint) {
SingleAlert singleAlert = this.firingAlertMap.remove(String.valueOf(defineId), fingerPrint);
if (null == singleAlert) {
return this.firingAlertMap.remove(getCustomKey(fingerPrint), fingerPrint);
}
return singleAlert;
this.firingAlertMap.put(fingerPrint, alert);
}
public SingleAlert getFiring(String fingerPrint) {
return this.firingAlertMap.get(getCustomKey(fingerPrint), fingerPrint);
return this.firingAlertMap.get(fingerPrint);
}
private String getCustomKey(String fingerPrint) {
return CUSTOM_FIRING_ROW_KEY + fingerPrint;
}
public SingleAlert removeFiring(String fingerPrint) {
return this.firingAlertMap.remove(getCustomKey(fingerPrint), fingerPrint);
return this.firingAlertMap.remove(fingerPrint);
}
}
@@ -76,12 +76,11 @@ public class CollectorAlertHandler {
fingerPrints.put(KEY_COLLECTOR_VERSION, collector.getVersion());
fingerPrints.put(KEY_COLLECTOR_HOST, collector.getIp());
String fingerprint = AlertUtil.calculateFingerprint(fingerPrints);
SingleAlert firingAlert = alarmCacheManager.removeFiring(fingerprint);
SingleAlert firingAlert = alarmCacheManager.getFiring(fingerprint);
if (firingAlert != null) {
firingAlert.setTriggerTimes(1);
firingAlert.setEndAt(System.currentTimeMillis());
firingAlert.setStatus(CommonConstants.ALERT_STATUS_RESOLVED);
firingAlert.setContent(this.bundle.getString("alerter.availability.collector.recover"));
alarmCommonReduce.reduceAndSendAlarm(firingAlert.clone());
}
}
@@ -17,9 +17,8 @@
package org.apache.hertzbeat.alert.calculate;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
import org.apache.hertzbeat.alert.service.DataSourceService;
import org.apache.hertzbeat.alert.util.AlertTemplateUtil;
@@ -27,11 +26,11 @@ import org.apache.hertzbeat.alert.util.AlertUtil;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Component;
/**
* Periodic Alert Calculator
@@ -55,9 +54,9 @@ public class PeriodicAlertCalculator {
this.alarmCacheManager = alarmCacheManager;
}
public void calculate(AlertDefine define) {
if (!define.isEnable() || StringUtils.isEmpty(define.getExpr())) {
log.error("Periodic define {} is disabled or expression is empty", define.getName());
public void calculate(AlertDefine rule) {
if (!rule.isEnable() || StringUtils.isEmpty(rule.getExpr())) {
log.error("Periodic rule {} is disabled or expression is empty", rule.getName());
return;
}
long currentTimeMilli = System.currentTimeMillis();
@@ -67,8 +66,8 @@ public class PeriodicAlertCalculator {
// the return result should be matched with threshold
try {
List<Map<String, Object>> results = dataSourceService.calculate(
define.getDatasource(),
define.getExpr()
rule.getDatasource(),
rule.getExpr()
);
// if no match the expr threshold, the results item map {'value': null} should be null and others field keep
// if results has multi list, should trigger multi alert
@@ -78,9 +77,8 @@ public class PeriodicAlertCalculator {
for (Map<String, Object> result : results) {
Map<String, String> fingerPrints = new HashMap<>(8);
// here use the alert name as finger, not care the alert name may be changed
fingerPrints.put(CommonConstants.LABEL_DEFINE_ID, String.valueOf(define.getId()));
fingerPrints.put(CommonConstants.LABEL_ALERT_NAME, define.getName());
fingerPrints.putAll(define.getLabels());
fingerPrints.put(CommonConstants.LABEL_ALERT_NAME, rule.getName());
fingerPrints.putAll(rule.getLabels());
for (Map.Entry<String, Object> entry : result.entrySet()) {
if (entry.getValue() != null && !VALUE.equals(entry.getKey())
&& !TIMESTAMP.equals(entry.getKey())) {
@@ -89,33 +87,32 @@ public class PeriodicAlertCalculator {
}
if (result.get(VALUE) == null) {
// recovery the alert
handleRecoveredAlert(define.getId(), fingerPrints);
handleRecoveredAlert(fingerPrints);
continue;
}
Map<String, Object> fieldValueMap = new HashMap<>(8);
fieldValueMap.putAll(define.getLabels());
fieldValueMap.put(CommonConstants.LABEL_ALERT_NAME, define.getName());
fieldValueMap.putAll(rule.getLabels());
fieldValueMap.put(CommonConstants.LABEL_ALERT_NAME, rule.getName());
for (Map.Entry<String, Object> entry : result.entrySet()) {
if (entry.getValue() != null) {
fieldValueMap.put(entry.getKey(), entry.getValue());
}
}
afterThresholdRuleMatch(currentTimeMilli, fingerPrints, fieldValueMap, define);
afterThresholdRuleMatch(currentTimeMilli, fingerPrints, fieldValueMap, rule);
}
} catch (Exception ignored) {
// ignore the query exception eg: no result, timeout, etc
return;
}
} catch (Exception e) {
log.error("Calculate periodic define {} failed: {}", define.getName(), e.getMessage());
log.error("Calculate periodic rule {} failed: {}", rule.getName(), e.getMessage());
}
}
private void afterThresholdRuleMatch(long currentTimeMilli, Map<String, String> fingerPrints,
Map<String, Object> fieldValueMap, AlertDefine define) {
Long defineId = define.getId();
String fingerprint = AlertUtil.calculateFingerprint(fingerPrints);
SingleAlert existingAlert = alarmCacheManager.getPending(defineId, fingerprint);
SingleAlert existingAlert = alarmCacheManager.getPending(fingerprint);
Map<String, String> labels = new HashMap<>(8);
fieldValueMap.putAll(define.getLabels());
labels.putAll(fingerPrints);
@@ -136,11 +133,11 @@ public class PeriodicAlertCalculator {
// If required trigger times is 1, set to firing status directly
if (requiredTimes <= 1) {
newAlert.setStatus(CommonConstants.ALERT_STATUS_FIRING);
alarmCacheManager.putFiring(defineId, fingerprint, newAlert);
alarmCacheManager.putFiring(fingerprint, newAlert);
alarmCommonReduce.reduceAndSendAlarm(newAlert.clone());
} else {
// Otherwise put into pending queue first
alarmCacheManager.putPending(defineId, fingerprint, newAlert);
alarmCacheManager.putPending(fingerprint, newAlert);
}
} else {
// Update existing alert
@@ -150,17 +147,17 @@ public class PeriodicAlertCalculator {
// Check if required trigger times reached
if (existingAlert.getStatus().equals(CommonConstants.ALERT_STATUS_PENDING) && existingAlert.getTriggerTimes() >= requiredTimes) {
// Reached trigger times threshold, change to firing status
alarmCacheManager.removePending(defineId, fingerprint);
alarmCacheManager.removePending(fingerprint);
existingAlert.setStatus(CommonConstants.ALERT_STATUS_FIRING);
alarmCacheManager.putFiring(defineId, fingerprint, existingAlert);
alarmCacheManager.putFiring(fingerprint, existingAlert);
alarmCommonReduce.reduceAndSendAlarm(existingAlert.clone());
}
}
}
private void handleRecoveredAlert(Long defineId, Map<String, String> fingerprints) {
private void handleRecoveredAlert(Map<String, String> fingerprints) {
String fingerprint = AlertUtil.calculateFingerprint(fingerprints);
SingleAlert firingAlert = alarmCacheManager.removeFiring(defineId, fingerprint);
SingleAlert firingAlert = alarmCacheManager.removeFiring(fingerprint);
if (firingAlert != null) {
// todo consider multi times to tig for resolved alert
firingAlert.setTriggerTimes(1);
@@ -168,7 +165,7 @@ public class PeriodicAlertCalculator {
firingAlert.setStatus(CommonConstants.ALERT_STATUS_RESOLVED);
alarmCommonReduce.reduceAndSendAlarm(firingAlert.clone());
}
alarmCacheManager.removePending(defineId, fingerprint);
alarmCacheManager.removePending(fingerprint);
}
}
@@ -183,11 +183,9 @@ public class RealTimeAlertCalculator {
if (StringUtils.isBlank(expr)) {
continue;
}
Long defineId = define.getId();
Map<String, String> commonFingerPrints = new HashMap<>(8);
commonFingerPrints.put(CommonConstants.LABEL_INSTANCE, instance);
// here use the alert name as finger, not care the alert name may be changed
commonFingerPrints.put(CommonConstants.LABEL_DEFINE_ID, String.valueOf(define.getId()));
commonFingerPrints.put(CommonConstants.LABEL_ALERT_NAME, define.getName());
commonFingerPrints.put(CommonConstants.LABEL_INSTANCE_NAME, instanceName);
commonFingerPrints.put(CommonConstants.LABEL_INSTANCE_HOST, instanceHost);
@@ -202,9 +200,9 @@ public class RealTimeAlertCalculator {
try {
if (match) {
// If the threshold rule matches, the number of times the threshold has been triggered is determined and an alarm is triggered
afterThresholdRuleMatch(defineId, currentTimeMilli, commonFingerPrints, fieldValueMap, define, annotations);
afterThresholdRuleMatch(currentTimeMilli, commonFingerPrints, fieldValueMap, define, annotations);
} else {
handleRecoveredAlert(defineId, commonFingerPrints);
handleRecoveredAlert(commonFingerPrints);
}
// if this threshold pre compile success, ignore blew
continue;
@@ -256,9 +254,9 @@ public class RealTimeAlertCalculator {
boolean match = execAlertExpression(fieldValueMap, expr, false);
try {
if (match) {
afterThresholdRuleMatch(defineId, currentTimeMilli, fingerPrints, fieldValueMap, define, annotations);
afterThresholdRuleMatch(currentTimeMilli, fingerPrints, fieldValueMap, define, annotations);
} else {
handleRecoveredAlert(defineId, fingerPrints);
handleRecoveredAlert(fingerPrints);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
@@ -336,9 +334,9 @@ public class RealTimeAlertCalculator {
.collect(Collectors.toList());
}
private void handleRecoveredAlert(Long defineId, Map<String, String> fingerprints) {
private void handleRecoveredAlert(Map<String, String> fingerprints) {
String fingerprint = AlertUtil.calculateFingerprint(fingerprints);
SingleAlert firingAlert = alarmCacheManager.removeFiring(defineId, fingerprint);
SingleAlert firingAlert = alarmCacheManager.removeFiring(fingerprint);
if (firingAlert != null) {
// todo consider multi times to tig for resolved alert
firingAlert.setTriggerTimes(1);
@@ -346,14 +344,13 @@ public class RealTimeAlertCalculator {
firingAlert.setStatus(CommonConstants.ALERT_STATUS_RESOLVED);
alarmCommonReduce.reduceAndSendAlarm(firingAlert.clone());
}
alarmCacheManager.removePending(defineId, fingerprint);
alarmCacheManager.removePending(fingerprint);
}
private void afterThresholdRuleMatch(long defineId, long currentTimeMilli, Map<String, String> fingerPrints,
Map<String, Object> fieldValueMap, AlertDefine define,
Map<String, String> annotations) {
private void afterThresholdRuleMatch(long currentTimeMilli, Map<String, String> fingerPrints,
Map<String, Object> fieldValueMap, AlertDefine define, Map<String, String> annotations) {
String fingerprint = AlertUtil.calculateFingerprint(fingerPrints);
SingleAlert existingAlert = alarmCacheManager.getPending(defineId, fingerprint);
SingleAlert existingAlert = alarmCacheManager.getPending(fingerprint);
fieldValueMap.putAll(define.getLabels());
int requiredTimes = define.getTimes() == null ? 1 : define.getTimes();
if (existingAlert == null) {
@@ -385,11 +382,11 @@ public class RealTimeAlertCalculator {
// If required trigger times is 1, set to firing status directly
if (requiredTimes <= 1) {
newAlert.setStatus(CommonConstants.ALERT_STATUS_FIRING);
alarmCacheManager.putFiring(defineId, fingerprint, newAlert);
alarmCacheManager.putFiring(fingerprint, newAlert);
alarmCommonReduce.reduceAndSendAlarm(newAlert.clone());
} else {
// Otherwise put into pending queue first
alarmCacheManager.putPending(define.getId(), fingerprint, newAlert);
alarmCacheManager.putPending(fingerprint, newAlert);
}
} else {
// Update existing alert
@@ -399,9 +396,9 @@ public class RealTimeAlertCalculator {
// Check if required trigger times reached
if (existingAlert.getStatus().equals(CommonConstants.ALERT_STATUS_PENDING) && existingAlert.getTriggerTimes() >= requiredTimes) {
// Reached trigger times threshold, change to firing status
alarmCacheManager.removePending(defineId, fingerprint);
alarmCacheManager.removePending(fingerprint);
existingAlert.setStatus(CommonConstants.ALERT_STATUS_FIRING);
alarmCacheManager.putFiring(defineId, fingerprint, existingAlert);
alarmCacheManager.putFiring(fingerprint, existingAlert);
alarmCommonReduce.reduceAndSendAlarm(existingAlert.clone());
}
}
@@ -27,7 +27,7 @@ import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor;
* of the available methods.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
* operations with no return type.
*/
@SuppressWarnings("CheckReturnValue")
public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements AlertExpressionVisitor<T> {
@@ -37,10 +37,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitExpression(AlertExpressionParser.ExpressionContext ctx) {
return visitChildren(ctx);
}
@Override public T visitExpression(AlertExpressionParser.ExpressionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -48,10 +45,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitAndExpr(AlertExpressionParser.AndExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitAndExpr(AlertExpressionParser.AndExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -59,10 +53,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitComparisonExpr(AlertExpressionParser.ComparisonExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitComparisonExpr(AlertExpressionParser.ComparisonExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -70,10 +61,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitUnlessExpr(AlertExpressionParser.UnlessExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitUnlessExpr(AlertExpressionParser.UnlessExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -81,10 +69,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitSqlExpr(AlertExpressionParser.SqlExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitSqlExpr(AlertExpressionParser.SqlExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -92,10 +77,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitSqlCallExpr(AlertExpressionParser.SqlCallExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitSqlCallExpr(AlertExpressionParser.SqlCallExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -103,10 +85,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitLiteralExpr(AlertExpressionParser.LiteralExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitLiteralExpr(AlertExpressionParser.LiteralExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -114,10 +93,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitParenExpr(AlertExpressionParser.ParenExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitParenExpr(AlertExpressionParser.ParenExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -125,10 +101,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitPromqlCallExpr(AlertExpressionParser.PromqlCallExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitPromqlCallExpr(AlertExpressionParser.PromqlCallExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -136,10 +109,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitPromqlExpr(AlertExpressionParser.PromqlExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitPromqlExpr(AlertExpressionParser.PromqlExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -147,10 +117,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitOrExpr(AlertExpressionParser.OrExprContext ctx) {
return visitChildren(ctx);
}
@Override public T visitOrExpr(AlertExpressionParser.OrExprContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -158,10 +125,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitFunctionCall(AlertExpressionParser.FunctionCallContext ctx) {
return visitChildren(ctx);
}
@Override public T visitFunctionCall(AlertExpressionParser.FunctionCallContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -169,10 +133,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitParameterList(AlertExpressionParser.ParameterListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitParameterList(AlertExpressionParser.ParameterListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -180,10 +141,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitParameter(AlertExpressionParser.ParameterContext ctx) {
return visitChildren(ctx);
}
@Override public T visitParameter(AlertExpressionParser.ParameterContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -191,10 +149,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitNumber(AlertExpressionParser.NumberContext ctx) {
return visitChildren(ctx);
}
@Override public T visitNumber(AlertExpressionParser.NumberContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -202,10 +157,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitString(AlertExpressionParser.StringContext ctx) {
return visitChildren(ctx);
}
@Override public T visitString(AlertExpressionParser.StringContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -213,10 +165,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitDuration(AlertExpressionParser.DurationContext ctx) {
return visitChildren(ctx);
}
@Override public T visitDuration(AlertExpressionParser.DurationContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -224,10 +173,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitFunctionName(AlertExpressionParser.FunctionNameContext ctx) {
return visitChildren(ctx);
}
@Override public T visitFunctionName(AlertExpressionParser.FunctionNameContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -235,10 +181,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitSelectSql(AlertExpressionParser.SelectSqlContext ctx) {
return visitChildren(ctx);
}
@Override public T visitSelectSql(AlertExpressionParser.SelectSqlContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -246,10 +189,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitSelectFieldList(AlertExpressionParser.SelectFieldListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitSelectFieldList(AlertExpressionParser.SelectFieldListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -257,10 +197,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitSelectField(AlertExpressionParser.SelectFieldContext ctx) {
return visitChildren(ctx);
}
@Override public T visitSelectField(AlertExpressionParser.SelectFieldContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -268,10 +205,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitGroupByList(AlertExpressionParser.GroupByListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitGroupByList(AlertExpressionParser.GroupByListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -279,10 +213,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitOrderByList(AlertExpressionParser.OrderByListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitOrderByList(AlertExpressionParser.OrderByListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -290,10 +221,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitOrderByField(AlertExpressionParser.OrderByFieldContext ctx) {
return visitChildren(ctx);
}
@Override public T visitOrderByField(AlertExpressionParser.OrderByFieldContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -301,10 +229,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitLimitClause(AlertExpressionParser.LimitClauseContext ctx) {
return visitChildren(ctx);
}
@Override public T visitLimitClause(AlertExpressionParser.LimitClauseContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -312,10 +237,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitRelList(AlertExpressionParser.RelListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitRelList(AlertExpressionParser.RelListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -323,10 +245,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitRelation(AlertExpressionParser.RelationContext ctx) {
return visitChildren(ctx);
}
@Override public T visitRelation(AlertExpressionParser.RelationContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -334,10 +253,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitConditionList(AlertExpressionParser.ConditionListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitConditionList(AlertExpressionParser.ConditionListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -345,10 +261,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitCompOp(AlertExpressionParser.CompOpContext ctx) {
return visitChildren(ctx);
}
@Override public T visitCompOp(AlertExpressionParser.CompOpContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -356,10 +269,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitCondition(AlertExpressionParser.ConditionContext ctx) {
return visitChildren(ctx);
}
@Override public T visitCondition(AlertExpressionParser.ConditionContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -367,10 +277,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitConditionUnit(AlertExpressionParser.ConditionUnitContext ctx) {
return visitChildren(ctx);
}
@Override public T visitConditionUnit(AlertExpressionParser.ConditionUnitContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -378,10 +285,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitPromql(AlertExpressionParser.PromqlContext ctx) {
return visitChildren(ctx);
}
@Override public T visitPromql(AlertExpressionParser.PromqlContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -389,10 +293,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitMetricSelector(AlertExpressionParser.MetricSelectorContext ctx) {
return visitChildren(ctx);
}
@Override public T visitMetricSelector(AlertExpressionParser.MetricSelectorContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -400,10 +301,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitLabelMatcherList(AlertExpressionParser.LabelMatcherListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitLabelMatcherList(AlertExpressionParser.LabelMatcherListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -411,10 +309,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitLabelMatcherItem(AlertExpressionParser.LabelMatcherItemContext ctx) {
return visitChildren(ctx);
}
@Override public T visitLabelMatcherItem(AlertExpressionParser.LabelMatcherItemContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -422,10 +317,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitLabelMatcherOp(AlertExpressionParser.LabelMatcherOpContext ctx) {
return visitChildren(ctx);
}
@Override public T visitLabelMatcherOp(AlertExpressionParser.LabelMatcherOpContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -433,10 +325,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitLabelList(AlertExpressionParser.LabelListContext ctx) {
return visitChildren(ctx);
}
@Override public T visitLabelList(AlertExpressionParser.LabelListContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -444,10 +333,7 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitInstantVectorOp(AlertExpressionParser.InstantVectorOpContext ctx) {
return visitChildren(ctx);
}
@Override public T visitInstantVectorOp(AlertExpressionParser.InstantVectorOpContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
@@ -455,8 +341,13 @@ public class AlertExpressionBaseVisitor<T> extends AbstractParseTreeVisitor<T> i
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override
public T visitAggregationOperator(AlertExpressionParser.AggregationOperatorContext ctx) {
return visitChildren(ctx);
}
@Override public T visitAggregationOperator(AlertExpressionParser.AggregationOperatorContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*/
@Override public T visitBinaryOperator(AlertExpressionParser.BinaryOperatorContext ctx) { return visitChildren(ctx); }
}
@@ -18,12 +18,11 @@
package org.apache.hertzbeat.alert.expr;
import org.antlr.v4.runtime.CommonTokenStream;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.hertzbeat.common.support.exception.ExpressionVisitorException;
import org.apache.hertzbeat.warehouse.db.QueryExecutor;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -34,7 +33,7 @@ import java.util.stream.Collectors;
*/
public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<Map<String, Object>>> {
private static final String SCALAR = "__scalar__";
private static final String THRESHOLD = "__threshold__";
private static final String NAME = "__name__";
private static final String VALUE = "__value__";
private static final String TIMESTAMP = "__timestamp__";
@@ -61,100 +60,28 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
public List<Map<String, Object>> visitComparisonExpr(AlertExpressionParser.ComparisonExprContext ctx) {
List<Map<String, Object>> leftResult = visit(ctx.left);
List<Map<String, Object>> rightResult = visit(ctx.right);
int type = ctx.op.getType();
boolean boolModifier = ctx.BOOL() != null;
boolean leftIsScalar = isScalar(leftResult);
boolean rightIsScalar = isScalar(rightResult);
List<Map<String, Object>> results = new ArrayList<>();
if (rightResult.size() == 1 && rightResult.get(0).containsKey(THRESHOLD)) {
double threshold = (double) rightResult.get(0).get(THRESHOLD);
String operator = ctx.op.getText();
// scalar and scalar
if (leftIsScalar && rightIsScalar) {
if (!boolModifier) {
// Between two scalars,
// the bool modifier must be provided and these operators result in another scalar that is either 0 (false) or 1 (true), depending on the comparison result.
return results;
}
Object leftVal = leftResult.get(0).get(SCALAR);
Object rightVal = rightResult.get(0).get(SCALAR);
Boolean match = compareOp(leftVal, type, rightVal);
// returns a result only if the comparison condition is met.
Map<String, Object> result = new HashMap<>();
result.put(VALUE, match ? 1 : 0);
results.add(result);
return results;
}
// scalar and vector
if (leftIsScalar) {
Object leftVal = leftResult.get(0).get(SCALAR);
for (Map<String, Object> rightItem : rightResult) {
Object rightVal = rightItem.getOrDefault(VALUE, null);
if (isValidValue(rightVal)) {
List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> item : leftResult) {
Object queryValues = item.get(VALUE);
if (queryValues == null) {
// ignore the query result data is empty
continue;
}
Boolean match = compareOp(leftVal, type, rightVal);
Map<String, Object> result = new HashMap<>(rightItem);
if (boolModifier) {
result.put(VALUE, match ? 1 : 0);
results.add(result);
} else {
result.put(VALUE, match ? rightVal : null);
results.add(result);
}
// queryValues may be a list of values, or a single value
Object matchValue = evaluateCondition(queryValues, operator, threshold);
Map<String, Object> resultMap = new HashMap(item);
resultMap.put(VALUE, matchValue);
// if matchValue is null, mean not match the threshold
// if not null, mean match the threshold
result.add(resultMap);
}
return results;
return result;
}
// vector and scalar
if (rightIsScalar) {
Object rightVal = rightResult.get(0).get(SCALAR);
for (Map<String, Object> leftItem : leftResult) {
Object leftVal = leftItem.getOrDefault(VALUE, null);
if (isValidValue(leftVal)) {
continue;
}
Boolean match = compareOp(leftVal, type, rightVal);
Map<String, Object> result = new HashMap<>(leftItem);
if (boolModifier) {
result.put(VALUE, match ? 1 : 0);
results.add(result);
} else {
result.put(VALUE, match ? leftVal : null);
results.add(result);
}
}
return results;
}
// vector and vector
Map<String, Map<String, Object>> rightMap = rightResult.stream()
.filter(item -> item.get(VALUE) != null)
.collect(Collectors.toMap(this::labelKey, item -> item, (existing, replacement) -> existing));
for (Map<String, Object> leftItem : leftResult) {
Object leftVal = leftItem.getOrDefault(VALUE, null);
if (isValidValue(leftVal)) {
continue;
}
Map<String, Object> rightItem = rightMap.get(labelKey(leftItem));
if (rightItem == null) {
continue;
}
Object rightVal = rightItem.get(VALUE);
if (isValidValue(rightVal)) {
continue;
}
Boolean match = compareOp(leftVal, type, rightVal);
Map<String, Object> result = new HashMap<>(leftItem);
if (boolModifier) {
result.put(VALUE, match ? 1 : 0);
results.add(result);
} else {
result.put(VALUE, match ? leftVal : null);
results.add(result);
}
}
return results;
return new LinkedList<>();
}
@Override
@@ -240,7 +167,7 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
double value = Double.parseDouble(ctx.number().getText());
List<Map<String, Object>> numAsList = new ArrayList<>();
Map<String, Object> valueMap = new HashMap<>();
valueMap.put(SCALAR, value);
valueMap.put(THRESHOLD, value);
numAsList.add(valueMap);
return numAsList;
}
@@ -267,7 +194,83 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
return callSqlOrPromql(tokens.getText(ctx.string()));
}
private List<Map<String, Object>> callSqlOrPromql(String text) {
private Object evaluateCondition(Object value, String operator, Double threshold) {
// value may be a list of values, or a single value
switch (operator) {
case ">":
// if value is list, return the max value
if (value instanceof List<?> values) {
Double doubleValue = values.stream().map(v -> Double.valueOf(v.toString())).max(Double::compareTo).orElse(null);
if (doubleValue != null) {
return doubleValue > threshold ? doubleValue : null;
} else {
return null;
}
} else {
return Double.parseDouble(value.toString()) > threshold ? value : null;
}
case ">=":
if (value instanceof List<?> values) {
Double doubleValue = values.stream().map(v -> Double.valueOf(v.toString())).max(Double::compareTo).orElse(null);
if (doubleValue != null) {
return doubleValue >= threshold ? doubleValue : null;
} else {
return null;
}
} else {
return Double.parseDouble(value.toString()) >= threshold ? value : null;
}
case "<":
if (value instanceof List<?> values) {
Double doubleValue = values.stream().map(v -> Double.valueOf(v.toString())).min(Double::compareTo).orElse(null);
if (doubleValue != null) {
return doubleValue < threshold ? doubleValue : null;
} else {
return null;
}
} else {
return Double.parseDouble(value.toString()) < threshold ? value : null;
}
case "<=":
if (value instanceof List<?> values) {
Double doubleValue = values.stream().map(v -> Double.valueOf(v.toString())).min(Double::compareTo).orElse(null);
if (doubleValue != null) {
return doubleValue <= threshold ? doubleValue : null;
} else {
return null;
}
} else {
return Double.parseDouble(value.toString()) <= threshold ? value : null;
}
case "==":
if (value instanceof List<?> values) {
for (Object v : values) {
if (v.equals(threshold)) {
return v;
}
}
return null;
} else {
return value.equals(threshold) ? value : null;
}
case "!=":
if (value instanceof List<?> values) {
for (Object v : values) {
if (v.equals(threshold)) {
return null;
}
}
return value;
} else {
return value.equals(threshold) ? null : value;
}
default:
// unsupported operator todo add more operator
return null;
}
}
private List<Map<String, Object>> callSqlOrPromql(String text){
String script = text.substring(1, text.length() - 1);
return executor.execute(script);
}
@@ -287,36 +290,4 @@ public class AlertExpressionEvalVisitor extends AlertExpressionBaseVisitor<List<
return key.isEmpty() ? "-" : key;
}
private boolean isScalar(List<Map<String, Object>> context) {
return CollectionUtils.isNotEmpty(context)
&& context.size() == 1
&& context.get(0).containsKey(SCALAR)
&& null != context.get(0).get(SCALAR);
}
private double parseStrToDouble(String text) {
try {
return Double.parseDouble(text);
} catch (NumberFormatException e) {
throw new ExpressionVisitorException("number format exception", e);
}
}
private boolean isValidValue(Object val) {
return val == null || val instanceof List<?>;
}
private Boolean compareOp(Object leftVal, int opType, Object rightVal) {
double left = parseStrToDouble(leftVal.toString());
double right = parseStrToDouble(rightVal.toString());
return switch (opType) {
case AlertExpressionParser.GT -> left > right;
case AlertExpressionParser.GE -> left >= right;
case AlertExpressionParser.LT -> left < right;
case AlertExpressionParser.LE -> left <= right;
case AlertExpressionParser.EQ -> left == right;
case AlertExpressionParser.NE -> left != right;
default -> false;
};
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -26,13 +26,12 @@ import org.antlr.v4.runtime.tree.ParseTreeVisitor;
* by {@link AlertExpressionParser}.
*
* @param <T> The return type of the visit operation. Use {@link Void} for
* operations with no return type.
* operations with no return type.
*/
public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#expression}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -41,7 +40,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code AndExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -50,7 +48,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code ComparisonExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -59,7 +56,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code UnlessExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -68,7 +64,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code SqlExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -77,7 +72,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code SqlCallExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -86,7 +80,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code LiteralExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -95,7 +88,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code ParenExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -104,7 +96,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code PromqlCallExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -113,7 +104,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code PromqlExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -122,7 +112,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by the {@code OrExpr}
* labeled alternative in {@link AlertExpressionParser#expr}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -130,7 +119,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#functionCall}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -138,7 +126,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#parameterList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -146,7 +133,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#parameter}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -154,7 +140,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#number}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -162,7 +147,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#string}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -170,7 +154,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#duration}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -178,7 +161,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#functionName}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -186,7 +168,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#selectSql}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -194,7 +175,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#selectFieldList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -202,7 +182,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#selectField}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -210,7 +189,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#groupByList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -218,7 +196,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#orderByList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -226,7 +203,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#orderByField}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -234,7 +210,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#limitClause}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -242,7 +217,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#relList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -250,7 +224,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#relation}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -258,7 +231,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#conditionList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -266,7 +238,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#compOp}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -274,7 +245,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#condition}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -282,7 +252,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#conditionUnit}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -290,7 +259,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#promql}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -298,7 +266,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#metricSelector}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -306,7 +273,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#labelMatcherList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -314,7 +280,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#labelMatcherItem}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -322,7 +287,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#labelMatcherOp}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -330,7 +294,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#labelList}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -338,7 +301,6 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#instantVectorOp}.
*
* @param ctx the parse tree
* @return the visitor result
*/
@@ -346,9 +308,15 @@ public interface AlertExpressionVisitor<T> extends ParseTreeVisitor<T> {
/**
* Visit a parse tree produced by {@link AlertExpressionParser#aggregationOperator}.
*
* @param ctx the parse tree
* @return the visitor result
*/
T visitAggregationOperator(AlertExpressionParser.AggregationOperatorContext ctx);
/**
* Visit a parse tree produced by {@link AlertExpressionParser#binaryOperator}.
* @param ctx the parse tree
* @return the visitor result
*/
T visitBinaryOperator(AlertExpressionParser.BinaryOperatorContext ctx);
}
@@ -28,9 +28,6 @@ import org.apache.hertzbeat.alert.dto.ExportAlertDefineDTO;
import org.apache.hertzbeat.alert.service.AlertDefineImExportService;
import org.apache.hertzbeat.alert.service.AlertDefineService;
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
import org.apache.hertzbeat.common.util.LogUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.util.CollectionUtils;
@@ -44,15 +41,12 @@ public abstract class AlertDefineAbstractImExportServiceImpl implements AlertDef
@Lazy
private AlertDefineService alertDefineService;
private static final Logger logger = LoggerFactory.getLogger(AlertDefineAbstractImExportServiceImpl.class);
@Override
public void importConfig(InputStream is) {
var formList = parseImport(is)
.stream()
.map(this::convert)
.toList();
LogUtil.info(logger, "Importing alert defines from {0}", formList);
if (!CollectionUtils.isEmpty(formList)) {
formList.forEach(alertDefine -> {
alertDefineService.validate(alertDefine, false);
@@ -27,14 +27,11 @@ import org.apache.hertzbeat.common.entity.alerter.NoticeReceiver;
import org.apache.hertzbeat.common.entity.alerter.NoticeTemplate;
import org.apache.hertzbeat.common.support.exception.SendMessageException;
import org.apache.hertzbeat.common.util.JsonUtil;
import org.apache.hertzbeat.common.util.LogUtil;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
@@ -65,7 +62,6 @@ public class AlibabaSmsClientImpl implements SmsClient {
private final String accessKeySecret;
private final String signName;
private final String templateCode;
private static final Logger logger = LoggerFactory.getLogger(AlibabaSmsClientImpl.class);
public AlibabaSmsClientImpl(AlibabaSmsProperties config) {
if (config != null) {
@@ -177,7 +173,7 @@ public class AlibabaSmsClientImpl implements SmsClient {
log.info("Successfully sent SMS to phone: {}", phoneNumber);
}
} catch (Exception e) {
LogUtil.warn(logger, "Failed to send SMS: {0}", e.getMessage());
log.warn("Failed to send SMS: {}", e.getMessage());
throw new SendMessageException(e.getMessage());
}
}
@@ -196,7 +192,6 @@ public class AlibabaSmsClientImpl implements SmsClient {
// Step 4: Build authorization header
return ALGORITHM + " Credential=" + accessKeyId + ",SignedHeaders=host;x-acs-action;x-acs-content-sha256;x-acs-date;" + "x-acs-signature-nonce;x-acs-version,Signature=" + signature;
} catch (Exception e) {
LogUtil.warn(logger, "Failed to calculate authorization {0}", e.getMessage());
throw new RuntimeException("Failed to calculate authorization", e);
}
}
@@ -75,7 +75,7 @@ public class DataSourceServiceImpl implements DataSourceService {
throw new IllegalArgumentException("Empty expression");
}
if (executors == null || executors.isEmpty()) {
throw new IllegalArgumentException(bundle.getString("alerter.datasource.executor.not.found"));
throw new IllegalArgumentException("No query executor found");
}
QueryExecutor executor = executors.stream().filter(e -> e.support(datasource)).findFirst().orElse(null);
@@ -33,4 +33,3 @@ alerter.priority.0 = Emergency Alert
alerter.priority.1 = Critical Alert
alerter.priority.2 = Warning Alert
alerter.calculate.parse.error = Expression is not fully parsed, may have syntax errors or incomplete inputs
alerter.datasource.executor.not.found = No query executor found
@@ -33,4 +33,3 @@ alerter.priority.0 = 紧急告警
alerter.priority.1 = 严重告警
alerter.priority.2 = 警告告警
alerter.calculate.parse.error = 表达式未完全解析,可能存在语法错误或输入不完整
alerter.datasource.executor.not.found = 未找到查询执行器
@@ -33,4 +33,3 @@ alerter.priority.0 = 緊急警報
alerter.priority.1 = 嚴重警報
alerter.priority.2 = 警告警報
alerter.calculate.parse.error = 表達式未完全解析,可能存在語法錯誤或輸入不完整
alerter.datasource.executor.not.found = 未找到查詢執行器
@@ -23,7 +23,7 @@ expression
expr
: LPAREN expr RPAREN # ParenExpr
| left=expr op=(GE|LE|GT|LT|EQ|NE) BOOL? right=expr # ComparisonExpr
| left=expr op=(GE|LE|GT|LT|EQ|NE) right=expr # ComparisonExpr
| left=expr AND right=expr # AndExpr
| left=expr UNLESS right=expr # UnlessExpr
| left=expr OR right=expr # OrExpr
@@ -191,6 +191,11 @@ aggregationOperator
: SUM | AVG | COUNT | MIN | MAX | STDDEV | STDVAR | TOPK | BOTTOMK | QUANTILE
;
binaryOperator
: EQ | NE | GT | LT | GE | LE
| AND | OR | UNLESS
;
// Lexer rules
// Boolean operators
@@ -254,7 +259,6 @@ LT : '<' ;
LE : '<=' ;
EQ : '==' | '=' ;
NE : '!=' ;
BOOL : 'bool';
// Delimiters
LPAREN : '(' ;
@@ -1,135 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.alert.calculate;
import org.apache.hertzbeat.alert.dao.SingleAlertDao;
import org.apache.hertzbeat.alert.util.AlertUtil;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.when;
/**
* alert cache manager test
*/
@ExtendWith(MockitoExtension.class)
public class AlarmCacheManagerTest {
@Mock
private SingleAlertDao singleAlertDao;
private AlarmCacheManager alarmCacheManager;
@BeforeEach
public void setUp() {
Map<String, String> labels = new HashMap<>();
labels.put(CommonConstants.LABEL_ALERT_SEVERITY, CommonConstants.ALERT_SEVERITY_CRITICAL);
labels.put(CommonConstants.LABEL_DEFINE_ID, String.valueOf(1L));
SingleAlert alert = new SingleAlert();
alert.setContent("Alert cache manager test");
alert.setLabels(labels);
when(singleAlertDao.querySingleAlertsByStatus(CommonConstants.ALERT_STATUS_FIRING)).thenReturn(Collections.singletonList(alert));
alarmCacheManager = new AlarmCacheManager(singleAlertDao);
}
@Test
void testInit() {
Map<String, String> labels = new HashMap<>();
labels.put(CommonConstants.LABEL_ALERT_SEVERITY, CommonConstants.ALERT_SEVERITY_CRITICAL);
labels.put(CommonConstants.LABEL_DEFINE_ID, String.valueOf(1L));
String fingerprint = AlertUtil.calculateFingerprint(labels);
SingleAlert firingSingleAlert = alarmCacheManager.getFiring(1L, fingerprint);
assertNotNull(firingSingleAlert);
assertEquals("Alert cache manager test", firingSingleAlert.getContent());
alarmCacheManager.removeFiring(1L, fingerprint);
firingSingleAlert = alarmCacheManager.getFiring(1L, fingerprint);
assertNull(firingSingleAlert);
}
@Test
void testPending() {
Map<String, String> labels = new HashMap<>();
labels.put(CommonConstants.LABEL_ALERT_SEVERITY, CommonConstants.ALERT_SEVERITY_CRITICAL);
labels.put(CommonConstants.ALERT_SEVERITY_INFO, CommonConstants.ALERT_STATUS_PENDING);
labels.put(CommonConstants.LABEL_DEFINE_ID, String.valueOf(2L));
SingleAlert alert = new SingleAlert();
alert.setContent("Alert cache manager test");
alert.setLabels(labels);
String fingerprint = AlertUtil.calculateFingerprint(alert.getLabels());
alarmCacheManager.putPending(2L, fingerprint, alert);
SingleAlert pendingSingleAlert = alarmCacheManager.getPending(2L, fingerprint);
assertNotNull(pendingSingleAlert);
alarmCacheManager.removePending(2L, fingerprint);
pendingSingleAlert = alarmCacheManager.getPending(2L, fingerprint);
assertNull(pendingSingleAlert);
}
@Test
void testFiring() {
Map<String, String> labels = new HashMap<>();
labels.put(CommonConstants.LABEL_ALERT_SEVERITY, CommonConstants.ALERT_SEVERITY_CRITICAL);
labels.put(CommonConstants.ALERT_SEVERITY_INFO, CommonConstants.ALERT_STATUS_PENDING);
labels.put(CommonConstants.LABEL_DEFINE_ID, String.valueOf(3L));
SingleAlert alert = new SingleAlert();
alert.setContent("Alert cache manager test");
alert.setLabels(labels);
String fingerprint = AlertUtil.calculateFingerprint(alert.getLabels());
alarmCacheManager.putFiring(3L, fingerprint, alert);
SingleAlert firingSingleAlert = alarmCacheManager.getFiring(3L, fingerprint);
assertNotNull(firingSingleAlert);
alarmCacheManager.removeFiring(3L, fingerprint);
firingSingleAlert = alarmCacheManager.getFiring(3L, fingerprint);
assertNull(firingSingleAlert);
}
@Test
void testHistorical() {
SingleAlert alert = new SingleAlert();
alert.setContent("Alert cache manager test");
alert.setLabels(Collections.singletonMap(CommonConstants.LABEL_ALERT_SEVERITY, CommonConstants.ALERT_SEVERITY_CRITICAL));
when(singleAlertDao.querySingleAlertsByStatus(CommonConstants.ALERT_STATUS_FIRING)).thenReturn(Collections.singletonList(alert));
alarmCacheManager = new AlarmCacheManager(singleAlertDao);
String fingerprint = AlertUtil.calculateFingerprint(alert.getLabels());
SingleAlert historicalSingleAlert = alarmCacheManager.getFiring(4L, fingerprint);
assertNotNull(historicalSingleAlert);
SingleAlert singleAlert = alarmCacheManager.removeFiring(4L, fingerprint);
assertNotNull(singleAlert);
historicalSingleAlert = alarmCacheManager.getFiring(4L, fingerprint);
assertNull(historicalSingleAlert);
}
}
@@ -1,147 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.alert.calculate;
import org.apache.hertzbeat.alert.dao.AlertCollectorDao;
import org.apache.hertzbeat.alert.dao.SingleAlertDao;
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
import org.apache.hertzbeat.alert.util.AlertUtil;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
import org.apache.hertzbeat.common.entity.manager.Collector;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
/**
* Collector alert handler test
*/
@ExtendWith(MockitoExtension.class)
public class CollectorAlertHandlerTest {
@Mock
private AlertCollectorDao alertCollectorDao;
@Mock
private SingleAlertDao singleAlertDao;
@Mock
private AlarmCommonReduce alarmCommonReduce;
private AlarmCacheManager alarmCacheManager;
private CollectorAlertHandler collectorAlertHandler;
@BeforeEach
void setUp() {
alarmCacheManager = Mockito.spy(new AlarmCacheManager(singleAlertDao));
collectorAlertHandler = new CollectorAlertHandler(alarmCommonReduce, alertCollectorDao, alarmCacheManager);
}
@Test
public void testOnline() {
String identity = "localhost-collector";
Collector collector = Collector.builder()
.name(identity)
.ip("127.0.0.1")
.version("1.0")
.build();
SingleAlert singleAlert = SingleAlert.builder().build();
when(alertCollectorDao.findCollectorByName(any(String.class))).thenReturn(collector);
when(alarmCacheManager.removeFiring(any(String.class))).thenReturn(singleAlert);
collectorAlertHandler.online(identity);
assertEquals(CommonConstants.ALERT_STATUS_RESOLVED, singleAlert.getStatus());
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
}
@Test
public void testOffline() {
String identity = "localhost-collector";
Collector collector = Collector.builder()
.name(identity)
.ip("127.0.0.1")
.version("1.0")
.build();
when(alertCollectorDao.findCollectorByName(any(String.class))).thenReturn(collector);
when(alarmCacheManager.getFiring(any(String.class))).thenReturn(null);
collectorAlertHandler.offline(identity);
verify(alarmCacheManager, times(1)).putFiring(any(String.class), any(SingleAlert.class));
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any(SingleAlert.class));
}
@Test
void testOfflineAndOnlineLifecycle() {
String identity = "localhost-collector";
Collector collector = Collector.builder()
.name(identity)
.ip("127.0.0.1")
.version("1.0")
.build();
Map<String, String> fingerPrints = new HashMap<>(8);
fingerPrints.put("collectorName", collector.getName());
fingerPrints.put("collectorVersion", collector.getVersion());
fingerPrints.put("collectorHost", collector.getIp());
String fingerprint = AlertUtil.calculateFingerprint(fingerPrints);
when(alertCollectorDao.findCollectorByName(identity)).thenReturn(collector);
// step1. first time offline
collectorAlertHandler.offline(identity);
assertNotNull(alarmCacheManager.getFiring(fingerprint));
// step2. online
collectorAlertHandler.online(identity);
assertNull(alarmCacheManager.getFiring(fingerprint));
// step3. second time offline
collectorAlertHandler.offline(identity);
assertNotNull(alarmCacheManager.getFiring(fingerprint));
// Verify that the push status is correct.
ArgumentCaptor<SingleAlert> captor = ArgumentCaptor.forClass(SingleAlert.class);
verify(alarmCommonReduce, atLeast(3)).reduceAndSendAlarm(captor.capture());
List<SingleAlert> alerts = captor.getAllValues();
assertEquals(CommonConstants.ALERT_STATUS_FIRING, alerts.get(0).getStatus());
assertEquals(CommonConstants.ALERT_STATUS_RESOLVED, alerts.get(1).getStatus());
assertEquals(CommonConstants.ALERT_STATUS_FIRING, alerts.get(2).getStatus());
}
}
@@ -42,7 +42,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -93,12 +92,12 @@ class PeriodicAlertCalculatorTest {
result.put("__value__", 95.0); // Non-null, matched with threshold
result.put("__timestamp__", System.currentTimeMillis());
when(dataSourceService.calculate(anyString(), anyString())).thenReturn(List.of(result));
when(alarmCacheManager.getPending(eq(rule.getId()), anyString())).thenReturn(null);
when(alarmCacheManager.getPending(anyString())).thenReturn(null);
periodicAlertCalculator.calculate(rule);
// Verify that putFiring is called
ArgumentCaptor<String> idCaptor = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<SingleAlert> alertCaptor = ArgumentCaptor.forClass(SingleAlert.class);
verify(alarmCacheManager).putFiring(eq(rule.getId()), idCaptor.capture(), alertCaptor.capture());
verify(alarmCacheManager).putFiring(idCaptor.capture(), alertCaptor.capture());
// Assertion alarm status and content
SingleAlert alert = alertCaptor.getValue();
assertAll(() -> assertEquals(CommonConstants.ALERT_STATUS_FIRING, alert.getStatus()),
@@ -113,7 +112,7 @@ class PeriodicAlertCalculatorTest {
result.put("__timestamp__", System.currentTimeMillis());
when(dataSourceService.calculate(anyString(), anyString())).thenReturn(List.of(result));
periodicAlertCalculator.calculate(rule);
verify(alarmCacheManager, times(0)).putFiring(any(), any(), any());
verify(alarmCacheManager, times(0)).putFiring(any(), any());
}
@Test
@@ -127,7 +126,7 @@ class PeriodicAlertCalculatorTest {
.triggerTimes(2).startAt(System.currentTimeMillis() - 60000)
.activeAt(System.currentTimeMillis() - 30000)
.build();
when(alarmCacheManager.removeFiring(eq(rule.getId()), anyString())).thenReturn(pendingAlert);
when(alarmCacheManager.removeFiring(anyString())).thenReturn(pendingAlert);
when(dataSourceService.calculate(anyString(), anyString())).thenReturn(List.of(result));
periodicAlertCalculator.calculate(rule);
ArgumentCaptor<SingleAlert> resolvedCaptor = ArgumentCaptor.forClass(SingleAlert.class);
@@ -132,7 +132,6 @@ public class RealTimeAlertCalculatorMatchTest {
AlertDefine matchDefine = new AlertDefine();
matchDefine.setId(1L);
matchDefine.setName("test");
matchDefine.setExpr(
"equals(__app__,\"prometheus\") && "
@@ -152,8 +151,8 @@ public class RealTimeAlertCalculatorMatchTest {
Thread.sleep(3000);
verify(alarmCacheManager, times(1)).getPending(any(), any());
verify(alarmCacheManager, times(1)).putFiring(any(), any(), any());
verify(alarmCacheManager, times(1)).getPending(any());
verify(alarmCacheManager, times(1)).putFiring(any(), any());
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any());
}
@@ -181,7 +180,6 @@ public class RealTimeAlertCalculatorMatchTest {
CollectRep.MetricsData metricsData = builder.build();
AlertDefine matchDefine = new AlertDefine();
matchDefine.setId(1L);
matchDefine.setName("test");
matchDefine.setExpr("equals(__app__,\"prometheus\") && equals(__metrics__,\"canal_instance\") && metric_value > 0");
matchDefine.setTemplate("Canal instance val: ${value}%");
@@ -196,8 +194,8 @@ public class RealTimeAlertCalculatorMatchTest {
Thread.sleep(3000);
verify(alarmCacheManager, times(1)).getPending(any(), any());
verify(alarmCacheManager, times(1)).putFiring(any(), any(), any());
verify(alarmCacheManager, times(1)).getPending(any());
verify(alarmCacheManager, times(1)).putFiring(any(), any());
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any());
}
@@ -231,7 +229,6 @@ public class RealTimeAlertCalculatorMatchTest {
CollectRep.MetricsData metricsData = builder.build();
AlertDefine matchDefine = new AlertDefine();
matchDefine.setId(1L);
matchDefine.setName("test");
matchDefine.setExpr("equals(__app__,\"springboot3\") && equals(__metrics__,\"available\") && equals(__instance__, \"518679137103104\") && responseTime > 0");
matchDefine.setTemplate("Canal instance val: ${value}%");
@@ -246,8 +243,8 @@ public class RealTimeAlertCalculatorMatchTest {
Thread.sleep(3000);
verify(alarmCacheManager, times(1)).getPending(any(), any());
verify(alarmCacheManager, times(1)).putFiring(any(), any(), any());
verify(alarmCacheManager, times(1)).getPending(any());
verify(alarmCacheManager, times(1)).putFiring(any(), any());
verify(alarmCommonReduce, times(1)).reduceAndSendAlarm(any());
}
@@ -181,10 +181,12 @@ class AlertExpressionEvalVisitorTest {
List.of(new HashMap<>(Map.of("__value__", List.of(10.0, 20.0, 30.0)))));
// promql
List<Map<String, Object>> result = evaluate("multi_val > 25");
assertEquals(0, result.size());
assertEquals(1, result.size());
assertEquals(30.0, result.get(0).get("__value__"));
// sql
result = evaluate("(select values from multi_metrics where group_id = 'test_group') > 25");
assertEquals(0, result.size());
assertEquals(1, result.size());
assertEquals(30.0, result.get(0).get("__value__"));
}
@Test
@@ -194,10 +196,12 @@ class AlertExpressionEvalVisitorTest {
List.of(new HashMap<>(Map.of("__value__", List.of(10.0, 20.0, 30.0)))));
// promql
List<Map<String, Object>> result = evaluate("multi_val < 15");
assertEquals(0, result.size());
assertEquals(1, result.size());
assertEquals(10.0, result.get(0).get("__value__"));
// sql
result = evaluate("(select response_times from performance_data where service = 'api') < 15");
assertEquals(0, result.size());
assertEquals(1, result.size());
assertEquals(10.0, result.get(0).get("__value__"));
}
@Test
@@ -207,10 +211,12 @@ class AlertExpressionEvalVisitorTest {
List.of(new HashMap<>(Map.of("__value__", List.of()))));
// promql
List<Map<String, Object>> result = evaluate("empty_list > 50");
assertEquals(0, result.size());
assertEquals(1, result.size());
assertNull(result.get(0).get("__value__"));
// sql
result = evaluate("(select error_codes from error_log where date = '2024-01-01') > 50");
assertEquals(0, result.size());
assertEquals(1, result.size());
assertNull(result.get(0).get("__value__"));
}
@Test
@@ -751,118 +757,6 @@ class AlertExpressionEvalVisitorTest {
assertEquals(16, result.get(1).get("__value__"));
}
@Test
void testComparisonExpr() {
String promql = "3 > bool 2";
// scalar and scalar
List<Map<String, Object>> result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(1, result.get(0).get("__value__"));
// scalar and vector
promql = "0 < http_server_requests_seconds_count";
Map<String, Object> vector = new HashMap<>() {
{
put("instance", "host.docker.internal:8989");
put("__value__", 1307);
put("method", "GET");
put("__name__", "http_server_requests_seconds_count");
put("__timestamp__", "1.750320922467E9");
put("uri", "/actuator/prometheus");
put("status", "200");
}
};
when(mockExecutor.execute("http_server_requests_seconds_count")).thenReturn(List.of(vector));
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(1307, result.get(0).get("__value__"));
// scalar and vector bool
promql = "0 < bool http_server_requests_seconds_count";
// true
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(1, result.get(0).get("__value__"));
// false
vector.put("__value__", -1);
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(0, result.get(0).get("__value__"));
// vector and scalar
promql = "http_server_requests_seconds_sum > 0";
vector = new HashMap<>() {
{
put("instance", "host.docker.internal:8989");
put("__value__", 13);
put("method", "GET");
put("__name__", "http_server_requests_seconds_count");
put("__timestamp__", "1.750320922467E9");
put("uri", "/actuator/prometheus");
put("status", "200");
}
};
when(mockExecutor.execute("http_server_requests_seconds_sum")).thenReturn(List.of(vector));
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(13, result.get(0).get("__value__"));
// vector and scalar bool
promql = "http_server_requests_seconds_sum > bool 0";
// true
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(1, result.get(0).get("__value__"));
// false
vector.put("__value__", -1);
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(0, result.get(0).get("__value__"));
// vector and vector
promql = "http_server_requests_seconds_count > http_server_requests_seconds_sum";
Map<String, Object> vectorCount = new HashMap<>() {
{
put("instance", "host.docker.internal:8989");
put("__value__", 13);
put("method", "GET");
put("__name__", "http_server_requests_seconds_count");
put("__timestamp__", "1.750320922467E9");
put("uri", "/actuator/prometheus");
put("status", "200");
}
};
Map<String, Object> vectorSum = new HashMap<>() {
{
put("instance", "host.docker.internal:8989");
put("__value__", 10);
put("method", "GET");
put("__name__", "http_server_requests_seconds_count");
put("__timestamp__", "1.750320922467E9");
put("uri", "/actuator/prometheus");
put("status", "200");
}
};
when(mockExecutor.execute("http_server_requests_seconds_count")).thenReturn(List.of(vectorCount));
when(mockExecutor.execute("http_server_requests_seconds_sum")).thenReturn(List.of(vectorSum));
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(13, result.get(0).get("__value__"));
// vector and vector bool
promql = "http_server_requests_seconds_count > bool http_server_requests_seconds_sum";
// true
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(1, result.get(0).get("__value__"));
// false
vectorCount.put("__value__", 1);
result = evaluate(promql);
assertEquals(1, result.size());
assertEquals(0, result.get(0).get("__value__"));
}
private List<Map<String, Object>> evaluate(String expression) {
AlertExpressionLexer lexer = new AlertExpressionLexer(CharStreams.fromString(expression));
@@ -33,7 +33,7 @@
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<mqtt.version>1.2.5</mqtt.version>
<mqtt.version>1.3.3</mqtt.version>
</properties>
<dependencies>
@@ -140,19 +140,10 @@
</dependency>
<!-- mqtt -->
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
<version>${mqtt.version}</version>
</dependency>
<!--Bouncy Castle-->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.68</version>
</dependency>
<!--plc-->
<dependency>
<groupId>org.apache.plc4x</groupId>
@@ -471,19 +471,19 @@ public class JdbcCommonCollect extends AbstractCollect {
// remove special characters
String cleanedUrl = jdbcProtocol.getUrl().replaceAll("[\\x00-\\x1F\\x7F\\xA0]", "");
String url = recursiveDecode(cleanedUrl);
String urlLowerCase = url.toLowerCase();
url = url.toLowerCase();
// url format check
if (!urlLowerCase.matches("^jdbc:[a-zA-Z0-9]+:([^\\s;]+)(;[^\\s;]+)*$")) {
if (!url.matches("^jdbc:[a-zA-Z0-9]+:([^\\s;]+)(;[^\\s;]+)*$")) {
throw new IllegalArgumentException("Invalid JDBC URL format");
}
// backlist check
for (String keyword : BLACK_LIST) {
if (urlLowerCase.contains(keyword.toLowerCase())) {
if (url.contains(keyword.toLowerCase())) {
throw new IllegalArgumentException("Invalid JDBC URL: contains potentially malicious parameter: " + keyword);
}
}
// universal detection
String normalizedUrl = urlLowerCase.replaceAll("[\\x00-\\x1F\\x7F\\xA0]", " ");
String normalizedUrl = url.replaceAll("[\\x00-\\x1F\\x7F\\xA0]", " ").toLowerCase();
// universal detection of JDBC injection and deserialization attacks
if (normalizedUrl.matches(".*jndi\\s*[:=].*")
|| normalizedUrl.matches(".*ldap\\s*[:=].*")
@@ -514,7 +514,7 @@ public class JdbcCommonCollect extends AbstractCollect {
}
}
}
return url;
return normalizedUrl;
}
assert jdbcProtocol.getPlatform() != null;
return switch (jdbcProtocol.getPlatform()) {
@@ -68,7 +68,6 @@ import org.apache.hertzbeat.common.util.Base64Util;
import org.apache.hertzbeat.common.util.CommonUtil;
import org.apache.hertzbeat.common.util.IpDomainUtil;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpStatus;
import org.apache.http.auth.AuthScope;
@@ -145,46 +144,37 @@ public class HttpCollectImpl extends AbstractCollect {
builder.setMsg(NetworkConstants.STATUS_CODE + SignConstants.BLANK + statusCode);
return;
}
long responseTime = System.currentTimeMillis() - startTime;
/*
this could create large objects, potentially impacting JVM memory space significantly.
Option 1: Parse using InputStream, but this requires significant code changes;
Option 2: Manually trigger garbage collection, similar to how it's done in Dubbo for large inputs.
*/
String resp = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
if (!StringUtils.hasText(resp)) {
log.info("http response entity is empty, status: {}.", statusCode);
}
Long responseTime = System.currentTimeMillis() - startTime;
String parseType = metrics.getHttp().getParseType();
HttpEntity entity = response.getEntity();
try {
if (DispatchConstants.PARSE_PROMETHEUS.equals(parseType)) {
if (entity != null) {
parseResponseByPrometheusExporter(entity.getContent(), metrics.getAliasFields(), builder);
}
} else if (DispatchConstants.PARSE_HEADER.equals(parseType)) {
parseResponseByHeader(builder, metrics.getAliasFields(), response);
// Consume entity to release connection
EntityUtils.consumeQuietly(entity);
} else {
/*
this could create large objects, potentially impacting JVM memory space significantly.
Option 1: Parse using InputStream, but this requires significant code changes;
Option 2: Manually trigger garbage collection, similar to how it's done in Dubbo for large inputs.
*/
String resp = entity == null ? "" : EntityUtils.toString(entity, StandardCharsets.UTF_8);
if (!StringUtils.hasText(resp)) {
log.info("http response entity is empty, status: {}.", statusCode);
}
switch (parseType) {
case DispatchConstants.PARSE_JSON_PATH ->
parseResponseByJsonPath(resp, metrics.getAliasFields(), metrics.getHttp(), builder, responseTime);
case DispatchConstants.PARSE_PROM_QL ->
parseResponseByPromQl(resp, metrics.getAliasFields(), metrics.getHttp(), builder);
case DispatchConstants.PARSE_XML_PATH ->
parseResponseByXmlPath(resp, metrics, builder, responseTime);
case DispatchConstants.PARSE_WEBSITE ->
parseResponseByWebsite(resp, metrics, metrics.getHttp(), builder, responseTime, statusCode);
case DispatchConstants.PARSE_SITE_MAP ->
parseResponseBySiteMap(resp, metrics.getAliasFields(), builder);
case DispatchConstants.PARSE_CONFIG ->
parseResponseByConfig(resp, metrics.getAliasFields(), metrics.getHttp(), builder, responseTime);
default ->
parseResponseByDefault(resp, metrics.getAliasFields(), metrics.getHttp(), builder, responseTime);
}
switch (parseType) {
case DispatchConstants.PARSE_JSON_PATH ->
parseResponseByJsonPath(resp, metrics.getAliasFields(), metrics.getHttp(), builder, responseTime);
case DispatchConstants.PARSE_PROM_QL ->
parseResponseByPromQl(resp, metrics.getAliasFields(), metrics.getHttp(), builder);
case DispatchConstants.PARSE_PROMETHEUS ->
parseResponseByPrometheusExporter(response.getEntity().getContent(), metrics.getAliasFields(), builder);
case DispatchConstants.PARSE_XML_PATH ->
parseResponseByXmlPath(resp, metrics, builder, responseTime);
case DispatchConstants.PARSE_WEBSITE ->
parseResponseByWebsite(resp, metrics, metrics.getHttp(), builder, responseTime, statusCode);
case DispatchConstants.PARSE_SITE_MAP ->
parseResponseBySiteMap(resp, metrics.getAliasFields(), builder);
case DispatchConstants.PARSE_HEADER ->
parseResponseByHeader(builder, metrics.getAliasFields(), response);
case DispatchConstants.PARSE_CONFIG ->
parseResponseByConfig(resp, metrics.getAliasFields(), metrics.getHttp(), builder, responseTime);
default ->
parseResponseByDefault(resp, metrics.getAliasFields(), metrics.getHttp(), builder, responseTime);
}
} catch (Exception e) {
log.info("parse error: {}.", e.getMessage(), e);
@@ -604,18 +594,6 @@ public class HttpCollectImpl extends AbstractCollect {
}
}
builder.addValueRow(valueRowBuilder.build());
} else if (objectValue instanceof Number numberValue) {
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder();
for (String alias : aliasFields) {
if (NetworkConstants.RESPONSE_TIME.equalsIgnoreCase(alias)) {
valueRowBuilder.addColumn(responseTime.toString());
} else if (CollectorConstants.KEYWORD.equalsIgnoreCase(alias)) {
valueRowBuilder.addColumn(Integer.toString(keywordNum));
} else {
valueRowBuilder.addColumn(numberValue.toString());
}
}
builder.addValueRow(valueRowBuilder.build());
}
}
}
@@ -878,4 +856,4 @@ public class HttpCollectImpl extends AbstractCollect {
}
return successCodeSet.contains(statusCode);
}
}
}
@@ -42,6 +42,7 @@ import javax.management.remote.JMXServiceURL;
import javax.management.remote.rmi.RMIConnectorServer;
import javax.naming.Context;
import javax.rmi.ssl.SslRMIClientSocketFactory;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.collector.collect.AbstractCollect;
import org.apache.hertzbeat.collector.collect.common.cache.AbstractConnection;
import org.apache.hertzbeat.collector.collect.common.cache.CacheIdentifier;
@@ -53,15 +54,13 @@ import org.apache.hertzbeat.common.entity.job.Metrics;
import org.apache.hertzbeat.common.entity.job.protocol.JmxProtocol;
import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.apache.hertzbeat.common.util.CommonUtil;
import org.apache.hertzbeat.common.util.LogUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* jmx protocol acquisition implementation
*/
@Slf4j
public class JmxCollectImpl extends AbstractCollect {
private static final String JMX_URL_PREFIX = "service:jmx:rmi:///jndi/rmi://";
@@ -76,8 +75,6 @@ public class JmxCollectImpl extends AbstractCollect {
private final ClassLoader jmxClassLoader;
private static final Logger logger = LoggerFactory.getLogger(JmxCollectImpl.class);
public JmxCollectImpl() {
jmxClassLoader = new JmxClassLoader(ClassLoader.getSystemClassLoader());
}
@@ -198,12 +195,12 @@ public class JmxCollectImpl extends AbstractCollect {
}
} catch (IOException exception) {
String errorMsg = CommonUtil.getMessageFromThrowable(exception);
LogUtil.error(logger, "JMX IOException: {0}", errorMsg);
log.error("JMX IOException :{}", errorMsg);
builder.setCode(CollectRep.Code.UN_CONNECTABLE);
builder.setMsg(errorMsg);
} catch (Exception e) {
String errorMsg = CommonUtil.getMessageFromThrowable(e);
LogUtil.error(logger, "JMX Error: {0}", errorMsg);
log.error("JMX Error :{}", errorMsg);
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg(errorMsg);
} finally {
@@ -224,7 +221,7 @@ public class JmxCollectImpl extends AbstractCollect {
for (Attribute attribute : attributeList.asList()) {
Object value = attribute.getValue();
if (value == null) {
LogUtil.info(logger, "attribute {0} value is null.", attribute.getName());
log.info("attribute {} value is null.", attribute.getName());
continue;
}
if (value instanceof Number || value instanceof String || value instanceof ObjectName
@@ -248,7 +245,7 @@ public class JmxCollectImpl extends AbstractCollect {
}
attributeValueMap.put(attribute.getName(), builder.toString());
} else {
LogUtil.warn(logger, "attribute value type {0} not support.", value.getClass().getName());
log.warn("attribute value type {} not support.", value.getClass().getName());
}
}
return attributeValueMap;
@@ -322,7 +319,7 @@ public class JmxCollectImpl extends AbstractCollect {
connectionCommonCache.addCache(identifier, new JmxConnect(conn));
return conn;
} catch (Exception e) {
LogUtil.error(logger, "Failed to connect to JMX connection: {0}", e.getMessage());
log.error("Failed to connect to JMX server: {}", e.getMessage());
throw new IOException("Failed to connect to JMX server: " + e.getMessage(), e);
}
}
@@ -1,195 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.collector.collect.mqtt;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Formats the private key and certificate, supporting concatenation of multiple certificates in PEM format.
*/
public class CertificateFormatter {
public static String formatCertificateChain(String input) {
if (input == null || input.trim().isEmpty()) {
return input;
}
String normalized = normalizeInput(input);
List<String> certificates = extractCertificates(normalized);
if (certificates.isEmpty()) {
return formatAsSingleCertificate(normalized);
}
StringBuilder formattedChain = new StringBuilder();
for (String cert : certificates) {
if (cert.trim().isEmpty()) continue;
String formatted = formatPemBlock(cert);
formattedChain.append(formatted).append("\n");
}
return formattedChain.toString().trim();
}
private static String normalizeInput(String input) {
return input
.replace("\r\n", "\n")
.replace("\r", "\n")
.replaceAll("\\s*\\\\n\\s*", "\n")
.replaceAll("(?m)^\\s+|\\s+$", "")
.trim();
}
private static List<String> extractCertificates(String input) {
List<String> certificates = new ArrayList<>();
String regex = "(-----BEGIN\\s+[\\w\\s]+?-----)[\\s\\S]*?(-----END\\s+[\\w\\s]+?-----)";
Pattern pattern = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(input);
int lastEnd = 0;
while (matcher.find()) {
if (matcher.start() > lastEnd) {
String gap = input.substring(lastEnd, matcher.start());
if (!gap.trim().isEmpty()) {
certificates.add(gap);
}
}
certificates.add(matcher.group());
lastEnd = matcher.end();
}
if (lastEnd < input.length()) {
certificates.add(input.substring(lastEnd));
}
return certificates;
}
private static String formatPemBlock(String block) {
try {
Pattern pattern = Pattern.compile(
"(-----BEGIN\\s+[\\w\\s]+?-----)(.*?)(-----END\\s+[\\w\\s]+?-----)",
Pattern.DOTALL | Pattern.CASE_INSENSITIVE
);
Matcher matcher = pattern.matcher(block);
if (matcher.find()) {
String header = matcher.group(1).trim();
String body = matcher.group(2);
String footer = matcher.group(3).trim();
if (body == null) body = "";
String cleanBody = body
.replaceAll("\\s", "")
.replaceAll("\"", "")
.trim();
if (cleanBody.isEmpty() && body != null && !body.trim().isEmpty()) {
cleanBody = body.replaceAll("[^a-zA-Z0-9+/=]", "").trim();
}
String formattedBody = formatBase64Body(cleanBody);
return header + "\n" + formattedBody + "\n" + footer;
} else {
return formatAsCertificate(block);
}
} catch (Exception e) {
return block;
}
}
private static String formatAsCertificate(String content) {
String cleanContent = content.replaceAll("[^a-zA-Z0-9+/=]", "").trim();
if (cleanContent.isEmpty()) {
return content;
}
String formattedBody = formatBase64Body(cleanContent);
if (cleanContent.toLowerCase().contains("private")) {
if (cleanContent.startsWith("MII") || cleanContent.length() > 1000) {
return "-----BEGIN PRIVATE KEY-----\n" + formattedBody + "\n-----END PRIVATE KEY-----";
} else {
return "-----BEGIN RSA PRIVATE KEY-----\n" + formattedBody + "\n-----END RSA PRIVATE KEY-----";
}
} else {
return "-----BEGIN CERTIFICATE-----\n" + formattedBody + "\n-----END CERTIFICATE-----";
}
}
private static String formatAsSingleCertificate(String input) {
String cleanContent = input.replaceAll("[^a-zA-Z0-9+/=]", "").trim();
return formatAsCertificate(cleanContent);
}
private static String formatBase64Body(String body) {
StringBuilder formatted = new StringBuilder();
int index = 0;
while (index < body.length()) {
int end = Math.min(index + 64, body.length());
formatted.append(body.substring(index, end));
if (end < body.length()) {
formatted.append("\n");
}
index = end;
}
return formatted.toString().trim();
}
public static String formatPrivateKey(String input) {
if (input == null || input.trim().isEmpty()) {
return input;
}
String normalized = normalizeInput(input);
if (isPemEncapsulated(normalized)) {
return formatPemBlock(normalized);
}
return formatAsCertificate(normalized);
}
private static boolean isPemEncapsulated(String block) {
return block.contains("-----BEGIN") && block.contains("-----END");
}
}
@@ -17,7 +17,26 @@
package org.apache.hertzbeat.collector.collect.mqtt;
import com.hivemq.client.mqtt.MqttVersion;
import com.hivemq.client.mqtt.datatypes.MqttQos;
import com.hivemq.client.mqtt.mqtt3.Mqtt3AsyncClient;
import com.hivemq.client.mqtt.mqtt3.Mqtt3Client;
import com.hivemq.client.mqtt.mqtt3.Mqtt3ClientBuilder;
import com.hivemq.client.mqtt.mqtt3.message.connect.connack.Mqtt3ConnAck;
import com.hivemq.client.mqtt.mqtt5.Mqtt5AsyncClient;
import com.hivemq.client.mqtt.mqtt5.Mqtt5Client;
import com.hivemq.client.mqtt.mqtt5.Mqtt5ClientBuilder;
import com.hivemq.client.mqtt.mqtt5.message.connect.connack.Mqtt5ConnAck;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.apache.hertzbeat.collector.collect.AbstractCollect;
import org.apache.hertzbeat.collector.constants.CollectorConstants;
@@ -27,27 +46,13 @@ import org.apache.hertzbeat.common.entity.job.Metrics;
import org.apache.hertzbeat.common.entity.job.protocol.MqttProtocol;
import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.apache.hertzbeat.common.entity.message.CollectRep.MetricsData.Builder;
import org.eclipse.paho.client.mqttv3.MqttAsyncClient;
import org.eclipse.paho.client.mqttv3.MqttClientPersistence;
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
import org.eclipse.paho.client.mqttv3.MqttCallback;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.IMqttToken;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Assert;
import org.springframework.util.StopWatch;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* collect mqtt metrics using Eclipse Paho
* collect mqtt metrics
*/
public class MqttCollectImpl extends AbstractCollect {
@@ -56,224 +61,138 @@ public class MqttCollectImpl extends AbstractCollect {
private static final Logger logger = LoggerFactory.getLogger(MqttCollectImpl.class);
@Override
public String supportProtocol() {
return DispatchConstants.PROTOCOL_MQTT;
}
@Override
public void preCheck(Metrics metrics) throws IllegalArgumentException {
MqttProtocol mqttProtocol = metrics.getMqtt();
Assert.hasText(mqttProtocol.getHost(), "MQTT protocol host is required");
Assert.hasText(mqttProtocol.getPort(), "MQTT protocol port is required");
if ("mqtts".equalsIgnoreCase(mqttProtocol.getProtocol())) {
if (Boolean.parseBoolean(mqttProtocol.getEnableMutualAuth())) {
Assert.hasText(mqttProtocol.getCaCert(), "CA certificate is required for mutual auth");
Assert.hasText(mqttProtocol.getClientCert(), "Client certificate is required for mutual auth");
Assert.hasText(mqttProtocol.getClientKey(), "Client private key is required for mutual auth");
}
}
Assert.hasText(mqttProtocol.getProtocolVersion(), "MQTT protocol version is required");
}
@Override
public void collect(Builder builder, Metrics metrics) {
MqttProtocol mqtt = metrics.getMqtt();
String protocolVersion = mqtt.getProtocolVersion();
MqttVersion mqttVersion = MqttVersion.valueOf(protocolVersion);
if (mqttVersion == MqttVersion.MQTT_3_1_1) {
collectWithVersion3(metrics, builder);
} else if (mqttVersion == MqttVersion.MQTT_5_0) {
collectWithVersion5(metrics, builder);
}
}
@Override
public String supportProtocol() {
return DispatchConstants.PROTOCOL_MQTT;
}
/**
* collecting data of MQTT 5
*/
private void collectWithVersion5(Metrics metrics, Builder builder) {
MqttProtocol mqttProtocol = metrics.getMqtt();
Map<Object, String> data = new HashMap<>();
try {
MqttAsyncClient client = buildMqttClient(mqttProtocol);
long responseTime = connectClient(client, mqttProtocol);
testSubscribeAndPublish(client, mqttProtocol, data);
convertToMetricsData(builder, metrics, responseTime, data);
client.disconnect();
} catch (Exception e) {
logger.error("MQTT collection error: {}", e.getMessage(), e);
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg("Collection failed: " + e.getMessage());
}
}
private MqttAsyncClient buildMqttClient(MqttProtocol protocol) throws Exception {
String clientId = protocol.getClientId();
String serverUri = String.format("%s://%s:%s",
StringUtils.equals(protocol.getProtocol(), "MQTT") ? "tcp" : "ssl",
protocol.getHost(),
protocol.getPort());
MqttClientPersistence persistence = new MemoryPersistence();
return new MqttAsyncClient(serverUri, clientId, persistence);
}
private long connectClient(MqttAsyncClient client, MqttProtocol protocol) throws Exception {
MqttConnectOptions connOpts = new MqttConnectOptions();
if (protocol.hasAuth()) {
connOpts.setUserName(protocol.getUsername());
connOpts.setPassword(protocol.getPassword().toCharArray());
}
connOpts.setKeepAliveInterval(Integer.parseInt(protocol.getKeepalive()));
connOpts.setConnectionTimeout(Integer.parseInt(protocol.getTimeout()) / 1000);
connOpts.setCleanSession(true);
connOpts.setAutomaticReconnect(false);
if ("mqtts".equalsIgnoreCase(protocol.getProtocol())) {
boolean insecureSkipVerify = Boolean.parseBoolean(protocol.getInsecureSkipVerify());
if (insecureSkipVerify) {
connOpts.setHttpsHostnameVerificationEnabled(false);
}
if (Boolean.parseBoolean(protocol.getEnableMutualAuth())) {
connOpts.setSocketFactory(MqttSslFactory.getMslSocketFactory(protocol, insecureSkipVerify));
} else {
connOpts.setSocketFactory(MqttSslFactory.getSslSocketFactory(protocol, insecureSkipVerify));
}
}
StopWatch connectWatch = new StopWatch();
connectWatch.start();
client.connect(connOpts).waitForCompletion(Long.parseLong(protocol.getTimeout()));
connectWatch.stop();
return connectWatch.getTotalTimeMillis();
}
/**
* Test MQTT subscribe and publish capabilities
*/
private void testSubscribeAndPublish(MqttAsyncClient client, MqttProtocol protocol, Map<Object, String> data) {
// 1 test subscribe
if (StringUtils.isNotBlank(protocol.getTopic())) {
String subscribe = testSubscribe(client, protocol.getTopic());
if (StringUtils.isBlank(subscribe)) {
data.put("canSubscribe", "Subscription successful");
} else {
data.put("canSubscribe", String.format("Subscription failed: %s", subscribe));
}
} else {
data.put("canSubscribe", "No topic, subscription test skipped");
}
// 2 test publish
if (StringUtils.isNotBlank(protocol.getTestMessage())) {
String publish = testPublish(client, protocol.getTopic(), protocol.getTestMessage());
if (StringUtils.isBlank(publish)) {
data.put("canPublish", "Message published successfully");
// 3 test receive message
String receivedData = getReceivedData(client, protocol.getTopic());
data.put("canReceive", receivedData);
} else {
data.put("canPublish", String.format("Message publishing failed: %s", publish));
data.put("canReceive", "Message reception skipped due to failed publish");
}
} else {
data.put("canPublish", "No test message, publish test skipped");
data.put("canReceive", "No test message, receive test skipped");
}
// 4 test unsubscribe
if (StringUtils.isNotBlank(protocol.getTopic())) {
String subscribe = testUnSubscribe(client, protocol.getTopic());
if (StringUtils.isBlank(subscribe)) {
data.put("canUnSubscribe", "Unsubscription successful");
} else {
data.put("canUnSubscribe", String.format("Unsubscription failed: %s", subscribe));
}
} else {
data.put("canUnSubscribe", "No topic, unsubscription test skipped");
}
}
private String getReceivedData(MqttAsyncClient client, String topic) {
final CountDownLatch latch = new CountDownLatch(1);
final StringBuilder messageHolder = new StringBuilder();
client.setCallback(new MqttCallback() {
@Override
public void connectionLost(Throwable cause) {
latch.countDown();
}
@Override
public void messageArrived(String arrivedTopic, MqttMessage message) {
if (topic.equals(arrivedTopic)) {
messageHolder.append(new String(message.getPayload()));
latch.countDown();
}
}
@Override
public void deliveryComplete(IMqttDeliveryToken token) {
Mqtt5AsyncClient client = buildMqtt5Client(mqttProtocol);
long responseTime = connectClient(client, mqtt5AsyncClient -> {
CompletableFuture<Mqtt5ConnAck> connectFuture = mqtt5AsyncClient.connect();
try {
connectFuture.get(Long.parseLong(mqttProtocol.getTimeout()), TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg(getErrorMessage(e.getMessage()));
}
});
try {
boolean received = latch.await(5, TimeUnit.SECONDS);
if (messageHolder.length() > 0) {
return messageHolder.toString();
} else if (!received) {
return "Message reception timed out after 5 seconds";
} else {
return "No valid message received";
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
return e.getMessage();
} finally {
client.setCallback(null);
}
}
private String testSubscribe(MqttAsyncClient client, String topic) {
try {
IMqttToken subToken = client.subscribe(topic, 1);
subToken.waitForCompletion(5000);
return "";
} catch (MqttException e) {
logger.warn("MQTT subscribe test failed: {}", e.getMessage());
return e.getMessage();
}
}
private String testPublish(MqttAsyncClient client, String topic, String message) {
try {
MqttMessage mqttMessage = new MqttMessage(message.getBytes());
mqttMessage.setQos(1);
IMqttToken pubToken = client.publish(topic, mqttMessage);
pubToken.waitForCompletion(5000);
return "";
} catch (MqttException e) {
logger.warn("MQTT publish test failed: {}", e.getMessage());
return e.getMessage();
}
}
private String testUnSubscribe(MqttAsyncClient client, String topic) {
try {
IMqttToken unsubToken = client.unsubscribe(topic);
unsubToken.waitForCompletion(5000);
return "";
} catch (MqttException e) {
logger.warn("MQTT unsubscribe test failed: {}", e.getMessage());
return e.getMessage();
}
testDescribeAndPublish5(client, mqttProtocol, data);
convertToMetricsData(builder, metrics, responseTime, data);
client.disconnect();
}
/**
* Convert collected data to MetricsData
* collecting data of MQTT 3.1.1
*/
private void collectWithVersion3(Metrics metrics, Builder builder) {
MqttProtocol mqttProtocol = metrics.getMqtt();
Map<Object, String> data = new HashMap<>();
Mqtt3AsyncClient client = buildMqtt3Client(mqttProtocol);
long responseTime = connectClient(client, mqtt3AsyncClient -> {
CompletableFuture<Mqtt3ConnAck> connectFuture = mqtt3AsyncClient.connect();
try {
connectFuture.get(Long.parseLong(mqttProtocol.getTimeout()), TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg(getErrorMessage(e.getMessage()));
}
});
testDescribeAndPublish3(client, mqttProtocol, data);
convertToMetricsData(builder, metrics, responseTime, data);
client.disconnect();
}
private void testDescribeAndPublish3(Mqtt3AsyncClient client, MqttProtocol mqttProtocol, Map<Object, String> data) {
data.put("canDescribe", test(() -> {
client.subscribeWith().topicFilter(mqttProtocol.getTopic()).qos(MqttQos.AT_LEAST_ONCE).send();
client.unsubscribeWith().topicFilter(mqttProtocol.getTopic()).send();
}, "subscribe").toString());
data.put("canPublish", !mqttProtocol.testPublish() ? Boolean.FALSE.toString() : test(() -> {
client.publishWith().topic(mqttProtocol.getTopic())
.payload(mqttProtocol.getTestMessage().getBytes(StandardCharsets.UTF_8))
.qos(MqttQos.AT_LEAST_ONCE).send();
data.put("canPublish", Boolean.TRUE.toString());
}, "publish").toString());
}
private void testDescribeAndPublish5(Mqtt5AsyncClient client, MqttProtocol mqttProtocol, Map<Object, String> data) {
data.put("canDescribe", test(() -> {
client.subscribeWith().topicFilter(mqttProtocol.getTopic()).qos(MqttQos.AT_LEAST_ONCE).send();
client.unsubscribeWith().topicFilter(mqttProtocol.getTopic()).send();
}, "subscribe").toString());
data.put("canPublish", !mqttProtocol.testPublish() ? Boolean.FALSE.toString() : test(() -> {
client.publishWith().topic(mqttProtocol.getTopic())
.payload(mqttProtocol.getTestMessage().getBytes(StandardCharsets.UTF_8))
.qos(MqttQos.AT_LEAST_ONCE).send();
data.put("canPublish", Boolean.TRUE.toString());
}, "publish").toString());
}
private Mqtt5AsyncClient buildMqtt5Client(MqttProtocol mqttProtocol) {
Mqtt5ClientBuilder mqtt5ClientBuilder = Mqtt5Client.builder()
.serverHost(mqttProtocol.getHost())
.identifier(mqttProtocol.getClientId())
.serverPort(Integer.parseInt(mqttProtocol.getPort()));
if (mqttProtocol.hasAuth()) {
mqtt5ClientBuilder.simpleAuth().username(mqttProtocol.getUsername())
.password(mqttProtocol.getPassword().getBytes(StandardCharsets.UTF_8))
.applySimpleAuth();
}
return mqtt5ClientBuilder.buildAsync();
}
private Mqtt3AsyncClient buildMqtt3Client(MqttProtocol mqttProtocol) {
Mqtt3ClientBuilder mqtt3ClientBuilder = Mqtt3Client.builder()
.serverHost(mqttProtocol.getHost())
.identifier(mqttProtocol.getClientId())
.serverPort(Integer.parseInt(mqttProtocol.getPort()));
if (mqttProtocol.hasAuth()) {
mqtt3ClientBuilder.simpleAuth().username(mqttProtocol.getUsername())
.password(mqttProtocol.getPassword().getBytes(StandardCharsets.UTF_8))
.applySimpleAuth();
}
return mqtt3ClientBuilder.buildAsync();
}
public <T> long connectClient(T client, Consumer<T> connect) {
StopWatch stopWatch = new StopWatch();
stopWatch.start();
connect.accept(client);
stopWatch.stop();
return stopWatch.getTotalTimeMillis();
}
private void convertToMetricsData(Builder builder, Metrics metrics, long responseTime, Map<Object, String> data) {
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder();
for (String column : metrics.getAliasFields()) {
@@ -288,4 +207,25 @@ public class MqttCollectImpl extends AbstractCollect {
builder.addValueRow(valueRowBuilder.build());
}
private Boolean test(Runnable runnable, String operationName) {
try {
runnable.run();
return true;
} catch (Exception e) {
logger.error("{} fail", operationName, e);
}
return false;
}
private String getErrorMessage(String errorMessage) {
if (StringUtils.isBlank(errorMessage)) {
return "connect failed";
}
String[] split = errorMessage.split(":");
if (split.length > 1) {
return Arrays.stream(split).skip(1).collect(Collectors.joining(":"));
}
return errorMessage;
}
}
@@ -1,186 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.collector.collect.mqtt;
import org.apache.hertzbeat.common.entity.job.protocol.MqttProtocol;
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.openssl.PEMKeyPair;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.TrustManagerFactory;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.StringReader;
import java.security.KeyStore;
import java.security.PrivateKey;
import java.security.Security;
import java.security.cert.Certificate;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
import java.util.Collection;
/**
* Support MQTT SSL Factory
*/
public class MqttSslFactory {
/**
* Get MSL Socket Factory
*/
public static SSLSocketFactory getMslSocketFactory(MqttProtocol mqttProtocol, boolean insecureSkipVerify) {
try {
Security.addProvider(new BouncyCastleProvider());
KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(null, null);
Certificate[] chain = null;
if (mqttProtocol.getClientCert() != null && !mqttProtocol.getClientCert().isEmpty()) {
String formatClientCert = CertificateFormatter.formatCertificateChain(mqttProtocol.getClientCert());
try (InputStream certIn = new ByteArrayInputStream(formatClientCert.getBytes())) {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Collection<? extends Certificate> certs = cf.generateCertificates(certIn);
chain = certs.toArray(new Certificate[0]);
}
}
PrivateKey privateKey;
if (mqttProtocol.getClientKey() != null && !mqttProtocol.getClientKey().isEmpty()) {
String formatClientKey = CertificateFormatter.formatPrivateKey(mqttProtocol.getClientKey());
try (PEMParser pemParser = new PEMParser(new StringReader(formatClientKey))) {
JcaPEMKeyConverter converter = new JcaPEMKeyConverter().setProvider("BC");
Object object = pemParser.readObject();
if (object instanceof PEMKeyPair) {
privateKey = converter.getPrivateKey(((PEMKeyPair) object).getPrivateKeyInfo());
} else if (object instanceof PrivateKeyInfo) {
privateKey = converter.getPrivateKey((PrivateKeyInfo) object);
} else {
throw new IllegalArgumentException("Unsupported private key type");
}
ks.setKeyEntry("private-key", privateKey, "".toCharArray(), chain);
}
}
TrustManager[] trustManagers;
if (insecureSkipVerify) {
trustManagers = createInsecureTrustManager();
} else {
String formatCaCert = CertificateFormatter.formatCertificateChain(mqttProtocol.getCaCert());
KeyStore trustStore = createMergedTrustStore(formatCaCert);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(trustStore);
trustManagers = tmf.getTrustManagers();
}
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(ks, "".toCharArray());
SSLContext context = SSLContext.getInstance(mqttProtocol.getTlsVersion());
context.init(kmf.getKeyManagers(), trustManagers, null);
return context.getSocketFactory();
} catch (Exception e) {
throw new RuntimeException("Fails to SSL initialize: " + e.getMessage(), e);
}
}
/**
* Get SSL Socket Factory
*/
public static SSLSocketFactory getSslSocketFactory(MqttProtocol mqttProtocol, boolean insecureSkipVerify) {
try {
Security.addProvider(new BouncyCastleProvider());
TrustManager[] trustManagers;
if (insecureSkipVerify) {
trustManagers = createInsecureTrustManager();
} else {
String formatCaCert = CertificateFormatter.formatCertificateChain(mqttProtocol.getCaCert());
KeyStore trustStore = createMergedTrustStore(formatCaCert);
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init(trustStore);
trustManagers = tmf.getTrustManagers();
}
SSLContext sslContext = SSLContext.getInstance(mqttProtocol.getTlsVersion());
sslContext.init(null, trustManagers, null);
return sslContext.getSocketFactory();
} catch (Exception e) {
throw new RuntimeException("Fails to SSL initialize: " + e.getMessage(), e);
}
}
private static TrustManager[] createInsecureTrustManager() {
return new TrustManager[]{
new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) {
}
public void checkServerTrusted(X509Certificate[] chain, String authType) {
}
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
}
};
}
private static KeyStore createMergedTrustStore(String caCertPem) throws Exception {
KeyStore mergedKs = KeyStore.getInstance(KeyStore.getDefaultType());
mergedKs.load(null, null);
TrustManagerFactory systemTmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
systemTmf.init((KeyStore) null);
X509TrustManager systemTm = (X509TrustManager) systemTmf.getTrustManagers()[0];
int systemIndex = 1;
for (X509Certificate cert : systemTm.getAcceptedIssuers()) {
mergedKs.setCertificateEntry("system-ca-" + systemIndex++, cert);
}
if (caCertPem != null && !caCertPem.isEmpty()) {
try (InputStream caIn = new ByteArrayInputStream(caCertPem.getBytes())) {
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Collection<? extends Certificate> customCerts = cf.generateCertificates(caIn);
int customIndex = 1;
for (Certificate cert : customCerts) {
mergedKs.setCertificateEntry("custom-ca-" + customIndex++, cert);
}
}
}
return mergedKs;
}
}
@@ -17,6 +17,11 @@
package org.apache.hertzbeat.collector.collect.database;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
import org.apache.hertzbeat.common.entity.job.Metrics;
import org.apache.hertzbeat.common.entity.job.protocol.JdbcProtocol;
@@ -24,14 +29,6 @@ import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* Test case for {@link JdbcCommonCollect}
*/
@@ -131,81 +128,4 @@ class JdbcCommonCollectTest {
String protocol = jdbcCommonCollect.supportProtocol();
assertEquals(DispatchConstants.PROTOCOL_JDBC, protocol);
}
@Test
void testUrlPassThrough() {
String[] testUrls = {
"jdbc:mysql://localhost:3306/test?allowPublicKeyRetrieval=true&useSSL=false",
"jdbc:mysql://localhost:3306/test?usessl=false&verifyServerCertificate=true",
"jdbc:mysql://localhost:3306/test?serverTimezone=UTC&autoReconnect=false"
};
JdbcCommonCollect jdbcCollect = new JdbcCommonCollect();
for (String originalUrl : testUrls) {
try {
JdbcProtocol jdbcProtocol = JdbcProtocol.builder()
.host("localhost")
.port("3306")
.platform("mysql")
.username("root")
.password("root")
.database("test")
.url(originalUrl)
.build();
// Use reflection to call constructDatabaseUrl method
Method constructMethod = JdbcCommonCollect.class.getDeclaredMethod("constructDatabaseUrl", JdbcProtocol.class, String.class, String.class);
constructMethod.setAccessible(true);
String processedUrl = (String) constructMethod.invoke(jdbcCollect, jdbcProtocol, "localhost", "3306");
// Verify that the processed URL is the same as the original URL
assertEquals(originalUrl, processedUrl,
"URL should be passed through without modification: " + originalUrl);
} catch (Exception e) {
System.out.println("URL rejected by security validation: " + originalUrl + ", reason: " + e.getMessage());
}
}
}
@Test
void testConstructDatabaseUrlSecurityInterception() {
JdbcCommonCollect jdbcCollect = new JdbcCommonCollect();
String[] maliciousUrls = {
// URL length limit test
"jdbc:mysql://localhost:3306/test?" + "a".repeat(2050) + "=value",
// url format check
"jdbca:mysql://localhost:3306/test?allowLoadLocalInfile=true",
// backlist check
"jdbc:mysql://localhost:3306/test?allowLoadLocalInfile=true",
// universal detection of JDBC injection and deserialization attacks
"jdbc:mysql://localhost:3306/test?jndi:ldap://duansg.com/exploit",
// universal detection of bypass
"jdbc:mysql://localhost:3306/test?param=create\\trigger",
// database platform specific bypass detection
"jdbc:mysql://localhost:3306/test?allow\\nload\\nlocal\\ninfile=true"
};
// Test malicious URLs - should throw exceptions
for (String maliciousUrl : maliciousUrls) {
JdbcProtocol jdbcProtocol = JdbcProtocol.builder()
.host("localhost")
.port("3306")
.platform("mysql")
.username("root")
.password("root")
.database("test")
.url(maliciousUrl)
.build();
assertThrows(Exception.class, () -> {
try {
Method constructMethod = JdbcCommonCollect.class.getDeclaredMethod("constructDatabaseUrl", JdbcProtocol.class, String.class, String.class);
constructMethod.setAccessible(true);
constructMethod.invoke(jdbcCollect, jdbcProtocol, "localhost", "3306");
} catch (InvocationTargetException e) {
throw e.getCause();
}
}, "Malicious URL should be blocked: " + maliciousUrl);
}
}
}
@@ -17,6 +17,15 @@
package org.apache.hertzbeat.collector.collect.http;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import com.google.common.collect.Lists;
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
import org.apache.hertzbeat.common.entity.job.Metrics;
@@ -25,15 +34,6 @@ import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* Test case for {@link HttpCollectImpl}
*/
@@ -186,107 +186,4 @@ class HttpCollectImplTest {
assertEquals("0.0", secondRow.getColumns(2), "Second server CPU should be 0.0");
assertEquals("0", secondRow.getColumns(3), "Second server memory should be 0");
}
@Test
void parseResponseByJsonPath() throws Exception {
String jsonResponse = "{"
+ " \"name\": \"jvm.memory.used\","
+ " \"description\": \"The amount of used memory\","
+ " \"baseUnit\": \"bytes\","
+ " \"measurements\": ["
+ " {"
+ " \"statistic\": \"VALUE\","
+ " \"value\": 90282296"
+ " }"
+ " ],"
+ " \"availableTags\": ["
+ " {"
+ " \"tag\": \"area\","
+ " \"values\": ["
+ " \"heap\","
+ " \"nonheap\""
+ " ]"
+ " },"
+ " {"
+ " \"tag\": \"id\","
+ " \"values\": ["
+ " \"G1 Survivor Space\","
+ " \"G1 Eden Space\""
+ " ]"
+ " }"
+ " ]"
+ "}";
HttpProtocol http = HttpProtocol.builder()
.parseType(DispatchConstants.PARSE_JSON_PATH)
.parseScript("$.availableTags[?(@.tag == \"id\")].values[*]")
.build();
List<CollectRep.ValueRow> capturedRows = new ArrayList<>();
CollectRep.MetricsData.Builder builder = new CollectRep.MetricsData.Builder() {
@Override
public CollectRep.MetricsData.Builder addValueRow(CollectRep.ValueRow valueRow) {
capturedRows.add(valueRow);
return super.addValueRow(valueRow);
}
};
Method parseMethod = HttpCollectImpl.class.getDeclaredMethod(
"parseResponseByJsonPath",
String.class,
List.class,
HttpProtocol.class,
CollectRep.MetricsData.Builder.class,
Long.class);
parseMethod.setAccessible(true);
// Call the method
parseMethod.invoke(httpCollectImpl, jsonResponse, Lists.newArrayList("id"), http, builder, 100L);
// Verify the results
assertEquals(2, capturedRows.size());
CollectRep.ValueRow firstRow = capturedRows.get(0);
assertEquals("G1 Survivor Space", firstRow.getColumns(0));
CollectRep.ValueRow secondRow = capturedRows.get(1);
assertEquals("G1 Eden Space", secondRow.getColumns(0));
// number
String numberJson = "{"
+ " \"name\": \"system.cpu.usage\","
+ " \"description\": \"The \\\"recent cpu usage\\\" of the system the application is running in\","
+ " \"measurements\": ["
+ " {"
+ " \"statistic\": \"VALUE\","
+ " \"value\": 0.268751364291017"
+ " }"
+ " ],"
+ " \"availableTags\": []"
+ "}";
http = HttpProtocol.builder()
.parseType(DispatchConstants.PARSE_JSON_PATH)
.parseScript("$.measurements[?(@.statistic == \"VALUE\")].value")
.build();
capturedRows.clear();
builder = new CollectRep.MetricsData.Builder() {
@Override
public CollectRep.MetricsData.Builder addValueRow(CollectRep.ValueRow valueRow) {
capturedRows.add(valueRow);
return super.addValueRow(valueRow);
}
};
parseMethod = HttpCollectImpl.class.getDeclaredMethod(
"parseResponseByJsonPath",
String.class,
List.class,
HttpProtocol.class,
CollectRep.MetricsData.Builder.class,
Long.class);
parseMethod.setAccessible(true);
// Call the method
parseMethod.invoke(httpCollectImpl, numberJson, Lists.newArrayList("usage"), http, builder, 100L);
// Verify the results
assertEquals(1, capturedRows.size());
firstRow = capturedRows.get(0);
assertEquals("0.268751364291017", firstRow.getColumns(0));
}
}
@@ -17,91 +17,108 @@
package org.apache.hertzbeat.collector.collect.mqtt;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import com.hivemq.client.mqtt.MqttVersion;
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
import org.apache.hertzbeat.common.entity.job.Metrics;
import org.apache.hertzbeat.common.entity.job.protocol.MqttProtocol;
import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* Test case for {@link MqttCollectImpl}
*/
class MqttCollectTest {
public class MqttCollectTest {
private MqttCollectImpl mqttCollect;
private Metrics metrics;
private MqttProtocol.MqttProtocolBuilder mqttBuilder;
private CollectRep.MetricsData.Builder builder;
@BeforeEach
void setup() {
public void setup() {
mqttCollect = new MqttCollectImpl();
metrics = new Metrics();
// Initialize base MQTT parameters for test cases
mqttBuilder = MqttProtocol.builder()
.host("example.com")
.port("1883")
.protocol("mqtt")
.timeout("5000")
.keepalive("60");
}
// Region: preCheck validation tests
@Test
// Verify preCheck throws exception when host is missing
void preCheckShouldThrowWhenHostMissing() {
metrics.setMqtt(mqttBuilder.host("").build());
assertThrows(IllegalArgumentException.class, () -> mqttCollect.preCheck(metrics));
MqttProtocol mqtt = MqttProtocol.builder().build();
metrics = Metrics.builder()
.mqtt(mqtt)
.build();
builder = CollectRep.MetricsData.newBuilder();
}
@Test
// Verify preCheck throws exception when port is missing
void preCheckShouldThrowWhenPortMissing() {
metrics.setMqtt(mqttBuilder.port("").build());
assertThrows(IllegalArgumentException.class, () -> mqttCollect.preCheck(metrics));
void preCheck() {
// host is empty
assertThrows(IllegalArgumentException.class, () -> {
mqttCollect.preCheck(metrics);
});
// port is empty
assertThrows(IllegalArgumentException.class, () -> {
MqttProtocol mqtt = MqttProtocol.builder().build();
mqtt.setHost("example.com");
metrics.setMqtt(mqtt);
mqttCollect.preCheck(metrics);
});
// protocol version is empty
assertThrows(IllegalArgumentException.class, () -> {
MqttProtocol mqtt = MqttProtocol.builder().build();
mqtt.setHost("example.com");
mqtt.setPort("1883");
metrics.setMqtt(mqtt);
mqttCollect.preCheck(metrics);
});
// everything is ok
assertDoesNotThrow(() -> {
MqttProtocol mqtt = MqttProtocol.builder().build();
mqtt.setHost("example.com");
mqtt.setPort("1883");
metrics.setMqtt(mqtt);
mqtt.setProtocolVersion("3.1.1");
mqttCollect.preCheck(metrics);
});
}
@Test
// Verify preCheck throws exception when MQTTS mutual auth is enabled but CA cert is missing
void preCheckShouldThrowWhenMqttsMutualAuthMissingCerts() {
metrics.setMqtt(mqttBuilder
.protocol("mqtts")
.enableMutualAuth("true")
.caCert("")
.clientCert("client.crt")
.clientKey("client.key")
.build());
assertThrows(IllegalArgumentException.class, () -> mqttCollect.preCheck(metrics));
void supportProtocol() {
Assertions.assertEquals(DispatchConstants.PROTOCOL_MQTT, mqttCollect.supportProtocol());
}
@Test
// Verify preCheck succeeds with valid standard MQTT parameters
void preCheckShouldSucceedWithValidMqttParams() {
metrics.setMqtt(mqttBuilder.build());
assertDoesNotThrow(() -> mqttCollect.preCheck(metrics));
}
void collect() {
// with version 3.1.1
assertDoesNotThrow(() -> {
MqttProtocol mqtt = MqttProtocol.builder().build();
mqtt.setHost("example.com");
mqtt.setPort("1883");
mqtt.setClientId("clientid");
mqtt.setTimeout("1");
mqtt.setProtocolVersion(MqttVersion.MQTT_3_1_1.name());
@Test
// Verify preCheck succeeds with valid MQTTS parameters including mutual authentication
void preCheckShouldSucceedWithValidMqttsMutualAuth() {
metrics.setMqtt(mqttBuilder
.protocol("mqtts")
.enableMutualAuth("true")
.caCert("ca.pem")
.clientCert("client.crt")
.clientKey("client.key")
.build());
assertDoesNotThrow(() -> mqttCollect.preCheck(metrics));
}
// End region
metrics.setMqtt(mqtt);
metrics.setAliasFields(new ArrayList<>());
@Test
// Verify supportProtocol method returns correct MQTT constant
void supportProtocolShouldReturnMqttConstant() {
assertEquals(DispatchConstants.PROTOCOL_MQTT, mqttCollect.supportProtocol());
mqttCollect.collect(builder, metrics);
});
assertDoesNotThrow(() -> {
MqttProtocol mqtt = MqttProtocol.builder().build();
mqtt.setHost("example.com");
mqtt.setPort("1883");
mqtt.setClientId("clientid");
mqtt.setTimeout("1");
mqtt.setProtocolVersion(MqttVersion.MQTT_5_0.name());
metrics.setMqtt(mqtt);
metrics.setAliasFields(new ArrayList<>());
mqttCollect.collect(builder, metrics);
});
}
}
@@ -70,11 +70,14 @@
<version>${hertzbeat.version}</version>
</dependency>
<!-- spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
@@ -84,15 +87,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>
<!-- metrics -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
</dependencies>
<build>
@@ -23,7 +23,6 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.collector.dispatch.entrance.internal.CollectJobService;
import org.apache.hertzbeat.collector.metrics.HertzBeatMetricsCollector;
import org.apache.hertzbeat.common.timer.Timeout;
import org.apache.hertzbeat.collector.timer.TimerDispatch;
import org.apache.hertzbeat.collector.timer.WheelTimerTask;
@@ -34,7 +33,6 @@ import org.apache.hertzbeat.common.entity.job.Job;
import org.apache.hertzbeat.common.entity.job.Metrics;
import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.apache.hertzbeat.common.queue.CommonDataQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@@ -92,9 +90,6 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
private final String collectorIdentity;
@Autowired
private HertzBeatMetricsCollector metricsCollector;
public CommonDispatcher(MetricsCollectorQueue jobRequestQueue,
TimerDispatch timerDispatch,
CommonDataQueue commonDataQueue,
@@ -158,23 +153,12 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
for (Map.Entry<String, MetricsTime> entry : metricsTimeoutMonitorMap.entrySet()) {
MetricsTime metricsTime = entry.getValue();
if (metricsTime.getStartTime() < deadline) {
// Metrics collection timeout
MetricsTime removedMetricsTime = metricsTimeoutMonitorMap.remove(entry.getKey());
if (removedMetricsTime == null) {
continue;
}
// Metrics collection timeout
WheelTimerTask timerJob = (WheelTimerTask) metricsTime.getTimeout().task();
Job job = timerJob.getJob();
// timeout metrics
if (metricsCollector != null) {
long duration = System.currentTimeMillis() - removedMetricsTime.getStartTime();
metricsCollector.recordCollectMetrics(job, duration, "timeout");
}
CollectRep.MetricsData metricsData = CollectRep.MetricsData.newBuilder()
.setId(job.getMonitorId())
.setTenantId(job.getTenantId())
.setApp(job.getApp())
.setId(timerJob.getJob().getMonitorId())
.setTenantId(timerJob.getJob().getTenantId())
.setApp(timerJob.getJob().getApp())
.setMetrics(metricsTime.getMetrics().getName())
.setPriority(metricsTime.getMetrics().getPriority())
.setTime(System.currentTimeMillis())
@@ -183,6 +167,7 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
if (metricsData.getPriority() == 0) {
dispatchCollectData(metricsTime.timeout, metricsTime.getMetrics(), metricsData);
}
metricsTimeoutMonitorMap.remove(entry.getKey());
}
}
} catch (Exception e) {
@@ -192,7 +177,7 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
@Override
public void dispatchMetricsTask(Timeout timeout) {
// Divide the collection task of a single application into corresponding collection tasks of the metrics under it.
// Divide the collection task of a single application into corresponding collection tasks of the metrics according to the metrics under it.
// Put each collect task into the thread pool for scheduling
WheelTimerTask timerTask = (WheelTimerTask) timeout.task();
Job job = timerTask.getJob();
@@ -216,27 +201,16 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
public void dispatchCollectData(Timeout timeout, Metrics metrics, CollectRep.MetricsData metricsData) {
WheelTimerTask timerJob = (WheelTimerTask) timeout.task();
Job job = timerJob.getJob();
String monitorKey;
if (metrics.isHasSubTask()) {
monitorKey = job.getId() + "-" + metrics.getName() + "-sub-" + metrics.getSubTaskId();
} else {
monitorKey = job.getId() + "-" + metrics.getName();
}
MetricsTime metricsTime = metricsTimeoutMonitorMap.remove(monitorKey);
// job completed metrics
if (metricsTime != null && metricsCollector != null) {
long duration = System.currentTimeMillis() - metricsTime.getStartTime();
String status = metricsData.getCode() == CollectRep.Code.SUCCESS ? "success" : "fail";
metricsCollector.recordCollectMetrics(job, duration, status);
}
if (metrics.isHasSubTask()) {
metricsTimeoutMonitorMap.remove(job.getId() + "-" + metrics.getName() + "-sub-" + metrics.getSubTaskId());
boolean isLastTask = metrics.consumeSubTaskResponse(metricsData);
if (isLastTask) {
metricsData = metrics.getSubTaskDataRef().get().build();
} else {
return;
}
} else {
metricsTimeoutMonitorMap.remove(job.getId() + "-" + metrics.getName());
}
Set<Metrics> metricsSet = job.getNextCollectMetrics(metrics, false);
if (job.isCyclic()) {
@@ -348,13 +322,7 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
public void dispatchCollectData(Timeout timeout, Metrics metrics, List<CollectRep.MetricsData> metricsDataList) {
WheelTimerTask timerJob = (WheelTimerTask) timeout.task();
Job job = timerJob.getJob();
MetricsTime metricsTime = metricsTimeoutMonitorMap.remove(String.valueOf(job.getId()));
if (metricsTime != null && metricsCollector != null) {
long duration = System.currentTimeMillis() - metricsTime.getStartTime();
// For a list, we consider it a success if at least one item is successful.
boolean isSuccess = metricsDataList.stream().anyMatch(item -> item.getCode() == CollectRep.Code.SUCCESS);
metricsCollector.recordCollectMetrics(job, duration, isSuccess ? "success" : "fail");
}
metricsTimeoutMonitorMap.remove(String.valueOf(job.getId()));
if (job.isCyclic()) {
// The collection and execution of all task of this job are completed.
// The periodic task pushes the task to the time wheel again.
@@ -372,6 +340,7 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
// and the result listener is notified of the combination of all metrics data
timerDispatch.responseSyncJobData(job.getId(), metricsDataList);
}
}
@@ -385,4 +354,4 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
private Metrics metrics;
private Timeout timeout;
}
}
}
@@ -422,9 +422,6 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
*/
private Object[] transformCal(String cal, Map<String, String> fieldAliasMap) {
int splitIndex = cal.indexOf("=");
if (splitIndex < 0) {
return null;
}
String field = cal.substring(0, splitIndex).trim();
String expressionStr = cal.substring(splitIndex + 1).trim().replace("\\#", "#");
JexlExpression expression;
@@ -1,89 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.hertzbeat.collector.metrics;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.common.entity.job.Job;
import org.springframework.stereotype.Service;
import java.time.Duration;
import java.util.Map;
/**
* Service for managing and recording Micrometer metrics.
* This service uses Micrometer which integrates natively with Spring Boot Actuator.
*/
@Service
@Slf4j
public class HertzBeatMetricsCollector {
private final MeterRegistry meterRegistry;
public HertzBeatMetricsCollector(MeterRegistry meterRegistry) {
this.meterRegistry = meterRegistry;
log.info("MetricsService initialized with MeterRegistry: {}", meterRegistry.getClass().getSimpleName());
}
/**
* Records the metrics for a completed collection sub-task.
*
* @param job The parent job containing monitor info.
* @param durationMillis The duration of the collection task in milliseconds.
* @param status The final status of the collection ("success", "fail", "timeout").
*/
public void recordCollectMetrics(Job job, long durationMillis, String status) {
if (job == null) {
return;
}
Map<String, String> metadata = job.getMetadata();
String monitorName = metadata != null ? metadata.get("instancename") : "unknown";
String monitorTarget = metadata != null ? metadata.get("instancehost") : "unknown";
// Record collection count
Counter.builder("hertzbeat.collect.total")
.description("The total number of collection tasks executed")
.tag("status", status)
.tag("monitor_type", job.getApp())
.tag("monitor_id", String.valueOf(job.getMonitorId()))
.tag("monitor_name", monitorName)
.tag("monitor_target", monitorTarget)
.register(meterRegistry)
.increment();
// Record collection duration
Timer.builder("hertzbeat.collect.duration")
.description("The duration of collection task executions")
.tag("status", status)
.tag("monitor_type", job.getApp())
.tag("monitor_id", String.valueOf(job.getMonitorId()))
.tag("monitor_name", monitorName)
.tag("monitor_target", monitorTarget)
.register(meterRegistry)
.record(Duration.ofMillis(durationMillis));
if (log.isDebugEnabled()) {
log.debug("Recorded metrics for monitor [{}] ({}): status={}, duration={}ms",
monitorName, job.getMonitorId(), status, durationMillis);
}
}
}
@@ -30,23 +30,7 @@ spring:
# need to disable spring boot mongodb auto config, or default mongodb connection tried and failed...
autoconfigure:
exclude: org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration, org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration, org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
management:
endpoints:
web:
exposure:
include:
- 'prometheus'
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
---
spring:
config:
@@ -22,11 +22,8 @@ import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.collector.timer.TimerDispatch;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.entity.dto.ServerInfo;
import org.apache.hertzbeat.common.entity.message.ClusterMsg;
import org.apache.hertzbeat.common.support.SpringContextHolder;
import org.apache.hertzbeat.common.util.AesUtil;
import org.apache.hertzbeat.common.util.JsonUtil;
import org.apache.hertzbeat.remoting.netty.NettyRemotingProcessor;
/**
@@ -43,16 +40,6 @@ public class GoOnlineProcessor implements NettyRemotingProcessor {
if (this.timerDispatch == null) {
this.timerDispatch = SpringContextHolder.getBean(TimerDispatch.class);
}
if (message.getMsg().isEmpty()) {
log.warn("The message that server response to collector is empty, please upgrade server");
} else {
ServerInfo serverInfo = JsonUtil.fromJson(message.getMsg().toStringUtf8(), ServerInfo.class);
if (serverInfo == null || serverInfo.getAesSecret() == null) {
log.warn("The message that server response to collector has not secret empty, please check");
} else {
AesUtil.setDefaultSecretKey(serverInfo.getAesSecret());
}
}
timerDispatch.goOnline();
log.info("receive online message and handle success");
return ClusterMsg.Message.newBuilder()
@@ -19,6 +19,7 @@ package org.apache.hertzbeat.common.config;
import org.apache.hertzbeat.common.constants.ConfigConstants;
import org.apache.hertzbeat.common.constants.SignConstants;
import org.apache.hertzbeat.common.util.AesUtil;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ComponentScan;
@@ -33,4 +34,10 @@ import org.springframework.context.annotation.ComponentScan;
+ ConfigConstants.FunctionModuleConstants.COMMON)
@EnableConfigurationProperties(CommonProperties.class)
public class CommonConfig {
public CommonConfig(CommonProperties commonProperties) {
if (commonProperties != null && commonProperties.getSecret() != null) {
AesUtil.setDefaultSecretKey(commonProperties.getSecret());
}
}
}
@@ -87,11 +87,6 @@ public interface CommonConstants {
*/
String LABEL_INSTANCE = "instance";
/**
* label key: defineid
*/
String LABEL_DEFINE_ID = "defineid";
/**
* label key: alert name
*/
@@ -372,9 +367,4 @@ public interface CommonConstants {
* status page incident state resolved
*/
byte MONITOR_TYPE_DISCOVERY_AUTO_CREATE = 2;
/**
* JEXL custom function `json`
*/
String JEXL_CUSTOM_JSON_FUNCTION = "json";
}
@@ -1,62 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.common.constants;
import java.util.Arrays;
/**
* Jexl keywords enum
*/
public enum JexlKeywordsEnum {
SIZE("size"),
EMPTY("empty"),
NEW("new"),
VAR("var"),
RETURN("return"),
IF("if"),
ELSE("else"),
ELSEIF("elseif"),
WHILE("while"),
DO("do"),
FOR("for"),
CONTINUE("continue"),
BREAK("break"),
TRUE("true"),
FALSE("false"),
NULL("null"),
UNDEFINED("undefined");
private final String keyword;
JexlKeywordsEnum(String keyword) {
this.keyword = keyword;
}
public String getKeyword() {
return keyword;
}
public static boolean match(String word) {
if (word == null || word.trim().isEmpty()) {
return false;
}
return Arrays.stream(values()).anyMatch(t -> t.keyword.equals(word));
}
}
@@ -1,40 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.common.entity.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* collector info
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "manager server info")
public class ServerInfo {
/**
* the aes secret key value for aes encode decode
*/
private String aesSecret;
}
@@ -33,73 +33,49 @@ import org.apache.commons.lang3.StringUtils;
public class MqttProtocol implements CommonRequestProtocol, Protocol {
/**
* mqtt client id
*/
private String clientId;
/**
* mqtt username
*/
private String username;
/**
* mqtt password
*/
private String password;
/**
* mqtt host
* ip address or domain name of the peer host
*/
private String host;
/**
* mqtt port
* peer host port
*/
private String port;
/**
* mqtt protocol version
* MQTT,MQTTS
* username
*/
private String protocol;
private String username;
/**
* mqtt connect timeout
* the maximum time to wait for a connection to be established
* password
*/
private String password;
/**
* time out period
*/
private String timeout;
/**
* mqtt keepalive
* between ping requests to the broker to keep the connection alive
* client id
*/
private String keepalive;
private String clientId;
/**
* mqtt topic name
*/
private String topic;
/**
* mqtt publish message
* message used to test whether the mqtt connection can be pushed normally
*/
private String testMessage;
/**
* mqtt tls version
* TLSv1.2, TLSv1.3
* protocol version of mqtt
*/
private String tlsVersion;
private String protocolVersion;
/**
* mqtt tls insecure skip verify server certificate
* monitor topic
*/
private String insecureSkipVerify;
/**
* mqtt tls ca cert
*/
private String caCert;
/**
* mqtt tls enable mutual auth
*/
private String enableMutualAuth;
/**
* mqtt tls client cert
*/
private String clientCert;
/**
* mqtt tls client key
*/
private String clientKey;
private String topic;
/**
* Determine whether authentication is required
@@ -109,4 +85,11 @@ public class MqttProtocol implements CommonRequestProtocol, Protocol {
return StringUtils.isNotBlank(this.username) && StringUtils.isNotBlank(this.password);
}
/**
* Determine whether you need to test whether messages can be pushed normally
* @return turn if it has test message
*/
public boolean testPublish(){
return StringUtils.isNotBlank(this.testMessage);
}
}
@@ -1,29 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.common.support.exception;
/**
* Expression visitor exception
*/
public class ExpressionVisitorException extends RuntimeException {
public ExpressionVisitorException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -37,7 +37,7 @@ public final class AesUtil {
* Default encryption key The AES encryption key is 16 bits by default.
* If the AES encryption key is larger than or smaller than 16 bits, an error message is displayed
*/
public static final String DEFAULT_ENCODE_RULES = "tomSun28HaHaHaHa";
private static final String ENCODE_RULES = "tomSun28HaHaHaHa";
/**
* Default algorithm
@@ -50,17 +50,13 @@ public final class AesUtil {
* Encryption key The AES encryption key is 16 bits.
* If the AES encryption key is larger than 16 bits, an error message is displayed
*/
private static String secretKey = DEFAULT_ENCODE_RULES;
private static String secretKey = ENCODE_RULES;
private AesUtil() {}
public static void setDefaultSecretKey(String secretKeyNow) {
secretKey = secretKeyNow;
}
public static String getDefaultSecretKey() {
return secretKey;
}
public static String aesEncode(String content) {
return aesEncode(content, secretKey);
@@ -113,9 +109,9 @@ public final class AesUtil {
byte[] byteDecode = getBytes(content, decryptKey);
return new String(byteDecode, StandardCharsets.UTF_8);
} catch (BadPaddingException e) {
if (!DEFAULT_ENCODE_RULES.equals(decryptKey)) {
if (!ENCODE_RULES.equals(decryptKey)) {
log.warn("There has default encode secret encode content, try to decode with default secret key");
return aesDecode(content, DEFAULT_ENCODE_RULES);
return aesDecode(content, ENCODE_RULES);
}
log.error("aes decode content error: {}, please config right common secret key", e.getMessage());
return content;
@@ -19,19 +19,15 @@
package org.apache.hertzbeat.common.util;
import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.Maps;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import org.apache.commons.jexl3.JexlBuilder;
import org.apache.commons.jexl3.JexlContext;
import org.apache.commons.jexl3.JexlEngine;
import org.apache.commons.jexl3.JexlExpression;
import org.apache.commons.jexl3.JexlFeatures;
import org.apache.commons.jexl3.MapContext;
import org.apache.hertzbeat.common.constants.CommonConstants;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.function.Function;
/**
* jexl express runner
@@ -45,7 +41,6 @@ public class JexlExpressionRunner {
Map<String, Object> functions = Maps.newLinkedHashMap();
// set the root namespace function
functions.put(null, new JexlCommonFunction());
functions.put(CommonConstants.JEXL_CUSTOM_JSON_FUNCTION, jsonFunction());
ClassLoader classLoader = new ClassLoader() {
@Override
public String getName() {
@@ -83,17 +78,5 @@ public class JexlExpressionRunner {
public static JexlExpression compile(String expression) {
return jexlEngine.createExpression(expression);
}
/**
* custom function `json:apply(xx)`
*
* @return java.util.function.Function
*/
private static Function<String, Map<String, Object>> jsonFunction() {
return json -> {
TypeReference<Map<String, Object>> typeReference = new TypeReference<>() {
};
return JsonUtil.fromJson(json, typeReference);
};
}
}
@@ -17,8 +17,6 @@
package org.apache.hertzbeat.common.util;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
@@ -46,7 +44,6 @@ public final class JsonUtil {
OBJECT_MAPPER
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
.registerModule(new JavaTimeModule());
}
@@ -1,167 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.common.util;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.slf4j.Logger;
import java.text.MessageFormat;
/**
* Log utility class that provides formatted logging methods with location information.
* This class enhances standard SLF4J logging by automatically adding caller location details.
*/
public class LogUtil {
private static final String TEMPLATE_REGEX = "\\{\\d}";
/**
* Print debug level formatted log
* Example: LogUtil.debug(logger, "hello,{0},here has a {1} exception", "other information");
*/
@SuppressWarnings("unused")
public static void debug(Logger logger, String msg, Object... params) {
if (logger.isDebugEnabled()) {
if (ArrayUtils.isEmpty(params)) {
logger.debug(LogUtil.buildLocationInfo() + msg);
} else {
logger.debug(LogUtil.buildLocationInfo() + format(msg, params));
}
}
}
/**
* Print info level formatted log
* Example: LogUtil.info(logger, "hello,{0},{1} exception", "dear", "database operation");
*/
public static void info(Logger logger, String msg, Object... params) {
if (logger.isInfoEnabled()) {
if (ArrayUtils.isEmpty(params)) {
logger.info(LogUtil.buildLocationInfo() + msg);
} else {
logger.info(LogUtil.buildLocationInfo() + format(msg, params));
}
}
}
/**
* Print warn level formatted log
*/
public static void warn(Logger logger, String msg, Object... params) {
if (logger.isWarnEnabled()) {
if (ArrayUtils.isEmpty(params)) {
logger.warn(LogUtil.buildLocationInfo() + msg);
} else {
logger.warn(LogUtil.buildLocationInfo() + format(msg, params));
}
}
}
/**
* Print error level formatted log, use {0},{1},.. for parameter replacement
* Example: LogUtil.error(logger, "hello,{0}, a {1} exception occurred here", "dear", "database operation");
*/
public static void error(Logger logger, String msg, Object... params) {
if (logger.isErrorEnabled()) {
if (ArrayUtils.isEmpty(params)) {
logger.error(LogUtil.buildLocationInfo() + msg);
} else {
logger.error(LogUtil.buildLocationInfo() + format(msg, params));
}
}
}
/**
* Print warn level formatted log with exception, use {0},{1},.. for parameter replacement
* Example: LogUtil.warn(logger, e, "hello,{0}, a {1} exception occurred here", "dear", "database operation");
*/
public static void warn(Logger logger, Throwable e, String msg, Object... params) {
if (logger.isWarnEnabled()) {
if (ArrayUtils.isEmpty(params)) {
logger.warn(LogUtil.buildLocationInfo() + msg, e);
} else {
logger.warn(LogUtil.buildLocationInfo() + format(msg, params), e);
}
}
}
/**
* Print error level formatted log with exception, use {0},{1},.. for parameter replacement
* Example: LogUtil.error(logger, e, "hello,{0}, a {1} exception occurred here", "dear", "database operation");
*/
public static void error(Logger logger, Throwable e, String msg, Object... params) {
if (logger.isErrorEnabled()) {
if (ArrayUtils.isEmpty(params)) {
logger.error(LogUtil.buildLocationInfo() + msg, e);
} else {
logger.error(LogUtil.buildLocationInfo() + format(msg, params), e);
}
}
}
/**
* Get the class name, method and line number that calls LogUtil
*
* @return location information string
*/
private static String buildLocationInfo() {
StringBuilder header = new StringBuilder();
// LOG4J2-1029 new Throwable().getStackTrace is faster than Thread.currentThread().getStackTrace().
final StackTraceElement[] stackTraceElements = new Throwable().getStackTrace();
for (int i = 0; i < stackTraceElements.length - 1; i++) {
StackTraceElement currentStackTrace = stackTraceElements[i];
StackTraceElement nextStackTrace = stackTraceElements[i + 1];
// If current stack trace is in LogUtil
// and next stack trace is not in LogUtil
// then the next node is the caller of LogUtil
if (LogUtil.class.getName().equals(currentStackTrace.getClassName())
&& !LogUtil.class.getName().equals(nextStackTrace.getClassName())) {
String stackTrace = nextStackTrace.toString();
header.append(" ").append(StringUtils.removeStart(stackTrace, nextStackTrace.getClassName() + "."));
break;
}
}
return header.append(":").toString();
}
private static String format(String msg, Object... params) {
if (StringUtils.isEmpty(msg)) {
return StringUtils.EMPTY;
}
if (params != null && params.length > 0) {
msg = MessageFormat.format(msg, params);
}
return msg.replaceAll(TEMPLATE_REGEX, StringUtils.EMPTY);
}
private static String toString(Object object) {
return ToStringBuilder.reflectionToString(object, ToStringStyle.SHORT_PREFIX_STYLE);
}
}
@@ -90,15 +90,4 @@ class AesUtilTest {
assertFalse(isCiphertext(encryptedText, invalidKey));
}
@Test
void testDefaultKeyCompatibility() {
// Test with default key
String originalText = "This is a secret message";
// encode use default secret key
String encryptedText = aesEncode(originalText, AesUtil.DEFAULT_ENCODE_RULES);
// decode use new secret key
String decryptedText = aesDecode(encryptedText, "newkey1234567890");
// old data can decode with default secret key
assertEquals(originalText, decryptedText);
}
}
@@ -21,7 +21,6 @@ package org.apache.hertzbeat.common.util;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.HashMap;
@@ -70,21 +69,4 @@ public class JexlExpressionRunnerTest {
contains("Abc", "a")
"""));
}
@Test
void testJsonFunction() {
Map<String, Object> context = new HashMap<String, Object>();
context.put("$.info", "{\"current\":537132,\"grantTotal\":63129,\"instanceCode\":\"CSDZMC\",\"timeMillis\":1754579874357}");
String expression = "json:apply($.info).current";
JexlExpression expObj = JexlExpressionRunner.compile(expression);
assertEquals(537132, JexlExpressionRunner.evaluate(expObj, context));
context.put("$.info", "{\"grantTotal\":63129,\"instanceCode\":\"CSDZMC\",\"timeMillis\":1754579874357}");
assertNull(JexlExpressionRunner.evaluate(expObj, context));
context.clear();
assertNull(JexlExpressionRunner.evaluate(expObj, context));
}
}
@@ -1,117 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.common.util;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.slf4j.Logger;
import java.lang.reflect.Method;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.contains;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
class LogUtilTest {
@Mock
private Logger mockLogger;
private AutoCloseable mocks;
@BeforeEach
void setUp() {
mocks = MockitoAnnotations.openMocks(this);
}
@AfterEach
void tearDown() throws Exception {
if (mocks != null) {
mocks.close();
}
}
@Test
void testFormat_noParams_returnsOriginalMessage() throws Exception {
String original = "hello world";
Method formatMethod = LogUtil.class.getDeclaredMethod("format", String.class, Object[].class);
formatMethod.setAccessible(true);
String formatted = (String) formatMethod.invoke(null, original, new Object[0]);
assertEquals(original, formatted);
}
@Test
void testFormat_withParams_replacesPlaceholders() throws Exception {
String template = "hello,{0}, world {1}!";
Method formatMethod = LogUtil.class.getDeclaredMethod("format", String.class, Object[].class);
formatMethod.setAccessible(true);
Object[] params = {"Alice", 123};
String result = (String) formatMethod.invoke(null, template, params);
assertTrue(result.contains("hello,Alice"));
assertTrue(result.contains("world 123!"));
}
@Test
void testDebug_noParams_logsRawMessage() {
when(mockLogger.isDebugEnabled()).thenReturn(true);
String msg = "test-debug";
LogUtil.debug(mockLogger, msg);
verify(mockLogger).debug(contains(msg));
}
@Test
void testDebug_withParams_logsFormattedMessage() {
when(mockLogger.isDebugEnabled()).thenReturn(true);
LogUtil.debug(mockLogger, "user={0}", "Bob");
verify(mockLogger).debug(contains("user=Bob"));
}
@Test
void testInfo_levelOff_doesNotLog() {
when(mockLogger.isInfoEnabled()).thenReturn(false);
LogUtil.info(mockLogger, "should-not-log");
verify(mockLogger, never()).info(anyString());
}
@Test
void testWarn_withException_logsMessageAndException() {
when(mockLogger.isWarnEnabled()).thenReturn(true);
RuntimeException ex = new RuntimeException("warn-ex");
LogUtil.warn(mockLogger, ex, "warning {0}", "occurred");
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
verify(mockLogger).warn(captor.capture(), eq(ex));
assertTrue(captor.getValue().contains("warning occurred"));
}
@Test
void testError_withExceptionAndParams_logsError() {
when(mockLogger.isErrorEnabled()).thenReturn(true);
RuntimeException ex = new RuntimeException("err");
LogUtil.error(mockLogger, ex, "fail code {0}", 500);
ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
verify(mockLogger).error(captor.capture(), eq(ex));
assertTrue(captor.getValue().contains("fail code 500"));
}
}
-4
View File
@@ -210,10 +210,6 @@
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-netty</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
</dependencies>
<build>
@@ -20,15 +20,14 @@ package org.apache.hertzbeat.manager.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.usthe.sureness.util.JsonWebTokenUtil;
import jakarta.annotation.Resource;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.Random;
import java.util.TimeZone;
import lombok.SneakyThrows;
import org.apache.commons.lang3.StringUtils;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.entity.manager.GeneralConfig;
import org.apache.hertzbeat.common.util.AesUtil;
import org.apache.hertzbeat.common.util.TimeZoneUtil;
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
import org.apache.hertzbeat.manager.pojo.dto.MuteConfig;
@@ -63,9 +62,6 @@ public class ConfigInitializer implements SmartLifecycle {
@Value("${sureness.jwt.secret:" + DEFAULT_JWT_SECRET + "}")
private String currentJwtSecret;
@Value("${common.secret:" + AesUtil.DEFAULT_ENCODE_RULES + "}")
private String currentAesSecret;
@Resource
private SystemGeneralConfigServiceImpl systemGeneralConfigService;
@@ -114,41 +110,30 @@ public class ConfigInitializer implements SmartLifecycle {
// for template config, flush the template config in db to memory
TemplateConfig templateConfig = templateConfigService.getConfig();
appService.updateCustomTemplateConfig(templateConfig);
// for system jwt secrets and aes secret
boolean needUpdate = false;
SystemSecret.SystemSecretBuilder systemSecretBuilder = SystemSecret.builder();
SystemSecret systemSecret = systemSecretService.getConfig();
if (systemSecret != null) {
systemSecretBuilder.jwtSecret(systemSecret.getJwtSecret());
systemSecretBuilder.aesSecret(systemSecret.getAesSecret());
}
// for system secrets
if (DEFAULT_JWT_SECRET.equals(currentJwtSecret)) {
// use the random jwt secret
SystemSecret systemSecret = systemSecretService.getConfig();
if (systemSecret == null || StringUtils.isBlank(systemSecret.getJwtSecret())) {
currentJwtSecret = randomizeSecret(DEFAULT_JWT_SECRET);
systemSecretBuilder.jwtSecret(currentJwtSecret);
needUpdate = true;
char[] chars = DEFAULT_JWT_SECRET.toCharArray();
Random rand = new Random();
for (int i = 0; i < chars.length; i++) {
int index = rand.nextInt(chars.length);
char temp = chars[i];
chars[i] = chars[index];
chars[index] = temp;
}
currentJwtSecret = new String(chars);
systemSecret = SystemSecret.builder().jwtSecret(currentJwtSecret).build();
systemSecretService.saveConfig(systemSecret);
} else {
currentJwtSecret = systemSecret.getJwtSecret();
}
}
// else use the user custom jwt secret, set the jwt secret token in util
// else use the user custom jwt secret
// set the jwt secret token in util
JsonWebTokenUtil.setDefaultSecretKey(currentJwtSecret);
// Aes secret config
if (AesUtil.DEFAULT_ENCODE_RULES.equals(currentAesSecret)) {
// use the random aes secret
if (systemSecret == null || StringUtils.isBlank(systemSecret.getAesSecret())) {
currentAesSecret = randomizeSecret(AesUtil.DEFAULT_ENCODE_RULES);
systemSecretBuilder.aesSecret(currentAesSecret);
needUpdate = true;
} else {
currentAesSecret = systemSecret.getAesSecret();
}
}
AesUtil.setDefaultSecretKey(currentAesSecret);
if (needUpdate) {
systemSecretService.saveConfig(systemSecretBuilder.build());
}
// init web-app mute config
MuteConfig muteConfig = muteGeneralConfigService.getConfig();
if (muteConfig == null) {
@@ -177,18 +162,4 @@ public class ConfigInitializer implements SmartLifecycle {
public int getPhase() {
return Ordered.HIGHEST_PRECEDENCE;
}
private String randomizeSecret(String secret) {
SecureRandom random = new SecureRandom();
StringBuilder sb = new StringBuilder(secret.length());
for (int i = 0; i < secret.length(); i++) {
char ch;
do {
int codePoint = random.nextInt('z' - '0' + 1) + '0';
ch = (char) codePoint;
} while (!Character.isLetterOrDigit(ch));
sb.append(ch);
}
return sb.toString();
}
}
@@ -43,12 +43,12 @@ public class SwaggerConfig {
.info(new Info()
.title("HertzBeat")
.description("An Open-Source Real-time Monitoring Tool.")
.termsOfService("https://hertzbeat.apache.org/")
.termsOfService("https://hertzbeat.com/")
.contact(new Contact().name("tom").url("https://github.com/tomsun28").email("tomsun28@outlook.com"))
.version("v1.0")
.license(new License().name("Apache 2.0").url("https://www.apache.org/licenses/LICENSE-2.0")))
.externalDocs(new ExternalDocumentation()
.description("HertzBeat Docs").url("https://hertzbeat.apache.org/docs/"))
.description("HertzBeat Docs").url("https://hertzbeat.com/docs/"))
.addSecurityItem(new SecurityRequirement().addList(SECURITY_SCHEME_NAME))
.components(new Components().addSecuritySchemes(SECURITY_SCHEME_NAME,
new SecurityScheme()
@@ -17,6 +17,7 @@
package org.apache.hertzbeat.manager.controller;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -24,7 +25,6 @@ import jakarta.annotation.Resource;
import jakarta.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.common.entity.dto.Message;
import org.apache.hertzbeat.common.util.CommonUtil;
import org.apache.hertzbeat.common.util.ResponseUtil;
import org.apache.hertzbeat.manager.pojo.dto.TemplateConfig;
import org.apache.hertzbeat.manager.service.ConfigService;
@@ -37,19 +37,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.TextStyle;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
/**
* Alert sender Configuration API
*/
@@ -58,9 +45,6 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
@Tag(name = "Alert sender Configuration API")
@Slf4j
public class GeneralConfigController {
private static final Set<String> ZONE_IDS = ZoneId.getAvailableZoneIds();
@Resource
private ConfigService configService;
@@ -90,28 +74,4 @@ public class GeneralConfigController {
@RequestBody TemplateConfig.AppTemplate template) {
return ResponseUtil.handle(() -> configService.updateTemplateAppConfig(app, template));
}
@GetMapping(path = "/timezones")
@Operation(summary = "Get all available timezones and their current UTC offset", description = "Get all available timezones and their current UTC offset")
public ResponseEntity<Message<List<Map<String, String>>>> getTimezones() {
List<Map<String, String>> timezones = ZONE_IDS.stream()
.map(id -> {
try {
ZoneId zoneId = ZoneId.of(id);
ZonedDateTime now = ZonedDateTime.now(zoneId);
int totalSeconds = now.getOffset().getTotalSeconds();
String offset = String.format("UTC%+03d:%02d", totalSeconds / 3600, Math.abs((totalSeconds / 60) % 60));
String displayName = zoneId.getDisplayName(TextStyle.FULL, Locale.getDefault());
return Map.of("zoneId", id, "offset", offset, "displayName", displayName);
} catch (Exception e) {
String errorMsg = CommonUtil.getMessageFromThrowable(e);
log.warn("Query Timezone failed. {} ", errorMsg);
return null;
}
})
.filter(t -> Objects.nonNull(t) && Objects.nonNull(t.get("zoneId")))
.sorted(Comparator.comparing(m -> m.get("zoneId")))
.collect(Collectors.toList());
return ResponseEntity.ok(Message.success(timezones));
}
}
@@ -121,14 +121,6 @@ public class MonitorsController {
monitorService.export(ids, type, res);
}
@GetMapping("/export/all")
@Operation(summary = "export all monitor config", description = "export all monitor config")
public void exportAll(
@Parameter(description = "Export Type:JSON,EXCEL,YAML") @RequestParam(defaultValue = "JSON") String type,
HttpServletResponse res) throws Exception {
monitorService.exportAll(type, res);
}
@PostMapping("/import")
@Operation(summary = "import monitor config", description = "import monitor config")
public ResponseEntity<Message<Void>> export(MultipartFile file) throws Exception {
@@ -35,9 +35,4 @@ public class SystemSecret {
* secret key for jwt
*/
private String jwtSecret;
/**
* secret key for aes
*/
private String aesSecret;
}
@@ -36,7 +36,6 @@ import org.apache.hertzbeat.collector.dispatch.entrance.internal.CollectJobServi
import org.apache.hertzbeat.collector.dispatch.entrance.internal.CollectResponseEventListener;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.entity.dto.CollectorInfo;
import org.apache.hertzbeat.common.entity.dto.ServerInfo;
import org.apache.hertzbeat.common.entity.job.Configmap;
import org.apache.hertzbeat.common.entity.job.Job;
import org.apache.hertzbeat.common.entity.manager.Collector;
@@ -46,7 +45,6 @@ import org.apache.hertzbeat.common.entity.manager.Param;
import org.apache.hertzbeat.common.entity.manager.ParamDefine;
import org.apache.hertzbeat.common.entity.message.ClusterMsg;
import org.apache.hertzbeat.common.entity.message.CollectRep;
import org.apache.hertzbeat.common.util.AesUtil;
import org.apache.hertzbeat.common.util.JsonUtil;
import org.apache.hertzbeat.common.util.SnowFlakeIdGenerator;
import org.apache.hertzbeat.manager.dao.CollectorDao;
@@ -149,9 +147,6 @@ public class CollectorJobScheduler implements CollectorScheduling, CollectJobSch
appDefine.setDefaultInterval(monitor.getIntervals());
appDefine.setCyclic(true);
appDefine.setTimestamp(System.currentTimeMillis());
Map<String, String> metadata = Map.of(CommonConstants.LABEL_INSTANCE_NAME, monitor.getName(),
CommonConstants.LABEL_INSTANCE_HOST, monitor.getHost());
appDefine.setMetadata(metadata);
List<Param> params = paramDao.findParamsByMonitorId(monitor.getId());
List<Configmap> configmaps = params.stream()
.map(param -> Configmap.builder()
@@ -263,11 +258,9 @@ public class CollectorJobScheduler implements CollectorScheduling, CollectJobSch
if (Objects.isNull(collector)) {
return false;
}
ServerInfo serverInfo = ServerInfo.builder().aesSecret(AesUtil.getDefaultSecretKey()).build();
ClusterMsg.Message message = ClusterMsg.Message.newBuilder()
.setType(ClusterMsg.MessageType.GO_ONLINE)
.setDirection(ClusterMsg.Direction.REQUEST)
.setMsg(ByteString.copyFromUtf8(JsonUtil.toJson(serverInfo)))
.setIdentity(identity)
.build();
ClusterMsg.Message response = this.manageServer.sendMsgSync(identity, message);
@@ -17,15 +17,12 @@
package org.apache.hertzbeat.manager.scheduler.netty.process;
import com.google.protobuf.ByteString;
import io.netty.channel.ChannelHandlerContext;
import java.net.InetSocketAddress;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.hertzbeat.common.entity.dto.CollectorInfo;
import org.apache.hertzbeat.common.entity.dto.ServerInfo;
import org.apache.hertzbeat.common.entity.message.ClusterMsg;
import org.apache.hertzbeat.common.util.AesUtil;
import org.apache.hertzbeat.common.util.JsonUtil;
import org.apache.hertzbeat.manager.scheduler.netty.ManageServer;
import org.apache.hertzbeat.remoting.netty.NettyRemotingProcessor;
@@ -55,12 +52,6 @@ public class CollectorOnlineProcessor implements NettyRemotingProcessor {
}
this.manageServer.addChannel(collector, ctx.channel());
this.manageServer.getCollectorAndJobScheduler().collectorGoOnline(collector, collectorInfo);
ServerInfo serverInfo = ServerInfo.builder().aesSecret(AesUtil.getDefaultSecretKey()).build();
return ClusterMsg.Message.newBuilder()
.setIdentity(message.getIdentity())
.setDirection(ClusterMsg.Direction.RESPONSE)
.setMsg(ByteString.copyFromUtf8(JsonUtil.toJson(serverInfo)))
.setType(ClusterMsg.MessageType.GO_ONLINE)
.build();
return null;
}
}
@@ -173,15 +173,6 @@ public interface MonitorService {
*/
void export(List<Long> ids, String type, HttpServletResponse res) throws Exception;
/**
* Export All Monitoring Configuration
*
* @param type file type
* @param res response
* @throws Exception This exception will be thrown if the export fails
*/
void exportAll(String type, HttpServletResponse res) throws Exception;
/**
* Import Monitoring Configuration
*
@@ -41,7 +41,6 @@ import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
import org.apache.hertzbeat.collector.util.CollectUtil;
import org.apache.hertzbeat.common.constants.JexlKeywordsEnum;
import org.apache.hertzbeat.common.entity.job.Configmap;
import org.apache.hertzbeat.common.entity.job.Job;
import org.apache.hertzbeat.common.entity.job.Metrics;
@@ -459,10 +458,6 @@ public class AppServiceImpl implements AppService, InitializingBean {
throw new IllegalArgumentException(app.getApp() + " " + metrics.getName() + " "
+ field.getField() + " can not duplicated.");
}
if (JexlKeywordsEnum.match(field.getField())) {
throw new IllegalArgumentException(app.getApp() + " " + metrics.getName() + " "
+ field.getField() + " prohibited keywords.");
}
fieldsSet.add(field.getField());
}
}
@@ -523,15 +518,16 @@ public class AppServiceImpl implements AppService, InitializingBean {
} else {
if (objectStoreConfig.getType() == ObjectStoreDTO.Type.OBS) {
appDefineStore = new ObjectStoreAppDefineStoreImpl();
} else if (objectStoreConfig.getType() == ObjectStoreDTO.Type.DATABASE) {
} else if (objectStoreConfig.getType() == ObjectStoreDTO.Type.DATABASE){
appDefineStore = new DatabaseAppDefineStoreImpl();
} else {
appDefineStore = new LocalFileAppDefineStoreImpl();
}
}
jarAppDefineStore.loadAppDefines();
// merge define yml files inside jars
appDefineStore.loadAppDefines();
var success = appDefineStore.loadAppDefines();
if (!success) {
new JarAppDefineStoreImpl().loadAppDefines();
}
}
private interface AppDefineStore {
@@ -713,7 +709,7 @@ public class AppServiceImpl implements AppService, InitializingBean {
}
}
});
return true;
return false;
}
@Override
@@ -773,7 +769,8 @@ public class AppServiceImpl implements AppService, InitializingBean {
appDefines.put(define.getApp().toLowerCase(), app);
}
}
return true;
// merge define yml files inside jars
return false;
}
@Override
@@ -67,7 +67,7 @@ public class LabelServiceImpl implements LabelService {
public void modifyLabel(Label label) {
Optional<Label> optional = labelDao.findById(label.getId());
if (optional.isPresent()) {
Optional<Label> existOptional = labelDao.findLabelByNameAndTagValue(label.getName(), label.getTagValue());
if (existOptional.isPresent() && !existOptional.get().getId().equals(label.getId())) {
throw new IllegalArgumentException("The label with same key and value already exists.");
@@ -116,38 +116,33 @@ public class LabelServiceImpl implements LabelService {
@Override
public void deleteLabels(HashSet<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
if (CollectionUtils.isEmpty(ids)){
return;
}
labelDao.deleteLabelsByIdIn(ids);
}
@Override
public List<Label> determineNewLabels(Set<Map.Entry<String, String>> originLabels) {
public List<Label> determineNewLabels(Set<Map.Entry<String, String>> originLabels){
if (originLabels == null || originLabels.isEmpty()) return List.of();
// Get all labels from the database
Set<Label> allLabels = labelDao.findAll().stream()
.map(label -> Label.builder()
.name(label.getName())
.tagValue(label.getTagValue())
.build())
Set<Map.Entry<String, String>> allLabels = labelDao.findAll().stream()
.map(label -> Map.entry(label.getName(), label.getTagValue()))
.collect(Collectors.toSet());
// If the bound label (key:value) does not exist, then add it
return originLabels.stream()
.map(entry -> Label.builder()
.name(entry.getKey())
.tagValue(entry.getValue())
.build())
Set<Map.Entry<String, String>> addLabelsKv = originLabels.stream()
.filter(label -> !allLabels.contains(label))
.map(label -> Label.builder()
.id(null)
.name(label.getName())
.tagValue(label.getTagValue())
.type((byte) 0)
.build())
.toList();
.collect(Collectors.toCollection(HashSet::new));
return addLabelsKv.stream().map(kv -> {
Label label = new Label();
label.setId(null);
label.setName(kv.getKey());
label.setTagValue(kv.getValue());
label.setType((byte) 0);
return label;
}).toList();
}
}
@@ -27,7 +27,6 @@ import org.apache.hertzbeat.alert.dao.AlertDefineBindDao;
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
import org.apache.hertzbeat.common.constants.CommonConstants;
import org.apache.hertzbeat.common.constants.ExportFileConstants;
import org.apache.hertzbeat.common.constants.JexlKeywordsEnum;
import org.apache.hertzbeat.common.constants.NetworkConstants;
import org.apache.hertzbeat.common.constants.SignConstants;
import org.apache.hertzbeat.common.entity.grafana.GrafanaDashboard;
@@ -236,18 +235,6 @@ public class MonitorServiceImpl implements MonitorService {
imExportService.exportConfig(res.getOutputStream(), ids);
}
@Override
public void exportAll(String type, HttpServletResponse res) throws Exception {
// Get all monitor IDs from the database
List<Long> allMonitorIds = monitorDao.findAll()
.stream()
.map(Monitor::getId)
.collect(Collectors.toList());
// Use the existing export method to export all monitors
export(allMonitorIds, type, res);
}
@Override
public void importConfig(MultipartFile file) throws Exception {
var fileName = FileUtil.getFileName(file);
@@ -437,27 +424,6 @@ public class MonitorServiceImpl implements MonitorService {
}
}
}
checkJobFields(monitorDto.getMonitor().getApp());
}
private void checkJobFields(String app) {
if (null == app || app.trim().isEmpty()) {
return;
}
Job job = appService.getAppDefine(app);
if (null != job && !CollectionUtils.isEmpty(job.getMetrics())) {
for (Metrics metrics : job.getMetrics()) {
if (null == metrics.getFields() || metrics.getFields().isEmpty()) {
continue;
}
for (Metrics.Field field : metrics.getFields()) {
if (JexlKeywordsEnum.match(field.getField())) {
throw new IllegalArgumentException(job.getApp() + " " + metrics.getName() + " "
+ field.getField() + " prohibited keywords, please modify the template information.");
}
}
}
}
}
@Override
@@ -22,7 +22,6 @@ spring:
url: jdbc:h2:./data/test;MODE=MYSQL
hikari:
max-lifetime: 120000
jpa:
show-sql: false
database-platform: org.eclipse.persistence.platform.database.MySQLPlatform
@@ -31,10 +30,8 @@ spring:
eclipselink:
logging:
level: SEVERE
flyway:
enabled: false
mail:
host: smtp.exmail.qq.com
username: example@tancloud.cn
@@ -58,57 +55,26 @@ warehouse:
jpa:
enabled: true
expire-time: 1h
max-history-record-num: 6000
victoria-metrics:
enabled: false
url: http://localhost:8428
username: root
password: root
insert:
buffer-size: 100
buffer-size: 1000
flush-interval: 3
compression:
enabled: false
cluster:
enabled: false
select:
url: http://localhost:8481
username: root
password: root
insert:
url: http://localhost:8480
username: root
password: root
buffer-size: 1000
flush-interval: 3
td-engine:
enabled: false
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://127.0.0.1:6041/hertzbeat
username: root
password: taosdata
greptime:
enabled: false
grpc-endpoints: localhost:4001
http-endpoint: http://localhost:4000
database: public
username: greptime
password: greptime
iot-db:
enabled: false
host: 127.0.0.1
rpc-port: 6667
username: root
password: root
query-timeout-in-ms: -1
expire-time: '7776000000'
influxdb:
enabled: false
server-url: http://127.0.0.1:8086
username: root
password: root
expire-time: '30d'
replication: 1
# store real-time metrics data, enable only one below
real-time:
memory:
@@ -126,58 +92,6 @@ warehouse:
# redis db index, default: DB0
db: 0
alerter:
# custom console url
console-url: https://console.tancloud.io
# we work
we-work-webhook-url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=
# ding ding talk
ding-talk-webhook-url: https://oapi.dingtalk.com/robot/send?access_token=
# fei shu fly book
fly-book-webhook-url: https://open.feishu.cn/open-apis/bot/v2/hook/
# telegram
telegram-webhook-url: https://api.telegram.org/bot%s/sendMessage
# discord
discord-webhook-url: https://discord.com/api/v9/channels/%s/messages
# serverChan
server-chan-webhook-url: https://sctapi.ftqq.com/%s.send
# gotify
gotify-webhook-url: http://127.0.0.1/message?token=%s
# alert inhibit ttl unit ms, default 14400000(4 hours)
inhibit:
ttl: 14400000
sms:
enable: false
type: tencent
tencent:
secret-id:
secret-key:
app-id:
sign-name:
template-id:
alibaba:
access-key-id:
access-key-secret:
sign-name:
template-code:
unisms:
# auth-mode: simple or hmac
auth-mode: simple
access-key-id: YOUR_ACCESS_KEY_ID
# hmac mode need to fill in access-key-secret
access-key-secret: YOUR_ACCESS_KEY_SECRET
signature: YOUR_SMS_SIGNATURE
template-id: YOUR_TEMPLATE_ID
smslocal:
api-key: YOUR_API_KEY_HERE
aws:
access-key-id: YOUR_ACCESS_KEY_ID
access-key-secret: YOUR_ACCESS_KEY_SECRET
region: AWS_REGION_FOR_END_USER_MESSAGING
twilio:
account-sid: YOUR_ACCOUNT_SID
auth-token: YOUR_AUTH_TOKEN
twilio-phone-number: YOUR_TWILIO_PHONE_NUMBER
scheduler:
server:
enabled: true
@@ -186,13 +100,13 @@ scheduler:
grafana:
enabled: false
url: http://127.0.0.1:3000
expose-url: http://127.0.0.1:3000
username: admin
password: admin
# AI config
# See the documentation for details : https://hertzbeat.apache.org/zh-cn/docs/help/aiConfig
ai:
# AI Type:zhiPu、alibabaAi、kimiAi、sparkDesk、ollama、openRouter
# AI Type:zhiPu、alibabaAi、kimiAi、sparkDesk
type:
# Model nameglm-4、qwen-turboo、moonshot-v1-8k、generalv3.5
model:
@@ -200,5 +114,3 @@ ai:
api-key:
#At present, only IFLYTEK large model needs to be filled in
api-secret:
# The URL of the ollama AI service
api-url:
@@ -48,19 +48,7 @@ management:
include:
- 'metrics'
- 'health'
- 'prometheus'
enabled-by-default: on
endpoint:
prometheus:
access: read_only
metrics:
tags:
application: ${spring.application.name}
environment: ${spring.profiles.active}
prometheus:
metrics:
export:
enabled: true
sureness:
container: jakarta_servlet
@@ -150,10 +138,8 @@ warehouse:
username: root
password: root
insert:
buffer-size: 100
buffer-size: 1000
flush-interval: 3
compression:
enabled: false
cluster:
enabled: false
select:
@@ -29,8 +29,8 @@ help:
zh-TW: HertzBeat 對 GreptimeDB 時序資料庫進行監控。<br><span class='help_module_span'><a class='help_module_content' https://docs.greptime.com/user-guide/operations/monitoring'>點擊查看開啓步驟</a>。</span>
ja-JP: HertzBeat は GreptimeDB 時系列データベースを監視します。<br><span class='help_module_span'><a class='help_module_content' https://docs.greptime.com/user-guide/operations/monitoring'>クリックしてガイドを見ます</a>。</span>
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/greptimedb
en-US: https://hertzbeat.apache.org/docs/help/greptimedb
zh-CN: https://hertzbeat.com/zh-cn/docs/help/greptimedb
en-US: https://hertzbeat.com/docs/help/greptimedb
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
@@ -29,8 +29,8 @@ help:
zh-TW: HertzBeat 對 InfluxDB 時序資料庫進行監控。<br><span class='help_module_span'><a class='help_module_content' href='https://docs.influxdata.com/platform/monitoring/influxdata-platform/tools/measurements-internal'>點擊查看開啓步驟</a>。</span>
ja-JP: HertzBeat は InfluxDB 時系列データベースを監視します。<br><span class='help_module_span'><a class='help_module_content' href='https://docs.influxdata.com/platform/monitoring/influxdata-platform/tools/measurements-internal'>クリックしてガイドを見ます</a>。</span>
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/influxdb/
en-US: https://hertzbeat.apache.org/docs/help/influxdb/
zh-CN: https://hertzbeat.com/zh-cn/docs/help/influxdb/
en-US: https://hertzbeat.com/docs/help/influxdb/
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
@@ -21,13 +21,11 @@ app: jvm
name:
zh-CN: JVM虚拟机
en-US: JVM
ja-JP: Java仮想マシン
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a href="https://hertzbeat.apache.org/docs/advanced/extend-jmx">JMX 协议</a> 对 JVM 虚拟机的通用性能指标(基础信息,内存池,类加载,线程信息等)进行采集监控。<br>⚠️注意:您需要在 JVM 应用中开启 JMX 服务,应用启动时添加 JMX 参数, 可自定义暴露端口,对外IP。<a href="https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote">点击查看开启步骤</a>。
en-US: HertzBeat uses <a href='https://hertzbeat.apache.org/docs/advanced/extend-jmx'>JMX Protocol</a> to monitoring and collect general performance metric of jvm application. <br>⚠️Note:You need to enable JMX services in JVM application, and add the JXM parameters when the application start. You can also customize external IP address and exposed port.<a href='https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote'>Click here to view the activation steps.</a>"
zh-TW: HertzBeat 使用 <a href="https://hertzbeat.apache.org/docs/advanced/extend-jmx">JMX 協議</a> 對 JVM 虛擬機的通用性能指標(基礎信息,內存池,類加載,線程信息等)進行采集監控。<br>⚠️注意:您需要在 JVM 應用中開啓 JMX 服務,應用啓動時添加 JMX 參數, 可自定義暴露端口,對外IP。<a href="https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote">點擊查看開啓步驟</a>。
ja-JP: HertzBeat は <a href='https://hertzbeat.apache.org/docs/advanced/extend-jmx'> JMXプロトコルを介して</a> Java仮想マシンの一般的なパフォーマンスのメトリクスを監視します。<br>⚠️注意:Java仮想マシンの応用 で JMX サービスを有効にする必要があります。<a href='https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html#remote'>クリックしてガイドを見ます</a>。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/jvm/
en-US: https://hertzbeat.apache.org/docs/help/jvm/
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: JMX URL
en-US: JMX URL
ja-JP: JMX URL
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -80,7 +75,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -95,7 +89,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -112,7 +105,6 @@ metrics:
i18n:
zh-CN: 虚拟机基础信息
en-US: JVM Basic
ja-JP: Java仮想マシン基礎情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -121,26 +113,22 @@ metrics:
i18n:
zh-CN: 名称
en-US: Vm Name
ja-JP: 仮想マシン名
- field: VmVendor
type: 1
i18n:
zh-CN: 厂商
en-US: Vm Vendor
ja-JP: 仮想マシンベンダー
- field: VmVersion
type: 1
i18n:
zh-CN: 版本
en-US: Vm Version
ja-JP: 仮想マシンバージョン
- field: Uptime
type: 0
unit: ms
i18n:
zh-CN: 运行时长
en-US: Up time
ja-JP: アップタイム
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: jmx
# the config content when protocol is jmx
@@ -160,7 +148,6 @@ metrics:
i18n:
zh-CN: 内存池
en-US: Memory Pool
ja-JP: メモリプール
fields:
- field: name
type: 1
@@ -168,35 +155,30 @@ metrics:
i18n:
zh-CN: 指标名称
en-US: Name
ja-JP: メトリクス名
- field: committed
type: 0
unit: MB
i18n:
zh-CN: 已分配内存
en-US: Committed
ja-JP: コミットされたメモリ
- field: init
type: 0
unit: MB
i18n:
zh-CN: 初始化内存
en-US: Init
ja-JP: イニシャルメモリ
- field: max
type: 0
unit: MB
i18n:
zh-CN: 最大内存
en-US: Max
ja-JP: 最大メモリ
- field: used
type: 0
unit: MB
i18n:
zh-CN: 已使用内存
en-US: Used
ja-JP: 使用したメモリ
units:
- committed=B->MB
- init=B->MB
@@ -233,32 +215,27 @@ metrics:
i18n:
zh-CN: 本地代码缓冲区
en-US: Code Cache
ja-JP: コードキャッシュ
fields:
- field: committed
type: 0
i18n:
zh-CN: 已分配内存
en-US: Committed
ja-JP: コミットされたメモリ
- field: init
type: 0
i18n:
zh-CN: 初始化内存
en-US: Init
ja-JP: イニシャルメモリ
- field: max
type: 0
i18n:
zh-CN: 最大内存
en-US: Max
ja-JP: 最大メモリ
- field: used
type: 0
i18n:
zh-CN: 已使用内存
en-US: Used
ja-JP: 使用したメモリ
aliasFields:
- Usage->committed
- Usage->init
@@ -285,7 +262,6 @@ metrics:
i18n:
zh-CN: 类加载信息
en-US: Class Loading
ja-JP: クラスローディング情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -294,19 +270,16 @@ metrics:
i18n:
zh-CN: 当前已加载类数量
en-US: Loaded Class Count
ja-JP: ロードされたクラス数
- field: TotalLoadedClassCount
type: 0
i18n:
zh-CN: 已加载类总数量
en-US: Total Loaded Class Count
ja-JP: ロードされたクラス総数
- field: UnloadedClassCount
type: 0
i18n:
zh-CN: 未加载类总数量
en-US: Unloaded Class Count
ja-JP: アンロードされたクラス総数
protocol: jmx
jmx:
host: ^_^host^_^
@@ -321,7 +294,6 @@ metrics:
i18n:
zh-CN: 线程信息
en-US: Thread
ja-JP: スレッド情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -330,39 +302,33 @@ metrics:
i18n:
zh-CN: 已启动线程总数
en-US: Total Started Thread Count
ja-JP: スレッド総数
- field: ThreadCount
type: 0
i18n:
zh-CN: 活跃线程数
en-US: Thread Count
ja-JP: 活躍スレッド数
- field: PeakThreadCount
type: 0
i18n:
zh-CN: 最大峰值线程数
en-US: Peak Thread Count
ja-JP: 最大スレッド数
- field: DaemonThreadCount
type: 0
i18n:
zh-CN: 活跃守护线程数
en-US: Daemon Thread Count
ja-JP: デーモンスレッド数
- field: CurrentThreadUserTime
type: 0
unit: s
i18n:
zh-CN: 线程占用的CPU时间(用户态)
en-US: Current Thread User Time
ja-JP: 現在のスレッドユーザー時間
- field: CurrentThreadCpuTime
type: 0
unit: s
i18n:
zh-CN: 线程占用的CPU时间
en-US: Current Thread CPU Time
ja-JP: 現在のスレッドシステム時間
units:
- CurrentThreadUserTime=NS->S
- CurrentThreadCpuTime=NS->S
@@ -21,13 +21,11 @@ app: kafka
name:
zh-CN: Kafka消息系统
en-US: Kafka Message
ja-JP: Kafkaメッセージングシステム
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a href="https://hertzbeat.apache.org/docs/advanced/extend-jmx">JMX 协议</a> 对 Kafka 的通用性能指标 (server info、code cache、active controller count、broker partition count、broker leader count、broker handler avg percent etc) 进行采集监控。<br><span class='help_module_span'>注意⚠️:您需要在 Kafka 开启 JMX 服务,应用启动时添加 JMX 参数,暴露端口,对外IP。下方配置的端口即为JMX暴露的端口,而非Kafka的server端口。<a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/kafka'>点击查看开启步骤</a>。</span>
en-US: HertzBeat uses <a href='https://hertzbeat.apache.org/docs/advanced/extend-jmx'>JMX Protocol</a> to monitoring kafka general performance metrics (server info、code cache、active controller count、broker partition count、broker leader count、broker handler avg percent etc). <br><span class='help_module_span'>Note⚠️:You need to enable JMX service in Kafka, export JMX port and config params.The port configured below is the JMX exposed port, not the Kafka server port. <a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/kafka'>Click here to view the specific steps.</a></span>
zh-TW: HertzBeat 使用 <a href="https://hertzbeat.apache.org/docs/advanced/extend-jmx">JMX 協議</a> 對 Kafka 的通用性能指標 (server info、code cache、active controller count、broker partition count、broker leader count、broker handler avg percent etc) 進行采集監控。<br><span class='help_module_span'>注意⚠️:您需要在 Kafka 開啓 JMX 服務,應用啓動時添加 JMX 參數,暴露端口,對外IP。下方配置的端口即為 JMX 暴露的端口,而非 Kafka 的伺服器端口。<a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/kafka'>點擊查看開啓步驟</a>。</span>
ja-JP: HertzBeat は <a href='https://hertzbeat.apache.org/docs/advanced/extend-jmx'> JMXプロトコルを介して</a> Kafkaの一般的なパフォーマンスのメトリクスを監視します。<br><span class='help_module_span'>⚠️注意:Kafka で JMX サービスを有効にする必要があります。<a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/kafka'>クリックしてガイドを見ます</a>。</span>
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/kafka
en-US: https://hertzbeat.apache.org/docs/help/kafka
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -48,7 +45,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
type: number
# when type is number, range is required
range: '[0,65535]'
@@ -58,7 +54,6 @@ params:
name:
zh-CN: JMX URL
en-US: JMX URL
ja-JP: JMX URL
type: text
required: false
hide: true
@@ -67,7 +62,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -76,7 +70,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
hide: true
@@ -87,7 +80,6 @@ metrics:
i18n:
zh-CN: 服务器信息
en-US: Server Info
ja-JP: サーバー情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -99,19 +91,16 @@ metrics:
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: StartTimeMs
type: 1
i18n:
zh-CN: 启动时间
en-US: Start Time
ja-JP: 起動時間
- field: CommitId
type: 1
i18n:
zh-CN: CommitId
en-US: CommitId
ja-JP: CommitId
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: jmx
# the config content when protocol is jmx
@@ -129,7 +118,6 @@ metrics:
i18n:
zh-CN: 虚拟机基础信息
en-US: JVM Basic
ja-JP: Java仮想マシン基礎情報
priority: 1
fields:
- field: VmName
@@ -137,26 +125,22 @@ metrics:
i18n:
zh-CN: 名称
en-US: Vm Name
ja-JP: 仮想マシン名
- field: VmVendor
type: 1
i18n:
zh-CN: 厂商
en-US: Vm Vendor
ja-JP: 仮想マシンベンダー
- field: VmVersion
type: 1
i18n:
zh-CN: 版本
en-US: Vm Version
ja-JP: 仮想マシンバージョン
- field: Uptime
type: 0
unit: ms
i18n:
zh-CN: 运行时长
en-US: Up time
ja-JP: アップタイム
protocol: jmx
jmx:
host: ^_^host^_^
@@ -171,7 +155,6 @@ metrics:
i18n:
zh-CN: 内存池
en-US: Memory Pool
ja-JP: メモリプール
priority: 2
fields:
- field: name
@@ -180,31 +163,26 @@ metrics:
i18n:
zh-CN: 指标名称
en-US: Name
ja-JP: メトリクス名
- field: committed
type: 0
i18n:
zh-CN: 已分配内存
en-US: Committed
ja-JP: コミットされたメモリ
- field: init
type: 0
i18n:
zh-CN: 初始化内存
en-US: Init
ja-JP: イニシャルメモリ
- field: max
type: 0
i18n:
zh-CN: 最大内存
en-US: Max
ja-JP: 最大メモリ
- field: used
type: 0
i18n:
zh-CN: 已使用内存
en-US: Used
ja-JP: 使用したメモリ
aliasFields:
- Name
- Usage->committed
@@ -230,7 +208,6 @@ metrics:
i18n:
zh-CN: Kafka控制器指标
en-US: Kafka Controller Metrics
ja-JP: Kafkaコントローラーのメトリクス
priority: 3
fields:
- field: ActiveBrokerCount
@@ -238,79 +215,66 @@ metrics:
i18n:
zh-CN: 活跃代理数量
en-US: Active Broker Count
ja-JP: 活動中のブローカー数
- field: ActiveControllerCount
type: 0
i18n:
zh-CN: 活跃控制器数量
en-US: Active Controller Count
ja-JP: 活動中のコントローラー数
- field: ControllerState
type: 0
i18n:
zh-CN: 控制器状态
en-US: Controller State
ja-JP: コントローラー状態
- field: FencedBrokerCount
type: 0
i18n:
zh-CN: 被隔离代理数量
en-US: Fenced Broker Count
ja-JP: フェンスのブローカー数
- field: GlobalPartitionCount
type: 0
i18n:
zh-CN: 全局分区数量
en-US: Global Partition Count
ja-JP: パーティション数
- field: GlobalTopicCount
type: 0
i18n:
zh-CN: 全局主题数量
en-US: Global Topic Count
ja-JP: トピック数
- field: OfflinePartitionsCount
type: 0
i18n:
zh-CN: 离线分区数量
en-US: Offline Partitions Count
ja-JP: オフラインのパーティション数
- field: PreferredReplicaImbalanceCount
type: 0
i18n:
zh-CN: 首选副本不平衡数量
en-US: Preferred Replica Imbalance Count
ja-JP: 優先レプリカ不均衡数
- field: ReplicasIneligibleToDeleteCount
type: 0
i18n:
zh-CN: 不能删除的副本数量
en-US: Replicas Ineligible To Delete Count
ja-JP: 削除できないレプリカ数
- field: ReplicasToDeleteCount
type: 0
i18n:
zh-CN: 待删除副本数量
en-US: Replicas To Delete Count
ja-JP: 削除待ちのレプリカ数
- field: TopicsIneligibleToDeleteCount
type: 0
i18n:
zh-CN: 不能删除的主题数量
en-US: Topics Ineligible To Delete Count
ja-JP: 削除できないトピック数
- field: TopicsToDeleteCount
type: 0
i18n:
zh-CN: 待删除主题数量
en-US: Topics To Delete Count
ja-JP: 削除待ちのトピック数
- field: ZkMigrationState
type: 0
i18n:
zh-CN: ZooKeeper迁移状态
en-US: Zk Migration State
ja-JP: ZooKeeperマイグレーション状態
aliasFields:
- Value->ActiveBrokerCount
- Value->ActiveControllerCount
@@ -354,7 +318,6 @@ metrics:
i18n:
zh-CN: Broker处理器平均百分比
en-US: Broker Handler Avg Percent
ja-JP: ブローカーハンドラの平均パーセント
priority: 6
fields:
- field: EventType
@@ -362,43 +325,36 @@ metrics:
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
protocol: jmx
jmx:
host: ^_^host^_^
@@ -413,7 +369,6 @@ metrics:
i18n:
zh-CN: Kafka副本管理器指标
en-US: Kafka Replica Manager Metrics
ja-JP: Kafkaレプリカマネジャーのメトリクス
priority: 6
fields:
- field: AtMinIsrPartitionCount
@@ -421,73 +376,61 @@ metrics:
i18n:
zh-CN: 达到最小ISR的分区数
en-US: At Min ISR Partition Count
ja-JP: 最小ISRパーティション数
- field: FailedIsrUpdatesPerSec
type: 0
i18n:
zh-CN: 每秒失败ISR更新数
en-US: Failed ISR Updates Per Sec
ja-JP: 1秒あたりのISR更新失敗数
- field: IsrExpandsPerSec
type: 0
i18n:
zh-CN: 每秒ISR扩展数
en-US: ISR Expands Per Sec
ja-JP: 1秒あたりのISR拡張数
- field: IsrShrinksPerSec
type: 0
i18n:
zh-CN: 每秒ISR收缩数
en-US: ISR Shrinks Per Sec
ja-JP: 1秒あたりのISR収縮数
- field: LeaderCount
type: 0
i18n:
zh-CN: 领导者数量
en-US: Leader Count
ja-JP: リーダー数
- field: OfflineReplicaCount
type: 0
i18n:
zh-CN: 离线副本数量
en-US: Offline Replica Count
ja-JP: オフラインのレプリカ数
- field: PartitionCount
type: 0
i18n:
zh-CN: 分区总数
en-US: Partition Count
ja-JP: パーティション数
- field: PartitionsWithLateTransactionsCount
type: 0
i18n:
zh-CN: 含有延迟交易的分区数
en-US: Partitions With Late Transactions Count
ja-JP: 遅いトランザクションのあるパーティション数
- field: ProducerIdCount
type: 0
i18n:
zh-CN: 生产者ID数量
en-US: Producer ID Count
ja-JP: 生産者ID数
- field: ReassigningPartitions
type: 0
i18n:
zh-CN: 正在重新分配的分区数
en-US: Reassigning Partitions
ja-JP: 再割り当てのパーティション数
- field: UnderMinIsrPartitionCount
type: 0
i18n:
zh-CN: 低于最小ISR的分区数
en-US: Under Min ISR Partition Count
ja-JP: 最小ISR未満のパーティション数
- field: UnderReplicatedPartitions
type: 0
i18n:
zh-CN: 副本数低于预期的分区数量
en-US: Under Replicated Partitions
ja-JP: レプリカ未満のパーティション数
aliasFields:
- Value->LeaderCount
- Value->AtMinIsrPartitionCount
@@ -529,7 +472,6 @@ metrics:
i18n:
zh-CN: 每秒主题流入字节
en-US: Total Bytes In Per Second
ja-JP: 1秒あたりのトピック合計受信されたバイト
priority: 7
fields:
- field: EventType
@@ -537,43 +479,36 @@ metrics:
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
protocol: jmx
jmx:
host: ^_^host^_^
@@ -588,7 +523,6 @@ metrics:
i18n:
zh-CN: 各主题每秒流入字节
en-US: Bytes In Per Topic Per Second
ja-JP: 各トピックの1秒あたりの受信されたバイト
priority: 7
fields:
- field: topic
@@ -596,49 +530,41 @@ metrics:
i18n:
zh-CN: 主题名称
en-US: Topic Name
ja-JP: トピック名
- field: EventType
type: 1
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
protocol: jmx
jmx:
host: ^_^host^_^
@@ -653,7 +579,6 @@ metrics:
i18n:
zh-CN: 主题每秒流出字节
en-US: Total Bytes Out Per Second
ja-JP: 1秒あたりのトピック合計転送されたバイト
priority: 8
fields:
- field: EventType
@@ -661,43 +586,36 @@ metrics:
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
protocol: jmx
jmx:
host: ^_^host^_^
@@ -712,7 +630,6 @@ metrics:
i18n:
zh-CN: 各主题每秒流出字节
en-US: Bytes Out Per Topic Per Second
ja-JP: 各トピックの1秒あたりの転送されたバイト
priority: 9
fields:
- field: topic
@@ -720,49 +637,41 @@ metrics:
i18n:
zh-CN: 主题名称
en-US: Topic Name
ja-JP: トピック名
- field: EventType
type: 1
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
protocol: jmx
jmx:
host: ^_^host^_^
@@ -777,7 +686,6 @@ metrics:
i18n:
zh-CN: 每秒生产消息转换
en-US: Produce Message Conversions PerSec
ja-JP: 1秒あたりのメッセージ変換数
priority: 9
fields:
- field: EventType
@@ -785,43 +693,36 @@ metrics:
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
protocol: jmx
jmx:
host: ^_^host^_^
@@ -836,7 +737,6 @@ metrics:
i18n:
zh-CN: 每秒生产总请求数
en-US: Produce Total Requests PerSec
ja-JP: 1秒あたりの合計リクエスト数
priority: 10
fields:
- field: EventType
@@ -844,43 +744,36 @@ metrics:
i18n:
zh-CN: 事件类型
en-US: Event Type
ja-JP: イベントタイプ
- field: RateUnit
type: 1
i18n:
zh-CN: 速率单位
en-US: Rate Unit
ja-JP: レート単位
- field: MeanRate
type: 0
i18n:
zh-CN: 平均速率
en-US: Mean Rate
ja-JP: 平均レート
- field: OneMinuteRate
type: 0
i18n:
zh-CN: 一分钟速率
en-US: One Minute Rate
ja-JP: 1分間のレート
- field: FiveMinuteRate
type: 0
i18n:
zh-CN: 五分钟速率
en-US: Five Minute Rate
ja-JP: 5分間のレート
- field: FifteenMinuteRate
type: 0
i18n:
zh-CN: 十五分钟速率
en-US: Fifteen Minute Rate
ja-JP: 15分間のレート
- field: Count
type: 0
i18n:
zh-CN: 计数
en-US: Count
ja-JP: カウント
protocol: jmx
jmx:
host: ^_^host^_^
@@ -895,7 +788,6 @@ metrics:
i18n:
zh-CN: Kafka消费者组指标
en-US: Kafka Group Metrics
ja-JP: Kafka消費者グループメトリクス
priority: 11
fields:
- field: NumGroups
@@ -903,43 +795,36 @@ metrics:
i18n:
zh-CN: 群组数量
en-US: Num Groups
ja-JP: 消費者グループ総数
- field: NumGroupsCompletingRebalance
type: 0
i18n:
zh-CN: 正在完成重新平衡的群组数量
en-US: Num Groups Completing Rebalance
ja-JP: リバランス中の消費者グループ数
- field: NumGroupsDead
type: 0
i18n:
zh-CN: 死亡群组数量
en-US: Num Groups Dead
ja-JP: デッドの消費者グループ数
- field: NumGroupsEmpty
type: 0
i18n:
zh-CN: 空群组数量
en-US: Num Groups Empty
ja-JP: 空の消費者グループ数
- field: NumGroupsPreparingRebalance
type: 0
i18n:
zh-CN: 正在准备重新平衡的群组数量
en-US: Num Groups Preparing Rebalance
ja-JP: リバランス準備中の消費者グループ数
- field: NumGroupsStable
type: 0
i18n:
zh-CN: 稳定群组数量
en-US: Num Groups Stable
ja-JP: 安定した消費者グループ数
- field: NumOffsets
type: 0
i18n:
zh-CN: 偏移量数量
en-US: Num Offsets
ja-JP: オフセット数
aliasFields:
- Value->NumGroups
- Value->NumGroupsCompletingRebalance
@@ -18,13 +18,11 @@ app: kafka_client
name:
zh-CN: Kafka消息系统(客户端)
en-US: Kafka MessageClient
ja-JP: Kafkaメッセージングシステム(クライアント)
help:
zh-CN: HertzBeat 使用 <a href="https://hertzbeat.apache.org/zh-cn/docs/help/kafka_client">Kafka Admin Client</a> 对 Kafka 的通用指标进行采集监控。</span>
en-US: HertzBeat uses <a href='https://hertzbeat.apache.org/docs/help/kafka_client'>Kafka Admin Client</a> to monitoring kafka general metrics. </span>
zh-TW: HertzBeat 使用 <a href="https://hertzbeat.apache.org/zh-cn/docs/help/kafka_client">Kafka Admin Client</a> 對 Kafka 的通用指標進行采集監控。</span>
ja-JP: HertzBeat は <a href="https://hertzbeat.apache.org/docs/help/kafka_client">Kafka Admin Clientを介して</a> Kafkaの一般的なパフォーマンスのメトリクスを監視します。</span>
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/kafka_client
@@ -35,14 +33,12 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
type: host
required: true
- field: port
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
type: number
range: '[0,65535]'
required: true
@@ -51,7 +47,6 @@ params:
name:
zh-CN: 是否监控内部主题
en-US: Monitor Internal Topic
ja-JP: 内部トピックを監視するかどうか
type: boolean
required: true
defaultValue: false
@@ -61,7 +56,6 @@ metrics:
i18n:
zh-CN: 主题列表
en-US: Topic List
ja-JP: トピック一覧
priority: 0
fields:
- field: TopicName
@@ -69,7 +63,6 @@ metrics:
i18n:
zh-CN: 主题名称
en-US: Topic Name
ja-JP: トピック名
protocol: kclient
kclient:
host: ^_^host^_^
@@ -80,7 +73,6 @@ metrics:
i18n:
zh-CN: 主题详细信息
en-US: Topic Detail Info
ja-JP: トピック詳細情報
priority: 1
fields:
- field: TopicName
@@ -88,43 +80,36 @@ metrics:
i18n:
zh-CN: 主题名称
en-US: Topic Name
ja-JP: トピック名
- field: PartitionNum
type: 1
i18n:
zh-CN: 分区数量
en-US: Partition Num
ja-JP: パーティション数
- field: PartitionLeader
type: 1
i18n:
zh-CN: 分区领导者
en-US: Partition Leader
ja-JP: パーティションリーダー
- field: BrokerHost
type: 1
i18n:
zh-CN: Broker主机
en-US: Broker Host
ja-JP: ブローカーホスト
- field: BrokerPort
type: 1
i18n:
zh-CN: Broker端口
en-US: Broker Port
ja-JP: ブローカーポート
- field: ReplicationFactorSize
type: 1
i18n:
zh-CN: 复制因子大小
en-US: Replication Factor Size
ja-JP: レプリカファクターのサイズ
- field: ReplicationFactor
type: 1
i18n:
zh-CN: 复制因子
en-US: Replication Factor
ja-JP: レプリカファクター
protocol: kclient
kclient:
host: ^_^host^_^
@@ -135,7 +120,6 @@ metrics:
i18n:
zh-CN: 主题偏移量
en-US: Topic Offset
ja-JP: トピックオフセット
priority: 2
# Kafka offset does not need to be obtained frequently, as getting it too quickly will affect performance
interval: 300
@@ -146,26 +130,22 @@ metrics:
i18n:
zh-CN: 主题名称
en-US: Topic Name
ja-JP: トピック名
- field: PartitionNum
label: true
type: 1
i18n:
zh-CN: 分区号
en-US: Partition Num
ja-JP: パーティション数
- field: earliest
type: 0
i18n:
zh-CN: 最早偏移量
en-US: Earliest Offset
ja-JP: 最早オフセット
- field: latest
type: 0
i18n:
zh-CN: 最新偏移量
en-US: Latest Offset
ja-JP: 最新オフセット
protocol: kclient
kclient:
host: ^_^host^_^
@@ -176,7 +156,6 @@ metrics:
i18n:
zh-CN: 消费者组情况
en-US: Consumer Detail Info
ja-JP: 消費者グループ詳細情報
priority: 3
# Kafka offset does not need to be obtained frequently, as getting it too quickly will affect performance
interval: 300
@@ -187,32 +166,27 @@ metrics:
i18n:
zh-CN: 消费者组ID
en-US: Consumer Group ID
ja-JP: 消費者グループID
- field: Group Member Num
type: 1
i18n:
zh-CN: 消费者实例数量
en-US: Group Member Num
ja-JP: 消費者グループのメンバー数
- field: Topic
label: true
type: 1
i18n:
zh-CN: 订阅主题名称
en-US: Subscribed Topic Name
ja-JP: 購読されたトピック名
- field: Offset of Each Partition
type: 1
i18n:
zh-CN: 各分区偏移量
en-US: Offset of Each Partition
ja-JP: 各パーティションのオフセット
- field: Lag
type: 0
i18n:
zh-CN: 落后偏移量
en-US: Total Lag
ja-JP: ラグオフセット
protocol: kclient
kclient:
host: ^_^host^_^
@@ -20,13 +20,11 @@ app: kafka_promql
name:
zh-CN: Kafka-PromQL
en-US: Kafka-PromQL
ja-JP: Kafka-PromQL
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 使用 Prometheus PromQL 从 Prometheus 服务器中查询到 Kafka 的通用指标数据来进行监控。此方案适用于 Prometheus 已监控 Kafka,需要从 Prometheus 服务器抓取 Kafka 的监控数据。<br>您可以点击 “<i>新建 Kafka-PromQL</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses Prometheus PromQL query metrics data from Prometheus Server to monitoring Kafka. This solution is suitable for Prometheus to monitor Kafka, and it need to capture Kafka monitoring data from the Prometheus server. <br>You could click the "<i>New Kafka-PromQL</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: Hertzbeat 使用 Prometheus PromQL 從 Prometheus 服務器中查詢到 Kafka 的通用指標數據來進行監控。此方案適用于 Prometheus 已監控 Kafka,需要從 Prometheus 服務器抓取 Kafka 的監控數據。<br>您可以點擊 “<i>新建 Kafka-PromQL</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は Prometheus PromQL を介して Prometheus サーバーに Kafka の一般的なパフォーマンスのメトリクスをクエリして監視します。このシナリオは、PrometheusがすでにKafkaを監視しており、PrometheusサーバーからKafkaの監視データを取得する必要がある場合に適用されます。。<br>「<i>新規 Kafka-PromQL</i>」をクリックして設定しましょう。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/kafka_promql
en-US: https://hertzbeat.apache.org/docs/help/kafka_promql
@@ -35,14 +33,12 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
type: host
required: true
- field: port
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
type: number
range: '[0,65535]'
required: true
@@ -51,7 +47,6 @@ params:
name:
zh-CN: 请求方式
en-US: Method
ja-JP: リクエストメソッド
type: radio
required: true
options:
@@ -68,7 +63,6 @@ params:
name:
zh-CN: 相对路径
en-US: URI
ja-JP: URI
type: text
limit: 200
required: true
@@ -78,14 +72,12 @@ params:
name:
zh-CN: 启动SSL
en-US: SSL
ja-JP: SSL
type: boolean
required: false
- field: headers
name:
zh-CN: 请求Headers
en-US: Headers
ja-JP: ヘッダ
type: key-value
required: false
keyAlias: Header Name
@@ -94,7 +86,6 @@ params:
name:
zh-CN: 查询Params
en-US: Params
ja-JP: パラメータ
type: key-value
required: false
keyAlias: Param Key
@@ -103,7 +94,6 @@ params:
name:
zh-CN: Content-Type
en-US: Content-Type
ja-JP: コンテンツタイプ
type: text
placeholder: '请求BODY资源类型'
required: false
@@ -112,7 +102,6 @@ params:
name:
zh-CN: 请求BODY
en-US: BODY
ja-JP: ボディ
type: textarea
placeholder: 'POST PUT请求时有效'
required: false
@@ -121,7 +110,6 @@ params:
name:
zh-CN: 认证方式
en-US: Auth Type
ja-JP: 認証方法
type: radio
required: false
hide: true
@@ -134,7 +122,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -143,7 +130,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
hide: true
@@ -153,7 +139,6 @@ metrics:
i18n:
zh-CN: Kafka Broker 数量
en-US: Kafka Broker Count
ja-JP: Kafkaブローカー数量
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -165,25 +150,21 @@ metrics:
i18n:
zh-CN: 名称
en-US: Name
ja-JP: 名前
- field: instance
type: 1
i18n:
zh-CN: 实例
en-US: Instance
ja-JP: インスタンス
- field: timestamp
type: 1
i18n:
zh-CN: 时间戳
en-US: Timestamp
ja-JP: タイムスタンプ
- field: value
type: 1
i18n:
zh-CN: 数值
en-US: Value
ja-JP:
# The protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# The config content when protocol is http
@@ -220,7 +201,6 @@ metrics:
i18n:
zh-CN: Kafka Topic 分区数量
en-US: Kafka Topic Partitions
ja-JP: Kafkaトピックのパーティション数量
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -232,25 +212,21 @@ metrics:
i18n:
zh-CN: 名称
en-US: Name
ja-JP: 名前
- field: topic
type: 1
i18n:
zh-CN: 主题
en-US: Topic
ja-JP: トピック
- field: timestamp
type: 1
i18n:
zh-CN: 时间戳
en-US: Timestamp
ja-JP: タイムスタンプ
- field: value
type: 1
i18n:
zh-CN: 数值
en-US: Value
ja-JP:
# The protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# The config content when protocol is http
@@ -288,7 +264,6 @@ metrics:
i18n:
zh-CN: Kafka Server Broker Topic 每秒字节入
en-US: Kafka Server Broker Topic Bytes In Per Second
ja-JP: Kafkaサーバーブローカーの1秒あたりのトピック合計受信されたバイト
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -300,31 +275,26 @@ metrics:
i18n:
zh-CN: 实例
en-US: Instance
ja-JP: インスタンス
- field: job
type: 1
i18n:
zh-CN: 任务
en-US: Job
ja-JP: タスク
- field: topic
type: 1
i18n:
zh-CN: 主题
en-US: Topic
ja-JP: トピック
- field: timestamp
type: 1
i18n:
zh-CN: 时间戳
en-US: Timestamp
ja-JP: タイムスタンプ
- field: value
type: 1
i18n:
zh-CN: 数值
en-US: Value
ja-JP:
# The protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# The specific collection configuration when the protocol is http
@@ -21,13 +21,11 @@ app: kingbase
name:
zh-CN: Kingbase数据库
en-US: Kingbase DB
ja-JP: Kingbaseデータベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 Kingbase 数据库的通用性能指标 (basic、state、activity etc) 进行采集监控,支持版本为 KingbaseV8r6+。<br>您可以点击“<i>新建 Kingbase 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of Kingbase database (basic、state、activity etc). Supported version is KingbaseV8r6+. <br>You can click "<i>New Kingbase Database</i>" and configure it, or select "<i>More Action</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 Kingbase 數據庫的通用性能指標 (basic、state、activity etc)進行采集監控,支持版本爲 KingbaseV8r6+。<br>您可以點擊“<i>新建 Kingbase 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBCプロトコルを介して</a> Kingbase データベース(V8r6+)の一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 Kingbase データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/kingbase
en-US: https://hertzbeat.apache.org/docs/help/kingbase
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -63,7 +59,6 @@ params:
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
type: number
range: '[400,200000]'
required: false
@@ -73,7 +68,6 @@ params:
name:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
type: text
defaultValue: kingbase
required: false
@@ -81,7 +75,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -89,14 +82,12 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: url
name:
zh-CN: URL
en-US: URL
ja-JP: URL
type: text
required: false
hide: true
@@ -108,7 +99,6 @@ metrics:
i18n:
zh-CN: 基本信息
en-US: Basic Info
ja-JP: 基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -121,31 +111,26 @@ metrics:
i18n:
zh-CN: 服务器版本
en-US: Server Version
ja-JP: バージョン
- field: port
type: 1
i18n:
zh-CN: 端口
en-US: Port
ja-JP: ポート
- field: server_encoding
type: 1
i18n:
zh-CN: 服务器编码
en-US: Server Encoding
ja-JP: サーバーのエンコード
- field: data_directory
type: 1
i18n:
zh-CN: 数据目录
en-US: Data Directory
ja-JP: データディレクトリ
- field: max_connections
type: 0
i18n:
zh-CN: 最大连接数
en-US: Max Connections
ja-JP: 最大接続数
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: jdbc
# the config content when protocol is jdbc
@@ -170,7 +155,6 @@ metrics:
i18n:
zh-CN: 状态信息
en-US: State Info
ja-JP: 状態情報
priority: 1
fields:
- field: db_name
@@ -179,55 +163,47 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: conflicts
type: 0
unit: times
i18n:
zh-CN: 冲突次数
en-US: Conflicts
ja-JP: コンフリクト回数
- field: deadlocks
type: 0
unit: times
i18n:
zh-CN: 死锁次数
en-US: Deadlocks
ja-JP: デッドロック回数
- field: blks_read
type: 0
unit: blocks per second
i18n:
zh-CN: 读取块
en-US: Blocks Read
ja-JP: 読み取られたブロック
- field: blks_hit
type: 0
unit: blocks per second
i18n:
zh-CN: 命中块
en-US: Blocks Hit
ja-JP: ヒットブロック
- field: blk_read_time
type: 0
unit: ms
i18n:
zh-CN: 读取时间
en-US: Read Time
ja-JP: 読み取られタイム
- field: blk_write_time
type: 0
unit: ms
i18n:
zh-CN: 写入时间
en-US: Write Time
ja-JP: 書き込まれ時間
- field: stats_reset
type: 1
i18n:
zh-CN: 统计重置
en-US: Stats Reset
ja-JP: 統計リセット
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -245,7 +221,6 @@ metrics:
i18n:
zh-CN: 活动信息
en-US: Activity Info
ja-JP: 活動情報
priority: 2
fields:
- field: running
@@ -254,7 +229,6 @@ metrics:
i18n:
zh-CN: 运行中
en-US: Running
ja-JP: 実行中
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -272,7 +246,6 @@ metrics:
i18n:
zh-CN: 资源配置
en-US: Resource Config
ja-JP: リソース設定
priority: 3
fields:
- field: work_mem
@@ -281,40 +254,34 @@ metrics:
i18n:
zh-CN: 工作内存
en-US: Work Memory
ja-JP: ワークメモリ
- field: shared_buffers
type: 0
unit: MB
i18n:
zh-CN: 共享缓冲区
en-US: Shared Buffers
ja-JP: 共有バッファ
- field: autovacuum
type: 1
i18n:
zh-CN: 自动清理
en-US: Auto Vacuum
ja-JP: オートバキューム
- field: max_connections
type: 0
i18n:
zh-CN: 最大连接数
en-US: Max Connections
ja-JP: 最大接続数
- field: effective_cache_size
type: 0
unit: MB
i18n:
zh-CN: 有效缓存大小
en-US: Effective Cache Size
ja-JP: キャッシュサイズ
- field: wal_buffers
type: 0
unit: MB
i18n:
zh-CN: WAL缓冲区
en-US: WAL Buffers
ja-JP: WALバッファ
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -332,7 +299,6 @@ metrics:
i18n:
zh-CN: 连接信息
en-US: Connection Info
ja-JP: 接続情報
priority: 4
fields:
- field: active
@@ -340,7 +306,6 @@ metrics:
i18n:
zh-CN: 活动连接
en-US: Active Connection
ja-JP: 活躍的な接続
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -358,7 +323,6 @@ metrics:
i18n:
zh-CN: 连接状态
en-US: Connection State
ja-JP: 接続状態
priority: 5
fields:
- field: state
@@ -367,13 +331,11 @@ metrics:
i18n:
zh-CN: 状态
en-US: State
ja-JP: 状態
- field: num
type: 0
i18n:
zh-CN: 数量
en-US: Num
ja-JP: 数量
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -391,7 +353,6 @@ metrics:
i18n:
zh-CN: 连接数据库
en-US: Connection Db
ja-JP: 接続データベース
priority: 6
fields:
- field: db_name
@@ -400,13 +361,11 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: active
type: 0
i18n:
zh-CN: 活动连接
en-US: Active Connection
ja-JP: 活躍的な接続
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -424,7 +383,6 @@ metrics:
i18n:
zh-CN: 元组信息
en-US: Tuple Info
ja-JP: 組情報
priority: 7
fields:
- field: fetched
@@ -432,31 +390,26 @@ metrics:
i18n:
zh-CN: 获取次数
en-US: Fetched
ja-JP: フェッチ回数
- field: returned
type: 0
i18n:
zh-CN: 返回次数
en-US: Returned
ja-JP: 戻る回数
- field: inserted
type: 0
i18n:
zh-CN: 插入次数
en-US: Inserted
ja-JP: インサート回数
- field: updated
type: 0
i18n:
zh-CN: 更新次数
en-US: Updated
ja-JP: 更新回数
- field: deleted
type: 0
i18n:
zh-CN: 删除次数
en-US: Deleted
ja-JP: 削除回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -474,7 +427,6 @@ metrics:
i18n:
zh-CN: 临时文件
en-US: Temp File
ja-JP: 一時ファイル
priority: 8
fields:
- field: db_name
@@ -483,20 +435,17 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: num
type: 0
i18n:
zh-CN: 次数
en-US: Num
ja-JP: 数量
- field: size
type: 0
unit: B
i18n:
zh-CN: 大小
en-US: Size
ja-JP: サイズ
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -514,7 +463,6 @@ metrics:
i18n:
zh-CN: 锁信息
en-US: Lock Info
ja-JP: ロック情報
priority: 9
fields:
- field: db_name
@@ -523,21 +471,18 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: conflicts
type: 0
unit: times
i18n:
zh-CN: 冲突次数
en-US: Conflicts
ja-JP: コンフリクト回数
- field: deadlocks
type: 0
unit: times
i18n:
zh-CN: 死锁次数
en-US: Deadlocks
ja-JP: デッドロック回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -555,7 +500,6 @@ metrics:
i18n:
zh-CN: 慢查询
en-US: Slow Sql
ja-JP: スローSQL
priority: 10
fields:
- field: sql_text
@@ -564,33 +508,28 @@ metrics:
i18n:
zh-CN: SQL语句
en-US: SQL Text
ja-JP: SQL文のテキスト
- field: calls
type: 0
i18n:
zh-CN: 调用次数
en-US: Calls
ja-JP: コール回数
- field: rows
type: 0
i18n:
zh-CN: 行数
en-US: Rows
ja-JP:
- field: avg_time
type: 0
unit: ms
i18n:
zh-CN: 平均时间
en-US: Avg Time
ja-JP: 平均時間
- field: total_time
type: 0
unit: ms
i18n:
zh-CN: 总时间
en-US: Total Time
ja-JP: 合計時間
aliasFields:
- query
- calls
@@ -618,7 +557,6 @@ metrics:
i18n:
zh-CN: 事务信息
en-US: Transaction Info
ja-JP: トランザクション情報
priority: 12
fields:
- field: db_name
@@ -627,21 +565,18 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: commits
type: 0
unit: times
i18n:
zh-CN: 提交次数
en-US: Commits
ja-JP: コミット回数
- field: rollbacks
type: 0
unit: times
i18n:
zh-CN: 回滚次数
en-US: Rollbacks
ja-JP: ロールバック回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -659,7 +594,6 @@ metrics:
i18n:
zh-CN: 冲突信息
en-US: Conflicts Info
ja-JP: コンフリクト情報
priority: 13
fields:
- field: db_name
@@ -668,37 +602,31 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: tablespace
type: 0
i18n:
zh-CN: 表空间
en-US: Tablespace
ja-JP: 表領域
- field: lock
type: 0
i18n:
zh-CN:
en-US: Lock
ja-JP: ロック
- field: snapshot
type: 0
i18n:
zh-CN: 快照
en-US: Snapshot
ja-JP: スナップショット
- field: bufferpin
type: 0
i18n:
zh-CN: 缓冲区
en-US: Bufferpin
ja-JP: バッファ
- field: deadlock
type: 0
i18n:
zh-CN: 死锁
en-US: Deadlock
ja-JP: デッドロック
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -716,7 +644,6 @@ metrics:
i18n:
zh-CN: 缓存命中率
en-US: Cache Hit Ratio
ja-JP: キャッシュ命中率
priority: 14
fields:
- field: db_name
@@ -725,14 +652,12 @@ metrics:
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: ratio
type: 0
unit: '%'
i18n:
zh-CN: 命中率
en-US: Hit Ratio
ja-JP: 命中率
aliasFields:
- blks_hit
- blks_read
@@ -756,7 +681,6 @@ metrics:
i18n:
zh-CN: Checkpoint信息
en-US: Checkpoint Info
ja-JP: チェックポイント情報
priority: 15
fields:
- field: checkpoint_sync_time
@@ -765,14 +689,12 @@ metrics:
i18n:
zh-CN: Checkpoint同步时间
en-US: Checkpoint Sync Time
ja-JP: チェックポイント同期時間
- field: checkpoint_write_time
type: 0
unit: ms
i18n:
zh-CN: Checkpoint写入时间
en-US: Checkpoint Write Time
ja-JP: Checkpoint書き込まれた時間
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -790,7 +712,6 @@ metrics:
i18n:
zh-CN: Buffer信息
en-US: Buffer Info
ja-JP: バッファ情報
priority: 16
fields:
- field: allocated
@@ -798,31 +719,26 @@ metrics:
i18n:
zh-CN: 已分配
en-US: Allocated
ja-JP: 割り当てバッファ
- field: fsync_calls_by_backend
type: 0
i18n:
zh-CN: 后端进程直接执行的文件同步调用次数
en-US: Fsync Calls By Backend
ja-JP: バックエンド同期コール回数
- field: written_directly_by_backend
type: 0
i18n:
zh-CN: 后台写入到数据文件
en-US: Written Directly By Backend
ja-JP: バックエンドによる直接書き込まれたファイル
- field: written_by_background_writer
type: 0
i18n:
zh-CN: 后台写入
en-US: Written By Background Writer
ja-JP: バックグラウンドライターに書き込まれた
- field: written_during_checkpoints
type: 0
i18n:
zh-CN: 检查点期间写入
en-US: Written During Checkpoints
ja-JP: チェックポイント中の書き込み
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -21,13 +21,11 @@ app: kubernetes
name:
zh-CN: Kubernetes
en-US: Kubernetes
ja-JP: Kubernetes
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 通过查询 Kubernetes ApiServer api 来对 kubernetes 的通用性能指标(nodes、namespaces、pods、services)进行采集监控。<br><span class='help_module_span'>注意⚠️:为了监控 Kubernetes 中的信息,则需要获取到可访问 Api Server 的授权 TOKEN,让采集请求获取到对应的信息,<a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/kubernetes'>点击查看获取步骤</a>。</span>
en-US: HertzBeat monitoring Kubernetes general metrics such as nodes, namespaces and pods through querying data from Kubernetes ApiServer api. <br><span class='help_module_span'>Note⚠️:In order to monitor the information of Kubernetes, Hertzbeat need to obtain the authorized TOKEN that can access Api Server. <a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/kubernetes'>Click here to view the specific steps.</a></span>
zh-TW: HertzBeat 通過查詢 Kubernetes ApiServer api 來對 kubernetes 的通用性能指標(nodes、namespaces、pods、services)進行采集監控。<br><span class='help_module_span'>注意⚠️:爲了監控 Kubernetes 中的信息,則需要獲取到可訪問 Api Server 的授權 TOKEN,讓采集請求獲取到對應的信息,<a class='help_module_content' href='https://hertzbeat.apache.org/zh-cn/docs/help/kubernetes'>點擊查看獲取步驟</a>。</span>
ja-JP: HertzBeat は Kubernetes ApiServer api を呼び出し、kubernetes の一般的なパフォーマンスのメトリクスを収集して監視します。<br><span class='help_module_span'>注意⚠️Kubernetesでメトリクスを監視するためには、Api Serverにアクセスするための認可されたTOKENを取得する必要があります。<a class='help_module_content' href='https://hertzbeat.apache.org/docs/help/kubernetes'>クリックしてガイドを見ます</a>。</span>
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/kubernetes
en-US: https://hertzbeat.apache.org/docs/help/kubernetes
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: ApiServer端口
en-US: ApiServer Port
ja-JP: ApiServerポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 认证方式
en-US: Auth Type
ja-JP: 認証方法
# type-param field type(radio mapping the html radio tag)
type: radio
# required-true or false
@@ -79,7 +74,6 @@ params:
name:
zh-CN: 认证Token
en-US: Access Token
ja-JP: アクセストークン
type: text
required: true
# collect metrics config list
@@ -97,45 +91,38 @@ metrics:
i18n:
zh-CN: 节点名称
en-US: Node Name
ja-JP: ノード名
- field: is_ready
type: 1
i18n:
zh-CN: 节点就绪状态
en-US: Node Ready Status
ja-JP: ノード準備完了
- field: capacity_cpu
type: 0
i18n:
zh-CN: CPU 容量
en-US: CPU Capacity
ja-JP: CPU 容量
- field: allocatable_cpu
type: 0
i18n:
zh-CN: 可分配 CPU
en-US: Allocatable CPU
ja-JP: 割り当て可能CPU
- field: capacity_memory
type: 0
unit: Mi
i18n:
zh-CN: 内存容量
en-US: Memory Capacity
ja-JP: メモリ容量
- field: allocatable_memory
type: 0
unit: Mi
i18n:
zh-CN: 可分配内存
en-US: Allocatable Memory
ja-JP: 割り当て可能CPUメモリ
- field: creation_time
type: 1
i18n:
zh-CN: 创建时间
en-US: Creation Time
ja-JP: 作成時間
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- $.metadata.name
@@ -180,19 +167,16 @@ metrics:
i18n:
zh-CN: 命名空间
en-US: Namespace
ja-JP: 名前空間
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: Status
ja-JP: ステータス
- field: creation_time
type: 1
i18n:
zh-CN: 创建时间
en-US: Creation Time
ja-JP: 作成時間
aliasFields:
- $.metadata.name
- $.status.phase
@@ -222,49 +206,41 @@ metrics:
i18n:
zh-CN: Pod名称
en-US: Pod Name
ja-JP: ポッド名
- field: namespace
type: 1
i18n:
zh-CN: 命名空间
en-US: Namespace
ja-JP: 名前空間
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: Status
ja-JP: ステータス
- field: restart
type: 1
i18n:
zh-CN: 重启次数
en-US: Restart Count
ja-JP: リスタート回数
- field: host_ip
type: 1
i18n:
zh-CN: 主机IP
en-US: Host IP
ja-JP: ホストIP
- field: pod_ip
type: 1
i18n:
zh-CN: Pod IP
en-US: Pod IP
ja-JP: ポッドIP
- field: creation_time
type: 1
i18n:
zh-CN: 创建时间
en-US: Creation Time
ja-JP: 作成時間
- field: start_time
type: 1
i18n:
zh-CN: 启动时间
en-US: Start Time
ja-JP: 起動時間
aliasFields:
- $.metadata.name
- $.metadata.namespace
@@ -304,37 +280,31 @@ metrics:
i18n:
zh-CN: 服务
en-US: Service
ja-JP: サービス
- field: namespace
type: 1
i18n:
zh-CN: 命名空间
en-US: Namespace
ja-JP: 名前空間
- field: type
type: 1
i18n:
zh-CN: 类型
en-US: Type
ja-JP: タイプ
- field: cluster_ip
type: 1
i18n:
zh-CN: 集群IP
en-US: Cluster IP
ja-JP: クラスタIP
- field: selector
type: 1
i18n:
zh-CN: 选择器
en-US: Selector
ja-JP: セレクター
- field: creation_time
type: 1
i18n:
zh-CN: 创建时间
en-US: Creation Time
ja-JP: 作成時間
aliasFields:
- $.metadata.name
- $.metadata.namespace
@@ -21,13 +21,11 @@ app: kvrocks
name:
zh-CN: Kvrocks 数据库
en-US: Kvrocks
ja-JP: Kvrocksデータベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 对 Apache Kvrocks 数据库的通用性能指标进行采集监控(server、clients、memory、persistence、stats、replication、cpu、cluster、commandstats),支持版本为 Apache Kvrocks 2.9.0+。<br>您可以点击“<i>新建 Kvrocks 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat monitors Apache Kvrocks database of general performance metrics such as memory, persistence, replication and so on. The versions we support is Apache Kvrocks 2.9.0+. <br>You could click the "<i>New Kvrocks</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: HertzBeat 對 Apache Kvrocks 數據庫的通用性能指標進行采集監控(server、clients、memory、persistence、stats、replication、cpu、cluster、commandstats),支持版本爲 Apache Kvrocks 2.9.0+。<br>您可以點擊“<i>新建 Kvrocks 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は Apache Kvrocks データベース(2.9.0+)の一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 Kvrocks データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/kvrocks
en-US: https://hertzbeat.apache.org/docs/help/kvrocks
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 超时时间
en-US: Timeout
ja-JP: タイムアウト
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -79,7 +74,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -88,7 +82,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
@@ -102,7 +95,6 @@ metrics:
i18n:
zh-CN: 服务器信息
en-US: Server
ja-JP: サーバー情報
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: kvrocks_version
@@ -110,121 +102,101 @@ metrics:
i18n:
zh-CN: Kvrocks 服务版本
en-US: Kvrocks Version
ja-JP: Kvrocks バージョン
- field: redis_version
type: 1
i18n:
zh-CN: Redis 服务版本
en-US: Redis Version
ja-JP: Redis バージョン
- field: git_sha1
type: 0
i18n:
zh-CN: Kvrocks Git SHA1
en-US: Kvrocks Git SHA1
ja-JP: Kvrocks Git SHA1
- field: kvrocks_mode
type: 1
i18n:
zh-CN: 运行模式
en-US: Server Mode
ja-JP: サーバーモード
- field: os
type: 1
i18n:
zh-CN: 操作系统
en-US: Operating System
ja-JP: オーエス
- field: arch_bits
type: 0
i18n:
zh-CN: 架构
en-US: Architecture Bits
ja-JP: アーキテクチャ
- field: multiplexing_api
type: 1
i18n:
zh-CN: IO多路复用器API
en-US: Multiplexing API
ja-JP: IO多重化API
- field: atomicvar_api
type: 1
i18n:
zh-CN: 原子操作处理API
en-US: Atomicvar API
ja-JP: 原子操作API
- field: gcc_version
type: 1
i18n:
zh-CN: GCC版本
en-US: GCC Version
ja-JP: GCC バージョン
- field: process_id
type: 0
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: tcp_port
type: 0
i18n:
zh-CN: TCP/IP监听端口
en-US: TCP Port
ja-JP: TCP ポート
- field: server_time_usec
type: 0
i18n:
zh-CN: 服务器时间戳
en-US: Server Time Usec
ja-JP: サーバー時間
- field: uptime_in_seconds
type: 0
i18n:
zh-CN: 运行时长(秒)
en-US: Uptime(Seconds)
ja-JP: アップタイム(秒)
- field: uptime_in_days
type: 0
i18n:
zh-CN: 运行时长(天)
en-US: Uptime(Days)
ja-JP: アップタイム(日)
- field: hz
type: 0
i18n:
zh-CN: 事件循环频率
en-US: hz
ja-JP: hz
- field: configured_hz
type: 0
i18n:
zh-CN: 配置的事件循环频率
en-US: Configured hz
ja-JP: Configured hz
- field: lru_clock
type: 0
i18n:
zh-CN: LRU时钟
en-US: LRU Clock
ja-JP: LRUクロック
- field: executable
type: 1
i18n:
zh-CN: 服务器执行路径
en-US: Server's Executable Path
ja-JP: サーバーの実行パス
- field: config_file
type: 1
i18n:
zh-CN: 配置文件路径
en-US: Config File Path
ja-JP: 配置ファイルのパス
- field: io_threads_active
type: 0
i18n:
zh-CN: 活跃IO线程数
en-US: Active IO Threads
ja-JP: 活動中のI/Oスレッド数
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -247,7 +219,6 @@ metrics:
i18n:
zh-CN: 客户端信息
en-US: Clients
ja-JP: クライアント情報
# collect metrics content
fields:
- field: connected_clients
@@ -255,25 +226,21 @@ metrics:
i18n:
zh-CN: 已连接客户端数量
en-US: Connected Clients
ja-JP: 接続クライアント数
- field: maxclients
type: 0
i18n:
zh-CN: 最大客户端连接数
en-US: Max Clients
ja-JP: 最大クライアント数
- field: blocked_clients
type: 0
i18n:
zh-CN: 阻塞客户端数量
en-US: Blocked Clients
ja-JP: ブロックされたクライアント数
- field: monitor_clients
type: 0
i18n:
zh-CN: 监控的客户端数量
en-US: monitor Clients
ja-JP: モニタークライアント数
protocol: redis
redis:
host: ^_^host^_^
@@ -289,7 +256,6 @@ metrics:
i18n:
zh-CN: 内存信息
en-US: Memory
ja-JP: メモリ情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -298,33 +264,28 @@ metrics:
i18n:
zh-CN: 已使用内存(字节)
en-US: Used Memory RSS
ja-JP: 使用した物理メモリ(バイト)
- field: used_memory_rss_human
type: 0
unit: MB
i18n:
zh-CN: 已使用物理内存
en-US: Used Memory RSS Human
ja-JP: 使用した物理メモリ
- field: used_memory_lua
type: 0
i18n:
zh-CN: LUA脚本占用的内存(字节)
en-US: Used Memory LUA
ja-JP: LUAが使用するメモリ(バイト)
- field: used_memory_lua_human
type: 0
unit: KB
i18n:
zh-CN: LUA脚本占用的内存
en-US: Used Memory LUA Human
ja-JP: LUAが使用するメモリ
- field: used_memory_startup
type: 0
i18n:
zh-CN: 启动占用内存
en-US: Used Memory Startup
ja-JP: 起動時の使用メモリ
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -348,7 +309,6 @@ metrics:
i18n:
zh-CN: 持久化信息
en-US: Persistence
ja-JP: 永続化
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -357,31 +317,26 @@ metrics:
i18n:
zh-CN: 是否正在加载持久化文件
en-US: Loading
ja-JP: 読み込み中
- field: bgsave_in_progress
type: 0
i18n:
zh-CN: 是否正在进行bgsave
en-US: bgsave In Progress
ja-JP: bgsaveである
- field: last_bgsave_time
type: 0
i18n:
zh-CN: 最近一次bgsave命令执行时间
en-US: Last Save Time
ja-JP: 最後のbgsave実行時間
- field: last_bgsave_status
type: 1
i18n:
zh-CN: 最近一次bgsave命令执行状态
en-US: Last bgsave Status
ja-JP: 最後のbgsaveの実行状況
- field: last_bgsave_time_sec
type: 0
i18n:
zh-CN: 最近一次bgsave命令执行时间(秒)
en-US: Last bgsave Time Sec
ja-JP: 最後のbgsave実行時間(秒)
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -405,7 +360,6 @@ metrics:
i18n:
zh-CN: 全局统计信息
en-US: Stats
ja-JP: 統計情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -414,73 +368,61 @@ metrics:
i18n:
zh-CN: 已接受的总连接数
en-US: Total Connections Received
ja-JP: 受信された接続数
- field: total_commands_processed
type: 0
i18n:
zh-CN: 执行过的命令总数
en-US: Total Commands Processed
ja-JP: 処理済みのコマンド数
- field: instantaneous_ops_per_sec
type: 0
i18n:
zh-CN: 命令处理条数/秒
en-US: Instantaneous Ops Per Sec
ja-JP: 処理されたコマンド数/秒
- field: total_net_input_bytes
type: 0
i18n:
zh-CN: 输入总网络流量(字节)
en-US: Total Net Input Bytes
ja-JP: 受信されたネットワークトラフィック(バイト)
- field: total_net_output_bytes
type: 0
i18n:
zh-CN: 输出总网络流量(字节)
en-US: Total Net Output Bytes
ja-JP: 転送されたネットワークトラフィック(バイト)
- field: instantaneous_input_kbps
type: 0
i18n:
zh-CN: 输入字节数/秒
en-US: Instantaneous Input Kbps
ja-JP: 受信されたバイト/秒
- field: instantaneous_output_kbps
type: 0
i18n:
zh-CN: 输出字节数/秒
en-US: Instantaneous Output Kbps
ja-JP: 転送されたバイト/秒
- field: sync_full
type: 0
i18n:
zh-CN: 主从完全同步成功次数
en-US: Sync Full
ja-JP: Full Sync回数
- field: sync_partial_ok
type: 0
i18n:
zh-CN: 主从部分同步成功次数
en-US: Sync Partial OK
ja-JP: Partial Sync成功回数
- field: sync_partial_err
type: 0
i18n:
zh-CN: 主从部分同步失败次数
en-US: Sync Partial Error
ja-JP: Partial Sync失敗回数
- field: pubsub_channels
type: 0
i18n:
zh-CN: 订阅的频道数量
en-US: Pubsub Channels
ja-JP: 購読されたチャンネル数
- field: pubsub_patterns
type: 0
i18n:
zh-CN: 订阅的模式数量
en-US: Pubsub Patterns
ja-JP: 購読されたパターン数
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -504,7 +446,6 @@ metrics:
i18n:
zh-CN: 主从同步信息
en-US: Replication
ja-JP: レプリケーション情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -513,19 +454,16 @@ metrics:
i18n:
zh-CN: 节点角色
en-US: Role
ja-JP: 役割
- field: connected_slaves
type: 0
i18n:
zh-CN: 已连接的从节点个数
en-US: Connected Slaves
ja-JP: 接続スレーブ数
- field: master_repl_offset
type: 0
i18n:
zh-CN: 主节点偏移量
en-US: Master Repl Offset
ja-JP: マスターのログオフセット
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -549,7 +487,6 @@ metrics:
i18n:
zh-CN: CPU消耗信息
en-US: CPU
ja-JP: CPU情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -558,13 +495,11 @@ metrics:
i18n:
zh-CN: Kvrocks进程使用的CPU时钟总和(内核态)
en-US: Used CPU Sys
ja-JP: Kvrocksが使用するシステム時間
- field: used_cpu_user
type: 0
i18n:
zh-CN: Kvrocks进程使用的CPU时钟总和(用户态)
en-US: Used CPU User
ja-JP: Kvrocksが使用するユーザー時間
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -588,7 +523,6 @@ metrics:
i18n:
zh-CN: 命令信息
en-US: Command Stats
ja-JP: コマンドの統計情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -597,13 +531,11 @@ metrics:
i18n:
zh-CN: 命令
en-US: Command Stat Command
ja-JP: コマンド
- field: cmdstat_info
type: 1
i18n:
zh-CN: 命令监控信息
en-US: Command Stat Info
ja-JP: コマンドの統計情報
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -626,7 +558,6 @@ metrics:
i18n:
zh-CN: 集群信息
en-US: Cluster
ja-JP: クラスター情報
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: cluster_enabled
@@ -634,7 +565,6 @@ metrics:
i18n:
zh-CN: 节点是否开启集群模式
en-US: Cluster Enabled
ja-JP: 有効
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -658,7 +588,6 @@ metrics:
i18n:
zh-CN: 命令统计信息
en-US: Command Stats
ja-JP: コマンドの統計情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -667,55 +596,46 @@ metrics:
i18n:
zh-CN: 客户端命令统计
en-US: cmdstat client
ja-JP: クライアントのコマンド
- field: cmdstat_config
type: 1
i18n:
zh-CN: 配置命令统计
en-US: cmdstat config
ja-JP: 配置のコマンド
- field: cmdstat_get
type: 1
i18n:
zh-CN: get
en-US: get
ja-JP: get
- field: cmdstat_hello
type: 1
i18n:
zh-CN: hello
en-US: hello
ja-JP: hello
- field: cmdstat_info
type: 1
i18n:
zh-CN: info
en-US: info
ja-JP: info
- field: cmdstat_keys
type: 1
i18n:
zh-CN: keys
en-US: keys
ja-JP: keys
- field: cmdstat_ping
type: 1
i18n:
zh-CN: ping
en-US: ping
ja-JP: ping
- field: cmdstat_select
type: 1
i18n:
zh-CN: select
en-US: select
ja-JP: select
- field: cmdstat_set
type: 1
i18n:
zh-CN: set
en-US: set
ja-JP: set
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -739,7 +659,6 @@ metrics:
i18n:
zh-CN: 数据库统计信息
en-US: Keyspace
ja-JP: キー空間
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -748,49 +667,41 @@ metrics:
i18n:
zh-CN: db0
en-US: db0
ja-JP: db0
- field: sequence
type: 1
i18n:
zh-CN: 序列
en-US: sequence
ja-JP: シーケンス
- field: used_db_size
type: 1
i18n:
zh-CN: 数据库使用大小
en-US: used_db_size
ja-JP: 使用したサイズ
- field: max_db_size
type: 1
i18n:
zh-CN: 数据库最大使用大小
en-US: max_db_size
ja-JP: 最大サイズ
- field: used_percent
type: 1
i18n:
zh-CN: 数据库使用百分比
en-US: used_percent
ja-JP: パーセント
- field: disk_capacity
type: 1
i18n:
zh-CN: 磁盘容量
en-US: disk_capacity
ja-JP: ディスク容量
- field: used_disk_size
type: 1
i18n:
zh-CN: 占用磁盘大小
en-US: used_disk_size
ja-JP: 使用したディスクサイズ
- field: used_disk_percent
type: 1
i18n:
zh-CN: 占用磁盘百分比
en-US: used_disk_percent
ja-JP: 使用したディスク率
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: redis
# the config content when protocol is redis
@@ -21,13 +21,11 @@ app: linux
name:
zh-CN: Linux操作系统
en-US: OS Linux
ja-JP: OS Linux
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 Linux 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 Linux</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors Linux operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New Linux</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 Linux 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 Linux</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> Linuxシステムの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 Linux</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/linux
en-US: https://hertzbeat.apache.org/docs/help/linux
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 超时时间(ms)
en-US: Timeout(ms)
ja-JP: タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -80,7 +75,6 @@ params:
name:
zh-CN: 复用连接
en-US: Reuse Connection
ja-JP: 接続再利用
# type-param field type(most mapping the html input type)
type: boolean
# required-true or false
@@ -92,7 +86,6 @@ params:
name:
zh-CN: 使用代理
en-US: Use Proxy Connection
ja-JP: プロキシ接続利用
# type-param field type(most mapping the html input type)
type: boolean
# required-true or false
@@ -104,7 +97,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -117,7 +109,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -128,7 +119,6 @@ params:
name:
zh-CN: 私钥
en-US: PrivateKey
ja-JP: 秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -141,7 +131,6 @@ params:
name:
zh-CN: 密钥短语
en-US: PrivateKey PassPhrase
ja-JP: 秘密鍵フレーズ
# type-param field type(most mapping the html input type)
type: password
# required-true or false
@@ -154,7 +143,6 @@ params:
name:
zh-CN: 代理主机
en-US: Proxy Host
ja-JP: プロキシホスト
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -166,7 +154,6 @@ params:
name:
zh-CN: 代理端口
en-US: Proxy Port
ja-JP: プロキシポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -183,7 +170,6 @@ params:
name:
zh-CN: 代理用户名
en-US: Proxy Username
ja-JP: プロキシユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -198,7 +184,6 @@ params:
name:
zh-CN: 代理密码
en-US: Proxy Password
ja-JP: プロキシパスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -211,7 +196,6 @@ params:
name:
zh-CN: 代理主机私钥
en-US: proxyPrivateKey
ja-JP: プロキシ秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -226,7 +210,6 @@ metrics:
i18n:
zh-CN: 系统基本信息
en-US: Basic Info
ja-JP: システム基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -239,19 +222,16 @@ metrics:
i18n:
zh-CN: 主机名称
en-US: Host Name
ja-JP: ホスト名
- field: version
type: 1
i18n:
zh-CN: 操作系统版本
en-US: System Version
ja-JP: オーエスバージョン
- field: uptime
type: 1
i18n:
zh-CN: 启动时间
en-US: Uptime
ja-JP: アップタイム
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: ssh
# the config content when protocol is ssh
@@ -291,7 +271,6 @@ metrics:
i18n:
zh-CN: CPU 信息
en-US: CPU Info
ja-JP: CPU情報
priority: 1
fields:
- field: info
@@ -299,38 +278,32 @@ metrics:
i18n:
zh-CN: 型号
en-US: Info
ja-JP: バージョン
- field: cores
type: 1
i18n:
zh-CN: 核数
en-US: Cores
ja-JP: コア数
- field: interrupt
type: 0
i18n:
zh-CN: 中断数
en-US: Interrupt
ja-JP: 割り込み数
- field: load
type: 1
i18n:
zh-CN: 负载
en-US: Load
ja-JP: ロード
- field: context_switch
type: 0
i18n:
zh-CN: 上下文切换
en-US: Context Switch
ja-JP: コンテキストスイッチ
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- info
@@ -377,7 +350,6 @@ metrics:
i18n:
zh-CN: 内存信息
en-US: Memory Info
ja-JP: メモリ情報
priority: 2
fields:
- field: total
@@ -386,42 +358,36 @@ metrics:
i18n:
zh-CN: 总内存容量
en-US: Total Memory
ja-JP: メモリ容量
- field: used
type: 0
unit: Mb
i18n:
zh-CN: 用户程序内存量
en-US: User Program Memory
ja-JP: ユーザープログラムメモリ
- field: free
type: 0
unit: Mb
i18n:
zh-CN: 空闲内存容量
en-US: Free Memory
ja-JP: 空きメモリ
- field: buff_cache
type: 0
unit: Mb
i18n:
zh-CN: 缓存占用内存
en-US: Buff Cache Memory
ja-JP: バッファメモリ
- field: available
type: 0
unit: Mb
i18n:
zh-CN: 剩余可用内存
en-US: Available Memory
ja-JP: 使用可能のメモリ
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 内存使用率
en-US: Memory Usage
ja-JP: メモリ使用率
aliasFields:
- total
- used
@@ -464,7 +430,6 @@ metrics:
i18n:
zh-CN: 磁盘信息
en-US: Disk Info
ja-JP: ディスク情報
priority: 3
fields:
- field: disk_num
@@ -472,32 +437,27 @@ metrics:
i18n:
zh-CN: 磁盘总数
en-US: Disk Num
ja-JP: ディスク番号
- field: partition_num
type: 1
i18n:
zh-CN: 分区总数
en-US: Partition Num
ja-JP: パーティション
- field: block_write
type: 0
i18n:
zh-CN: 写磁盘块数
en-US: Block Write
ja-JP: 書き込みディスクブロック数
- field: block_read
type: 0
i18n:
zh-CN: 读磁盘块数
en-US: Block Read
ja-JP: 読み取りブロック数
- field: write_rate
type: 0
unit: iops
i18n:
zh-CN: 磁盘写速率
en-US: Write Rate
ja-JP: ディスク書き込み速度
protocol: ssh
ssh:
host: ^_^host^_^
@@ -527,7 +487,6 @@ metrics:
i18n:
zh-CN: 网卡信息
en-US: Interface Info
ja-JP: ネットワークカード情報
priority: 4
fields:
- field: interface_name
@@ -536,21 +495,18 @@ metrics:
i18n:
zh-CN: 网卡名称
en-US: Interface Name
ja-JP: ネットワークカード名
- field: receive_bytes
type: 0
unit: Mb
i18n:
zh-CN: 入站数据流量
en-US: Receive Bytes
ja-JP: 受信されたバイト数
- field: transmit_bytes
type: 0
unit: Mb
i18n:
zh-CN: 出站数据流量
en-US: Transmit Bytes
ja-JP: 転送されたバイト数
units:
- receive_bytes=B->MB
- transmit_bytes=B->MB
@@ -583,7 +539,6 @@ metrics:
i18n:
zh-CN: 文件系统
en-US: Disk Free
ja-JP: ファイルシステム
priority: 5
fields:
- field: filesystem
@@ -591,35 +546,30 @@ metrics:
i18n:
zh-CN: 文件系统
en-US: Filesystem
ja-JP: ファイルシステム
- field: used
type: 0
unit: Mb
i18n:
zh-CN: 已使用量
en-US: Used
ja-JP: 使用済み
- field: available
type: 0
unit: Mb
i18n:
zh-CN: 可用量
en-US: Available
ja-JP: 使用可能
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
- field: mounted
type: 1
label: true
i18n:
zh-CN: 挂载点
en-US: Mounted
ja-JP: マウント
protocol: ssh
ssh:
host: ^_^host^_^
@@ -649,7 +599,6 @@ metrics:
i18n:
zh-CN: Top10 CPU 进程
en-US: Top10 CPU Process
ja-JP: トップ10 CPUプロセス
priority: 6
fields:
- field: pid
@@ -658,27 +607,23 @@ metrics:
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: cpu_usage
type: 0
unit: '%'
i18n:
zh-CN: CPU占用率
en-US: CPU Usage
ja-JP: CPU使用率
- field: mem_usage
type: 0
unit: '%'
i18n:
zh-CN: 内存占用率
en-US: Memory Usage
ja-JP: メモリ使用率
- field: command
type: 1
i18n:
zh-CN: 执行命令
en-US: Command
ja-JP: コマンド
protocol: ssh
ssh:
host: ^_^host^_^
@@ -708,7 +653,6 @@ metrics:
i18n:
zh-CN: Top10 内存进程
en-US: Top10 Memory Process
ja-JP: トップ10 メモリプロセス
priority: 7
fields:
- field: pid
@@ -717,27 +661,23 @@ metrics:
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: mem_usage
type: 0
unit: '%'
i18n:
zh-CN: 内存占用率
en-US: Memory Usage
ja-JP: メモリ使用率
- field: cpu_usage
type: 0
unit: '%'
i18n:
zh-CN: CPU占用率
en-US: CPU Usage
ja-JP: CPU使用率
- field: command
type: 1
i18n:
zh-CN: 执行命令
en-US: Command
ja-JP: コマンド
protocol: ssh
ssh:
host: ^_^host^_^
@@ -21,13 +21,11 @@ app: linux_script
name:
zh-CN: Linux 命令
en-US: Linux Script
ja-JP: Linux Script
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 使用采集器作为 agent 直接运行 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-script'> Shell 命令 </a> 对 Linux 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 Linux Script</i>”进行添加。或者选择“<i>更多操作</i>”,导入已有配置。
en-US: Hertzbeat uses a collector as an agent to directly execute <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-script'> Shell commands </a> to collect and monitor general performance metrics of the Linux operating system (system information, CPU, memory, disk, network card, file system, TOP resource processes, etc.).<br>You can click “<i>Create New Linux Script</i>” to add it. Or select “<i>More Actions</i>” to import an existing configuration.
zh-TW: Hertzbeat 使用采集器作為 agent 直接運行 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-script'> Shell 命令 </a> 對 Linux 操作系統的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 Linux Script</i>”進行添加。或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は agent として <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-script'> Shell コマンドを介して </a> Linuxシステムの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 Linux Script</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/linux_script
en-US: https://hertzbeat.apache.org/docs/help/linux_script
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -51,7 +48,6 @@ metrics:
i18n:
zh-CN: 系统基本信息
en-US: Basic Info
ja-JP: 基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -64,19 +60,16 @@ metrics:
i18n:
zh-CN: 主机名称
en-US: Host Name
ja-JP: ホスト名
- field: version
type: 1
i18n:
zh-CN: 操作系统版本
en-US: System Version
ja-JP: オーエスバージョン
- field: uptime
type: 1
i18n:
zh-CN: 启动时间
en-US: Uptime
ja-JP: アップタイム
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: script
# the config content when protocol is ssh
@@ -96,7 +89,6 @@ metrics:
i18n:
zh-CN: CPU 信息
en-US: CPU Info
ja-JP: CPU情報
priority: 1
fields:
- field: info
@@ -104,38 +96,32 @@ metrics:
i18n:
zh-CN: 型号
en-US: Info
ja-JP: バージョン
- field: cores
type: 1
i18n:
zh-CN: 核数
en-US: Cores
ja-JP: コア数
- field: interrupt
type: 0
i18n:
zh-CN: 中断数
en-US: Interrupt
ja-JP: 割り込み数
- field: load
type: 1
i18n:
zh-CN: 负载
en-US: Load
ja-JP: ロード
- field: context_switch
type: 0
i18n:
zh-CN: 上下文切换
en-US: Context Switch
ja-JP: コンテキストスイッチ
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- info
@@ -166,7 +152,6 @@ metrics:
i18n:
zh-CN: 内存信息
en-US: Memory Info
ja-JP: メモリ情報
priority: 2
fields:
- field: total
@@ -175,42 +160,36 @@ metrics:
i18n:
zh-CN: 总内存容量
en-US: Total Memory
ja-JP: メモリ容量
- field: used
type: 0
unit: Mb
i18n:
zh-CN: 用户程序内存量
en-US: User Program Memory
ja-JP: ユーザープログラムメモリ
- field: free
type: 0
unit: Mb
i18n:
zh-CN: 空闲内存容量
en-US: Free Memory
ja-JP: 空きメモリ
- field: buff_cache
type: 0
unit: Mb
i18n:
zh-CN: 缓存占用内存
en-US: Buff Cache Memory
ja-JP: バッファメモリ
- field: available
type: 0
unit: Mb
i18n:
zh-CN: 剩余可用内存
en-US: Available Memory
ja-JP: 使用可能のメモリ
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 内存使用率
en-US: Memory Usage
ja-JP: メモリ使用率
aliasFields:
- total
- used
@@ -235,7 +214,6 @@ metrics:
i18n:
zh-CN: 磁盘信息
en-US: Disk Info
ja-JP: ディスク情報
priority: 3
fields:
- field: disk_num
@@ -243,32 +221,27 @@ metrics:
i18n:
zh-CN: 磁盘总数
en-US: Disk Num
ja-JP: ディスク番号
- field: partition_num
type: 1
i18n:
zh-CN: 分区总数
en-US: Partition Num
ja-JP: パーティション
- field: block_write
type: 0
i18n:
zh-CN: 写磁盘块数
en-US: Block Write
ja-JP: 書き込みディスクブロック数
- field: block_read
type: 0
i18n:
zh-CN: 读磁盘块数
en-US: Block Read
ja-JP: 読み取りブロック数
- field: write_rate
type: 0
unit: iops
i18n:
zh-CN: 磁盘写速率
en-US: Write Rate
ja-JP: ディスク書き込み速度
protocol: script
script:
scriptTool: bash
@@ -280,7 +253,6 @@ metrics:
i18n:
zh-CN: 网卡信息
en-US: Interface Info
ja-JP: ネットワークカード情報
priority: 4
fields:
- field: interface_name
@@ -289,21 +261,18 @@ metrics:
i18n:
zh-CN: 网卡名称
en-US: Interface Name
ja-JP: ネットワークカード名
- field: receive_bytes
type: 0
unit: Mb
i18n:
zh-CN: 入站数据流量
en-US: Receive Bytes
ja-JP: 受信されたバイト数
- field: transmit_bytes
type: 0
unit: Mb
i18n:
zh-CN: 出站数据流量
en-US: Transmit Bytes
ja-JP: 転送されたバイト数
units:
- receive_bytes=B->MB
- transmit_bytes=B->MB
@@ -318,7 +287,6 @@ metrics:
i18n:
zh-CN: 文件系统
en-US: Disk Free
ja-JP: ファイルシステム
priority: 5
fields:
- field: filesystem
@@ -326,35 +294,30 @@ metrics:
i18n:
zh-CN: 文件系统
en-US: Filesystem
ja-JP: ファイルシステム
- field: used
type: 0
unit: Mb
i18n:
zh-CN: 已使用量
en-US: Used
ja-JP: 使用済み
- field: available
type: 0
unit: Mb
i18n:
zh-CN: 可用量
en-US: Available
ja-JP: 使用可能
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
- field: mounted
type: 1
label: true
i18n:
zh-CN: 挂载点
en-US: Mounted
ja-JP: マウント
protocol: script
script:
scriptTool: bash
@@ -366,7 +329,6 @@ metrics:
i18n:
zh-CN: Top10 CPU 进程
en-US: Top10 CPU Process
ja-JP: トップ10 CPUプロセス
priority: 6
fields:
- field: pid
@@ -375,27 +337,23 @@ metrics:
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: cpu_usage
type: 0
unit: '%'
i18n:
zh-CN: CPU占用率
en-US: CPU Usage
ja-JP: CPU使用率
- field: mem_usage
type: 0
unit: '%'
i18n:
zh-CN: 内存占用率
en-US: Memory Usage
ja-JP: メモリ使用率
- field: command
type: 1
i18n:
zh-CN: 执行命令
en-US: Command
ja-JP: コマンド
protocol: script
script:
scriptTool: bash
@@ -407,7 +365,6 @@ metrics:
i18n:
zh-CN: Top10 内存进程
en-US: Top10 Memory Process
ja-JP: トップ10 メモリプロセス
priority: 7
fields:
- field: pid
@@ -416,27 +373,23 @@ metrics:
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: mem_usage
type: 0
unit: '%'
i18n:
zh-CN: 内存占用率
en-US: Memory Usage
ja-JP: メモリ使用率
- field: cpu_usage
type: 0
unit: '%'
i18n:
zh-CN: CPU占用率
en-US: CPU Usage
ja-JP: CPU使用率
- field: command
type: 1
i18n:
zh-CN: 执行命令
en-US: Command
ja-JP: コマンド
protocol: script
script:
scriptTool: bash
@@ -21,13 +21,11 @@ app: mariadb
name:
zh-CN: MariaDB数据库
en-US: MariaDB
ja-JP: MariaDB データベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 MariaDB 数据库的通用性能指标(系统信息、性能状态、Innodb、缓存、事物、用户线程、慢SQL等)进行采集监控,支持版本为 MariaDB5+。<br>您可以点击“<i>新建 MariaDB 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of MariaDB database (system information, performance status, Innodb, cache, things, user threads, slow SQL, etc.). Supported version is MariaDB5+. <br>You can click "<i>New MariaDB Database</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 MariaDB 數據庫的通用性能指標(系統信息、性能狀態、Innodb、緩存、事物、用戶線程、慢SQL等)進行采集監控,支持版本爲 MariaDB5+。<br>您可以點擊“<i>新建 MariaDB 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBCプロトコルを介して</a> MariaDB データベース(MariaDB5+)の一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 MariaDB データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mariadb
en-US: https://hertzbeat.apache.org/docs/help/mariadb
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -63,7 +59,6 @@ params:
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
type: number
# when type is number, range is required
range: '[400,200000]'
@@ -74,14 +69,12 @@ params:
name:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
type: text
required: false
- field: username
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -89,14 +82,12 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: url
name:
zh-CN: URL
en-US: URL
ja-JP: URL
type: text
required: false
hide: true
@@ -109,9 +100,8 @@ metrics:
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
i18n:
zh-CN: 基础信息
zh-CN: 基础 信息
en-US: Basic Info
ja-JP: 基礎情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -120,38 +110,32 @@ metrics:
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: port
type: 1
i18n:
zh-CN: 端口
en-US: Port
ja-JP: ポート
- field: datadir
type: 1
i18n:
zh-CN: 存储目录
en-US: Data Directory
ja-JP: データディレクトリ
en-US: DataDir
- field: max_connections
type: 0
i18n:
zh-CN: 最大连接数
en-US: Max Connections
ja-JP: 最大接続数
- field: thread_cache_size
type: 0
i18n:
zh-CN: 连接池大小
en-US: Thread Cache Size
ja-JP: キャッシュするスレッドの数
- field: innodb_buffer_pool_size
type: 0
unit: KB
i18n:
zh-CN: InnoDB缓冲池的大小
en-US: Innodb Buffer Pool Size
ja-JP: Innodbバッファープールのサイズ
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- version
@@ -204,9 +188,8 @@ metrics:
priority: 1
# collect metrics content
i18n:
zh-CN: 缓存信息
zh-CN: 缓存 信息
en-US: Cache Info
ja-JP: キャッシュ情報
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: query_cache_hit_rate
@@ -215,32 +198,27 @@ metrics:
i18n:
zh-CN: 缓存命中率
en-US: Query Cache Hit Rate
ja-JP: キャッシュ命中率
- field: cache_hits
type: 0
i18n:
zh-CN: 缓存命中数
en-US: Cache Hits
ja-JP: キャッシュ命中数
- field: cache_inserts
type: 0
i18n:
zh-CN: 缓存插入数
en-US: Cache Inserts
ja-JP: キャッシュインサート数
- field: cache_free_blocks
type: 0
i18n:
zh-CN: 缓存空闲块数量
en-US: Cache Free Blocks
ja-JP: キャッシュの空きブロック数
- field: cache_free_memory
type: 0
unit: KB
i18n:
zh-CN: 空闲缓存大小
en-US: Cache Free Memory
ja-JP: キャッシュの利用可能メモリ
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- Qcache_hits
@@ -263,6 +241,7 @@ metrics:
# the config content when protocol is jdbc
jdbc:
# jdbc host
# jdbchost
host: ^_^host^_^
# port
port: ^_^port^_^
@@ -285,22 +264,19 @@ metrics:
- name: performance
priority: 2
i18n:
zh-CN: 性能信息
zh-CN: 性能 信息
en-US: Performance Info
ja-JP: パフォーマンス情報
fields:
- field: questions
type: 0
i18n:
zh-CN: 查询总数
en-US: Questions
ja-JP: クエリ総数
- field: qps
type: 0
i18n:
zh-CN: QPS
en-US: QPS
ja-JP: QPS
zh-CN: 每秒处理查询数
en-US: Queries Per Second
aliasFields:
- uptime
- questions
@@ -322,9 +298,8 @@ metrics:
- name: innodb
priority: 3
i18n:
zh-CN: Innodb信息
zh-CN: Innodb 信息
en-US: Innodb Info
ja-JP: Innodb情報
fields:
- field: innodb_data_reads
type: 0
@@ -332,35 +307,30 @@ metrics:
i18n:
zh-CN: 磁盘读取次数
en-US: Innodb Data Reads
ja-JP: Innodb読み取り回数
- field: innodb_data_writes
type: 0
unit: Times
i18n:
zh-CN: 磁盘写入次数
en-US: Innodb Data Writes
ja-JP: Innodb書き込み回数
- field: innodb_data_read
type: 0
unit: KB
i18n:
zh-CN: 磁盘读取数据量
en-US: Innodb Data Read
ja-JP: Innodb読み取り(KB
- field: innodb_data_written
type: 0
unit: KB
i18n:
zh-CN: 磁盘写入数据量
en-US: Innodb Data Written
ja-JP: Innodb書き込み(KB
- field: innodb_buffer_hit_rate
type: 0
unit: '%'
i18n:
zh-CN: Innodb 缓存命中数
en-US: Innodb Buffer Hit Rate
ja-JP: Innodbバッファーキャッシュ命中率
aliasFields:
- Innodb_data_reads
- Innodb_data_writes
@@ -394,9 +364,8 @@ metrics:
- name: status
priority: 4
i18n:
zh-CN: 状态信息
zh-CN: 状态 信息
en-US: Status Info
ja-JP: 状態情報
fields:
- field: uptime
type: 0
@@ -404,73 +373,61 @@ metrics:
i18n:
zh-CN: 运行时间
en-US: Uptime
ja-JP: アップタイム
- field: com_select
type: 0
i18n:
zh-CN: 查询次数
en-US: Com Select
ja-JP: セレクト回数
- field: com_insert
type: 0
i18n:
zh-CN: 插入次数
en-US: Com Insert
ja-JP: インサート回数
- field: com_update
type: 0
i18n:
zh-CN: 更新次数
en-US: Com Update
ja-JP: 更新回数
- field: com_delete
type: 0
i18n:
zh-CN: 删除次数
en-US: Com Delete
ja-JP: 削除回数
- field: com_commit
type: 0
i18n:
zh-CN: 事务提交次数
en-US: Com Commit
ja-JP: トランザクションのコミット数
- field: com_rollback
type: 0
i18n:
zh-CN: 事务回滚次数
en-US: Com Rollback
ja-JP: トランザクションのロールバック数
- field: threads_created
type: 0
i18n:
zh-CN: 线程创建数
en-US: Threads Created
ja-JP: スレッド作成数
- field: threads_connected
type: 0
i18n:
zh-CN: 连接线程数
en-US: Threads Connected
ja-JP: 接続スレッド数
- field: threads_cached
type: 0
i18n:
zh-CN: 缓存线程数
en-US: Threads Cached
ja-JP: キャッシュスレッド数
- field: threads_running
type: 0
i18n:
zh-CN: 活动线程数
en-US: Threads Running
ja-JP: 活動中のスレッド数
- field: qps
type: 0
i18n:
zh-CN: QPS
en-US: QPS
ja-JP: QPS
zh-CN: 每秒处理查询数
en-US: Com Insert
aliasFields:
- uptime
- com_select
@@ -502,82 +459,69 @@ metrics:
- name: handler
priority: 5
i18n:
zh-CN: 处理器信息
zh-CN: 处理器 信息
en-US: Handler Info
ja-JP: ハンドラ情報
fields:
- field: handler_commit
type: 0
i18n:
zh-CN: 处理的事务提交数
en-US: Handler Commit
ja-JP: ハンドラのコミット操作数
- field: handler_delete
type: 0
i18n:
zh-CN: 处理的删除操作数
en-US: Handler Delete
ja-JP: ハンドラの削除操作数
- field: handler_write
type: 0
i18n:
zh-CN: 处理的写入操作数
en-US: Handler Write
ja-JP: ハンドラの書き込み操作数
- field: handler_update
type: 0
i18n:
zh-CN: 处理的更新操作数
en-US: Handler Update
ja-JP: ハンドラの更新操作数
- field: handler_discover
type: 0
i18n:
zh-CN: 处理的发现操作数
en-US: Handler Discover
ja-JP: ハンドラのディスカバー操作数
- field: handler_prepare
type: 0
i18n:
zh-CN: 处理的准备操作数
en-US: Handler Prepare
ja-JP: ハンドラの準備操作数
- field: handler_read_first
type: 0
i18n:
zh-CN: 读取首行操作数
en-US: Handler Read First
ja-JP: ハンドラの最初の行を読む操作数
- field: handler_read_rnd
type: 0
i18n:
zh-CN: 随机读取操作数
en-US: Handler Read RND
ja-JP: ハンドラのランダムアクセス操作数
- field: handler_read_next
type: 0
i18n:
zh-CN: 读取下一行操作数
en-US: Handler Read Next
ja-JP: ハンドラの次の行を読む操作数
- field: handler_read_rnd_next
type: 0
i18n:
zh-CN: 随机读取下一行操作数
en-US: Handler Read RND Next
ja-JP: ハンドラの次の行をランダムに読む操作数
- field: handler_read_key
type: 0
i18n:
zh-CN: 按索引键读取操作数
en-US: Handler Read Key
ja-JP: ハンドラのインデックスを使用して読み取る操作数
- field: handler_external_lock
type: 0
i18n:
zh-CN: 外部锁定操作数
en-US: Handler External Key
ja-JP: ハンドラの外部のキーを使用して読み取る操作数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -594,34 +538,29 @@ metrics:
- name: connection
priority: 6
i18n:
zh-CN: 连接信息
zh-CN: 连接 信息
en-US: Connection Info
ja-JP: 接続情報
fields:
- field: connections
type: 0
i18n:
zh-CN: 当前连接数
en-US: Connections
ja-JP: 現在接続数
- field: max_used_connections
type: 0
i18n:
zh-CN: 历史最大连接数
en-US: Max Used Connections
ja-JP: 最大接続数
- field: aborted_connects
type: 0
i18n:
zh-CN: 失败连接数
en-US: Aborted Connects
ja-JP: 失敗接続数
- field: aborted_clients
type: 0
i18n:
zh-CN: 客户端中断数
en-US: Aborted Clients
ja-JP: クライアントの割り込み数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -638,34 +577,29 @@ metrics:
- name: thread
priority: 7
i18n:
zh-CN: 线程信息
zh-CN: 线程 信息
en-US: Thread Info
ja-JP: スレッド情報
fields:
- field: threads_created
type: 0
i18n:
zh-CN: 创建线程数
en-US: Threads Created
ja-JP: スレッド作成数
- field: threads_connected
type: 0
i18n:
zh-CN: 连接线程数
en-US: Threads Connected
ja-JP: 接続スレッド数
- field: threads_cached
type: 0
i18n:
zh-CN: 缓存线程数
en-US: CThreads Cached
ja-JP: キャッシュスレッド数
- field: threads_running
type: 0
i18n:
zh-CN: 运行线程数
en-US: Threads Running
ja-JP: 活動中のスレッド数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -682,28 +616,24 @@ metrics:
- name: tmp
priority: 8
i18n:
zh-CN: 临时表信息
zh-CN: 临时表 信息
en-US: TMP Info
ja-JP: 一時テーブル情報
fields:
- field: created_tmp_tables
type: 0
i18n:
zh-CN: 创建的临时表数量
en-US: Created TMP Tables
ja-JP: 一時テーブル作成数
- field: created_tmp_disk_tables
type: 0
i18n:
zh-CN: 创建的临时磁盘表数量
en-US: Created TMP Disk Tables
ja-JP: 一時ディスクテーブル作成数
- field: created_tmp_files
type: 0
i18n:
zh-CN: 创建的临时文件数量
en-US: Created TMP Files
ja-JP: 一時ファイル作成数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -720,40 +650,34 @@ metrics:
- name: select_type
priority: 9
i18n:
zh-CN: 查询类型信息
zh-CN: 查询类型 信息
en-US: Select Type Info
ja-JP: 検索タイプ情報
fields:
- field: select_full_join
type: 0
i18n:
zh-CN: 全表连接数
en-US: Select Full Join
ja-JP: 全件結合数
- field: select_full_range_join
type: 0
i18n:
zh-CN: 带范围的全表连接数
en-US: Select Full Range Join
ja-JP: 範囲検索付き全件結合数
- field: select_range
type: 0
i18n:
zh-CN: 索引范围查询数
en-US: Select Range
ja-JP: 範囲検索数
- field: select_range_check
type: 0
i18n:
zh-CN: 索引范围内二次检查数
en-US: Select Range Check
ja-JP: 範囲内二次検索数
- field: select_scan
type: 0
i18n:
zh-CN: 全表扫描查询数
en-US: Select Scan
ja-JP: テーブル全体をスキャンする回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -770,34 +694,29 @@ metrics:
- name: sort
priority: 10
i18n:
zh-CN: 排序信息
zh-CN: 排序 信息
en-US: Sort Info
ja-JP: ソート情報
fields:
- field: sort_rows
type: 0
i18n:
zh-CN: 排序总行数
en-US: Sort Rows
ja-JP: ソートされた行数
- field: sort_range
type: 0
i18n:
zh-CN: 范围条件排序次数
en-US: Sort Range
ja-JP: 範囲付きのソート回数
- field: sort_merge_passes
type: 0
i18n:
zh-CN: 合并排序段次数
en-US: Sort Merge Passes
ja-JP: マージソート回数
- field: sort_scan
type: 0
i18n:
zh-CN: 全表扫描排序次数
en-US: Sort Scan
ja-JP: テーブル全体をスキャンしてソートする回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -814,22 +733,19 @@ metrics:
- name: table_lock
priority: 11
i18n:
zh-CN: 表级锁信息
zh-CN: 表级锁 信息
en-US: Table Lock Info
ja-JP: テーブルロック情報
fields:
- field: table_locks_immediate
type: 0
i18n:
zh-CN: 立即获得表锁次数
en-US: Table Locks Immediate
ja-JP: 即座に取得できた回数
- field: table_locks_waited
type: 0
i18n:
zh-CN: 须等待获取表锁次数
en-US: Table Locks Waited
ja-JP: 取得を待機した回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -846,9 +762,8 @@ metrics:
- name: process_state
priority: 12
i18n:
zh-CN: 进程状态信息
zh-CN: 进程状态 信息
en-US: Process State Info
ja-JP: プロセス状態情報
fields:
- field: state
type: 1
@@ -856,13 +771,11 @@ metrics:
i18n:
zh-CN: 进程状态
en-US: State
ja-JP: プロセス状態
- field: num
type: 0
i18n:
zh-CN: 该状态进程数量
en-US: Num
ja-JP: プロセス総数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -879,9 +792,8 @@ metrics:
- name: slow_sql
priority: 13
i18n:
zh-CN: 慢查询信息
zh-CN: 慢查询 信息
en-US: Slow Sql Info
ja-JP: スローSQL情報
fields:
- field: id
type: 1
@@ -889,31 +801,26 @@ metrics:
i18n:
zh-CN: ID
en-US: ID
ja-JP: ID
- field: sql_text
type: 1
i18n:
zh-CN: SQL 文本
en-US: SQL Text
ja-JP: SQL文のテキスト
- field: start_time
type: 1
i18n:
zh-CN: 开始时间
en-US: Start Time
ja-JP: 開始時間
- field: db
type: 1
i18n:
zh-CN: 数据库
en-US: Database
ja-JP: データベース
- field: query_time
type: 3
i18n:
zh-CN: 查询时间
en-US: Query Time
ja-JP: クエリ時間
aliasFields:
- sql_text
- start_time
@@ -21,22 +21,19 @@ app: memcached
name:
zh-CN: Memcached
en-US: Memcached
ja-JP: Memcached
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 支持 Memcached 服务监控,通过(stats、stats settings、stats sizes)命令对(服务器进程ID、服务器已运行秒数、版本、当前线程数、item的大小、item的数量、当前存储占用的字节数)等指标进行监测。
en-US: HertzBeat supports Memcached service monitoring by using commands such as stats, stats settings, and stats sizes to monitor indicators such as server process ID, server running seconds, version, current number of threads, item size, number of items, and current byte storage usage.
zh-TW: HertzBeat支持Memcached服務監控,通過(stats、stats settings、stats sizes)命令對(服務器行程ID、服務器已運行秒數、版本、當前線程數、item的大小、item的數量、當前存儲佔用的位元組數)等名額進行監測。
ja-JP: HertzBeat は Memcached サービスの一般的なメトリクスを監視します。
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
- field: host
# name-param field display i18n name
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
zh-CN: Memcached服务的Host
en-US: Host of Memcached service
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -47,7 +44,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -63,7 +59,6 @@ metrics:
i18n:
zh-CN: 系统信息
en-US: Server Info
ja-JP: サーバー情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -75,106 +70,89 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
- field: pid
type: 1
i18n:
zh-CN: 服务器进程ID
en-US: PID
ja-JP: プロセスID
en-US: Pid
- field: uptime
type: 0
unit: s
i18n:
zh-CN: 已运行秒数
en-US: Uptime
ja-JP: アップタイム
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: curr_connections
type: 0
i18n:
zh-CN: 当前连接数量
en-US: Curr Connections
ja-JP: 現在接続数
- field: auth_errors
type: 0
i18n:
zh-CN: 认证失败数目
en-US: Auth Errors
ja-JP: 認証失敗回数
- field: threads
type: 0
i18n:
zh-CN: 当前线程数
en-US: Threads
ja-JP: 現在スレッド数
- field: item_size
type: 0
unit: byte
i18n:
zh-CN: Item 大小
en-US: Item Size
ja-JP: Itemサイズ
- field: item_count
type: 0
i18n:
zh-CN: Item 数量
en-US: Item Count
ja-JP: Item数量
- field: curr_items
type: 0
i18n:
zh-CN: 当前存储的数据总数
en-US: Curr Items
ja-JP: 現在のItem数
- field: total_items
type: 0
i18n:
zh-CN: 启动以来存储的数据总数
en-US: Total Items
ja-JP: Item総数
- field: bytes
type: 0
unit: byte
i18n:
zh-CN: 当前存储占用的字节数
en-US: Bytes
ja-JP: バイト
- field: cmd_get
type: 0
i18n:
zh-CN: Get命令请求次数
en-US: Cmd Get
ja-JP: Getコマンドの実行回数
- field: cmd_set
type: 0
i18n:
zh-CN: Set命令请求次数
en-US: Cmd Set
ja-JP: Setコマンドの実行回数
- field: cmd_flush
type: 0
i18n:
zh-CN: Flush命令请求次数
en-US: Cmd Flush
ja-JP: Flushコマンドの実行回数
- field: get_misses
type: 0
i18n:
zh-CN: Get命令未命中次数
en-US: Get Misses
ja-JP: Getコマンドのミス回数
- field: delete_misses
type: 0
i18n:
zh-CN: Delete命令未命中次数
en-US: Delete Misses
ja-JP: Deleteコマンドのミス回数
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: memcached
# Specific collection configuration when protocol is telnet protocol
@@ -21,13 +21,11 @@ app: modbus
name:
zh-CN: ModBus服务器
en-US: ModBus Server
ja-JP: ModBusサーバー
# The description and help of this monitoring type
help:
zh-CN: HertzBeat对支持Modbus协议的服务进行(保持寄存器和线圈)相关指标进行采集
en-US: HertzBeat collects metrics related to maintaining registers and coils for services that support Modbus protocol
zh-TW: HertzBeat對支持Modbus協定的服務進行(保持寄存器和線圈)相關名額進行採集
ja-JP: HertzBeatはModbusプロトコルをサポートするサービスのメトリクスを監視します。
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
@@ -36,7 +34,6 @@ params:
name:
zh-CN: ModBus服务Host
en-US: ModBus Server Host
ja-JP: ModBusサーバーのホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -47,7 +44,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -61,7 +57,6 @@ params:
name:
zh-CN: slaveId
en-US: slaveId
ja-JP: slaveId
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -71,7 +66,6 @@ params:
name:
zh-CN: 请求超时时间(ms)
en-US: Request Timeout(ms)
ja-JP: リクエストタイムアウト(ms)
type: number
# when type is number, range is required
range: '[400,200000]'
@@ -83,25 +77,27 @@ params:
name:
zh-CN: 保持寄存器地址
en-US: Holding Registers address
ja-JP: Holdingレジスタのアドレス
# type-param field type(most mapping the html input type)
type: array
# param field input placeholder
placeholder: 'Input RegisterAddress'
# required-true or false
required: true
# hide param-true or false
# hide: true
- field: coilRegisterAddresses
# name-param field display i18n name
name:
zh-CN: 线圈寄存器地址
en-US: Coil Register address
ja-JP: コイルレジスタのアドレス
# type-param field type(most mapping the html input type)
type: array
# param field input placeholder
placeholder: 'Input RegisterAddress'
# required-true or false
required: true
# hide param-true or false
# hide: true
# collect metrics config list
metrics:
@@ -110,7 +106,6 @@ metrics:
i18n:
zh-CN: 保持寄存器 统计信息
en-US: holding-register stats
ja-JP: Holdingレジスタの統計情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -122,40 +117,38 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: address-0
type: 0
i18n:
zh-CN: address-0
en-US: address-0
ja-JP: address-0
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: address-1-0
type: 0
i18n:
zh-CN: address-1-0
en-US: address-1-0
ja-JP: address-1-0
- field: address-1-1
type: 0
i18n:
zh-CN: address-1-1
en-US: address-1-1
ja-JP: address-1-1
- field: address-1-2
type: 0
i18n:
zh-CN: address-1-2
en-US: address-1-2
ja-JP: address-1-2
# 指标别名列表,按照寄存器地址来进行命名的
# 例如 地址为下标为0 ,值为m holding-register:0
# 地址为下标为1,值为m[2] holding-register:1-0 holding-register:1-1
aliasFields:
- responseTime
- holding-register:0
- holding-register:1-0
- holding-register:1-1
- holding-register:1-2
# mapping and conversion expressions, use the same aliasField above to calculate metrics value# eg: cores=core1+core2, usage=usage, waitTimeallTime-runningTime
# mapping and conversion expressions, use thesand aliasField above to calculate metrics value# (可选)指标映射转换计算表达式,与上面的别名一起作用,计算出最终需要的指标值# eg: cores=core1+core2, usage=usage, waitTimeallTime-runningTime
calculates:
- responseTime=responseTime
- address-0=holding-register:0
@@ -180,7 +173,6 @@ metrics:
i18n:
zh-CN: 线圈 统计信息
en-US: coil stats
ja-JP: コイルの統計情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -192,40 +184,38 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: address-0
type: 0
i18n:
zh-CN: address-0
en-US: address-0
ja-JP: address-0
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: address-1-0
type: 0
i18n:
zh-CN: address-1-0
en-US: address-1-0
ja-JP: address-1-0
- field: address-1-1
type: 0
i18n:
zh-CN: address-1-1
en-US: address-1-1
ja-JP: address-1-1
- field: address-1-2
type: 0
i18n:
zh-CN: address-1-2
en-US: address-1-2
ja-JP: address-1-2
# 指标别名列表,按照寄存器地址来进行命名的
# 例如 地址为下标为0 ,值为m coil:0
# 地址为下标为1,值为m[2] coil:1-0 coil:1-1
aliasFields:
- responseTime
- coil:0
- coil:1-0
- coil:1-1
- coil:1-2
# mapping and conversion expressions, use the same aliasField above to calculate metrics value# eg: cores=core1+core2, usage=usage, waitTimeallTime-runningTime
# mapping and conversion expressions, use thesand aliasField above to calculate metrics value# (可选)指标映射转换计算表达式,与上面的别名一起作用,计算出最终需要的指标值# eg: cores=core1+core2, usage=usage, waitTimeallTime-runningTime
calculates:
- responseTime=responseTime
- address-0=coil:0
@@ -22,13 +22,11 @@ app: mongodb
name:
zh-CN: MongoDB数据库
en-US: MongoDB
ja-JP: MongoDBデータベース
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 对 MongoDB 数据库的通用指标进行测量监控。<br>您可以点击 “<i>新建 MongoDB 数据库</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: Hertzbeat monitors MongoDB general performance metrics. You could click the "<i>New MongoDB</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: Hertzbeat 對 MongoDB 數據庫的通用指標進行測量監控。<br>您可以點擊 “<i>新建 MongoDB 數據庫</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は MongoDBデータベースの一般的なメトリクスを監視します。<br>「<i>新規 MongoDBデータベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mongodb
en-US: https://hertzbeat.apache.org/docs/help/mongodb
@@ -40,7 +38,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -51,7 +48,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -64,7 +60,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -72,14 +67,12 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: database
name:
zh-CN: 数据库
en-US: database
ja-JP: データベース
type: text
# when type is text, use limit to limit string length
limit: 50
@@ -89,7 +82,6 @@ params:
name:
zh-CN: 认证数据库
en-US: authenticationDatabase
ja-JP: 認証データベース
type: text
limit: 50
required: true
@@ -99,7 +91,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -124,7 +115,6 @@ metrics:
i18n:
zh-CN: 构建信息
en-US: Build Info
ja-JP: ビルド情報
# monitoring metrics list
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -133,43 +123,36 @@ metrics:
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: gitVersion
type: 1
i18n:
zh-CN: git版本
en-US: Git Version
ja-JP: Gitバージョン
- field: sysInfo
type: 1
i18n:
zh-CN: 系统信息
en-US: Sys Info
ja-JP: システム情報
- field: loaderFlags
type: 1
i18n:
zh-CN: 加载器标志
en-US: Loader Flags
ja-JP: ローダフラグ
- field: compilerFlags
type: 1
i18n:
zh-CN: 编译器标志
en-US: Compiler Flags
ja-JP: コンパイラフラグ
- field: allocator
type: 1
i18n:
zh-CN: 分配器
en-US: Allocator
ja-JP: メモリ割り当て器
- field: javascriptEngine
type: 1
i18n:
zh-CN: JavaScript引擎
en-US: JavaScript Engine
ja-JP: JavaScriptエンジン
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: mongodb
# the config content when protocol is mongodb
@@ -197,32 +180,27 @@ metrics:
i18n:
zh-CN: 服务器文档
en-US: Server Document
ja-JP: サーバードキュメント
fields:
- field: deleted
type: 0
i18n:
zh-CN: 已删除数
en-US: Deleted
ja-JP: 削除回数
- field: inserted
type: 0
i18n:
zh-CN: 已插入数
en-US: Inserted
ja-JP: インサート回数
- field: returned
type: 0
i18n:
zh-CN: 返回结果数
en-US: Returned
ja-JP: 戻る回数
- field: updated
type: 0
i18n:
zh-CN: 已更新数
en-US: Updated
ja-JP: 更新回数
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -239,20 +217,17 @@ metrics:
i18n:
zh-CN: 服务器操作
en-US: Server Operation
ja-JP: サーバー操作
fields:
- field: scanAndOrder
type: 0
i18n:
zh-CN: 扫描订购
en-US: Scan And Order
ja-JP: スキャンとオーダー
- field: writeConflicts
type: 0
i18n:
zh-CN: 写冲突
en-US: Write And Order
ja-JP: 書き込みとオーダー
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -267,22 +242,19 @@ metrics:
- name: server_ttl
priority: 3
i18n:
zh-CN: 服务器_TTL
en-US: server TTL
ja-JP: サーバーTTL
zh-CN: 服务器_ttl
en-US: Max Connections
fields:
- field: deletedDocuments
type: 0
i18n:
zh-CN: 已删除文档数
en-US: Deleted Documents
ja-JP: 削除されたドキュメント数
- field: passes
type: 0
i18n:
zh-CN: 通过数
en-US: Passes
ja-JP: パス数
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -300,58 +272,49 @@ metrics:
i18n:
zh-CN: 系统信息
en-US: System Info
ja-JP: システム情報
fields:
- field: currentTime
type: 1
i18n:
zh-CN: 当前时间
en-US: Current Time
ja-JP: 現在時刻
- field: hostname
type: 1
i18n:
zh-CN: 主机名
en-US: Host Name
ja-JP: ホスト名
- field: cpuAddrSize
type: 0
i18n:
zh-CN: cpu地址大小
en-US: CPU Address Size
ja-JP: CPUアドレスサイズ
- field: memSizeMB
type: 0
unit: MB
i18n:
zh-CN: 内存大小(MB
en-US: Memory Size MB
ja-JP: メモリサイズ(MB)
- field: memLimitMB
type: 0
unit: MB
i18n:
zh-CN: 内存限制(MB
en-US: Memory Limit MB
ja-JP: メモリ制限(MB)
- field: numCores
type: 0
i18n:
zh-CN: CPU 核数
en-US: Num Cores
ja-JP: コア数
- field: cpuArch
type: 1
i18n:
zh-CN: CPU 架构
en-US: CPU Architecture
ja-JP: CPUアーキテクチャ
- field: numaEnabled
type: 1
i18n:
zh-CN: numa是否启用
en-US: Numa Enabled
ja-JP: 有効化
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -368,26 +331,22 @@ metrics:
i18n:
zh-CN: 操作系统信息
en-US: OS Info
ja-JP: オーエス情報
fields:
- field: type
type: 1
i18n:
zh-CN: 操作系统类型
en-US: Type
ja-JP: タイプ
- field: name
type: 1
i18n:
zh-CN: 名称
en-US: Name
ja-JP: 名前
- field: version
type: 1
i18n:
zh-CN: Version
en-US: 版本号
ja-JP: バージョン
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -404,56 +363,47 @@ metrics:
i18n:
zh-CN: 额外信息
en-US: Extra Info
ja-JP: 追加情報
fields:
- field: versionString
type: 1
i18n:
zh-CN: 版本字符串
en-US: Version String
ja-JP: バージョン文字列
- field: libcVersion
type: 1
i18n:
zh-CN: 标准库版本
en-US: Libc Version
ja-JP: Libcバージョン
- field: kernelVersion
type: 1
i18n:
zh-CN: 内核版本
en-US: Kernel Version
ja-JP: カーネルバージョン
- field: cpuFrequencyMHz
type: 1
i18n:
zh-CN: CPU 频率(兆赫兹)
en-US: CPU Frequency MHz
ja-JP: CPU周波数(MHz
- field: cpuFeatures
type: 1
i18n:
zh-CN: CPU 特性
en-US: CPU Features
ja-JP: CPU機能
- field: pageSize
type: 0
i18n:
zh-CN: 内存页大小
en-US: Page Size
ja-JP: ページサイズ
- field: numPages
type: 0
i18n:
zh-CN: 内存页数量
en-US: Num Pages
ja-JP: ページ数量
- field: maxOpenFiles
type: 0
i18n:
zh-CN: 最大打开文件数
en-US: Max Open Files
ja-JP: 開けるファイルの最大数
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -22,13 +22,11 @@ app: mongodb_atlas
name:
zh-CN: MongoDB Atlas 数据库
en-US: MongoDB Atlas Database
ja-JP: MongoDB Atlas データベース
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 对 MongoDB Atlas 数据库的通用指标进行测量监控。<br>您可以点击 “<i>新建 MongoDB Atlas 数据库</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: Hertzbeat monitors MongoDB Atlas general performance metrics. You could click the "<i>New MongoDB Atlas</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: Hertzbeat 對 MongoDB Atlas 數據庫的通用指標進行測量監控。<br>您可以點擊 “<i>新建 MongoDB Atlas 數據庫</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は MongoDB Atlas データベースの一般的なメトリクスを監視します。<br>「<i>新規 MongoDB Atlas データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mongodb
en-US: https://hertzbeat.apache.org/docs/help/mongodb
@@ -40,7 +38,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -58,14 +54,12 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: database
name:
zh-CN: 数据库
en-US: database
ja-JP: データベース
type: text
# when type is text, use limit to limit string length
limit: 50
@@ -75,7 +69,6 @@ params:
name:
zh-CN: 认证数据库
en-US: authenticationDatabase
ja-JP: 認証データベース
type: text
limit: 50
required: true
@@ -85,7 +78,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -101,8 +93,7 @@ params:
# name-param field display i18n name
name:
zh-CN: 集群模式
en-US: Cluster Mode
ja-JP: クラスターモード
en-US: Cluster Model
# type-param field type(most mapping the html input type)
type: text
# can get status information and other config params of MongoDB by running Diagnostic Commands
@@ -121,7 +112,6 @@ metrics:
i18n:
zh-CN: 构建信息
en-US: Build Info
ja-JP: ビルド情報
# monitoring metrics list
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -130,31 +120,26 @@ metrics:
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: gitVersion
type: 1
i18n:
zh-CN: git版本
en-US: Git Version
ja-JP: Gitバージョン
- field: sysInfo
type: 1
i18n:
zh-CN: 系统信息
en-US: Sys Info
ja-JP: システム情報
- field: allocator
type: 1
i18n:
zh-CN: 分配器
en-US: Allocator
ja-JP: メモリ割り当て器
- field: javascriptEngine
type: 1
i18n:
zh-CN: JavaScript引擎
en-US: JavaScript Engine
ja-JP: JavaScriptエンジン
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: mongodb
# the config content when protocol is mongodb
@@ -184,44 +169,37 @@ metrics:
i18n:
zh-CN: 服务器文档
en-US: Server Document
ja-JP: サーバードキュメント
fields:
- field: delete
type: 0
i18n:
zh-CN: 已删除数
en-US: delete
ja-JP: 削除回数
- field: insert
type: 0
i18n:
zh-CN: 已插入数
en-US: insert
ja-JP: インサート回数
- field: update
type: 0
i18n:
zh-CN: 更新数
en-US: update
ja-JP: 更新回数
- field: query
type: 0
i18n:
zh-CN: 查询数
en-US: query
ja-JP: クエリ回数
- field: getmore
type: 0
i18n:
zh-CN: 光标中剩余文档的请求数
en-US: getmore
ja-JP: getmore
- field: command
type: 0
i18n:
zh-CN: 执行命令操作的总数
en-US: command
ja-JP: 実行されたコマンド数
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -239,26 +217,22 @@ metrics:
i18n:
zh-CN: 网络操作
en-US: Network Operation
ja-JP: ネットワーク操作
fields:
- field: bytesIn
type: 0
i18n:
zh-CN: 读取字节数
en-US: Bytes In
ja-JP: 読み取りバイト数
- field: bytesOut
type: 0
i18n:
zh-CN: 写入字节数
en-US: Bytes Out
ja-JP: 書き込みバイト数
- field: numRequests
type: 0
i18n:
zh-CN: 请求数
en-US: Request Num
ja-JP: リクエスト数
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -276,26 +250,22 @@ metrics:
i18n:
zh-CN: 连接信息
en-US: Connection Info
ja-JP: 接続情報
fields:
- field: current
type: 0
i18n:
zh-CN: 当前正在进行连接数
en-US: Current Connections
ja-JP: 現在接続数
- field: available
type: 0
i18n:
zh-CN: 可用连接数
en-US: Available Connections
ja-JP: 利用可能な接続数
- field: totalCreated
type: 0
i18n:
zh-CN: 总创建连接数
en-US: Total Created Connections
ja-JP: 作成された接続総数
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -313,66 +283,56 @@ metrics:
i18n:
zh-CN: 数据库统计
en-US: Database Statistics
ja-JP: データベース統計
fields:
- field: db
type: 1
i18n:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
- field: collections
type: 0
i18n:
zh-CN: 集合数
en-US: Collections
ja-JP: コレクション数
- field: views
type: 0
i18n:
zh-CN: 视图数
en-US: Views
ja-JP: ビュー数
- field: objects
type: 0
i18n:
zh-CN: 文档数
en-US: Objects
ja-JP: ドキュメント数
- field: avgObjSize
type: 0
unit: Bytes
i18n:
zh-CN: 文档平均大小
en-US: Document Avg Size
ja-JP: ドキュメントの平均サイズ
- field: dataSize
type: 0
unit: Bytes
i18n:
zh-CN: 文档大小
en-US: Document Size
ja-JP: ドキュメントサイズ
- field: storageSize
type: 0
unit: Bytes
i18n:
zh-CN: 使用存储空间大小
en-US: Storage Size
ja-JP: ストレージサイズ
- field: indexes
type: 0
i18n:
zh-CN: 索引数
en-US: Indexes
ja-JP: インデックス数
- field: indexSize
type: 0
unit: Bytes
i18n:
zh-CN: 索引大小
en-US: Index Size
ja-JP: インデックスサイズ
protocol: mongodb
mongodb:
host: ^_^host^_^
@@ -13,167 +13,123 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# The monitoring type categoryservice-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring
category: service
# The monitoring type eg: linux windows tomcat mysql aws...
app: mqtt
# The app api i18n name
name:
zh-CN: MQTT 连接
en-US: MQTT Connection
ja-JP: MQTT 接続
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 对 MQTT 连接进行监测。<br>您可以点击 “<i>新建 MQTT 连接</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat monitors MQTT connections. <br>You can click "<i>New MQTT connection</i>" and configure it, or select "<i>More actions</i>" to import an existing configuration.
zh-TW: HertzBeat 對 MQTT 連接進行監測。 <br>您可以點選 “<i>新建 MQTT 連線</i>” 並進行配置,或選擇“<i>更多操作</i>”,匯入已有配置。
ja-JP: Hertzbeat はMQTT 接続を監視します。<br>「<i>新規 MQTT 接続</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mqtt
en-US: https://hertzbeat.apache.org/docs/help/mqtt
# Input params define for monitoring(render web ui by the definition)
params:
- field: clientId
# field-param field key
- field: host
# name-param field display i18n name
name:
zh-CN: 客户端ID
en-US: Client Id
ja-JP: クライエントID
type: text
defaultValue: hertzbeat-mqtt-client
zh-CN: MQTT的Host
en-US: Target Host
# type-param field type(most mapping the html input type)
type: host
# required-true or false
required: true
# field-param field key
- field: port
# name-param field display i18n name
name:
zh-CN: 端口
en-US: Port
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
range: '[0,65535]'
# required-true or false
required: true
# default value 1883
defaultValue: 1883
- field: protocolVersion
name:
zh-CN: 协议版本
en-US: Protocol version
type: radio
options:
- label: MQTT 3.1.1
value: MQTT_3_1_1
- label: MQTT 5.0
value: MQTT_5_0
required: true
defaultValue: MQTT_3_1_1
# field-param field key
- field: timeout
# name-param field display i18n name
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
range: '[0,100000]'
# required-true or false
required: true
# default value 6000
defaultValue: 6000
# field-param field key
- field: username
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
hide: true
# required-true or false
required: false
- field: password
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: host
name:
zh-CN: MQTT的Host
en-US: Target Host
ja-JP: 目標ホスト
type: host
required: true
- field: port
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
type: number
range: '[0,65535]'
required: true
defaultValue: 1883
- field: protocol
name:
zh-CN: 连接协议
en-US: Protocol
ja-JP: 接続プロトコル
type: radio
options:
- label: MQTT
value: MQTT
- label: MQTTS
value: MQTTS
required: true
defaultValue: MQTT
- field: timeout
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
type: number
range: '[0,100000]'
required: true
defaultValue: 10000
- field: keepalive
name:
zh-CN: 心跳检测时间(s)
en-US: Keep Alive(s)
ja-JP: ハートビート間隔(s)
type: number
range: '[0,100000]'
required: true
defaultValue: 30
- field: tlsVersion
name:
zh-CN: TLS版本
en-US: TLS Version
ja-JP: TLSバージョン
type: radio
options:
- label: TLSv1.2
value: TLSv1.2
- label: TLSv1.3
value: TLSv1.3
defaultValue: TLSv1.2
required: false
hide: true
- field: insecureSkipVerify
name:
zh-CN: 跳过证书验证
en-US: Skip Certificate Verification
ja-JP: 証明書の検証をスキップ
type: boolean
defaultValue: false
hide: true
- field: caCert
name:
zh-CN: CA证书
en-US: CA Certificate
ja-JP: CA証明書
type: text
hide: true
# required-true or false
required: false
hide: true
- field: enableMutualAuth
- field: clientId
name:
zh-CN: 双向认证
en-US: Enable Mutual Auth
ja-JP: 相互認証
type: boolean
defaultValue: false
hide: true
- field: clientCert
name:
zh-CN: 客户端证书
en-US: Client Certificate
ja-JP: クライエントの証明書
zh-CN: 客户端ID
en-US: Client Id
type: text
required: false
hide: true
- field: clientKey
name:
zh-CN: 客户端私钥
en-US: Client Private Key
ja-JP: クライエントの秘密鍵
type: text
required: false
hide: true
defaultValue: hertzbeat-mqtt-client
# required-true or false
required: true
- field: topic
name:
zh-CN: 主题
en-US: Topic
ja-JP: トピック
type: text
required: true
- field: testMessage
name:
zh-CN: 测试消息
en-US: Test message
ja-JP: 試験メッセージ
type: text
required: false
# collect metrics config list
metrics:
# metrics - summary
- name: summary
i18n:
zh-CN: 概要
en-US: Summary
ja-JP: 概要
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
fields:
- field: responseTime
type: 0
@@ -181,46 +137,37 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
- field: canSubscribe
- field: canDescribe
type: 1
i18n:
zh-CN: 订阅状态
en-US: Normal subscribe
ja-JP: サブスクライ状態
zh-CN: 正常订阅
en-US: Normal subscription
- field: canPublish
type: 1
i18n:
zh-CN: 发布状态
zh-CN: 正常推送
en-US: Normal publish
ja-JP: メッセージを転送できる
- field: canReceive
type: 1
i18n:
zh-CN: 接收数据
en-US: Receive data
ja-JP: 受信されたデータ
- field: canUnSubscribe
type: 1
i18n:
zh-CN: 取消订阅状态
en-US: Normal unsubscribe
ja-JP: サブスクライブ解除の状態
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: mqtt
# Specific collection configuration when protocol is telnet protocol
mqtt:
clientId: ^_^clientId^_^
username: ^_^username^_^
password: ^_^password^_^
# telnet host
host: ^_^host^_^
# port
port: ^_^port^_^
protocol: ^_^protocol^_^
# timeout
timeout: ^_^timeout^_^
keepalive: ^_^keepalive^_^
tlsVersion: ^_^tlsVersion^_^
insecureSkipVerify: ^_^insecureSkipVerify^_^
caCert: ^_^caCert^_^
enableMutualAuth: ^_^enableMutualAuth^_^
clientCert: ^_^clientCert^_^
clientKey: ^_^clientKey^_^
# email
topic: ^_^topic^_^
# clientId
clientId: ^_^clientId^_^
# protocolVersion
protocolVersion: ^_^protocolVersion^_^
# username
username: ^_^username^_^
# password
password: ^_^password^_^
# testMessage
testMessage: ^_^testMessage^_^
@@ -21,13 +21,11 @@ app: mysql
name:
zh-CN: Mysql数据库
en-US: Mysql DB
ja-JP: Mysql データベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 Mysql 数据库的通用性能指标(系统信息、性能状态、Innodb、缓存、事物、用户线程、慢SQL等)进行采集监控,支持版本为 Mysql5+。<br>您可以点击“<i>新建 Mysql 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of Mysql database (system information, performance status, Innodb, cache, things, user threads, slow SQL, etc.). Supported version is Mysql5+. <br>You can click "<i>New Mysql Database</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 Mysql 數據庫的通用性能指標(系統信息、性能狀態、Innodb、緩存、事物、用戶線程、慢SQL等)進行采集監控,支持版本爲 Mysql5+。<br>您可以點擊“<i>新建 Mysql 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: HertzBeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC プロトコル</a> を介して Mysql データベースの一般的なパフォーマンスのメトリクス(システム情報、パフォーマンスステータス、Innodb、キャッシュ、オブジェクト、ユーザースレッド、遅いSQLなど)収集監視を行う,サポートバージョンは Mysql5+。<br>クリックすることができます“<i>新規 Mysql データベース</i>”および構成,または“<i>その他の操作</i>”,既存の構成のインポートすることができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mysql
en-US: https://hertzbeat.apache.org/docs/help/mysql
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -82,7 +77,6 @@ params:
name:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
# type-param field type(most mapping the html input tag)
type: text
# required-true or false
@@ -93,7 +87,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input tag)
type: text
# when type is text, use limit to limit string length
@@ -106,7 +99,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -117,7 +109,6 @@ params:
name:
zh-CN: URL
en-US: URL
ja-JP: URL
# type-param field type(most mapping the html input tag)
type: text
# required-true or false
@@ -128,7 +119,6 @@ params:
name:
zh-CN: 是否启用SSH隧道
en-US: Enable SSH Tunnel
ja-JP: SSHトンネルを有効にするかどうか
type: boolean
required: true
hide: true
@@ -136,7 +126,6 @@ params:
name:
zh-CN: SSH Host
en-US: SSH Host
ja-JP: SSHホスト
type: text
required: false
placeholder: 'When Enable SSH Tunnel'
@@ -145,7 +134,6 @@ params:
name:
zh-CN: SSH端口
en-US: SSH Port
ja-JP: SSHポート
type: number
range: '[0,65535]'
required: false
@@ -156,7 +144,6 @@ params:
name:
zh-CN: SSH超时时间(ms)
en-US: SSH Timeout(ms)
ja-JP: SSHタイムアウト(ms)
type: number
required: false
range: '[400,200000]'
@@ -166,7 +153,6 @@ params:
name:
zh-CN: SSH用户名
en-US: SSH Username
ja-JP: SSHユーザー名
type: text
required: false
placeholder: 'When Enable SSH tunnel'
@@ -175,7 +161,6 @@ params:
name:
zh-CN: SSH密码
en-US: SSH Password
ja-JP: SSHパスワード
type: password
required: false
hide: true
@@ -183,7 +168,6 @@ params:
name:
zh-CN: 是否共享SSH连接
en-US: Share SSH Connection
ja-JP: SSH接続を共有するかどうか
type: boolean
required: true
defaultValue: true
@@ -192,7 +176,6 @@ params:
name:
zh-CN: SSH私钥
en-US: SSH PrivateKey
ja-JP: SSH秘密鍵
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
required: false
@@ -201,7 +184,6 @@ params:
name:
zh-CN: SSH密钥短语
en-US: SSH PrivateKey PassPhrase
ja-JP: SSH秘密鍵フレーズ
type: password
required: false
hide: true
@@ -214,9 +196,8 @@ metrics:
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
i18n:
zh-CN: 基础信息
zh-CN: 基础 信息
en-US: Basic Info
ja-JP: 基礎情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -225,38 +206,32 @@ metrics:
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: port
type: 1
i18n:
zh-CN: 端口
en-US: Port
ja-JP: ポート
- field: datadir
type: 1
i18n:
zh-CN: 存储目录
en-US: Data Directory
ja-JP: データディレクトリ
en-US: DataDir
- field: max_connections
type: 0
i18n:
zh-CN: 最大连接数
en-US: Max Connections
ja-JP: 最大接続数
- field: thread_cache_size
type: 0
i18n:
zh-CN: 连接池大小
en-US: Thread Cache Size
ja-JP: 接続プールのサイズ
- field: innodb_buffer_pool_size
type: 0
unit: KB
i18n:
zh-CN: InnoDB缓冲池的大小
en-US: Innodb Buffer Pool Size
ja-JP: InnoDBバッファプールのサイズ
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- version
@@ -319,9 +294,8 @@ metrics:
priority: 1
# collect metrics content
i18n:
zh-CN: 缓存信息
zh-CN: 缓存 信息
en-US: Cache Info
ja-JP: キャッシュ情報
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: query_cache_hit_rate
@@ -330,32 +304,27 @@ metrics:
i18n:
zh-CN: 缓存命中率
en-US: Query Cache Hit Rate
ja-JP: キャッシュ命中率
- field: cache_hits
type: 0
i18n:
zh-CN: 缓存命中数
en-US: Cache Hits
ja-JP: キャッシュ命中数
- field: cache_inserts
type: 0
i18n:
zh-CN: 缓存插入数
en-US: Cache Inserts
ja-JP: キャッシュ挿入数
- field: cache_free_blocks
type: 0
i18n:
zh-CN: 缓存空闲块数量
en-US: Cache Free Blocks
ja-JP: キャッシュの空きブロック数
- field: cache_free_memory
type: 0
unit: KB
i18n:
zh-CN: 空闲缓存大小
en-US: Cache Free Memory
ja-JP: キャッシュの利用可能メモリ
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- Qcache_hits
@@ -378,6 +347,7 @@ metrics:
# the config content when protocol is jdbc
jdbc:
# jdbc host
# jdbchost
host: ^_^host^_^
# port
port: ^_^port^_^
@@ -410,22 +380,19 @@ metrics:
- name: performance
priority: 2
i18n:
zh-CN: 性能信息
zh-CN: 性能 信息
en-US: Performance Info
ja-JP: パフォーマンス情報
fields:
- field: questions
type: 0
i18n:
zh-CN: 查询总数
en-US: Questions
ja-JP: 合計クエリ数
- field: qps
type: 0
i18n:
zh-CN: 每秒处理查询数
en-US: Queries Per Second
ja-JP: クエリーの処理数/秒
aliasFields:
- uptime
- questions
@@ -457,9 +424,8 @@ metrics:
- name: innodb
priority: 3
i18n:
zh-CN: Innodb信息
zh-CN: Innodb 信息
en-US: Innodb Info
ja-JP: Innodb情報
fields:
- field: innodb_data_reads
type: 0
@@ -467,35 +433,30 @@ metrics:
i18n:
zh-CN: 磁盘读取次数
en-US: Innodb Data Reads
ja-JP: ディスク読み取り回数
- field: innodb_data_writes
type: 0
unit: Times
i18n:
zh-CN: 磁盘写入次数
en-US: Innodb Data Writes
ja-JP: ディスクへの書き込み回数
- field: innodb_data_read
type: 0
unit: KB
i18n:
zh-CN: 磁盘读取数据量
en-US: Innodb Data Read
ja-JP: Innodb読み取りデータ量(KB
- field: innodb_data_written
type: 0
unit: KB
i18n:
zh-CN: 磁盘写入数据量
en-US: Innodb Data Written
ja-JP: Innodb書き込みデータ量(KB
- field: innodb_buffer_hit_rate
type: 0
unit: '%'
i18n:
zh-CN: Innodb 缓存命中数
en-US: Innodb Buffer Hit Rate
ja-JP: Innodbバッファーキャッシュ命中率
aliasFields:
- Innodb_data_reads
- Innodb_data_writes
@@ -539,9 +500,8 @@ metrics:
- name: status
priority: 4
i18n:
zh-CN: 状态信息
zh-CN: 状态 信息
en-US: Status Info
ja-JP: 状態情報
fields:
- field: uptime
type: 0
@@ -549,73 +509,61 @@ metrics:
i18n:
zh-CN: 运行时间
en-US: Uptime
ja-JP: 実行時間
- field: com_select
type: 0
i18n:
zh-CN: 查询次数
en-US: Com Select
ja-JP: セレクト回数
- field: com_insert
type: 0
i18n:
zh-CN: 插入次数
en-US: Com Insert
ja-JP: 挿入回数
- field: com_update
type: 0
i18n:
zh-CN: 更新次数
en-US: Com Update
ja-JP: 更新回数
- field: com_delete
type: 0
i18n:
zh-CN: 删除次数
en-US: Com Delete
ja-JP: 削除回数
- field: com_commit
type: 0
i18n:
zh-CN: 事务提交次数
en-US: Com Commit
ja-JP: トランザクションのコミット回数
- field: com_rollback
type: 0
i18n:
zh-CN: 事务回滚次数
en-US: Com Rollback
ja-JP: トランザクションのロールバック回数
- field: threads_created
type: 0
i18n:
zh-CN: 线程创建数
en-US: Threads Created
ja-JP: スレッド作成数
- field: threads_connected
type: 0
i18n:
zh-CN: 连接线程数
en-US: Threads Connected
ja-JP: 接続スレッド数
- field: threads_cached
type: 0
i18n:
zh-CN: 缓存线程数
en-US: Threads Cached
ja-JP: キャッシュされたスレッド数
- field: threads_running
type: 0
i18n:
zh-CN: 活动线程数
en-US: Threads Running
ja-JP: アクティブなスレッド数
- field: qps
type: 0
i18n:
zh-CN: 每秒处理查询数
en-US: Com Insert
ja-JP: クエリーの処理数/秒
aliasFields:
- uptime
- com_select
@@ -657,82 +605,69 @@ metrics:
- name: handler
priority: 5
i18n:
zh-CN: 处理器信息
zh-CN: 处理器 信息
en-US: Handler Info
ja-JP: ハンドラ情報
fields:
- field: handler_commit
type: 0
i18n:
zh-CN: 处理的事务提交数
en-US: Handler Commit
ja-JP: ハンドラのコミット操作数
- field: handler_delete
type: 0
i18n:
zh-CN: 处理的删除操作数
en-US: Handler Delete
ja-JP: ハンドラの削除操作数
- field: handler_write
type: 0
i18n:
zh-CN: 处理的写入操作数
en-US: Handler Write
ja-JP: ハンドラの書き込み操作数
- field: handler_update
type: 0
i18n:
zh-CN: 处理的更新操作数
en-US: Handler Update
ja-JP: ハンドラの更新操作数
- field: handler_discover
type: 0
i18n:
zh-CN: 处理的发现操作数
en-US: Handler Discover
ja-JP: ハンドラのディスカバー操作数
- field: handler_prepare
type: 0
i18n:
zh-CN: 处理的准备操作数
en-US: Handler Prepare
ja-JP: ハンドラの準備操作数
- field: handler_read_first
type: 0
i18n:
zh-CN: 读取首行操作数
en-US: Handler Read First
ja-JP: ハンドラの最初の行を読み取り操作数
- field: handler_read_rnd
type: 0
i18n:
zh-CN: 随机读取操作数
en-US: Handler Read RND
ja-JP: ハンドラのランダム読み取り操作数
- field: handler_read_next
type: 0
i18n:
zh-CN: 读取下一行操作数
en-US: Handler Read Next
ja-JP: ハンドラの次の行を読み取る操作数
- field: handler_read_rnd_next
type: 0
i18n:
zh-CN: 随机读取下一行操作数
en-US: Handler Read RND Next
ja-JP: ハンドラの次の行をランダムに読み取る操作数
- field: handler_read_key
type: 0
i18n:
zh-CN: 按索引键读取操作数
en-US: Handler Read Key
ja-JP: ハンドラのインデックスを使用して読み取る操作数
- field: handler_external_lock
type: 0
i18n:
zh-CN: 外部锁定操作数
en-US: Handler External Key
ja-JP: ハンドラの外部のキーを使用して読み取る操作数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -759,34 +694,29 @@ metrics:
- name: connection
priority: 6
i18n:
zh-CN: 连接信息
zh-CN: 连接 信息
en-US: Connection Info
ja-JP: 接続情報
fields:
- field: connections
type: 0
i18n:
zh-CN: 连接的总次数
en-US: Connections
ja-JP: 接続の合計回数
- field: max_used_connections
type: 0
i18n:
zh-CN: 历史最大连接数
en-US: Max Used Connections
ja-JP: 過去最大接続数
- field: aborted_connects
type: 0
i18n:
zh-CN: 失败连接数
en-US: Aborted Connects
ja-JP: 失敗した接続数
- field: aborted_clients
type: 0
i18n:
zh-CN: 客户端中断数
en-US: Aborted Clients
ja-JP: クライエントの割り込み数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -813,34 +743,29 @@ metrics:
- name: thread
priority: 7
i18n:
zh-CN: 线程信息
zh-CN: 线程 信息
en-US: Thread Info
ja-JP: スレッド情報
fields:
- field: threads_created
type: 0
i18n:
zh-CN: 创建线程数
en-US: Threads Created
ja-JP: スレッド作成数
- field: threads_connected
type: 0
i18n:
zh-CN: 连接线程数
en-US: Threads Connected
ja-JP: 接続スレッド数
- field: threads_cached
type: 0
i18n:
zh-CN: 缓存线程数
en-US: CThreads Cached
ja-JP: キャッシュスレッド数
- field: threads_running
type: 0
i18n:
zh-CN: 运行线程数
en-US: Threads Running
ja-JP: 活動中のスレッド数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -867,28 +792,24 @@ metrics:
- name: tmp
priority: 8
i18n:
zh-CN: 临时表信息
zh-CN: 临时表 信息
en-US: TMP Info
ja-JP: 一時テーブル情報
fields:
- field: created_tmp_tables
type: 0
i18n:
zh-CN: 创建的临时表数量
en-US: Created TMP Tables
ja-JP: 一時テーブルの作成数
- field: created_tmp_disk_tables
type: 0
i18n:
zh-CN: 创建的临时磁盘表数量
en-US: Created TMP Disk Tables
ja-JP: 一時ディスクテーブルの作成数
- field: created_tmp_files
type: 0
i18n:
zh-CN: 创建的临时文件数量
en-US: Created TMP Files
ja-JP: 一時ファイルの作成数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -915,40 +836,34 @@ metrics:
- name: select_type
priority: 9
i18n:
zh-CN: 查询类型信息
zh-CN: 查询类型 信息
en-US: Select Type Info
ja-JP: 検索タイプ情報
fields:
- field: select_full_join
type: 0
i18n:
zh-CN: 全表连接数
en-US: Select Full Join
ja-JP: 全件結合数
- field: select_full_range_join
type: 0
i18n:
zh-CN: 带范围的全表连接数
en-US: Select Full Range Join
ja-JP: 範囲検索付きの全件結合数
- field: select_range
type: 0
i18n:
zh-CN: 索引范围查询数
en-US: Select Range
ja-JP: 範囲検索数
- field: select_range_check
type: 0
i18n:
zh-CN: 索引范围内二次检查数
en-US: Select Range Check
ja-JP: 範囲内の二次検索数
- field: select_scan
type: 0
i18n:
zh-CN: 全表扫描查询数
en-US: Select Scan
ja-JP: テーブル全体をスキャンする回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -975,34 +890,29 @@ metrics:
- name: sort
priority: 10
i18n:
zh-CN: 排序信息
zh-CN: 排序 信息
en-US: Sort Info
ja-JP: ソート情報
fields:
- field: sort_rows
type: 0
i18n:
zh-CN: 排序总行数
en-US: Sort Rows
ja-JP: ソートの合計行数
- field: sort_range
type: 0
i18n:
zh-CN: 范围条件排序次数
en-US: Sort Range
ja-JP: 範囲付きのソート回数
- field: sort_merge_passes
type: 0
i18n:
zh-CN: 合并排序段次数
en-US: Sort Merge Passes
ja-JP: マージソート回数
- field: sort_scan
type: 0
i18n:
zh-CN: 全表扫描排序次数
en-US: Sort Scan
ja-JP: テーブル全体をスキャンしてソートする回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -1029,22 +939,19 @@ metrics:
- name: table_lock
priority: 11
i18n:
zh-CN: 表级锁信息
zh-CN: 表级锁 信息
en-US: Table Lock Info
ja-JP: テーブルロック情報
fields:
- field: table_locks_immediate
type: 0
i18n:
zh-CN: 立即获得表锁次数
en-US: Table Locks Immediate
ja-JP: テーブルロックの即時取得回数
- field: table_locks_waited
type: 0
i18n:
zh-CN: 须等待获取表锁次数
en-US: Table Locks Waited
ja-JP: テーブルロック取得待ち回数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -1071,9 +978,8 @@ metrics:
- name: process_state
priority: 12
i18n:
zh-CN: 进程状态信息
zh-CN: 进程状态 信息
en-US: Process State Info
ja-JP: プロセス状態情報
fields:
- field: state
type: 1
@@ -1081,13 +987,11 @@ metrics:
i18n:
zh-CN: 进程状态
en-US: State
ja-JP: プロセス状態
- field: num
type: 0
i18n:
zh-CN: 该状态进程数量
en-US: Num
ja-JP: プロセス総数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -1114,9 +1018,8 @@ metrics:
- name: slow_sql
priority: 13
i18n:
zh-CN: 慢查询信息
zh-CN: 慢查询 信息
en-US: Slow Sql Info
ja-JP: スローSQL情報
fields:
- field: id
type: 1
@@ -1124,31 +1027,26 @@ metrics:
i18n:
zh-CN: ID
en-US: ID
ja-JP: ID
- field: sql_text
type: 1
i18n:
zh-CN: SQL 文本
en-US: SQL Text
ja-JP: SQL文のテキスト
- field: start_time
type: 1
i18n:
zh-CN: 开始时间
en-US: Start Time
ja-JP: 開始時間
- field: db
type: 1
i18n:
zh-CN: 数据库
en-US: Database
ja-JP: データベース
- field: query_time
type: 3
i18n:
zh-CN: 查询时间
en-US: Query Time
ja-JP: クエリー時間
aliasFields:
- sql_text
- start_time
@@ -21,13 +21,11 @@ app: nacos
name:
zh-CN: Nacos分布式
en-US: Nacos Server
ja-JP: Nacosサーバー
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 通过调用 <a href="https://nacos.io/zh-cn/docs/monitor-guide.html">Nacos Metrics 接口</a> 对 Nacos 注册配置中心服务的通用指标进行采集监控。<br>注意⚠️:需要您提前 <a href="https://nacos.io/zh-cn/docs/monitor-guide.html">开启暴露 Nacos Metrics 数据</a>,支持 Nacos 版本0.8+,您可以点击 “<i>新建 Nacos</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: Hertzbeat monitors metrics of the Nacos Server by calling the <a href="https://nacos.io/en-us/docs/monitor-guide.html">Nacos Metrics Api</a>. <br>Note⚠️:You need to <a href="https://nacos.io/en-us/docs/monitor-guide.html">enable exposure of Nacos Metrics data</a> in advance, support Nacos version 0.8+ , you can click "<i>New Nacos</i>" and configure it, or select "<i>More Action</i>" to import the existing configuration.
zh-TW: Hertzbeat 通過調用 <a href="https://nacos.io/zh-cn/docs/monitor-guide.html">Nacos Metrics 接口</a> 對 Nacos 注冊配置中心服務的通用指標進行采集監控。<br>注意⚠️:需要您提前 <a href="https://nacos.io/zh-cn/docs/monitor-guide.html">開啓暴露 Nacos Metrics 數據</a>,支持 Nacos 版本0.8+,您可以點擊 “<i>新建 Nacos</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeatは、<a href="https://nacos.io/zh-cn/docs/monitor-guide.html">Nacos Metricsインタフェース</a>は、Nacosレジストレーション構成センターサービスの共通指標を収集監視します。<br/>注意⚠️:事前に<a href="https://nacos.io/zh-cn/docs/monitor-guide.html「>Nacos Metricsデータの暴露をオンにし、Nacosバージョン0.8+をサポートします。「<i>新規Nacos</i>」をクリックして構成するか、「<i>その他の操作</i>」を選択して既存の構成をインポートできます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/nacos
en-US: https://hertzbeat.apache.org/docs/help/nacos
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 服务器Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: Nacos服务端口
en-US: Nacos Port
ja-JP: Nacosポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -66,7 +62,6 @@ metrics:
i18n:
zh-CN: CPU 使用率
en-US: CPU Usage
ja-JP: CPU 使用率
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -77,7 +72,6 @@ metrics:
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
aliasFields:
- value
calculates:
@@ -100,7 +94,6 @@ metrics:
i18n:
zh-CN: JVM 内存使用
en-US: JVM Memory Used
ja-JP: Java仮想マシンのメモリ使用量
priority: 1
fields:
- field: area
@@ -108,21 +101,18 @@ metrics:
i18n:
zh-CN: 区域
en-US: Area
ja-JP: エリア
- field: id
type: 1
label: true
i18n:
zh-CN: ID
en-US: ID
ja-JP: ID
- field: value
type: 0
unit: MB
i18n:
zh-CN: 大小
en-US: Size
ja-JP: サイズ
units:
- value=B->MB
# The protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
@@ -143,7 +133,6 @@ metrics:
i18n:
zh-CN: Nacos 详情
en-US: Nacos Monitor
ja-JP: Nacos 詳細情報
priority: 2
fields:
- field: module
@@ -151,19 +140,16 @@ metrics:
i18n:
zh-CN: 模块
en-US: Module
ja-JP: モジュール
- field: name
type: 1
i18n:
zh-CN: 指标名称
en-US: Metric Name
ja-JP: メトリクス名
- field: value
type: 0
i18n:
zh-CN: 大小
en-US: Value
ja-JP: サイズ
# The protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# The config content when protocol is http
@@ -21,7 +21,6 @@ app: nacos_sd
name:
zh-CN: Nacos 服务发现
en-US: Nacos Service Discovery
ja-JP: Nacos サービスディスカバリー
# Input params define for app api(render web ui by the definition)
params:
# field-param field key
@@ -30,7 +29,6 @@ params:
name:
zh-CN: Nacos 服务发现 Host
en-US: Nacos Service Discovery Host
ja-JP: ホスト
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -39,16 +37,32 @@ params:
name:
zh-CN: Nacos 服务发现 Port
en-US: Nacos Service Discovery Port
ja-JP: ポート
type: number
required: true
# - field: __nacos_namespace__
# name:
# zh-CN: Nacos 命名空间
# en-US: Nacos Namespace
# type: text
# required: false
# - field: __nacos_username__
# name:
# zh-CN: Nacos 用户名
# en-US: Nacos Username
# type: text
# required: false
# - field: __nacos_password__
# name:
# zh-CN: Nacos 密码
# en-US: Nacos Password
# type: password
# required: false
metrics:
- name: target
i18n:
zh-CN: 监控目标
en-US: Monitor Target
ja-JP: 監視対象
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -60,16 +74,17 @@ metrics:
i18n:
zh-CN: Host
en-US: Host
ja-JP: ホスト
- field: port
type: 1
i18n:
zh-CN: Port
en-US: Port
ja-JP: ポート
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: nacos_sd
# the config content when protocol is nacos_sd
nacos_sd:
host: ^_^__nacos_sd_host__^_^
port: ^_^__nacos_sd_port__^_^
port: ^_^__nacos_sd_port__^_^
# namespace: ^_^__nacos_namespace__^_^
# username: ^_^__nacos_username__^_^
# password: ^_^__nacos_password__^_^
@@ -21,13 +21,11 @@ app: nebula_graph
name:
zh-CN: NebulaGraph
en-US: NebulaGraph
ja-JP: NebulaGraph
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 将调用NebulaGraph提供的 HTTP API 监控接口,对nebulaGraph及存储数据的rocksdb的指标进行监测。
en-US: Hertzbeat will call the HTTP API monitoring interface provided by NebulaGraph to monitor the indicators of NebulaGraph and the Rocksdb that stores data.
zh-TW: Hertzbeat將調用NebulaGraph提供的HTTP API監控介面,對nebulaGraph及存儲數據的rocksdb的名額進行監測。
ja-JP: Hertzbeatは、NebulaGraphが提供されたHTTP APIを呼び出してnebulaGraphとrocksdbのメトリクスを監視します。
# The description and help of this monitoring type
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/nebulaGraph
@@ -40,7 +38,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -51,7 +48,6 @@ params:
name:
zh-CN: graph端口
en-US: graphPort
ja-JP: graphポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: graph指标统计的时间范围(s)
en-US: graph indicator statistics time range (s)
ja-JP: graph統計情報の時間範囲(s)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -79,7 +74,6 @@ params:
name:
zh-CN: storage端口
en-US: storagePort
ja-JP: ストレージポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -94,7 +88,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -112,7 +105,6 @@ metrics:
i18n:
zh-CN: nebulaGraph 统计信息
en-US: nebulaGraph stats
ja-JP: nebulaGraph統計情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -123,337 +115,282 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
- field: num_queries_hit_memory_watermark_rate
type: 0
i18n:
zh-CN: 达到内存水位线的语句的数量(rate)
en-US: num_queries_hit_memory_watermark.rate
ja-JP: メモリーウォーターマークに達したクエリ数(rate)
- field: num_queries_hit_memory_watermark_sum
type: 0
i18n:
zh-CN: 达到内存水位线的语句的数量(sum)
en-US: num_queries_hit_memory_watermark.sum
ja-JP: メモリーウォーターマークに達したクエリ数(sum)
- field: num_reclaimed_expired_sessions_rate
type: 0
i18n:
zh-CN: 服务端主动回收的过期的会话数量(rate)
en-US: num_reclaimed_expired_sessions.rate
ja-JP: 期限切れセッションのリサイクル数(rate)
- field: num_reclaimed_expired_sessions_sum
type: 0
i18n:
zh-CN: 服务端主动回收的过期的会话数量(sum)
en-US: num_reclaimed_expired_sessions.sum
ja-JP: 期限切れセッションのリサイクル数(sum)
- field: slow_query_latency_us_avg
type: 0
i18n:
zh-CN: 慢查询延迟时间(avg)
en-US: slow_query_latency_us.avg
ja-JP: スロークエリーの平均レイテンシー
- field: slow_query_latency_us_p75
type: 0
i18n:
zh-CN: 慢查询延迟时间(p75)
en-US: slow_query_latency_us.p75
ja-JP: スロークエリーのレイテンシー(p75)
- field: slow_query_latency_us_p95
type: 0
i18n:
zh-CN: 慢查询延迟时间(p95)
en-US: slow_query_latency_us.p95
ja-JP: スロークエリーのレイテンシー(p95)
- field: slow_query_latency_us_p99
type: 0
i18n:
zh-CN: 慢查询延迟时间(p99)
en-US: slow_query_latency_us.p99
ja-JP: スロークエリーのレイテンシー(p99)
- field: slow_query_latency_us_p999
type: 0
i18n:
zh-CN: 慢查询延迟时间(p999)
en-US: slow_query_latency_us.p999
ja-JP: スロークエリーのレイテンシー(p999)
- field: query_latency_us_avg
type: 0
i18n:
zh-CN: 查询延迟时间(avg)
en-US: query_latency_us.avg
ja-JP: クエリーの平均レイテンシー
- field: query_latency_us_p75
type: 0
i18n:
zh-CN: 查询延迟时间(p75)
en-US: query_latency_us.p75
ja-JP: クエリーのレイテンシー(p75)
- field: query_latency_us_p95
type: 0
i18n:
zh-CN: 查询延迟时间(p95)
en-US: query_latency_us.p95
ja-JP: クエリーのレイテンシー(p95)
- field: query_latency_us_p99
type: 0
i18n:
zh-CN: 查询延迟时间(p99)
en-US: query_latency_us.p99
ja-JP: クエリーのレイテンシー(p99)
- field: query_latency_us_p999
type: 0
i18n:
zh-CN: 查询延迟时间(p999)
en-US: query_latency_us_p999
ja-JP: クエリーのレイテンシー(p999)
- field: num_auth_failed_sessions_bad_username_password_rate
type: 0
i18n:
zh-CN: 因用户名密码错误导验证失败的会话数量(rate)
en-US: num_auth_failed_sessions_bad_username_password.rate
ja-JP: ユーザー名とパスワードのエラーにより認証に失敗したセッション数(rate)
- field: num_auth_failed_sessions_bad_username_password_sum
type: 0
i18n:
zh-CN: 因用户名密码错误导验证失败的会话数量(sum)
en-US: num_auth_failed_sessions_bad_username_password.sum
ja-JP: ユーザー名とパスワードのエラーにより認証に失敗したセッション数(sum)
- field: num_queries_rate
type: 0
i18n:
zh-CN: 查询次数(rate)
en-US: num_queries.rate
ja-JP: クエリ回数(rate)
- field: num_queries_sum
type: 0
i18n:
zh-CN: 查询次数(sum)
en-US: num_queries.sum
ja-JP: クエリ回数(sum)
- field: num_sort_executors_rate
type: 0
i18n:
zh-CN: 排序(Sort)算子执行时间(rate)
en-US: num_sort_executors.rate
ja-JP: ソート実行時間(rate)
- field: num_sort_executors_sum
type: 0
i18n:
zh-CN: 排序(Sort)算子执行时间(sum)
en-US: num_sort_executors.sum
ja-JP: ソート実行時間(sum)
- field: num_rpc_sent_to_storaged_failed_rate
type: 0
i18n:
zh-CN: Graphd 服务发给 Storaged 服务的 RPC 请求失败的数量(rate)
en-US: num_rpc_sent_to_storaged_failed.rate
ja-JP: GraphdサービスからStoragedサービスへのRPCリクエスト失敗数(rate)
- field: num_rpc_sent_to_storaged_failed_sum
type: 0
i18n:
zh-CN: Graphd 服务发给 Storaged 服务的 RPC 请求失败的数量(sum)
en-US: num_rpc_sent_to_storaged_failed.sum
ja-JP: GraphdサービスからStoragedサービスへのRPCリクエスト失敗数(sum)
- field: num_auth_failed_sessions_rate
type: 0
i18n:
zh-CN: 登录验证失败的会话数量(rate)
en-US: num_auth_failed_sessions.rate
ja-JP: 権限認証に失敗したセッション数(rate)
- field: num_auth_failed_sessions_sum
type: 0
i18n:
zh-CN: 登录验证失败的会话数量(sum)
en-US: num_auth_failed_sessions.sum
ja-JP: 権限認証に失敗したセッション数(sum)
- field: num_query_errors_rate
type: 0
i18n:
zh-CN: 查询报错语句数量(rate)
en-US: num_query_errors_rate
ja-JP: クエリエラー数(rate)
- field: num_query_errors_sum
type: 0
i18n:
zh-CN: 查询报错语句数量(sum)
en-US: num_query_errors.sum
ja-JP: クエリエラー数(sum)
- field: num_killed_queries_rate
type: 0
i18n:
zh-CN: 被终止的查询数量(rate)
en-US: num_killed_queries.rate
ja-JP: 終了したクエリ数(rate)
- field: num_killed_queries_sum
type: 0
i18n:
zh-CN: 被终止的查询数量(sum)
en-US: num_killed_queries.sum
ja-JP: 終了したクエリ数(sum)
- field: num_query_errors_leader_changes_rate
type: 0
i18n:
zh-CN: 因查询错误而导致的 Leader 变更的次数(rate)
en-US: num_query_errors_leader_changes.rate
ja-JP: クエリーエラーによるリーダーの変更数(rate)
- field: num_query_errors_leader_changes_sum
type: 0
i18n:
zh-CN: 因查询错误而导致的 Leader 变更的次数(sum)
en-US: num_query_errors_leader_changes.sum
ja-JP: クエリーエラーによるリーダーの変更数(sum)
- field: num_rpc_sent_to_metad_rate
type: 0
i18n:
zh-CN: Graphd 服务发给 Metad 服务的 RPC 请求数量(rate)
en-US: num_rpc_sent_to_metad.rate
ja-JP: GraphdサービスがMetadサービスへのRPCリクエスト数(rate)
- field: num_rpc_sent_to_metad_sum
type: 0
i18n:
zh-CN: Graphd 服务发给 Metad 服务的 RPC 请求数量(sum)
en-US: num_rpc_sent_to_metad.sum
ja-JP: GraphdサービスがMetadサービスへのRPCリクエスト数(sum)
- field: num_slow_queries_rate
type: 0
i18n:
zh-CN: 慢查询次数(rate)
en-US: num_slow_queries.rate
ja-JP: スロークエリ回数(rate)
- field: num_slow_queries_sum
type: 0
i18n:
zh-CN: 慢查询次数(sum)
en-US: num_slow_queries.sum
ja-JP: スロークエリ回数(sum)
- field: num_active_sessions_sum
type: 0
i18n:
zh-CN: 活跃的会话数的变化数(rate)
en-US: num_active_sessions.rate
ja-JP: アクティブなセッション数(rate)
zh-CN: 活跃的会话数的变化数(sum)
en-US: num_active_sessions.sum
- field: num_active_queries_sum
type: 0
i18n:
zh-CN: 活跃的查询语句数的变化数(sum)
en-US: num_active_queries.sum
ja-JP: アクティブなセッション数(sum)
- field: num_sentences_rate
type: 0
i18n:
zh-CN: Graphd 服务接收的语句数(rate)
en-US: num_sentences.rate
ja-JP: 文数(rate)
- field: num_sentences_sum
type: 0
i18n:
zh-CN: Graphd 服务接收的语句数(sum)
en-US: num_sentences.sum
ja-JP: 文数(sum)
- field: num_aggregate_executors_rate
type: 0
i18n:
zh-CN: 聚合(Aggregate)算子执行时间(rate)
en-US: num_aggregate_executors.rate
ja-JP: アグリゲート実行時間(rate)
- field: num_aggregate_executors_sum
type: 0
i18n:
zh-CN: 聚合(Aggregate)算子执行时间(sum)
en-US: num_aggregate_executors.sum
ja-JP: アグリゲート実行時間(sum)
- field: optimizer_latency_us_avg
type: 0
i18n:
zh-CN: 优化器阶段延迟时间(avg)
en-US: optimizer_latency_us.avg
ja-JP: オプティマイザの平均レイテンシー
- field: optimizer_latency_us_p75
type: 0
i18n:
zh-CN: 优化器阶段延迟时间(p75)
en-US: optimizer_latency_us.p75
ja-JP: オプティマイザのレイテンシー(p75)
- field: optimizer_latency_us_p95
type: 0
i18n:
zh-CN: 优化器阶段延迟时间(p95)
en-US: optimizer_latency_us.p95
ja-JP: オプティマイザのレイテンシー(p95)
- field: optimizer_latency_us_p99
type: 0
i18n:
zh-CN: 优化器阶段延迟时间(p99)
en-US: optimizer_latency_us.p99
ja-JP: オプティマイザのレイテンシー(p99)
- field: optimizer_latency_us_p999
type: 0
i18n:
zh-CN: 优化器阶段延迟时间(p999)
en-US: optimizer_latency_us.p999
ja-JP: オプティマイザのレイテンシー(p999)
- field: num_rpc_sent_to_metad_failed_rate
type: 0
i18n:
zh-CN: Graphd 服务发给 Metad 的 RPC 请求失败的数量(rate)
en-US: num_rpc_sent_to_metad_failed.rate
ja-JP: GraphdサービスがMetadサービスへのRPCリクエスト失敗数(rate)
- field: num_rpc_sent_to_metad_failed_sum
type: 0
i18n:
zh-CN: Graphd 服务发给 Metad 的 RPC 请求失败的数量(sum)
en-US: num_rpc_sent_to_metad_failed.sum
ja-JP: GraphdサービスがMetadサービスへのRPCリクエスト失敗数(sum)
- field: num_indexscan_executors_rate
type: 0
i18n:
zh-CN: 索引扫描(IndexScan)算子执行时间(rate)
en-US: num_indexscan_executors.rate
ja-JP: 索引スキャン実行時間(rate)
- field: num_indexscan_executors_sum
type: 0
i18n:
zh-CN: 索引扫描(IndexScan)算子执行时间(sum)
en-US: num_indexscan_executors.sum
ja-JP: 索引スキャン実行時間(sum)
- field: num_opened_sessions_rate
type: 0
i18n:
zh-CN: 服务端建立过的会话数量(rate)
en-US: num_opened_sessions.rate
ja-JP: 開かれたセッション数(rate)
- field: num_opened_sessions_sum
type: 0
i18n:
zh-CN: 服务端建立过的会话数量(sum)
en-US: num_opened_sessions.sum
ja-JP: 開かれたセッション数(sum)
- field: num_auth_failed_sessions_out_of_max_allowed_rate
type: 0
i18n:
zh-CN: 因为超过FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONS参数导致的验证登录失败的会话数量(rate)
zh-CN: 因为超过FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONS参数导致的验证登录失败的会话数量(rate)
en-US: num_auth_failed_sessions_out_of_max_allowed.rate
ja-JP: FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONSが超過したため、認証ログインに失敗したセッション数(rate)
- field: num_auth_failed_sessions_out_of_max_allowed_sum
type: 0
i18n:
zh-CN: 因为超过FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONS参数导致的验证登录失败的会话数量(sum)
zh-CN: 因为超过FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONS参数导致的验证登录失败的会话数量(sum)
en-US: num_auth_failed_sessions_out_of_max_allowed.sum
ja-JP: FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONSが超過したため、認証ログインに失敗したセッション数(sum)
- field: num_rpc_sent_to_storaged_rate
type: 0
i18n:
zh-CN: Graphd 服务发给 Storaged 服务的 RPC 请求数量(rate)
en-US: num_rpc_sent_to_storaged.rate
ja-JP: GraphdサービスがStoragedサービスへのRPCリクエスト数(rate)
- field: num_rpc_sent_to_storaged_sum
type: 0
i18n:
zh-CN: Graphd 服务发给 Storaged 服务的 RPC 请求数量(sum)
en-US: num_rpc_sent_to_storaged.sum
ja-JP: GraphdサービスがStoragedサービスへのRPCリクエスト数(sum)
# 指标别名列表,用于在查询结果中识别指标
aliasFields:
- responseTime
- num_queries_hit_memory_watermark.rate
@@ -511,7 +448,7 @@ metrics:
- num_auth_failed_sessions_out_of_max_allowed.sum
- num_rpc_sent_to_storaged.rate
- num_rpc_sent_to_storaged.sum
# mapping and conversion expressions, use thesand aliasField above to calculate metrics value# eg: cores=core1+core2, usage=usage, waitTimeallTime-runningTime
# mapping and conversion expressions, use thesand aliasField above to calculate metrics value# (可选)指标映射转换计算表达式,与上面的别名一起作用,计算出最终需要的指标值# eg: cores=core1+core2, usage=usage, waitTimeallTime-runningTime
calculates:
- responseTime=responseTime
- num_queries_hit_memory_watermark_rate=num_queries_hit_memory_watermark.rate
@@ -586,7 +523,6 @@ metrics:
i18n:
zh-CN: rocksdb 统计数据
en-US: rocksdb stats
ja-JP: rocksdb統計
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -597,7 +533,6 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
- field: rocksdb.backup.read.bytes
- field: rocksdb.backup.write.bytes
- field: rocksdb.blobdb.blob.file.bytes.read
@@ -21,13 +21,11 @@ app: nebula_graph_cluster
name:
zh-CN: NebulaGraph集群
en-US: NebulaGraph Cluster
ja-JP: NebulaGraphクラスター
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat通过查询使用NGQL或OpenCypher查询 NebulaGraph 集群的基础信息,节点信息等指标。
en-US: Hertzbeat uses NGQL or OpenCypher to query the basic information, node information and other metrics of the NebulaGraph cluster.
zh-TW: Hertzbeat透過查詢使用NGQL或OpenCypher查詢 NebulaGraph 叢集的基礎訊息,節點資訊等指標。
ja-JP: Hertzbeatは、NGQLかOpenCypherをクエリしてNebulaGraphクラスターのメトリクスを監視します。
# The description and help of this monitoring type
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/nebulagraph_cluster
@@ -40,7 +38,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -51,7 +48,6 @@ params:
name:
zh-CN: graph端口
en-US: graphPort
ja-JP: graphポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -66,7 +62,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is number, range is required
@@ -77,7 +72,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input type)
type: password
# when type is number, range is required
@@ -89,7 +83,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -107,7 +100,6 @@ metrics:
i18n:
zh-CN: 基础信息
en-US: Base info
ja-JP: 基礎情報
priority: 0
fields:
- field: responseTime
@@ -116,25 +108,21 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
- field: charset
type: 1
i18n:
zh-CN: 字符集
en-US: Charset
ja-JP: 文字セット
- field: Collation
type: 1
i18n:
zh-CN: 排序规则
en-US: collation
ja-JP: 照合
- field: metaLeader
type: 1
i18n:
zh-CN: Meta Leader
en-US: Meta Leader
ja-JP: Metaリーダー
aliasFields:
- responseTime
@@ -161,7 +149,6 @@ metrics:
i18n:
zh-CN: Session
en-US: Session
ja-JP: セッション
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -171,14 +158,13 @@ metrics:
i18n:
zh-CN: Session数量
en-US: Session
ja-JP: セッション数量
- field: running_query_count
type: 1
i18n:
zh-CN: 正在执行的查询数量
en-US: Running query
ja-JP: 実行中のクエリ数
# 指标别名列表,用于在查询结果中识别指标
aliasFields:
- session
- running_query_count
@@ -202,7 +188,6 @@ metrics:
i18n:
zh-CN: 后台任务
en-US: Jobs
ja-JP: タスク
priority: 2
fields:
- field: queue_jobs
@@ -210,13 +195,11 @@ metrics:
i18n:
zh-CN: 等待中的任务
en-US: Queue jobs
ja-JP: 待機中のタスク数
- field: running_jobs
type: 0
i18n:
zh-CN: 执行中的任务
en-US: Running jobs
ja-JP: 実行中のタスク数
aliasFields:
- queue_jobs
@@ -236,7 +219,6 @@ metrics:
i18n:
zh-CN: 节点信息
en-US: Cluster node info
ja-JP: クラスターノード情報
priority: 3
fields:
- field: total_storage_node
@@ -244,39 +226,33 @@ metrics:
i18n:
zh-CN: Storage节点
en-US: Total storage node
ja-JP: ストレージノード総数
- field: offline_storage_node
type: 0
i18n:
zh-CN: 离线Storage节点
en-US: Offline storage node
ja-JP: オフラインのストレージノード
- field: total_meta_node
type: 0
i18n:
zh-CN: Meta节点
en-US: Total meta node
ja-JP: Metaノード総数
- field: offline_meta_node
type: 0
i18n:
zh-CN: 离线Meta节点
en-US: Offline meta node
ja-JP: オフラインのMetaノード
- field: total_graph_node
type: 0
i18n:
zh-CN: Graph节点
en-US: Total graph node
ja-JP: Graphノード総数
- field: offline_graph_node
type: 0
i18n:
zh-CN: 离线Graph节点
en-US: Offline graph node
ja-JP: オフラインのGraphノード
aliasFields:
- total_storage_node
@@ -307,7 +283,6 @@ metrics:
i18n:
zh-CN: Storage节点
en-US: Storage Nodes
ja-JP: ストレージノード
priority: 4
fields:
- field: host
@@ -315,43 +290,36 @@ metrics:
i18n:
zh-CN: Host
en-US: Host
ja-JP: ホスト
- field: port
type: 0
i18n:
zh-CN: Port
en-US: Port
ja-JP: ポート
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: STATUS
ja-JP: ステータス
- field: leaderCount
type: 0
i18n:
zh-CN: Leader数量
en-US: Leader Count
ja-JP: リーダー数量
- field: leaderDistribution
type: 1
i18n:
zh-CN: Leader分布
en-US: Leader Distribution
ja-JP: リーダー分布
- field: partitionDistribution
type: 1
i18n:
zh-CN: Partition分布
en-US: Partition Distribution
ja-JP: パーティション分布
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
aliasFields:
- Host
@@ -384,7 +352,6 @@ metrics:
i18n:
zh-CN: Meta节点
en-US: Meta Nodes
ja-JP: Metaノード
priority: 5
fields:
- field: host
@@ -392,25 +359,21 @@ metrics:
i18n:
zh-CN: Host
en-US: Host
ja-JP: ホスト
- field: port
type: 0
i18n:
zh-CN: Port
en-US: Port
ja-JP: ポート
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: STATUS
ja-JP: ステータス
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
aliasFields:
- Host
@@ -437,7 +400,6 @@ metrics:
i18n:
zh-CN: Graph节点
en-US: Graph Nodes
ja-JP: Graphノード
priority: 6
fields:
- field: host
@@ -445,25 +407,21 @@ metrics:
i18n:
zh-CN: Host
en-US: Host
ja-JP: ホスト
- field: port
type: 0
i18n:
zh-CN: Port
en-US: Port
ja-JP: ポート
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: STATUS
ja-JP: ステータス
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
aliasFields:
- Host
@@ -21,13 +21,11 @@ app: netease_mailbox
name:
zh-CN: 网易邮箱监控
en-US: NetEase Mailbox
ja-JP: NetEase電子メール
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 IMAP 协议对网易邮箱的详细信息进行采集监控。<br>您可以点击“<i>新建 网易邮箱</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses IMAP protocol to collect detailed metrics of NetEase mailbox. <br>You can click "<i>New NetEase Mailbox</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 IMAP 協議對網易郵箱的詳細信息進行採集監控。<br>您可以點擊“<i>新建 网易邮箱</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: HertzBeat は IMAP プロトコルを介してNetEase電子メールの詳細情報を監視します。<br>「<i>新規 NetEase電子メール</i>」をクリックしてパラメタを設定した後、新規することができます。
zh-CN: HertzBeat 使用 IMAP 协议对网易邮箱的详细信息进行采集监控。<br>您可以点击“<i>新建 POP3</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses IMAP protocol to collect detailed metrics of NetEase mailbox. <br>You can click "<i>New POP3</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 IMAP 協議對網易郵箱的詳細信息進行採集監控。<br>您可以點擊“<i>新建 POP3</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/imap
en-US: https://hertzbeat.apache.org/docs/help/imap
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 启动SSL
en-US: SSL
ja-JP: SSL
# When the type is boolean, the frontend will display a switch for it.
type: boolean
# required-true or false
@@ -60,7 +56,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -73,7 +68,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -87,8 +81,7 @@ params:
# name-param field display i18n name
name:
zh-CN: IMAP 邮箱地址
en-US: IMAP Address
ja-JP: IMAPアドレス
en-US: Email
# type-param field type(most mapping the html input type) The type "text" belongs to a text input field.
type: text
# required-true or false
@@ -99,7 +92,6 @@ params:
name:
zh-CN: 授权码
en-US: Authorize Code
ja-JP: 認証コード
# type-param field type(most mapping the html input type) The type "text" belongs to a text input field.
type: text
# required-true or false
@@ -112,7 +104,6 @@ metrics:
i18n:
zh-CN: 可用性
en-US: Available
ja-JP: 可用性
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -125,7 +116,6 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: imap
# Specific collection configuration when protocol is http protocol
@@ -149,7 +139,6 @@ metrics:
i18n:
zh-CN: 收件箱信息
en-US: Inbox info
ja-JP: 受信箱情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -161,19 +150,16 @@ metrics:
i18n:
zh-CN: 邮件总数
en-US: Total message count
ja-JP: メッセージ総数
- field: recentMessageCount
type: 0
i18n:
zh-CN: 最近收到邮件总数
en-US: Recent message count
ja-JP: 最新メッセージ総数
- field: unseenMessageCount
type: 0
i18n:
zh-CN: 未读邮件总数
en-US: Unread message count
ja-JP: 未読メッセージ総数
en-US: Unseen message count
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- INBOXTotalMessageCount
@@ -207,7 +193,6 @@ metrics:
i18n:
zh-CN: 已发送信息
en-US: Sent info
ja-JP: 送信情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -219,7 +204,6 @@ metrics:
i18n:
zh-CN: 邮件总数
en-US: Total message count
ja-JP: 送信したメッセージ総数
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- 已发送TotalMessageCount
@@ -249,7 +233,6 @@ metrics:
i18n:
zh-CN: 草稿箱信息
en-US: Drafts info
ja-JP: ドラフトボックス情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -261,7 +244,6 @@ metrics:
i18n:
zh-CN: 邮件总数
en-US: Total message count
ja-JP: ドラフトメッセージ総数
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- 草稿箱TotalMessageCount
@@ -291,7 +273,6 @@ metrics:
i18n:
zh-CN: 已删除信息
en-US: Deleted Messages info
ja-JP: 削除済みメッセージ情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -303,7 +284,6 @@ metrics:
i18n:
zh-CN: 邮件总数
en-US: Total message count
ja-JP: 削除済みメッセージ総数
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- 已删除TotalMessageCount
@@ -333,7 +313,6 @@ metrics:
i18n:
zh-CN: 垃圾箱信息
en-US: Junk info
ja-JP: 迷惑メールボックス情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -345,19 +324,16 @@ metrics:
i18n:
zh-CN: 邮件总数
en-US: Total message count
ja-JP: 迷惑メッセージ総数
- field: recentMessageCount
type: 0
i18n:
zh-CN: 最近收到邮件总数
en-US: Recent message count
ja-JP: 最新の迷惑メッセージ総数
- field: unseenMessageCount
type: 0
i18n:
zh-CN: 未读邮件总数
en-US: Unread message count
ja-JP: 未読の迷惑メッセージ総数
en-US: Unseen message count
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- 垃圾邮件TotalMessageCount
@@ -391,7 +367,6 @@ metrics:
i18n:
zh-CN: 病毒邮件信息
en-US: Virus Info
ja-JP: ウイルスメールボックス情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -403,19 +378,16 @@ metrics:
i18n:
zh-CN: 邮件总数
en-US: Total message count
ja-JP: ウイルスメッセージ総数
- field: recentMessageCount
type: 0
i18n:
zh-CN: 最近收到邮件总数
en-US: Recent message count
ja-JP: 最新のウイルスメッセージ総数
- field: unseenMessageCount
type: 0
i18n:
zh-CN: 未读邮件总数
en-US: Unread message count
ja-JP: 未読のウイルスメッセージ総数
en-US: Unseen message count
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- 病毒邮件TotalMessageCount
@@ -21,13 +21,11 @@ app: nginx
name:
zh-CN: Nginx服务器
en-US: Nginx Server
ja-JP: Nginxサーバー
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://www.tecmint.com/enable-nginx-status-page/'> Nginx </a> 通过配置 ngx_http_stub_status_module 对 nginx 的通用性能指标(nginx_status、req_status等)进行采集监控。<br>您可以点击“<i>新建 nginx</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://www.tecmint.com/enable-nginx-status-page/'> Nginx </a> to configure ngx_http_stub_status_module for collecting general metrics of Nginx (nginx_status, req_status.). <br>You can click "<i>New Nginx</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://www.tecmint.com/enable-nginx-status-page/'> Nginx </a> 通過配置 ngx_http_stub_status_module 對 Nginx 數據庫的通用性能指標(nginx信息、请求信息等)進行采集監控。<br>您可以點擊“<i>新建 Nginx</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: HertzBeat は、<a class='help_module_content' href='https://www.tecmint.com/enable-nginx-status-page/'>Nginx</a> の ngx_http_stub_status_module を設定することで、nginx_status や req_status などの一般的なパフォーマンス指標を収集・監視します。<br>「<i>新規 nginx 作成</i>」をクリックして設定を行うか、「<i>その他の操作</i>」から既存の設定をインポートすることができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/nginx
en-US: https://hertzbeat.apache.org/docs/help/nginx
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -80,7 +75,6 @@ params:
name:
zh-CN: 启动SSL
en-US: SSL
ja-JP: SSL利用
# When the type is boolean, the frontend will display a switch for it.
type: boolean
# required-true or false
@@ -93,7 +87,6 @@ metrics:
i18n:
zh-CN: 可用性
en-US: Available
ja-JP: 可用性
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -106,7 +99,6 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: nginx
# Specific collection configuration when protocol is http protocol
@@ -124,7 +116,6 @@ metrics:
i18n:
zh-CN: Nginx 状态信息
en-US: Nginx Status
ja-JP: Nginx 状態情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -134,49 +125,41 @@ metrics:
i18n:
zh-CN: 接受连接数
en-US: Accepts
ja-JP: 受けたクライアント接続の総数
- field: handled
type: 0
i18n:
zh-CN: 成功处理连接数
en-US: Handled
ja-JP: 処理された接続の総数
- field: active
type: 0
i18n:
zh-CN: 当前活跃连接数
en-US: Active
ja-JP: 現在アクティブなクライアント接続数
- field: dropped
type: 0
i18n:
zh-CN: 已丢弃连接数
en-US: Dropped
ja-JP: 中断したクライアント接続数
- field: requests
type: 0
i18n:
zh-CN: 客户端请求数
en-US: Requests
ja-JP: クライアントリクエストの総数
- field: reading
type: 0
i18n:
zh-CN: 正在执行读操作的连接数
en-US: Reading
ja-JP: 読み込み中の接続数
- field: writing
type: 0
i18n:
zh-CN: 正在执行写操作的连接数
en-US: Writing
ja-JP: 書き込み中の接続数
- field: waiting
type: 0
i18n:
zh-CN: 正在等待的连接数
en-US: Waiting
ja-JP: 待機中の接続数
# Alias field list, used to identify metrics in the query result
aliasFields:
- accepts
@@ -209,7 +192,6 @@ metrics:
i18n:
zh-CN: 请求详细信息
en-US: Req Status
ja-JP: リクエストの詳細情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 2
@@ -219,52 +201,44 @@ metrics:
i18n:
zh-CN: 分组类别
en-US: Zone Name
ja-JP: ゾーン名
- field: key
type: 1
i18n:
zh-CN: 分组名称
en-US: Key
ja-JP: グループの識別名
- field: max_active
type: 0
i18n:
zh-CN: 最大并发连接数
en-US: Max Active
ja-JP: 最大の同時実行の接続数
- field: max_bw
type: 0
unit: KB
i18n:
zh-CN: 最大带宽
en-US: Max BW
ja-JP: 最大帯域幅
- field: traffic
type: 0
unit: KB
i18n:
zh-CN: 总流量
en-US: Traffic
ja-JP: 通信量
- field: requests
type: 0
i18n:
zh-CN: 总请求数
en-US: Requests
ja-JP: 累積したリクエストの合計
- field: active
type: 0
i18n:
zh-CN: 当前并发连接数
en-US: Active
ja-JP: 現在のアクティブな同時実行接続数
- field: bandwidth
type: 0
unit: KB
i18n:
zh-CN: 当前带宽
en-US: Bandwidth
ja-JP: 現在の帯域幅
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: nginx
# the config content when protocol is http
@@ -21,13 +21,11 @@ app: ntp
name:
zh-CN: NTP服务器
en-US: NTP Server
ja-JP: NTPサーバー
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 对 NTP 服务的(响应时间、时间戳、时间、偏移量、延迟、版本号、模式、层级、参考ID、精度)相关指标进行监测。<br>您可以点击 “<i>新建 NTP服务器</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat monitors the relevant metrics of NTP services, including response time, timestamp, time, offset, delay, version number, mode, hierarchy, reference ID, and accuracy. <br>You can click "<i>New NTP Server</i>" and configure it, or select "<i>More Action</i>" to import the existing configuration.
zh-TW: HertzBeat 對 NTP 服務的(響應時間、時間戳、時間、偏移量、延遲、版本號、模式、層級、參考ID、精度)相關指標進行監測。<br>您可以點擊 “<i>新建 NTP服務器</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は NTPサーバーの一般的なメトリクスを監視します。<br>「<i>新規 NTPサーバー</i>」をクリックしてパラメタを設定した後、新規することができます。
zh-CN: HertzBeat 对 NTP 服务的(响应时间、时间戳、时间、偏移量、延迟、版本号、模式、层级、参考ID、精度)相关指标进行监测。<br>您可以点击 “<i>新建 NTP</i>” 并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat monitors the relevant metrics of NTP services, including response time, timestamp, time, offset, delay, version number, mode, hierarchy, reference ID, and accuracy. <br>You can click "<i>New NTP</i>" and configure it, or select "<i>More Action</i>" to import the existing configuration.
zh-TW: HertzBeat 對 NTP 服務的(響應時間、時間戳、時間、偏移量、延遲、版本號、模式、層級、參考ID、精度)相關指標進行監測。<br>您可以點擊 “<i>新建 NTP</i>” 並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
@@ -36,7 +34,6 @@ params:
name:
zh-CN: NTP服务Host
en-US: NTP Host
ja-JP: NTPホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -47,7 +44,6 @@ params:
name:
zh-CN: 连接超时时间(ms)
en-US: Connect Timeout(ms)
ja-JP: 接続タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -63,7 +59,6 @@ metrics:
i18n:
zh-CN: 概要
en-US: Summary
ja-JP: 概要
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -75,64 +70,54 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
- field: time
type: 0
unit: ms
i18n:
zh-CN: 时间戳
en-US: Timestamp
ja-JP: タイムスタンプ
- field: date
type: 1
i18n:
zh-CN: 时间
en-US: Date
ja-JP: 時間
- field: offset
type: 0
unit: ms
i18n:
zh-CN: 偏移量
en-US: Offset
ja-JP: オフセット
- field: delay
type: 0
unit: ms
i18n:
zh-CN: 延迟
en-US: Delay
ja-JP: 遅延
- field: version
type: 0
i18n:
zh-CN: 版本号
en-US: Version
ja-JP: バージョン
- field: mode
type: 0
i18n:
zh-CN: 模式
en-US: Mode
ja-JP: モード
- field: stratum
type: 0
i18n:
zh-CN: 层级
en-US: Stratum
ja-JP: 階層
- field: referenceId
type: 1
i18n:
zh-CN: 参考ID
en-US: ReferenceId
ja-JP: 参照ID
- field: precision
type: 0
i18n:
zh-CN: 精度
en-US: Precision
ja-JP: 精度
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: ntp
@@ -21,13 +21,11 @@ app: nvidia
name:
zh-CN: NVIDIA
en-US: NVIDIA
ja-JP: NVIDIA
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 NVIDIA GPU显卡的通用性能指标进行采集监控。<br>您可以点击“<i>新建 NVIDIA</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
en-US: Hertzbeat uses the <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'>SSH protocol</a> to collect and monitor general performance metrics of NVIDIA GPUs. <br> You can click " <i>Create NVIDIA</i> " to add and configure parameters such as HOST, port, account, etc., supporting SSH account password or key authentication. Alternatively, you can select " <i>More Actions</i> " to import an existing configuration.
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'>SSH 協議</a> 對 NVIDIA GPU 顯卡的通用性能指標進行採集監控。<br>您可以點擊“<i>新建 NVIDIA</i>”並配置 HOST、端口、帳戶等相關參數進行添加,支持 SSH 帳戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> NVIDIAの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 NVIDIA</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/nvidia/
en-US: https://hertzbeat.apache.org/docs/help/nvidia/
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 超时时间(ms)
en-US: Timeout(ms)
ja-JP: タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -73,6 +68,7 @@ params:
# required-true or false
required: false
# default value
# 默认值
defaultValue: 6000
# field-param field key
- field: reuseConnection
@@ -80,7 +76,6 @@ params:
name:
zh-CN: 复用连接
en-US: Reuse Connection
ja-JP: 接続再利用
# type-param field type(most mapping the html input type)
type: boolean
# required-true or false
@@ -92,7 +87,6 @@ params:
name:
zh-CN: 使用代理
en-US: Use Proxy Connection
ja-JP: プロキシ接続利用
# type-param field type(most mapping the html input type)
type: boolean
# required-true or false
@@ -104,7 +98,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -117,7 +110,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -128,7 +120,6 @@ params:
name:
zh-CN: 私钥
en-US: PrivateKey
ja-JP: 秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -143,7 +134,6 @@ params:
name:
zh-CN: 代理主机
en-US: Proxy Host
ja-JP: プロキシホスト
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -155,7 +145,6 @@ params:
name:
zh-CN: 代理端口
en-US: Proxy Port
ja-JP: プロキシポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -172,7 +161,6 @@ params:
name:
zh-CN: 代理用户名
en-US: Proxy Username
ja-JP: プロキシユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -187,7 +175,6 @@ params:
name:
zh-CN: 代理密码
en-US: Proxy Password
ja-JP: プロキシパスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -200,7 +187,6 @@ params:
name:
zh-CN: 代理主机私钥
en-US: proxyPrivateKey
ja-JP: プロキシ秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -214,7 +200,6 @@ params:
name:
zh-CN: 代理主机
en-US: Proxy Host
ja-JP: プロキシホスト
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -226,7 +211,6 @@ params:
name:
zh-CN: 代理端口
en-US: Proxy Port
ja-JP: プロキシポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -243,7 +227,6 @@ params:
name:
zh-CN: 代理用户名
en-US: Proxy Username
ja-JP: プロキシユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -258,7 +241,6 @@ params:
name:
zh-CN: 代理密码
en-US: Proxy Password
ja-JP: プロキシパスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -271,7 +253,6 @@ params:
name:
zh-CN: 代理主机私钥
en-US: proxyPrivateKey
ja-JP: プロキシ秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -286,7 +267,6 @@ metrics:
i18n:
zh-CN: 显卡基本信息
en-US: Basic Information
ja-JP: 基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -299,55 +279,47 @@ metrics:
i18n:
zh-CN: 显卡索引
en-US: Host Name
ja-JP: 番号
- field: name
type: 1
i18n:
zh-CN: 显卡名称
en-US: System Version
ja-JP: 名前
- field: utilization.gpu[%]
type: 0
unit: '%'
i18n:
zh-CN: GPU利用率
en-US: GPU Utilization
ja-JP: GPU使用率
- field: utilization.memory[%]
type: 0
unit: '%'
i18n:
zh-CN: 显存利用率
en-US: Memory Utilization
ja-JP: メモリ使用率
- field: memory.total[MiB]
type: 1
unit: 'MiB'
i18n:
zh-CN: 总显存
en-US: Total Memory
ja-JP: メモリ容量
- field: memory.used[MiB]
type: 0
unit: 'MiB'
i18n:
zh-CN: 已用显存
en-US: Used Memory
ja-JP: 使用したメモリ
- field: memory.free[MiB]
type: 0
unit: 'MiB'
i18n:
zh-CN: 空闲显存
en-US: Free Memory
ja-JP: 利用可能メモリ
- field: temperature.gpu
type: 1
unit: '°C'
i18n:
zh-CN: 显卡温度
en-US: GPU Temperature
ja-JP: GPU温度
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: ssh
# the config content when protocol is ssh
@@ -21,13 +21,11 @@ app: oceanbase
name:
zh-CN: OceanBase数据库
en-US: OceanBase DB
ja-JP: OceanBaseデータベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 OceanBase 数据库的通用性能指标(系统信息、性能状态、Innodb、缓存、事物、用户线程、慢SQL等)进行采集监控,支持版本为 OceanBase 4.0+。<br>您可以点击“<i>新建 OceanBase 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of OceanBase database (system information, performance status, Innodb, cache, things, user threads, slow SQL, etc.). Supported version is OceanBase 4.0+. <br>You can click "<i>New OceanBase Database</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 OceanBase 數據庫的通用性能指標(系統信息、性能狀態、Innodb、緩存、事物、用戶線程、慢SQL等)進行采集監控,支持版本爲 OceanBase 4.0+。<br>您可以點擊“<i>新建 OceanBase 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: HertzBeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC プロトコル</a> を使用して、SQL を設定することで OceanBase データベースの一般的なパフォーマンスのメトリクス(システム情報、パフォーマンス状態、Innodb、キャッシュ、トランザクション、ユーザー スレッド、スロー SQL など)を収集および監視します。対応バージョンは OceanBase 4.0+ です。<br>「<i>新規 OceanBase データベース</i>」をクリックして設定するか、「<i>その他の操作</i>」を選択して既存の設定をインポートすることができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/oceanbase
en-US: https://hertzbeat.apache.org/docs/help/oceanbase
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: ターゲットホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -82,7 +77,6 @@ params:
name:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
# type-param field type(most mapping the html input tag)
type: text
# required-true or false
@@ -93,7 +87,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input tag)
type: text
# when type is text, use limit to limit string length
@@ -106,7 +99,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -117,7 +109,6 @@ params:
name:
zh-CN: URL
en-US: URL
ja-JP: URL
# type-param field type(most mapping the html input tag)
type: text
# required-true or false
@@ -135,7 +126,6 @@ metrics:
i18n:
zh-CN: 基础 信息
en-US: Basic Info
ja-JP: 基本情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -145,19 +135,16 @@ metrics:
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: datadir
type: 1
i18n:
zh-CN: 存储目录
en-US: DataDir
ja-JP: データディレクトリ
- field: max_connections
type: 0
i18n:
zh-CN: 最大连接数
en-US: Max Connections
ja-JP: 最大接続数
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- version
@@ -203,7 +190,6 @@ metrics:
i18n:
zh-CN: 租户 信息
en-US: Tenant Info
ja-JP: テナント情報
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
@@ -213,19 +199,16 @@ metrics:
i18n:
zh-CN: 租户id
en-US: TenantId
ja-JP: テナントID
- field: tenant_name
type: 1
i18n:
zh-CN: 租户名称
en-US: tenantName
ja-JP: テナント名
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: status
ja-JP: ステータス
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- tenant_id
@@ -261,13 +244,12 @@ metrics:
sql: select tenant_id, tenant_name, info, status from oceanbase.__all_tenant;
# JDBC url
url: ^_^url^_^
- name: sql
priority: 2
i18n:
zh-CN: Sql 信息
en-US: Sql Info
ja-JP: Sql情報
fields:
- field: con_id
type: 1
@@ -275,43 +257,36 @@ metrics:
i18n:
zh-CN: 租户id
en-US: TenantId
ja-JP: テナントID
- field: sql_select_count
type: 0
i18n:
zh-CN: select 语句执行次数
en-US: sql select count
ja-JP: sql select 回数
- field: sql_insert_count
type: 0
i18n:
zh-CN: insert 语句执行次数
en-US: sql insert count
ja-JP: sql insert 回数
- field: sql_update_count
type: 0
i18n:
zh-CN: update 语句执行次数
en-US: sql update count
ja-JP: sql update 回数
- field: sql_delete_count
type: 0
i18n:
zh-CN: delete 语句执行次数
en-US: sql delete count
ja-JP: sql delete 回数
# - field: com_commit
# type: 0
# i18n:
# zh-CN: 事务提交次数
# en-US: trans commit count
# ja-JP: trans commit 回数
# - field: com_rollback
# type: 0
# i18n:
# zh-CN: 事务回滚次数
# en-US: trans rollback count
# ja-JP: trans rollback 回数
aliasFields:
- con_id
- sql_select_count
@@ -360,7 +335,6 @@ metrics:
i18n:
zh-CN: 进程状态 信息
en-US: Process State Info
ja-JP: プロセス状態情報
fields:
- field: state
type: 1
@@ -368,13 +342,11 @@ metrics:
i18n:
zh-CN: 进程状态
en-US: State
ja-JP: 状態
- field: num
type: 0
i18n:
zh-CN: 该状态进程数量
en-US: Num
ja-JP: プロセス総数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -21,13 +21,11 @@ app: openai
name:
zh-CN: OpenAI 监控
en-US: OpenAI
ja-JP: OpenAI
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 将调用 OpenAI API 接口,监测账户、账单、大模型 API 使用情况等数据。会话密钥获取请见使用指南。<br>您可以先点击“新增 OpenAI API”按钮并进行配置,或在“更多操作”中导入已有配置。
en-US: HertzBeat will call the OpenAI API interface to monitor account, billing, and usage data of LLM API, etc. Please refer to the user guide for session key acquisition.<br>You can click the "Add OpenAI API" button to configure it first, or import existing configurations in the "More Actions" section.
zh-TW: HertzBeat 將調用 OpenAI API 接口,監測帳戶、帳單、大模型 API 使用情況等數據。請參閱使用指南以獲取會話密鑰。<br>您可以先點擊“新增 OpenAI API”按鈕並進行配置,或在“更多操作”中導入已有配置。
ja-JP: Hertzbeatは、OpenAI APIを呼び出してメトリクスを監視します。<br>「<i>新規 OpenAI API</i>」をクリックして設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/openai
en-US: https://hertzbeat.apache.org/docs/help/openai
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 会话密钥
en-US: Session Key
ja-JP: セッションキー
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -52,7 +49,6 @@ metrics:
i18n:
zh-CN: 信用额度授予
en-US: Credit Grants
ja-JP: 与信枠
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -64,28 +60,24 @@ metrics:
i18n:
zh-CN: 总授予额度
en-US: Total Granted
ja-JP: 与信額合計
unit: $
- field: total_used
type: 0
i18n:
zh-CN: 总使用额度
en-US: Total Used
ja-JP: 使用した与信額
unit: $
- field: total_available
type: 0
i18n:
zh-CN: 总可用额度
en-US: Total Available
ja-JP: 使用可能な与信額
unit: $
- field: total_paid_available
type: 0
i18n:
zh-CN: 总付费可用额度
en-US: Total Paid Available
ja-JP: 使用可能な与信額合計
unit: $
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
@@ -115,7 +107,6 @@ metrics:
i18n:
zh-CN: 模型花费
en-US: Model Cost
ja-JP: モデルコスト
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 1
@@ -127,14 +118,12 @@ metrics:
i18n:
zh-CN: 模型名称
en-US: Model Name
ja-JP: モデル名
label: true
- field: cost
type: 0
i18n:
zh-CN: 花费
en-US: Cost
ja-JP: コスト
unit: $
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
@@ -167,7 +156,6 @@ metrics:
i18n:
zh-CN: 订阅计费
en-US: Billing Subscription
ja-JP: 課金購読
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 2
@@ -179,164 +167,138 @@ metrics:
i18n:
zh-CN: 是否有支付方式
en-US: Has Payment Method
ja-JP: 支払い方法の有無
- field: canceled
type: 1
i18n:
zh-CN: 订阅是否已取消
en-US: Canceled
ja-JP: 購読がキャンセルされた
- field: canceled_at
type: 1
i18n:
zh-CN: 订阅取消时间
en-US: Canceled At
ja-JP: 購読キャンセル時間
- field: delinquent
type: 1
i18n:
zh-CN: 订阅是否拖欠
en-US: Delinquent
ja-JP: 購読料滞納の有無
- field: soft_limit
type: 0
i18n:
zh-CN: 一定时间内最大使用量限制
en-US: Soft Limit
ja-JP: 一定期間の最大使用量制限
- field: hard_limit
type: 0
i18n:
zh-CN: 最大使用量限制
en-US: Hard Limit
ja-JP: 最大使用量制限
- field: system_hard_limit
type: 0
i18n:
zh-CN: 系统硬限制使用量
en-US: System Hard Limit
ja-JP: システムの最大使用量制限
- field: soft_limit_usd
type: 0
i18n:
zh-CN: 软限制费用
en-US: Soft Limit USD
ja-JP: 一定期間の最大使用量制限の費用
unit: $
- field: hard_limit_usd
type: 0
i18n:
zh-CN: 硬限制费用
en-US: Hard Limit USD
ja-JP: 最大使用量制限の費用
unit: $
- field: system_hard_limit_usd
type: 0
i18n:
zh-CN: 系统硬限制费用
en-US: System Hard Limit USD
ja-JP: システムの最大使用量制限の費用
unit: $
- field: plan
type: 1
i18n:
zh-CN: 订阅计划
en-US: Plan
ja-JP: 購読プラン
- field: primary
type: 1
i18n:
zh-CN: 是否是主要订阅
en-US: Primary
ja-JP: プライマリー購読
unit: $
- field: billing_mechanism
type: 1
i18n:
zh-CN: 结算机制
en-US: Billing Mechanism
ja-JP: 課金仕組み
- field: is_arrears_eligible
type: 1
i18n:
zh-CN: 是否符合拖欠资格
en-US: Is Arrears Eligible
ja-JP: 延滞の対象
- field: max_balance
type: 0
i18n:
zh-CN: 最大余额
en-US: Max Balance
ja-JP: 最大バランス
unit: $
- field: auto_recharge_eligible
type: 1
i18n:
zh-CN: 是否符合自动充值资格
en-US: Auto Recharge Eligible
ja-JP: オートリチャージ対象
- field: auto_recharge_enabled
type: 1
i18n:
zh-CN: 是否启用自动充值
en-US: Auto Recharge Enabled
ja-JP: オートリチャージ有効
- field: auto_recharge_threshold
type: 0
i18n:
zh-CN: 自动充值阈值
en-US: Auto Recharge Threshold
ja-JP: オートリチャージしきい値
unit: $
- field: auto_recharge_to_balance
type: 0
i18n:
zh-CN: 自动充值金额
en-US: Auto Recharge To Balance
ja-JP: オートリチャージ金額
unit: $
- field: trust_tier
type: 1
i18n:
zh-CN: 信用等级
en-US: Trust Tier
ja-JP: 信託層
- field: account_name
type: 1
i18n:
zh-CN: 账户名称
en-US: Account Name
ja-JP: アカウント名
- field: po_number
type: 1
i18n:
zh-CN: 采购号
en-US: Po Number
ja-JP: 購入番号
- field: billing_email
type: 1
i18n:
zh-CN: 账单邮箱
en-US: Billing Email
ja-JP: 請求先メール
- field: tax_ids
type: 1
i18n:
zh-CN: 税务ID
en-US: Tax IDs
ja-JP: 納税者番号
- field: billing_address
type: 1
i18n:
zh-CN: 结算地址
en-US: Billing Address
ja-JP: 請求先住所
- field: business_address
type: 1
i18n:
zh-CN: 业务地址
en-US: Business Address
ja-JP: ビジネスアドレス
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# the config content when protocol is http
@@ -18,13 +18,11 @@ app: opengauss
name:
zh-CN: OpenGauss数据库
en-US: OpenGauss DB
ja-JP: OpenGauss データベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 OpenGauss 数据库的通用性能指标 (basic、state、activity etc) 进行采集监控,支持版本为 PostgreSQL10+。<br>您可以点击“<i>新建 OpenGauss 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of OpenGauss database (basic、state、activity etc). Supported version is PostgreSQL10+. <br>You can click "<i>New OpenGauss Database</i>" and configure it, or select "<i>More Action</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 OpenGauss 數據庫的通用性能指標 (basic、state、activity etc)進行采集監控,支持版本爲 PostgreSQL10+。<br>您可以點擊“<i>新建 OpenGauss 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBCプロトコルを介して</a> OpenGauss データベースの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 OpenGauss データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/opengauss
en-US: https://hertzbeat.apache.org/docs/help/opengauss
@@ -33,14 +31,12 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
type: host
required: true
- field: port
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
type: number
range: '[0,65535]'
required: true
@@ -49,9 +45,9 @@ params:
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
type: number
# when type is number, range is required
# 当type为number时,用range表示范围
range: '[400,200000]'
required: false
hide: true
@@ -60,7 +56,6 @@ params:
name:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
type: text
defaultValue: postgres
required: false
@@ -68,7 +63,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -76,14 +70,12 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: url
name:
zh-CN: URL
en-US: URL
ja-JP: URL
type: text
required: false
hide: true
@@ -91,10 +83,11 @@ metrics:
- name: basic
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
# 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集
# 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度
i18n:
zh-CN: 基本信息
en-US: Basic Info
ja-JP: 基礎情報
priority: 0
# monitor metrics list
fields:
@@ -103,32 +96,27 @@ metrics:
i18n:
zh-CN: 数据库版本
en-US: Server Version
ja-JP: バージョン
type: 1
label: true
- field: port
i18n:
zh-CN: 端口号
en-US: Port
ja-JP: ポート
type: 1
- field: server_encoding
i18n:
zh-CN: 数据库编码格式
en-US: Encoding
ja-JP: エンコード
type: 1
- field: data_directory
i18n:
zh-CN: 数据存储目录
en-US: Data Directory
ja-JP: データディレクトリ
type: 1
- field: max_connections
i18n:
zh-CN: 最大连接数
en-US: Max Connection
ja-JP: 最大接続数
type: 0
unit: sbc
protocol: jdbc
@@ -152,7 +140,6 @@ metrics:
i18n:
zh-CN: 状态
en-US: Status
ja-JP: 状態情報
priority: 1
fields:
# metric information includes field name, type field type: 0-number, 1-string, label-whether it is a metric label field, unit-metric unit
@@ -160,55 +147,47 @@ metrics:
i18n:
zh-CN: 名称
en-US: Name
ja-JP: 名前
type: 1
- field: conflicts
i18n:
zh-CN: 冲突次数
en-US: Conflicts
ja-JP: コンフリクト回数
type: 0
unit: times
- field: deadlocks
i18n:
zh-CN: 死锁次数
en-US: Deadlocks
ja-JP: デッドロック回数
type: 0
unit: times
- field: blks_read
i18n:
zh-CN: 块读取数
en-US: Blocks Read
ja-JP: 読み取られたブロック
type: 0
unit: blocks per second
- field: blks_hit
i18n:
zh-CN: 块命中数
en-US: Blocks Hit
ja-JP: ヒットブロック
type: 0
unit: blocks per second
- field: blk_read_time
i18n:
zh-CN: 块读取时间
en-US: Block Read Time
ja-JP: 読み取られタイム
type: 0
unit: ms
- field: blk_write_time
i18n:
zh-CN: 块写入时间
en-US: Block Write
ja-JP: 書き込まれ時間
type: 0
unit: ms
- field: stats_reset
i18n:
zh-CN: 统计信息重置时间
en-US: States Reset
ja-JP: 統計リセット
type: 1
protocol: jdbc
jdbc:
@@ -231,7 +210,6 @@ metrics:
i18n:
zh-CN: 活跃进程
en-US: Activity
ja-JP: 活動情報
priority: 2
fields:
# metric information includes field name, type field type: 0-number, 1-string, label-whether it is a metric label field, unit-metric unit
@@ -239,7 +217,6 @@ metrics:
i18n:
zh-CN: 运行中进程数
en-US: Running
ja-JP: 実行中
type: 0
unit: sbc
protocol: jdbc
@@ -21,13 +21,11 @@ app: opensuse
name:
zh-CN: OpenSUSE
en-US: OpenSUSE
ja-JP: OpenSUSE
# The description and help of this monitoring type
help:
zh-CN: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 对 OpenSUSE 操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。<br>您可以点击“<i>新建 OpenSUSE</i>”并配置HOST端口账户等相关参数进行添加,支持SSH账户密码或密钥认证。或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH protocol</a> to monitors OpenSUSE operating system's general performance metrics such as cpu, memory, disk, basic, interface, disk_free, top_process etc. <br>You can click the "<i>New OpenSUSE</i>" and config host port and other related params to add, auth support password or secretKey. Or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: Hertzbeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSH 协议</a> 對 OpenSUSE 操作系统的通用性能指標 (系統信息、CPU、內存、磁盤、網卡、文件系統、TOP資源進程等) 進行採集監控。<br>您可以點擊“<i>新建 OpenSUSE</i>”並配置HOST端口賬戶等相關參數進行添加,支持SSH賬戶密碼或密鑰認證。或者選擇“<i>更多操作</i>”,導入已有配寘。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-ssh'> SSHプロトコルを介して</a> OpenSUSEシステムの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 OpenSUSE</i>」をクリックしてホストなどのパラメタを設定した後、新規することができます。SSHまたはキー認証をサポートします。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/opensuse
en-US: https://hertzbeat.apache.org/docs/help/opensuse
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -65,7 +61,6 @@ params:
name:
zh-CN: 超时时间(ms)
en-US: Timeout(ms)
ja-JP: タイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -80,7 +75,6 @@ params:
name:
zh-CN: 复用连接
en-US: Reuse Connection
ja-JP: 接続再利用
# type-param field type(most mapping the html input type)
type: boolean
# required-true or false
@@ -92,7 +86,6 @@ params:
name:
zh-CN: 使用代理
en-US: Use Proxy Connection
ja-JP: プロキシ接続利用
# type-param field type(most mapping the html input type)
type: boolean
# required-true or false
@@ -104,7 +97,6 @@ params:
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -117,7 +109,6 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -128,7 +119,6 @@ params:
name:
zh-CN: 私钥
en-US: PrivateKey
ja-JP: 秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -141,7 +131,6 @@ params:
name:
zh-CN: 密钥短语
en-US: PrivateKey PassPhrase
ja-JP: 秘密鍵フレーズ
# type-param field type(most mapping the html input type)
type: password
# required-true or false
@@ -154,7 +143,6 @@ params:
name:
zh-CN: 代理主机
en-US: Proxy Host
ja-JP: プロキシホスト
# type-param field type(most mapping the html input type)
type: text
# required-true or false
@@ -166,7 +154,6 @@ params:
name:
zh-CN: 代理端口
en-US: Proxy Port
ja-JP: プロキシポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -183,7 +170,6 @@ params:
name:
zh-CN: 代理用户名
en-US: Proxy Username
ja-JP: プロキシユーザー名
# type-param field type(most mapping the html input type)
type: text
# when type is text, use limit to limit string length
@@ -198,7 +184,6 @@ params:
name:
zh-CN: 代理密码
en-US: Proxy Password
ja-JP: プロキシパスワード
# type-param field type(most mapping the html input tag)
type: password
# required-true or false
@@ -211,7 +196,6 @@ params:
name:
zh-CN: 代理主机私钥
en-US: proxyPrivateKey
ja-JP: プロキシ秘密鍵
# type-param field type(most mapping the html input type)
type: textarea
placeholder: -----BEGIN RSA PRIVATE KEY-----
@@ -226,7 +210,6 @@ metrics:
i18n:
zh-CN: 系统基本信息
en-US: Basic Info
ja-JP: システム基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -239,19 +222,16 @@ metrics:
i18n:
zh-CN: 主机名称
en-US: Host Name
ja-JP: ホスト名
- field: version
type: 1
i18n:
zh-CN: 操作系统版本
en-US: System Version
ja-JP: オーエスバージョン
- field: uptime
type: 1
i18n:
zh-CN: 启动时间
en-US: Uptime
ja-JP: アップタイム
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: ssh
# the config content when protocol is ssh
@@ -291,7 +271,6 @@ metrics:
i18n:
zh-CN: CPU 信息
en-US: CPU Info
ja-JP: CPU情報
priority: 1
fields:
- field: info
@@ -299,38 +278,32 @@ metrics:
i18n:
zh-CN: 型号
en-US: Info
ja-JP: バージョン
- field: cores
type: 1
i18n:
zh-CN: 核数
en-US: Cores
ja-JP: コア数
- field: interrupt
type: 0
i18n:
zh-CN: 中断数
en-US: Interrupt
ja-JP: 割り込み数
- field: load
type: 1
i18n:
zh-CN: 负载
en-US: Load
ja-JP: ロード
- field: context_switch
type: 0
i18n:
zh-CN: 上下文切换
en-US: Context Switch
ja-JP: コンテキストスイッチ
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- info
@@ -377,7 +350,6 @@ metrics:
i18n:
zh-CN: 内存信息
en-US: Memory Info
ja-JP: メモリ情報
priority: 2
fields:
- field: total
@@ -386,42 +358,36 @@ metrics:
i18n:
zh-CN: 总内存容量
en-US: Total Memory
ja-JP: メモリ容量
- field: used
type: 0
unit: Mb
i18n:
zh-CN: 用户程序内存量
en-US: User Program Memory
ja-JP: ユーザープログラムメモリ
- field: free
type: 0
unit: Mb
i18n:
zh-CN: 空闲内存容量
en-US: Free Memory
ja-JP: 空きメモリ
- field: buff_cache
type: 0
unit: Mb
i18n:
zh-CN: 缓存占用内存
en-US: Buff Cache Memory
ja-JP: バッファメモリ
- field: available
type: 0
unit: Mb
i18n:
zh-CN: 剩余可用内存
en-US: Available Memory
ja-JP: 使用可能のメモリ
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 内存使用率
en-US: Memory Usage
ja-JP: メモリ使用率
aliasFields:
- total
- used
@@ -464,7 +430,6 @@ metrics:
i18n:
zh-CN: 磁盘信息
en-US: Disk Info
ja-JP: ディスク情報
priority: 3
fields:
- field: disk_num
@@ -472,32 +437,27 @@ metrics:
i18n:
zh-CN: 磁盘总数
en-US: Disk Num
ja-JP: ディスク番号
- field: partition_num
type: 1
i18n:
zh-CN: 分区总数
en-US: Partition Num
ja-JP: パーティション
- field: block_write
type: 0
i18n:
zh-CN: 写磁盘块数
en-US: Block Write
ja-JP: 書き込みディスクブロック数
- field: block_read
type: 0
i18n:
zh-CN: 读磁盘块数
en-US: Block Read
ja-JP: 読み取りブロック数
- field: write_rate
type: 0
unit: iops
i18n:
zh-CN: 磁盘写速率
en-US: Write Rate
ja-JP: ディスク書き込み速度
protocol: ssh
ssh:
host: ^_^host^_^
@@ -527,7 +487,6 @@ metrics:
i18n:
zh-CN: 网卡信息
en-US: Interface Info
ja-JP: ネットワークカード情報
priority: 4
fields:
- field: interface_name
@@ -536,21 +495,18 @@ metrics:
i18n:
zh-CN: 网卡名称
en-US: Interface Name
ja-JP: ネットワークカード名
- field: receive_bytes
type: 0
unit: Mb
i18n:
zh-CN: 入站数据流量
en-US: Receive Bytes
ja-JP: 受信されたバイト数
- field: transmit_bytes
type: 0
unit: Mb
i18n:
zh-CN: 出站数据流量
en-US: Transmit Bytes
ja-JP: 転送されたバイト数
units:
- receive_bytes=B->MB
- transmit_bytes=B->MB
@@ -583,7 +539,6 @@ metrics:
i18n:
zh-CN: 文件系统
en-US: Disk Free
ja-JP: ファイルシステム
priority: 5
fields:
- field: filesystem
@@ -591,35 +546,30 @@ metrics:
i18n:
zh-CN: 文件系统
en-US: Filesystem
ja-JP: ファイルシステム
- field: used
type: 0
unit: Mb
i18n:
zh-CN: 已使用量
en-US: Used
ja-JP: 使用済み
- field: available
type: 0
unit: Mb
i18n:
zh-CN: 可用量
en-US: Available
ja-JP: 使用可能
- field: usage
type: 0
unit: '%'
i18n:
zh-CN: 使用率
en-US: Usage
ja-JP: 使用率
- field: mounted
type: 1
label: true
i18n:
zh-CN: 挂载点
en-US: Mounted
ja-JP: マウント
protocol: ssh
ssh:
host: ^_^host^_^
@@ -649,7 +599,6 @@ metrics:
i18n:
zh-CN: Top10 CPU 进程
en-US: Top10 CPU Process
ja-JP: トップ10 CPUプロセス
priority: 6
fields:
- field: pid
@@ -658,27 +607,23 @@ metrics:
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: cpu_usage
type: 0
unit: '%'
i18n:
zh-CN: CPU占用率
en-US: CPU Usage
ja-JP: CPU使用率
- field: mem_usage
type: 0
unit: '%'
i18n:
zh-CN: 内存占用率
en-US: Memory Usage
ja-JP: メモリ使用率
- field: command
type: 1
i18n:
zh-CN: 执行命令
en-US: Command
ja-JP: コマンド
protocol: ssh
ssh:
host: ^_^host^_^
@@ -708,7 +653,6 @@ metrics:
i18n:
zh-CN: Top10 内存进程
en-US: Top10 Memory Process
ja-JP: トップ10 メモリプロセス
priority: 7
fields:
- field: pid
@@ -717,27 +661,23 @@ metrics:
i18n:
zh-CN: 进程ID
en-US: PID
ja-JP: プロセスID
- field: mem_usage
type: 0
unit: '%'
i18n:
zh-CN: 内存占用率
en-US: Memory Usage
ja-JP: メモリ使用率
- field: cpu_usage
type: 0
unit: '%'
i18n:
zh-CN: CPU占用率
en-US: CPU Usage
ja-JP: CPU使用率
- field: command
type: 1
i18n:
zh-CN: 执行命令
en-US: Command
ja-JP: コマンド
protocol: ssh
ssh:
host: ^_^host^_^
@@ -21,13 +21,11 @@ app: oracle
name:
zh-CN: Oracle数据库
en-US: Oracle DB
ja-JP: Oracle データベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 协议</a> 通过配置 SQL 对 Oracle 数据库的通用性能指标(表空间、性能状态、用户连接、缓存、慢SQL等)进行采集监控。<br>您可以点击“<i>新建 Oracle 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC Protocol</a> to configure SQL for collecting general metrics of Oracle database (tablespace、user connect、performance、slow SQL etc.). <br>You can click "<i>New Oracle Database</i>" and configure it, or select "<i>More Operations</i>" to import the existing configuration.
zh-TW: HertzBeat 使用 <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBC 協議</a> 通過配置 SQL 對 Oracle 數據庫的通用性能指標(表空間、性能狀態、用戶連接、緩存、慢SQL等)進行采集監控。<br>您可以點擊“<i>新建 Oracle 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は <a class='help_module_content' href='https://hertzbeat.apache.org/docs/advanced/extend-jdbc'> JDBCプロトコルを介して</a> Oracle データベースの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 Oracle データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/oracle/
en-US: https://hertzbeat.apache.org/docs/help/oracle/
@@ -39,7 +37,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -50,7 +47,6 @@ params:
name:
zh-CN: 端口
en-US: Port
ja-JP: ポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -63,7 +59,6 @@ params:
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
type: number
range: '[400,200000]'
required: false
@@ -73,7 +68,6 @@ params:
name:
zh-CN: 复用连接
en-US: Reuse Connection
ja-JP: 接続再利用
type: boolean
required: false
defaultValue: true
@@ -81,14 +75,12 @@ params:
name:
zh-CN: 服务名
en-US: Service Name
ja-JP: サービス名
type: text
required: false
- field: username
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
@@ -96,14 +88,12 @@ params:
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
- field: url
name:
zh-CN: URL
en-US: URL
ja-JP: URL
type: text
required: false
hide: true
@@ -115,7 +105,6 @@ metrics:
i18n:
zh-CN: 基本信息
en-US: Basic Info
ja-JP: 基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -128,31 +117,26 @@ metrics:
i18n:
zh-CN: 数据库版本
en-US: Database Version
ja-JP: データベースバージョン
- field: hostname
type: 1
i18n:
zh-CN: 主机名
en-US: Host Name
ja-JP: ホスト名
- field: instance_name
type: 1
i18n:
zh-CN: 实例名
en-US: Instance Name
ja-JP: インスタンス名
- field: startup_time
type: 1
i18n:
zh-CN: 启动时间
en-US: Startup Time
ja-JP: 起動時間
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: Status
ja-JP: ステータス
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- VERSION
@@ -193,7 +177,6 @@ metrics:
i18n:
zh-CN: 表空间
en-US: Tablespace
ja-JP: 表領域
priority: 1
fields:
- field: file_id
@@ -202,38 +185,32 @@ metrics:
i18n:
zh-CN: 文件ID
en-US: File ID
ja-JP: ファイルID
- field: file_name
type: 1
i18n:
zh-CN: 文件名
en-US: File Name
ja-JP: ファイル名
- field: tablespace_name
type: 1
i18n:
zh-CN: 表空间名
en-US: Tablespace Name
ja-JP: 表領域名
- field: status
type: 1
i18n:
zh-CN: 状态
en-US: Status
ja-JP: ステータス
- field: bytes
type: 0
i18n:
zh-CN: 字节数
en-US: Bytes
ja-JP: バイト数
unit: MB
- field: blocks
type: 0
i18n:
zh-CN: 块数
en-US: Blocks
ja-JP: ブロック数
unit:
protocol: jdbc
jdbc:
@@ -253,7 +230,6 @@ metrics:
i18n:
zh-CN: 会话总数
en-US: Total Sessions
ja-JP: セッション総数
priority: 2
fields:
- field: count
@@ -261,7 +237,6 @@ metrics:
i18n:
zh-CN: 总数
en-US: Count
ja-JP: 総数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -280,7 +255,6 @@ metrics:
i18n:
zh-CN: 活动会话
en-US: Active Sessions
ja-JP: アクティブなセッション
priority: 3
fields:
- field: count
@@ -288,7 +262,6 @@ metrics:
i18n:
zh-CN: 总数
en-US: Count
ja-JP: 総数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -307,7 +280,6 @@ metrics:
i18n:
zh-CN: 后台会话
en-US: Background Sessions
ja-JP: バックグラウンドセッション
priority: 4
fields:
- field: count
@@ -315,7 +287,6 @@ metrics:
i18n:
zh-CN: 总数
en-US: Count
ja-JP: 総数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -334,7 +305,6 @@ metrics:
i18n:
zh-CN: 连接
en-US: Connection
ja-JP: 接続
priority: 5
fields:
- field: username
@@ -342,13 +312,11 @@ metrics:
i18n:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
label: true
- field: count
i18n:
zh-CN: 总数
en-US: Count
ja-JP: 総数
type: 0
protocol: jdbc
jdbc:
@@ -368,7 +336,6 @@ metrics:
i18n:
zh-CN: 性能
en-US: Performance
ja-JP: パフォーマンス
priority: 6
fields:
- field: qps
@@ -376,21 +343,18 @@ metrics:
i18n:
zh-CN: 每秒查询数
en-US: QPS
ja-JP: QPS
unit: qps
- field: tps
type: 0
i18n:
zh-CN: 每秒事务数
en-US: TPS
ja-JP: TPS
unit: tps
- field: mbps
type: 0
i18n:
zh-CN: 每秒IO读写
en-US: MBPS
ja-JP: MBPS
unit: mbps
aliasFields:
- I/O Requests per Second
@@ -419,7 +383,6 @@ metrics:
i18n:
zh-CN: 百分比
en-US: Percentage
ja-JP: パーセント
priority: 7
fields:
- field: tablespace_name
@@ -427,39 +390,33 @@ metrics:
i18n:
zh-CN: 表空间名
en-US: Tablespace Name
ja-JP: 表領域名
label: true
- field: total
i18n:
zh-CN: 全部
en-US: Total
ja-JP: 合計
type: 0
- field: used
i18n:
zh-CN: 已用
en-US: Used
ja-JP: 使用済み
type: 0
- field: free
i18n:
zh-CN: 空闲
en-US: Free
ja-JP: 利用可能
type: 0
- field: used_percentage
type: 0
i18n:
zh-CN: 已用百分比
en-US: Used Percentage
ja-JP: 使用した比率
unit: '%'
- field: free_percentage
type: 0
i18n:
zh-CN: 空闲百分比
en-US: Free Percentage
ja-JP: 利用可能な比率
unit: '%'
protocol: jdbc
jdbc:
@@ -472,6 +429,7 @@ metrics:
timeout: ^_^timeout^_^
reuseConnection: ^_^reuseConnection^_^
queryType: multiRow
# DBA_TABLESPACE_USAGE_METRICS可以查出表空间used_max值,它的大小计算单位是block1kb=8block,把block*8/1024转化为MB单位
sql: "SELECT tablespace_name,ROUND ( (TABLESPACE_SIZE * 8 / 1024), 0) AS total,ROUND ( (USED_SPACE * 8 / 1024), 0) AS used,ROUND ( ( (TABLESPACE_SIZE * 8 / 1024) - (USED_SPACE * 8 / 1024)), 0) AS free,ROUND ( (USED_PERCENT), 0) AS used_percentage,100 - ROUND ( (USED_PERCENT), 0) AS free_percentage FROM sys.dba_tablespace_usage_metrics ORDER BY used_percent DESC"
url: ^_^url^_^
@@ -479,7 +437,6 @@ metrics:
i18n:
zh-CN: 进程
en-US: Process
ja-JP: プロセス
priority: 8
fields:
- field: process_count
@@ -487,7 +444,6 @@ metrics:
i18n:
zh-CN: 进程数
en-US: Process Count
ja-JP: プロセス数
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -506,7 +462,6 @@ metrics:
i18n:
zh-CN: 事务
en-US: Transaction
ja-JP: トランザクション
priority: 9
fields:
- field: commits
@@ -515,14 +470,12 @@ metrics:
i18n:
zh-CN: 提交数
en-US: Commits
ja-JP: コミット回数
- field: rollbacks
type: 0
unit: 't/s'
i18n:
zh-CN: 回滚数
en-US: Rollbacks
ja-JP: ロールバック回数
aliasFields:
- User Commits Per Sec
- User Rollbacks Per Sec
@@ -547,7 +500,6 @@ metrics:
i18n:
zh-CN: 等待
en-US: Wait
ja-JP: 待機
priority: 10
fields:
- field: concurrent_wait_time
@@ -556,56 +508,48 @@ metrics:
i18n:
zh-CN: 并发等待时间
en-US: Concurrent Wait Time
ja-JP: 同時実行の待機時間
- field: commit_wait_time
type: 0
unit: ms
i18n:
zh-CN: 提交等待时间
en-US: Commit Wait Time
ja-JP: コミット待機時間
- field: app_wait_time
type: 0
unit: ms
i18n:
zh-CN: 应用等待时间
en-US: Application Wait Time
ja-JP: 応用待機時間
- field: network_wait_time
type: 0
unit: ms
i18n:
zh-CN: 网络等待时间
en-US: Network Wait Time
ja-JP: ネットワーク待機時間
- field: system_io_wait_time
type: 0
unit: ms
i18n:
zh-CN: 系统I/O等待时间
en-US: System I/O Wait Time
ja-JP: システムI/O待機時間
- field: user_io_wait_time
type: 0
unit: ms
i18n:
zh-CN: 用户I/O等待时间
en-US: User I/O Wait Time
ja-JP: ユーザーI/O待機時間
- field: configure_wait_time
type: 0
unit: ms
i18n:
zh-CN: 配置等待时间
en-US: Configure Wait Time
ja-JP: 配置待機時間
- field: scheduler_wait_time
type: 0
unit: ms
i18n:
zh-CN: 调度等待时间
en-US: Scheduler Wait Time
ja-JP: Scheduler待機時間
aliasFields:
- System I/O
- Application
@@ -642,7 +586,6 @@ metrics:
i18n:
zh-CN: CPU状态
en-US: CPU Stats
ja-JP: CPU状態
priority: 11
fields:
- field: type
@@ -651,13 +594,11 @@ metrics:
i18n:
zh-CN: 类型
en-US: Type
ja-JP: タイプ
- field: num
type: 1
i18n:
zh-CN: 数量
en-US: Num
ja-JP: 数量
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -676,7 +617,6 @@ metrics:
i18n:
zh-CN: 内存状态
en-US: Memory Stats
ja-JP: メモリ状態
priority: 12
fields:
- field: type
@@ -685,13 +625,11 @@ metrics:
i18n:
zh-CN: 类型
en-US: Type
ja-JP: タイプ
- field: num
type: 1
i18n:
zh-CN: 数量
en-US: Num
ja-JP: 数量
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -710,7 +648,6 @@ metrics:
i18n:
zh-CN: 缓存命中率
en-US: Cache Hit Ratio
ja-JP: キャッシュ命中率
priority: 13
fields:
- field: lib_cache_hit_ratio
@@ -718,13 +655,11 @@ metrics:
i18n:
zh-CN: 库缓存命中率
en-US: LIB CACHE HIT RATIO
ja-JP: LIBキャッシュ命中率
- field: buffer_cache_hit_ratio
type: 0
i18n:
zh-CN: 缓冲区缓存命中率
en-US: BUFFER CACHE HIT RATIO
ja-JP: バッファキャッシュ命中率
aliasFields:
- Library Cache Hit Ratio
- Buffer Cache Hit Ratio
@@ -749,7 +684,6 @@ metrics:
i18n:
zh-CN: 慢查询
en-US: Slow Query
ja-JP: スロークエリ
priority: 14
fields:
- field: sql_id
@@ -757,70 +691,59 @@ metrics:
i18n:
zh-CN: sql 主键
en-US: SQL ID
ja-JP: SQL ID
- field: child_number
type: 1
i18n:
zh-CN: 子编号
en-US: Child Number
ja-JP: 子カーソルの番号
- field: executions
type: 1
i18n:
zh-CN: 执行数
en-US: EXECUTIONS
ja-JP: 行われた実行数
unit:
- field: per_secs
type: 1
i18n:
zh-CN: 每秒执行数
en-US: Per Secs
ja-JP: 1秒当たりの実行数
unit:
- field: cpu_secs
type: 1
i18n:
zh-CN: 每秒CPU
en-US: CPU Secs
ja-JP: 使用したCPU時間
unit:
- field: buffer_gets
type: 1
i18n:
zh-CN: 获得的缓冲区
en-US: Buffer Gets
ja-JP: バッファ取得数
- field: disk_reads
type: 1
i18n:
zh-CN: 磁盘读取
en-US: Disk Reads
ja-JP: ディスク読取り数
- field: fetches
type: 1
i18n:
zh-CN: 获取数量
en-US: Fetches
ja-JP: SQL文に関連するフェッチ数
- field: parse_calls
type: 1
i18n:
zh-CN: 解析调用
en-US: Parse Calls
ja-JP: 解析コール数
- field: optimizer_cost
type: 1
i18n:
zh-CN: 优化器成本
en-US: Optimizer Cost
ja-JP: オプティマイザによるこの問合せのコスト
- field: sql_text
type: 1
i18n:
zh-CN: SQL文本
en-US: SQL Text
ja-JP: SQLテキスト
protocol: jdbc
jdbc:
host: ^_^host^_^
@@ -25,13 +25,11 @@ app: ping
name:
zh-CN: PING连通性
en-US: PING CONNECT
ja-JP: PING接続
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 以 ms 为指标单位,对端 HOST 地址进行 PING 操作,判断其连通性。您可以点击“<i>新建 PING 连通性</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat uses 'ms' as the metric unit to PING the end HOST address and determines the connectivity. You could click the "Add API " button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>" menu.
zh-TW: HertzBeat 以 ms 爲指標單位,對端 HOST 地址進行 PING 操作,判斷其連通性。您可以點擊“<i>新建 PING 連通性</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: HertzBeat は、接続性を判断するために、エンド HOST アドレスに対して PING 操作を ms 単位で実行します。<br>「<i>新規 PING接続</i>」をクリックして設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/ping
en-US: https://hertzbeat.apache.org/docs/help/ping
@@ -43,7 +41,6 @@ params:
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
@@ -54,7 +51,6 @@ params:
name:
zh-CN: Ping超时时间(ms)
en-US: Ping Timeout(ms)
ja-JP: Pingタイムアウト(ms)
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
@@ -71,7 +67,6 @@ metrics:
i18n:
zh-CN: 概要
en-US: Summary
ja-JP: 概要
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
@@ -83,7 +78,6 @@ metrics:
i18n:
zh-CN: 响应时间
en-US: Response Time
ja-JP: 応答時間
# Monitoring and collection protocols eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: icmp
# Specific collection configuration when the protocol is the ping protocol

Some files were not shown because too many files have changed in this diff Show More