[feature] support auto collect metrics by prometheus task (#1342)

This commit is contained in:
tomsun28
2023-11-21 08:54:55 +08:00
committed by GitHub
parent c9fae5878a
commit 663973d77e
295 changed files with 2117 additions and 769 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ git pull upstream master
- **[warehouse](https://github.com/dromara/hertzbeat/tree/master/warehouse)** 提供监控数据仓储服务
> 采集指标结果数据管理,数据落盘,查询,计算统计。
- **[alerter](https://github.com/dromara/hertzbeat/tree/master/alerter)** 提供告警服务
> 告警计算触发,监控状态联动,告警配置,告警通知。
> 告警计算触发,任务状态联动,告警配置,告警通知。
- **[web-app](https://github.com/dromara/hertzbeat/tree/master/web-app)** 提供可视化控制台页面
> 监控告警系统可视化控制台前端
+1 -1
View File
@@ -28,7 +28,7 @@
### Features
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, database, os, middleware, cloud-native, network and more.
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more.
* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost.
* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat.
* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration.
+1 -1
View File
@@ -29,7 +29,7 @@
### 特点
-**监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控阈值告警通知一步到位。
-**监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。
- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。
-`Http,Jmx,Ssh,Snmp,Jdbc` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s``Docker` 等新的监控类型吗?
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
@@ -69,7 +69,7 @@ public class CalculateAlarm {
* The alarm in the process is triggered
* 触发中告警信息
* key - monitorId+alertDefineId 为普通阈值告警 The alarm is a common threshold alarm
* key - monitorId 为监控状态可用性可达性告警 Indicates the monitoring status availability reachability alarm
* key - monitorId 为任务状态可用性可达性告警 Indicates the monitoring status availability reachability alarm
*/
private final Map<String, Alert> triggeredAlertMap;
/**
@@ -137,7 +137,7 @@ public class CalculateAlarm {
String app = metricsData.getApp();
String metrics = metricsData.getMetrics();
// If the indicator group whose scheduling priority is 0 has the status of collecting response data UN_REACHABLE/UN_CONNECTABLE, the highest severity alarm is generated to monitor the status change
// 先判断调度优先级为0的指标组采集响应数据状态 UN_REACHABLE/UN_CONNECTABLE 则需发最高级别告警进行监控状态变更
// 先判断调度优先级为0的指标组采集响应数据状态 UN_REACHABLE/UN_CONNECTABLE 则需发最高级别告警进行任务状态变更
if (metricsData.getPriority() == 0) {
handlerAvailableMetrics(monitorId, app, metricsData);
}
@@ -378,7 +378,7 @@ public class CalculateAlarm {
} else {
// Check whether an availability or unreachable alarm is generated before the association monitoring
// and send a clear alarm to clear the monitoring status
// 判断关联监控之前是否有可用性或者不可达告警,发送恢复告警进行监控状态恢复
// 判断关联监控之前是否有可用性或者不可达告警,发送恢复告警进行任务状态恢复
String notResolvedAlertKey = monitorId + CommonConstants.AVAILABILITY;
Alert notResolvedAlert = notRecoveredAlertMap.remove(notResolvedAlertKey);
if (notResolvedAlert != null) {
@@ -42,17 +42,17 @@ public interface AlertDefineBindDao extends JpaRepository<AlertDefineMonitorBind
/**
* Deleting alarms based on monitoring IDs defines monitoring associations
* 根据监控ID删除告警定义监控关联
* 根据监控任务ID删除告警定义监控关联
*
* @param monitorId Monitor Id 监控ID
* @param monitorId Monitor Id 监控任务ID
*/
void deleteAlertDefineMonitorBindsByMonitorIdEquals(Long monitorId);
/**
* Delete alarm definition monitoring association based on monitoring ID list
* 根据监控ID列表删除告警定义监控关联
* 根据监控任务ID列表删除告警定义监控关联
*
* @param monitorIds Monitoring ID List 监控ID列表
* @param monitorIds Monitoring ID List 监控任务ID列表
*/
void deleteAlertDefineMonitorBindsByMonitorIdIn(Set<Long> monitorIds);
@@ -60,8 +60,8 @@ public interface AlertDefineDao extends JpaRepository<AlertDefine, Long>, JpaSpe
/**
* Query the alarm definition list associated with the monitoring ID
* 根据监控ID查询与之关联的告警定义列表
* @param monitorId 监控ID
* 根据监控任务ID查询与之关联的告警定义列表
* @param monitorId 监控任务ID
* @param app 监控类型
* @param metrics 指标组
* @return Alarm Definition List 告警定义列表
@@ -34,16 +34,16 @@ import java.util.List;
public interface AlertMonitorDao extends JpaRepository<Monitor, Long>, JpaSpecificationExecutor<Monitor> {
/**
* Query the monitoring status of a specified monitoring state 查询指定监控状态的监控
* @param status 监控状态
* Query the monitoring status of a specified monitoring state 查询指定任务状态的监控
* @param status 任务状态
* @return Monitor the list 监控列表
*/
List<Monitor> findMonitorsByStatusIn(List<Byte> status);
/**
* Query the monitoring status of a specified monitoring state 查询指定监控状态的监控
* @param status 监控状态
* Query the monitoring status of a specified monitoring state 查询指定任务状态的监控
* @param status 任务状态
* @return Monitor the list 监控列表
*/
List<Monitor> findMonitorsByStatus(Byte status);
@@ -69,7 +69,7 @@ public interface AlertDefineService {
/**
* Obtain alarm definition information
* 获取告警定义信息
* @param alertId Monitor the ID 监控ID
* @param alertId Monitor the ID 监控任务ID
* @return AlertDefine
* @throws RuntimeException An exception was thrown during the query 查询过程中异常抛出
*/
@@ -100,8 +100,8 @@ public interface AlertDefineService {
/**
* Query the alarm definitions that match the specified indicator group associated with the monitoring ID
* 查询与此监控ID关联的指定指标组匹配的告警定义
* @param monitorId Monitor the ID 监控ID
* 查询与此监控任务ID关联的指定指标组匹配的告警定义
* @param monitorId Monitor the ID 监控任务ID
* @param app Monitoring type 监控类型
* @param metrics Index group 指标组
* @return field - define[]
@@ -110,8 +110,8 @@ public interface AlertDefineService {
/**
* Query the alarm definitions that match the specified indicator group associated with the monitoring ID
* 查询与此监控ID关联的可用性告警定义
* @param monitorId Monitor the ID 监控ID
* 查询与此监控任务ID关联的可用性告警定义
* @param monitorId Monitor the ID 监控任务ID
* @param app Monitoring type 监控类型
* @param metrics Index group 指标组
* @return field - define[]
@@ -13,12 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
alerter.availability.recover = 可用性告警恢复通知, 监控状态已恢复正常
alerter.availability.recover = 可用性告警恢复通知, 任务状态已恢复正常
alerter.alarm.recover = 告警恢复通知
alerter.notify.title = HertzBeat告警通知
alerter.notify.target = 告警目标对象
alerter.notify.monitorId = 所属监控ID
alerter.notify.monitorName = 所属监控名称
alerter.notify.monitorId = 所属监控任务ID
alerter.notify.monitorName = 所属任务名称
alerter.notify.priority = 告警级别
alerter.notify.triggerTime = 告警触发时间
alerter.notify.times = 告警触发次数
@@ -22,8 +22,7 @@ import org.dromara.hertzbeat.common.entity.job.Metrics;
import org.dromara.hertzbeat.common.entity.message.CollectRep;
/**
* Specific indicator group collection implementation abstract class
* 具体的指标组采集实现抽象类
* Specific metrics group collection implementation abstract class
*
*
*
@@ -32,12 +31,11 @@ public abstract class AbstractCollect {
/**
* Real acquisition implementation interface
* 真正的采集实现接口
*
* @param builder response builder
* @param appId App monitoring ID 应用监控ID
* @param app Application Type 应用类型
* @param metrics Metric group configuration 指标组配置
* @param appId App monitoring ID
* @param app Application Type
* @param metrics Metric group configuration
* return response builder
*/
public abstract void collect(CollectRep.MetricsData.Builder builder, long appId, String app, Metrics metrics);
@@ -0,0 +1,367 @@
/*
* 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.dromara.hertzbeat.collector.collect.prometheus;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.net.util.Base64;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpHost;
import org.apache.http.HttpStatus;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.methods.RequestBuilder;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.auth.DigestScheme;
import org.apache.http.impl.client.BasicAuthCache;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.protocol.HttpContext;
import org.apache.http.util.EntityUtils;
import org.dromara.hertzbeat.collector.collect.common.http.CommonHttpClient;
import org.dromara.hertzbeat.collector.collect.http.promethus.exporter.ExporterParser;
import org.dromara.hertzbeat.collector.collect.http.promethus.exporter.MetricFamily;
import org.dromara.hertzbeat.collector.collect.http.promethus.exporter.MetricType;
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
import org.dromara.hertzbeat.collector.util.CollectUtil;
import org.dromara.hertzbeat.common.constants.CollectorConstants;
import org.dromara.hertzbeat.common.constants.CommonConstants;
import org.dromara.hertzbeat.common.entity.job.Metrics;
import org.dromara.hertzbeat.common.entity.job.protocol.PrometheusProtocol;
import org.dromara.hertzbeat.common.entity.message.CollectRep;
import org.dromara.hertzbeat.common.util.CommonUtil;
import org.dromara.hertzbeat.common.util.IpDomainUtil;
import org.springframework.util.StringUtils;
import javax.net.ssl.SSLException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.ConnectException;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.dromara.hertzbeat.common.constants.SignConstants.RIGHT_DASH;
/**
* http https collect
*
*
*/
@Slf4j
public class PrometheusAutoCollectImpl {
private final Set<Integer> defaultSuccessStatusCodes = Stream.of(HttpStatus.SC_OK, HttpStatus.SC_CREATED,
HttpStatus.SC_ACCEPTED, HttpStatus.SC_MULTIPLE_CHOICES, HttpStatus.SC_MOVED_PERMANENTLY,
HttpStatus.SC_MOVED_TEMPORARILY).collect(Collectors.toSet());
public PrometheusAutoCollectImpl() {
}
public List<CollectRep.MetricsData> collect(CollectRep.MetricsData.Builder builder,
Metrics metrics) {
try {
validateParams(metrics);
} catch (Exception e) {
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg(e.getMessage());
return null;
}
HttpContext httpContext = createHttpContext(metrics.getPrometheus());
HttpUriRequest request = createHttpRequest(metrics.getPrometheus());
try {
CloseableHttpResponse response = CommonHttpClient.getHttpClient()
.execute(request, httpContext);
int statusCode = response.getStatusLine().getStatusCode();
boolean isSuccessInvoke = defaultSuccessStatusCodes.contains(statusCode);
log.debug("http response status: {}", statusCode);
if (!isSuccessInvoke) {
// 状态码不在successCodes中的状态码为失败
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg("StatusCode " + statusCode);
return null;
}
// 在successCodes中的状态码成功
// todo 这里直接将InputStream转为了String, 对于prometheus exporter大数据来说, 会生成大对象, 可能会严重影响JVM内存空间
// todo 方法一、使用InputStream进行解析, 代码改动大; 方法二、手动触发gc, 可以参考dubbo for long i
String resp = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
long collectTime = System.currentTimeMillis();
builder.setTime(collectTime);
// 根据不同的解析方式解析
if (resp == null || "".equals(resp)) {
log.error("http response content is empty, status: {}.", statusCode);
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg("http response content is empty");
} else {
try {
return parseResponseByPrometheusExporter(resp, metrics.getAliasFields(), builder);
} catch (Exception e) {
log.info("parse error: {}.", e.getMessage(), e);
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg("parse response data error:" + e.getMessage());
}
}
} catch (ClientProtocolException e1) {
String errorMsg = CommonUtil.getMessageFromThrowable(e1);
log.error(errorMsg);
builder.setCode(CollectRep.Code.UN_CONNECTABLE);
builder.setMsg(errorMsg);
} catch (UnknownHostException e2) {
// 对端不可达
String errorMsg = CommonUtil.getMessageFromThrowable(e2);
log.info(errorMsg);
builder.setCode(CollectRep.Code.UN_REACHABLE);
builder.setMsg("unknown host:" + errorMsg);
} catch (InterruptedIOException | ConnectException | SSLException e3) {
// 对端连接失败
String errorMsg = CommonUtil.getMessageFromThrowable(e3);
log.info(errorMsg);
builder.setCode(CollectRep.Code.UN_CONNECTABLE);
builder.setMsg(errorMsg);
} catch (IOException e4) {
// 其它IO异常
String errorMsg = CommonUtil.getMessageFromThrowable(e4);
log.info(errorMsg);
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg(errorMsg);
} catch (Exception e) {
// 其它异常
String errorMsg = CommonUtil.getMessageFromThrowable(e);
log.error(errorMsg, e);
builder.setCode(CollectRep.Code.FAIL);
builder.setMsg(errorMsg);
} finally {
if (request != null) {
request.abort();
}
}
return Collections.singletonList(builder.build());
}
public String supportProtocol() {
return DispatchConstants.PROTOCOL_PROMETHEUS;
}
private void validateParams(Metrics metrics) throws Exception {
if (metrics == null || metrics.getPrometheus() == null) {
throw new Exception("Prometheus collect must has prometheus params");
}
PrometheusProtocol protocol = metrics.getPrometheus();
if (protocol.getPath() == null
|| "".equals(protocol.getPath())
|| !protocol.getPath().startsWith(RIGHT_DASH)) {
protocol.setPath(protocol.getPath() == null ? RIGHT_DASH : RIGHT_DASH + protocol.getPath().trim());
}
}
private static final Map<Long, ExporterParser> EXPORTER_PARSER_TABLE = new ConcurrentHashMap<>();
private List<CollectRep.MetricsData> parseResponseByPrometheusExporter(String resp, List<String> aliasFields,
CollectRep.MetricsData.Builder builder) {
if (!EXPORTER_PARSER_TABLE.containsKey(builder.getId())) {
EXPORTER_PARSER_TABLE.put(builder.getId(), new ExporterParser());
}
ExporterParser parser = EXPORTER_PARSER_TABLE.get(builder.getId());
Map<String, MetricFamily> metricFamilyMap = parser.textToMetric(resp);
List<CollectRep.MetricsData> metricsDataList = new LinkedList<>();
for (Map.Entry<String, MetricFamily> entry : metricFamilyMap.entrySet()) {
builder.clearMetrics();
builder.clearFields();
builder.clearValues();
String metricsName = entry.getKey();
builder.setMetrics(metricsName);
MetricFamily metricFamily = entry.getValue();
if (metricFamily.getMetricType() == MetricType.HISTOGRAM || metricFamily.getMetricType() == MetricType.SUMMARY) {
// todo HISTOGRAM SUMMARY
continue;
}
if (!metricFamily.getMetricList().isEmpty()) {
List<String> metricsFields = new LinkedList<>();
for (int index = 0; index < metricFamily.getMetricList().size(); index++) {
MetricFamily.Metric metric = metricFamily.getMetricList().get(index);
if (index == 0) {
metric.getLabelPair().forEach(label -> {
metricsFields.add(label.getName());
builder.addFields(CollectRep.Field.newBuilder().setName(label.getName()).setType(CommonConstants.TYPE_STRING).build());
});
builder.addFields(CollectRep.Field.newBuilder().setName("value").setType(CommonConstants.TYPE_NUMBER).build());
}
Map<String, String> labelMap = metric.getLabelPair()
.stream()
.collect(Collectors.toMap(MetricFamily.Label::getName, MetricFamily.Label::getValue));
CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder();
for (String field : metricsFields) {
String fieldValue = labelMap.get(field);
valueRowBuilder.addColumns(fieldValue == null ? CommonConstants.NULL_VALUE : fieldValue);
}
if (metric.getCounter() != null) {
valueRowBuilder.addColumns(String.valueOf(metric.getCounter().getValue()));
} else if (metric.getGauge() != null) {
valueRowBuilder.addColumns(String.valueOf(metric.getGauge().getValue()));
} else if (metric.getUntyped() != null) {
valueRowBuilder.addColumns(String.valueOf(metric.getUntyped().getValue()));
} else if (metric.getInfo() != null) {
valueRowBuilder.addColumns(String.valueOf(metric.getInfo().getValue()));
} else {
valueRowBuilder.addColumns(CommonConstants.NULL_VALUE);
}
builder.addValues(valueRowBuilder.build());
}
metricsDataList.add(builder.build());
}
}
return metricsDataList;
}
/**
* create httpContext
*
* @param protocol prometheus protocol
* @return context
*/
public HttpContext createHttpContext(PrometheusProtocol protocol) {
PrometheusProtocol.Authorization auth = protocol.getAuthorization();
if (auth != null && DispatchConstants.DIGEST_AUTH.equals(auth.getType())) {
HttpClientContext clientContext = new HttpClientContext();
if (StringUtils.hasText(auth.getDigestAuthUsername())
&& StringUtils.hasText(auth.getDigestAuthPassword())) {
CredentialsProvider provider = new BasicCredentialsProvider();
UsernamePasswordCredentials credentials
= new UsernamePasswordCredentials(auth.getDigestAuthUsername(), auth.getDigestAuthPassword());
provider.setCredentials(AuthScope.ANY, credentials);
AuthCache authCache = new BasicAuthCache();
authCache.put(new HttpHost(protocol.getHost(), Integer.parseInt(protocol.getPort())), new DigestScheme());
clientContext.setCredentialsProvider(provider);
clientContext.setAuthCache(authCache);
return clientContext;
}
}
return null;
}
/**
* 根据http配置参数构造请求头
*
* @param protocol 参数配置
* @return 请求体
*/
public HttpUriRequest createHttpRequest(PrometheusProtocol protocol) {
RequestBuilder requestBuilder = RequestBuilder.get();
// params
Map<String, String> params = protocol.getParams();
if (params != null && !params.isEmpty()) {
for (Map.Entry<String, String> param : params.entrySet()) {
if (StringUtils.hasText(param.getValue())) {
requestBuilder.addParameter(param.getKey(), param.getValue());
}
}
}
// The default request header can be overridden if customized
// keep-alive
requestBuilder.addHeader(HttpHeaders.CONNECTION, "keep-alive");
requestBuilder.addHeader(HttpHeaders.USER_AGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.76 Safari/537.36");
// headers The custom request header is overwritten here
Map<String, String> headers = protocol.getHeaders();
if (headers != null && !headers.isEmpty()) {
for (Map.Entry<String, String> header : headers.entrySet()) {
if (StringUtils.hasText(header.getValue())) {
requestBuilder.addHeader(CollectUtil.replaceUriSpecialChar(header.getKey()),
CollectUtil.replaceUriSpecialChar(header.getValue()));
}
}
}
// add accept
requestBuilder.addHeader(HttpHeaders.ACCEPT, "*/*");
// 判断是否使用Bearer Token认证
if (protocol.getAuthorization() != null) {
PrometheusProtocol.Authorization authorization = protocol.getAuthorization();
if (DispatchConstants.BEARER_TOKEN.equalsIgnoreCase(authorization.getType())) {
// 若使用 将token放入到header里面
String value = DispatchConstants.BEARER + " " + authorization.getBearerTokenToken();
requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, value);
} else if (DispatchConstants.BASIC_AUTH.equals(authorization.getType())) {
if (StringUtils.hasText(authorization.getBasicAuthUsername())
&& StringUtils.hasText(authorization.getBasicAuthPassword())) {
String authStr = authorization.getBasicAuthUsername() + ":" + authorization.getBasicAuthPassword();
String encodedAuth = new String(Base64.encodeBase64(authStr.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
requestBuilder.addHeader(HttpHeaders.AUTHORIZATION, DispatchConstants.BASIC + " " + encodedAuth);
}
}
}
// 请求内容,会覆盖post协议的params
if (StringUtils.hasLength(protocol.getPayload())) {
requestBuilder.setEntity(new StringEntity(protocol.getPayload(), StandardCharsets.UTF_8));
}
// uri
String uri = CollectUtil.replaceUriSpecialChar(protocol.getPath());
if (IpDomainUtil.isHasSchema(protocol.getHost())) {
requestBuilder.setUri(protocol.getHost() + ":" + protocol.getPort() + uri);
} else {
String ipAddressType = IpDomainUtil.checkIpAddressType(protocol.getHost());
String baseUri = CollectorConstants.IPV6.equals(ipAddressType)
? String.format("[%s]:%s%s", protocol.getHost(), protocol.getPort(), uri)
: String.format("%s:%s%s", protocol.getHost(), protocol.getPort(), uri);
boolean ssl = Boolean.parseBoolean(protocol.getSsl());
if (ssl) {
requestBuilder.setUri(CollectorConstants.HTTPS_HEADER + baseUri);
} else {
requestBuilder.setUri(CollectorConstants.HTTP_HEADER + baseUri);
}
}
// custom timeout
int timeout = CollectUtil.getTimeout(protocol.getTimeout(), 0);
if (timeout > 0) {
RequestConfig requestConfig = RequestConfig.custom()
.setConnectTimeout(timeout)
.setSocketTimeout(timeout)
.setRedirectsEnabled(true)
.build();
requestBuilder.setConfig(requestConfig);
}
return requestBuilder.build();
}
/**
* 获取实例
* @return instance
*/
public static PrometheusAutoCollectImpl getInstance() {
return PrometheusAutoCollectImpl.SingleInstance.INSTANCE;
}
/**
* 静态内部类
*/
private static class SingleInstance {
private static final PrometheusAutoCollectImpl INSTANCE = new PrometheusAutoCollectImpl();
}
}
@@ -22,6 +22,8 @@ import org.dromara.hertzbeat.collector.dispatch.timer.Timeout;
import org.dromara.hertzbeat.common.entity.job.Metrics;
import org.dromara.hertzbeat.common.entity.message.CollectRep;
import java.util.List;
/**
* Collection data scheduler interface
* 采集数据调度器接口
@@ -38,4 +40,14 @@ public interface CollectDataDispatch {
*/
void dispatchCollectData(Timeout timeout, Metrics metrics, CollectRep.MetricsData metricsData);
/**
* Processing and distributing collection result data
* 处理分发采集结果数据
*
* @param timeout time wheel timeout 时间轮timeout
* @param metrics The following indicator group collection tasks 下面的指标组采集任务
* @param metricsDataList Collect result data 采集结果数据
*/
void dispatchCollectData(Timeout timeout, Metrics metrics, List<CollectRep.MetricsData> metricsDataList);
}
@@ -211,8 +211,13 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
MetricsCollect metricsCollect = new MetricsCollect(metrics, timeout, this,
collectorIdentity, unitConvertList);
jobRequestQueue.addJob(metricsCollect);
metricsTimeoutMonitorMap.put(job.getId() + "-" + metrics.getName(),
new MetricsTime(System.currentTimeMillis(), metrics, timeout));
if (metrics.getPrometheus() != null) {
metricsTimeoutMonitorMap.put(String.valueOf(job.getId()),
new MetricsTime(System.currentTimeMillis(), metrics, timeout));
} else {
metricsTimeoutMonitorMap.put(job.getId() + "-" + metrics.getName(),
new MetricsTime(System.currentTimeMillis(), metrics, timeout));
}
});
}
@@ -345,6 +350,38 @@ public class CommonDispatcher implements MetricsTaskDispatch, CollectDataDispatc
}
}
@Override
public void dispatchCollectData(Timeout timeout, Metrics metrics, List<CollectRep.MetricsData> metricsDataList) {
WheelTimerTask timerJob = (WheelTimerTask) timeout.task();
Job job = timerJob.getJob();
metricsTimeoutMonitorMap.remove(String.valueOf(job.getId()));
if (job.isCyclic()) {
// If it is an asynchronous periodic cyclic task, directly send the collected data of the indicator group to the message middleware
// 若是异步的周期性循环任务,直接发送指标组的采集数据到消息中间件
metricsDataList.forEach(commonDataQueue::sendMetricsData);
// The collection and execution of all index groups of this job are completed.
// The periodic task pushes the task to the time wheel again.
// First, determine the execution time of the task and the task collection interval.
// 此Job所有指标组采集执行完成
// 周期性任务再次将任务push到时间轮
// 先判断此次任务执行时间与任务采集间隔时间
if (timeout.isCancelled()) {
return;
}
long spendTime = System.currentTimeMillis() - job.getDispatchTime();
long interval = job.getInterval() - spendTime / 1000;
interval = interval <= 0 ? 0 : interval;
// Reset Construction Execution Metrics Group View 重置构造执行指标组视图
job.constructPriorMetrics();
timerDispatch.cyclicJob(timerJob, interval, TimeUnit.SECONDS);
} else {
// The collection and execution of all indicator groups of this job are completed
// and the result listener is notified of the combination of all indicator group data
timerDispatch.responseSyncJobData(job.getId(), metricsDataList);
}
}
private List<Map<String, Configmap>> getConfigmapFromPreCollectData(CollectRep.MetricsData metricsData) {
if (metricsData.getValuesCount() <= 0 || metricsData.getFieldsCount() <= 0) {
return null;
@@ -79,6 +79,11 @@ public interface DispatchConstants {
* protocol push
*/
String PROTOCOL_PUSH = "push";
/**
* protocol prometheus
*/
String PROTOCOL_PROMETHEUS = "prometheus";
// Protocol type related - end
// 协议类型相关 - end //
@@ -22,6 +22,7 @@ import com.googlecode.aviator.Expression;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
import org.dromara.hertzbeat.collector.collect.prometheus.PrometheusAutoCollectImpl;
import org.dromara.hertzbeat.collector.collect.strategy.CollectStrategyFactory;
import org.dromara.hertzbeat.collector.dispatch.timer.Timeout;
import org.dromara.hertzbeat.collector.dispatch.timer.WheelTimerTask;
@@ -62,7 +63,7 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
protected long tenantId;
/**
* Monitor ID
* 监控ID
* 监控任务ID
*/
protected long monitorId;
/**
@@ -141,6 +142,14 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
response.setApp(app);
response.setId(monitorId);
response.setTenantId(tenantId);
// for prometheus auto
if (DispatchConstants.PROTOCOL_PROMETHEUS.equalsIgnoreCase(metrics.getProtocol())) {
List<CollectRep.MetricsData> metricsData = PrometheusAutoCollectImpl
.getInstance().collect(response, metrics);
validateResponse(metricsData.stream().findFirst().orElse(null));
collectDataDispatch.dispatchCollectData(timeout, metrics, metricsData);
return;
}
response.setMetrics(metrics.getName());
// According to the indicator group collection protocol, application type, etc., dispatch to the real application indicator group collection implementation class
// 根据指标组采集协议,应用类型等来调度到真正的应用指标组采集实现类
@@ -402,6 +411,24 @@ public class MetricsCollect implements Runnable, Comparable<MetricsCollect> {
return builder.build();
}
private void validateResponse(CollectRep.MetricsData metricsData) {
if (metricsData == null) {
log.error("[Collect Failed] Response metrics data is null.");
return;
}
long endTime = System.currentTimeMillis();
long runningTime = endTime - startTime;
long allTime = endTime - newTime;
if (startTime - newTime >= WARN_DISPATCH_TIME) {
log.warn("[Collector Dispatch Warn, Dispatch Use {}ms.", startTime - newTime);
}
if (metricsData.getCode() != CollectRep.Code.SUCCESS) {
log.info("[Collect Failed, Run {}ms, All {}ms] Reason: {}", runningTime, allTime, metricsData.getMsg());
} else {
log.info("[Collect Success, Run {}ms, All {}ms].", runningTime, allTime);
}
}
private void setNewThreadName(long monitorId, String app, long startTime, Metrics metrics) {
String builder = monitorId + "-" + app + "-" + metrics.getName() +
"-" + String.valueOf(startTime).substring(9);
@@ -145,7 +145,7 @@ public class CollectJobService {
* Cancel periodic asynchronous collection tasks
* 取消周期性异步采集任务
*
* @param jobId Job ID 任务ID
* @param jobId Job ID 采集任务ID
*/
public void cancelAsyncCollectJob(Long jobId) {
if (jobId != null) {
@@ -74,34 +74,22 @@ public interface CommonConstants {
/**
* Monitoring Status Code: Unmanaged
* 监控状态码: 未管理
* 任务状态码: 未管理
*/
byte UN_MANAGE_CODE = 0x00;
/**
* Monitoring Status Code: Available
* 监控状态码: 可用
* 任务状态码: 可用
*/
byte AVAILABLE_CODE = 0x01;
/**
* Monitoring Status Code: Not Available
* 监控状态码: 不可用
* 任务状态码: 不可用
*/
byte UN_AVAILABLE_CODE = 0x02;
/**
* Monitoring Status Code: Unreachable
* 监控状态码: 不可达
*/
byte UN_REACHABLE_CODE = 0x03;
/**
* Monitoring Status Code: Pending
* 监控状态码: 挂起
*/
byte SUSPENDING_CODE = 0x04;
/**
* Alarm status: 0 - normal alarm (to be processed)
* 告警状态: 0-正常告警(待处理)
@@ -238,12 +226,12 @@ public interface CommonConstants {
byte AUTH_TYPE_GITEE = 5;
/**
* 内有标签: monitorId 监控ID
* 内有标签: monitorId 监控任务ID
*/
String TAG_MONITOR_ID = "monitorId";
/**
* 内有标签: monitorName 监控名称
* 内有标签: monitorName 任务名称
*/
String TAG_MONITOR_NAME = "monitorName";
@@ -309,7 +297,7 @@ public interface CommonConstants {
/**
* ignore label
* 处理未配置恢复告警,但需要使用恢复告警变更监控状态的情况
* 处理未配置恢复告警,但需要使用恢复告警变更任务状态的情况
*/
String IGNORE = "ignore";
@@ -62,7 +62,7 @@ public class AlertDefineMonitorBind {
@Schema(title = "告警定义ID", example = "87432674384", accessMode = READ_WRITE)
private Long alertDefineId;
@Schema(title = "监控ID", example = "87432674336", accessMode = READ_WRITE)
@Schema(title = "监控任务ID", example = "87432674336", accessMode = READ_WRITE)
@Column(name = "monitor_id")
private Long monitorId;
@@ -37,7 +37,7 @@ import java.util.List;
@Schema(description = "指标组监控数据")
public class MetricsData {
@Schema(title = "监控ID")
@Schema(title = "监控任务ID")
private Long id;
@Schema(title = "监控类型")
@@ -38,7 +38,7 @@ import java.util.Map;
@Schema(description = "历史单指标数据")
public class MetricsHistoryData {
@Schema(title = "监控ID")
@Schema(title = "监控任务ID")
private Long id;
@Schema(title = "监控类型")
@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
public class Job {
/**
* Task id 任务ID
* Task id 采集任务ID
*/
private long id;
/**
@@ -54,13 +54,13 @@ public class Job {
private long tenantId = 0;
/**
* Monitoring ID Application ID
* 监控ID 应用ID
* 监控任务ID 应用ID
*/
private long monitorId;
/**
* Large categories of monitoring 监控的大类别
* service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
* service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
* service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 os-操作系统监控
*/
private String category;
/**
@@ -91,7 +91,7 @@ public class Metrics {
* Public attribute - expression calculation, map the pre-query attribute (pre Fields) with the final attribute (fields), and calculate the final attribute (fields) value
* 公共属性-表达式计算,将前置查询属性(preFields)与最终属性(fields)映射,计算出最终属性(fields)值
* eg: size = size1 + size2, speed = speedSize
* https://www.yuque.com/boyan-avfmj/aviatorscript/ban32m
* <a href="https://www.yuque.com/boyan-avfmj/aviatorscript/ban32m">www.yuque.com/boyan-avfmj/aviatorscript/ban32m</a>
*/
private List<String> calculates;
/**
@@ -166,6 +166,10 @@ public class Metrics {
* Monitoring configuration information using push style 使用push方式推送的监控配置信息
*/
private PushProtocol push;
/**
* Monitoring configuration information using the public prometheus protocol
*/
private PrometheusProtocol prometheus;
/**
* collector use - Temporarily store subTask indicator group response data
@@ -183,7 +187,7 @@ public class Metrics {
/**
* collector use - Temporarily store subTask id
* collector使用 - 分级任务ID
* collector使用 - 分级采集任务ID
*/
@JsonIgnore
private transient Integer subTaskId;
@@ -248,6 +252,7 @@ public class Metrics {
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public static class Field {
/**
* Indicator name
@@ -0,0 +1,110 @@
/*
* 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.dromara.hertzbeat.common.entity.job.protocol;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Map;
/**
* Prometheus 协议配置
*
*
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PrometheusProtocol {
/**
* 对端主机ip或域名
*/
private String host;
/**
* 对端主机端口
*/
private String port;
/**
* http/https metrics path
*/
private String path;
/**
* 超时时间
*/
private String timeout;
/**
* http是否使用链路加密ssl/tls,即是http还是https
*/
private String ssl = "false";
/**
* http请求方法: get, post, put, delete, patch
*/
private String method;
/**
* http请求携带头 eg: Content-Type = application/json
*/
private Map<String, String> headers;
/**
* http请求携带查询参数 eg: localhost:80/api?paramKey=value
*/
private Map<String, String> params;
/**
* http请求携带的请求体
*/
private String payload;
/**
* 认证信息
*/
private Authorization authorization;
/**
* 认证信息
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public static class Authorization {
/**
* 认证类型:Bearer Token, Basic Auth, Digest Auth
*/
private String type;
/**
* Bearer Token's token
*/
private String bearerTokenToken;
/**
* Basic Auth 's username
*/
private String basicAuthUsername;
/**
* Basic Auth 's password
*/
private String basicAuthPassword;
/**
* Digest Auth 's username
*/
private String digestAuthUsername;
/**
* Digest Auth 's password
*/
private String digestAuthPassword;
}
}
@@ -63,21 +63,21 @@ public class Monitor {
* 主键ID
*/
@Id
@Schema(title = "监控ID", example = "87584674384", accessMode = READ_ONLY)
@Schema(title = "监控任务ID", example = "87584674384", accessMode = READ_ONLY)
private Long id;
/**
* Job ID
* 监控对应下发的任务ID
* 监控对应下发的采集任务ID
*/
@Schema(title = "任务ID", example = "43243543543", accessMode = READ_ONLY)
@Schema(title = "采集任务ID", example = "43243543543", accessMode = READ_ONLY)
private Long jobId;
/**
* Monitor Name
* 监控的名称
*/
@Schema(title = "监控名称", example = "Api-TanCloud.cn", accessMode = READ_WRITE)
@Schema(title = "任务名称", example = "Api-TanCloud.cn", accessMode = READ_WRITE)
@Length(max = 100)
private String name;
@@ -107,10 +107,10 @@ public class Monitor {
private Integer intervals;
/**
* Monitoring status 0: Unmonitored, 1: Available, 2: Unavailable, 3: Unreachable, 4: Suspended
* 监控状态 0:未监控,1:可用,2:不可用,3:不可达,4:挂起
* Monitoring status 0: Unmonitored, 1: Available, 2: Unavailable
* 任务状态 0:未监控,1:可用,2:不可用
*/
@Schema(title = "监控状态 0:未监控,1:可用,2:不可用,3:不可达,4:挂起", accessMode = READ_WRITE)
@Schema(title = "任务状态 0:未监控,1:可用,2:不可用", accessMode = READ_WRITE)
@Min(0)
@Max(4)
private byte status;
@@ -65,9 +65,9 @@ public class Param {
/**
* Monitor ID
* 监控ID
* 监控任务ID
*/
@Schema(title = "监控ID", example = "875846754543", accessMode = READ_WRITE)
@Schema(title = "监控任务ID", example = "875846754543", accessMode = READ_WRITE)
private Long monitorId;
/**
@@ -59,7 +59,7 @@ public class TagMonitorBind {
@Column(name = "tag_id")
private Long tagId;
@Schema(title = "监控ID", example = "87432674336", accessMode = READ_WRITE)
@Schema(title = "监控任务ID", example = "87432674336", accessMode = READ_WRITE)
@Column(name = "monitor_id")
private Long monitorId;
@@ -36,7 +36,7 @@ public class History {
@Schema(description = "指标数据历史实体主键索引ID", example = "87584674384", accessMode = READ_ONLY)
private Long id;
@Schema(title = "监控ID", example = "87432674336", accessMode = READ_WRITE)
@Schema(title = "监控任务ID", example = "87432674336", accessMode = READ_WRITE)
private Long monitorId;
@Schema(title = "监控类型 mysql oracle db2")
+1 -1
View File
@@ -53,7 +53,7 @@ tags: [opensource]
- **[warehouse](https://github.com/dromara/hertzbeat/tree/master/warehouse)** 提供监控数据仓储服务
> 采集指标结果数据管理,数据落盘,查询,计算统计。
- **[alerter](https://github.com/dromara/hertzbeat/tree/master/alerter)** 提供告警服务
> 告警计算触发,监控状态联动,告警配置,告警通知。
> 告警计算触发,任务状态联动,告警配置,告警通知。
- **[web-app](https://github.com/dromara/hertzbeat/tree/master/web-app)** 提供可视化控制台页面
> 监控告警系统可视化控制台前端(angular+ts+zorro)
@@ -105,7 +105,7 @@ CREATE TABLE tag_monitor_bind
(
id bigint not null auto_increment comment '主键ID',
tag_id bigint not null comment 'TAG ID',
monitor_id bigint not null comment '监控ID',
monitor_id bigint not null comment '监控任务ID',
gmt_create timestamp default current_timestamp comment 'create time',
gmt_update datetime default current_timestamp on update current_timestamp comment 'update time',
primary key (id),
+1 -1
View File
@@ -50,7 +50,7 @@ gitee: https://gitee.com/dromara/hertzbeat
3. 查看检测指标数据
> 在监控列表可以查看监控状态,进监控详情可以查看指标数据图表等。
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image)
+2 -2
View File
@@ -146,8 +146,8 @@ shenyu:
```
[HertzBeat告警通知]
告警目标对象 : shenyu.process_open_fds.value
所属监控ID : 205540620349696
所属监控名称 : SHENYU_localhost
所属监控任务ID : 205540620349696
所属任务名称 : SHENYU_localhost
告警级别 : 警告告警
告警触发时间 : 2023-01-08 22:17:06
内容详情 : 请注意⚠️ ShenYu网关打开的文件描述符的数量为 3044 超过3000
+2 -2
View File
@@ -158,8 +158,8 @@ management:
```
[HertzBeat告警通知]
告警目标对象 : dynamic_tp.thread_pool_running.run_timeout_count
所属监控ID : 205540620349493
所属监控名称 : DynamicTp_localhost
所属监控任务ID : 205540620349493
所属任务名称 : DynamicTp_localhost
告警级别 : 严重告警
告警触发时间 : 2023-02-02 22:17:06
内容详情 : DynamicTp has run timeout thread, count is 2
+1 -1
View File
@@ -25,7 +25,7 @@ Cloud: **[GreptimePlay](https://greptime.com/playground)**
> [HertzBeat](https://github.com/dromara/hertzbeat) 一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。
-**监控+告警+通知** All in one,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控,阈值告警通知一步到位。
-**监控+告警+通知** All in one,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控,阈值告警通知一步到位。
- 更自由化的阈值规则(计算表达式)`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式及时送达。
-`Http,Jmx,Ssh,Snmp,Jdbc`等协议规范可配置化,只需在浏览器配置`YML`监控模版就能使用这些协议去自定义采集想要的指标。
+1 -1
View File
@@ -16,7 +16,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### Features
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, database, os, middleware, cloud-native, network and more.
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more.
* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost.
* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat.
* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration.
+1 -1
View File
@@ -16,7 +16,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### Features
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, database, os, middleware, cloud-native, network and more.
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more.
* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost.
* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat.
* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration.
+1 -1
View File
@@ -14,7 +14,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### Features
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, database, os, middleware, cloud-native, network and more.
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more.
* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost.
* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat.
* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration.
+1 -1
View File
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Apache Airflow监控]
| 参数名称 | 参数帮助描述 |
| ------------ | ------------------------------------------------------------ |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性 |
| 端口 | 数据库对外提供的端口,默认为8080 |
| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认3000毫秒 |
| HTTPS | 是否启用HTTPS |
+2 -2
View File
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, DORIS数据库BE监控]
| 参数名称 | 参数帮助描述 |
| ------------ | ------------------------------------------------------------ |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性 |
| 端口 | 数据库对外提供的端口,默认为8040 |
| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认3000毫秒 |
| 数据库名称 | 数据库实例名称,可选 |
@@ -167,4 +167,4 @@ keywords: [开源监控系统, 开源数据库监控, DORIS数据库BE监控]
| 指标名称 | 指标单位 | 指标帮助描述 |
| -------- | -------- | --------------------------------------------------- |
| value | 字节 | BE 进程物理内存大小,取自 `/proc/self/status/VmRSS` |
| value | 字节 | BE 进程物理内存大小,取自 `/proc/self/status/VmRSS` |
+2 -2
View File
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, DORIS数据库FE监控]
| 参数名称 | 参数帮助描述 |
| ------------ | ------------------------------------------------------------ |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性 |
| 端口 | 数据库对外提供的端口,默认为8030 |
| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认3000毫秒 |
| 数据库名称 | 数据库实例名称,可选 |
@@ -124,4 +124,4 @@ keywords: [开源监控系统, 开源数据库监控, DORIS数据库FE监控]
| prepare | 无 | 准备中 |
| committed | 无 | 已提交 |
| visible | 无 | 可见 |
| aborted | 无 | 已中止/已撤销 |
| aborted | 无 | 已中止/已撤销 |
+1 -1
View File
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Redis数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | redis对外提供的端口,默认为6379,sentinel节点默认26379 |
| 超时时间 | 设置redis info 查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
+1 -1
View File
@@ -29,7 +29,7 @@ slug: /
### Features
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, database, os, middleware, cloud-native, network and more.
* Combines **monitoring, alarm, and notification** features into one platform, and supports monitoring for web service, program, database, cache, os, webserver, middleware, bigdata, cloud-native, network, custom and more.
* Easy to use and agentless, offering full web-based operations for monitoring and alerting with just a few clicks, all at zero learning cost.
* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc` configurable, allowing you to collect any metrics by simply configuring the template `YML` file online. Imagine being able to quickly adapt to a new monitoring type like K8s or Docker simply by configuring online with HertzBeat.
* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration.
+1 -1
View File
@@ -24,7 +24,7 @@ sidebar_label: HertzBeat 实时监控
### 特点
-**监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控阈值告警通知一步到位。
-**监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。
- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。
-`Http,Jmx,Ssh,Snmp,Jdbc` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s``Docker` 等新的监控类型吗?
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
+1 -1
View File
@@ -25,7 +25,7 @@ sidebar_label: HertzBeat 华为云镜像部署快速指引
## 🎡 <font color="green">介绍</font>
> [HertzBeat赫兹跳动](https://github.com/dromara/hertzbeat) 是一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。
> 集 **监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控,阈值告警通知一步到位。
> 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控,阈值告警通知一步到位。
> 更自由化的阈值规则(计算表达式),`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式及时送达。
> 我们将`Http,Jmx,Ssh,Snmp,Jdbc`等协议规范可配置化,您只需在浏览器配置`YML`就能使用这些协议去自定义采集任何您想要的指标。
+1 -1
View File
@@ -24,7 +24,7 @@ sidebar_label: TanCloud 实时监控
### 特点
-**监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控阈值告警通知一步到位。
-**监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。
- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。
-`Http,Jmx,Ssh,Snmp,Jdbc` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s``Docker` 等新的监控类型吗?
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
@@ -54,7 +54,7 @@ keywords: [开源监控系统, 开源告警系统]
- **[warehouse](https://github.com/dromara/hertzbeat/tree/master/warehouse)** 提供监控数据仓储服务
> 采集指标结果数据管理,数据落盘,查询,计算统计。
- **[alerter](https://github.com/dromara/hertzbeat/tree/master/alerter)** 提供告警服务
> 告警计算触发,监控状态联动,告警配置,告警通知。
> 告警计算触发,任务状态联动,告警配置,告警通知。
- **[web-app](https://github.com/dromara/hertzbeat/tree/master/web-app)** 提供可视化控制台页面
> 监控告警系统可视化控制台前端(angular+ts+zorro)
@@ -105,7 +105,7 @@ CREATE TABLE tag_monitor_bind
(
id bigint not null auto_increment comment '主键ID',
tag_id bigint not null comment 'TAG ID',
monitor_id bigint not null comment '监控ID',
monitor_id bigint not null comment '监控任务ID',
gmt_create timestamp default current_timestamp comment 'create time',
gmt_update datetime default current_timestamp on update current_timestamp comment 'update time',
primary key (id),
@@ -50,7 +50,7 @@ gitee: https://gitee.com/dromara/hertzbeat
3. 查看检测指标数据
> 在监控列表可以查看监控状态,进监控详情可以查看指标数据图表等。
> 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。
![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image)
@@ -114,8 +114,8 @@ metricReporterList:
```
[HertzBeat告警通知]
告警目标对象 : iotdb.cluster_node_status.status
所属监控ID : 205540620349696
所属监控名称 : IOTDB_localhost
所属监控任务ID : 205540620349696
所属任务名称 : IOTDB_localhost
告警级别 : 紧急告警
告警触发时间 : 2023-01-05 22:17:06
内容详情 : 监控到 IOTDB 节点 127.0.0.1 状态 OFFLINE, 请及时处理。
@@ -146,8 +146,8 @@ shenyu:
```
[HertzBeat告警通知]
告警目标对象 : shenyu.process_open_fds.value
所属监控ID : 205540620349696
所属监控名称 : SHENYU_localhost
所属监控任务ID : 205540620349696
所属任务名称 : SHENYU_localhost
告警级别 : 警告告警
告警触发时间 : 2023-01-08 22:17:06
内容详情 : 请注意⚠️ ShenYu网关打开的文件描述符的数量为 3044 超过3000
@@ -158,8 +158,8 @@ management:
```
[HertzBeat告警通知]
告警目标对象 : dynamic_tp.thread_pool_running.run_timeout_count
所属监控ID : 205540620349493
所属监控名称 : DynamicTp_localhost
所属监控任务ID : 205540620349493
所属任务名称 : DynamicTp_localhost
告警级别 : 严重告警
告警触发时间 : 2023-02-02 22:17:06
内容详情 : DynamicTp has run timeout thread, count is 2
@@ -108,8 +108,8 @@ keywords: [开源监控系统, 开源数据库监控, Mysql数据库监控]
```
[HertzBeat告警通知]
告警目标对象 : mysql.cahce.query_cache_hit_rate
所属监控ID : 205540620394932
所属监控名称 : Mysql_localhost
所属监控任务ID : 205540620394932
所属任务名称 : Mysql_localhost
告警级别 : 严重告警
告警触发时间 : 2023-02-11 21:13:44
内容详情 : mysql db query_cache_hit_rate is too low, now is 20.
@@ -170,8 +170,8 @@ Github: https://github.com/dromara/hertzbeat
```
[HertzBeat告警通知]
告警目标对象 : linux.cpu.usage
所属监控ID : 483783444839382
所属监控名称 : Linux_182.33.34.2
所属监控任务ID : 483783444839382
所属任务名称 : Linux_182.33.34.2
告警级别 : 警告告警
告警触发时间 : 2023-02-15 21:13:44
内容详情 : The linux cpu usage is too high. now is 95.
@@ -18,7 +18,7 @@ keywords: [开源监控系统, 告警系统, Linux监控]
### What is HertzBeat?
> HertzBeat赫兹跳动 是一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。
> 集 **监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等指标监控,阈值告警通知一步到位。
> 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等指标监控,阈值告警通知一步到位。
> 支持更自由化的阈值规则(计算表达式),`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式及时送达。
> 我们将`Http,Jmx,Ssh,Snmp,Jdbc`等协议规范可配置化,您只需配置`YML`就能使用这些协议去自定义采集任何您想要的指标。
@@ -14,7 +14,7 @@ keywords: [开源监控系统, SpringBoot监控, 监控告警]
> HertzBeat 是一款开源,易用友好的实时监控工具,无需Agent,拥有强大自定义监控能力。
- 集**监控-告警-通知为一体**,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控,阈值告警,告警通知(邮件微信钉钉飞书短信 Slack Discord Telegram)。
- 集**监控-告警-通知为一体**,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控,阈值告警,告警通知(邮件微信钉钉飞书短信 Slack Discord Telegram)。
- 其将Http,Jmx,Ssh,Snmp,Jdbc等协议规范可配置化,只需配置YML就能使用这些协议去自定义采集任何您想要采集的指标。您相信只需配置YML就能立刻适配一个K8s或Docker等新的监控类型吗?
- HertzBeat 的强大自定义,多类型支持,易扩展,低耦合,希望能帮助开发者和中小团队快速搭建自有监控系统。
@@ -159,8 +159,8 @@ management:
```
[HertzBeat告警通知]
告警目标对象 : springboot2.threads.size
所属监控ID : 483783444839322
所属监控名称 : SPRINGBOOT2_localhost
所属监控任务ID : 483783444839322
所属任务名称 : SPRINGBOOT2_localhost
告警级别 : 警告告警
告警触发时间 : 2023-03-22 21:13:44
内容详情 : The springboot2 service's runnable state threads num is over 300, now is 444.
@@ -18,7 +18,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### What is HertzBeat?
> HertzBeat赫兹跳动 是一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。
> 集 **监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等指标监控,阈值告警通知一步到位。
> 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等指标监控,阈值告警通知一步到位。
> 支持更自由化的阈值规则(计算表达式),`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式及时送达。
> 我们将`Http,Jmx,Ssh,Snmp,Jdbc`等协议规范可配置化,您只需配置`YML`就能使用这些协议去自定义采集任何您想要的指标。
@@ -25,7 +25,7 @@ Cloud: **[GreptimePlay](https://greptime.com/playground)**
> [HertzBeat](https://github.com/dromara/hertzbeat) 一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。
-**监控+告警+通知** All in one,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控,阈值告警通知一步到位。
-**监控+告警+通知** All in one,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控,阈值告警通知一步到位。
- 更自由化的阈值规则(计算表达式)`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式及时送达。
-`Http,Jmx,Ssh,Snmp,Jdbc`等协议规范可配置化,只需在浏览器配置`YML`监控模版就能使用这些协议去自定义采集想要的指标。
@@ -18,7 +18,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
> HertzBeat赫兹跳动 是一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。
> 致力于**易用友好**,全 WEB 页面操作,鼠标点一点就能监控告警,零上手学习成本。
> 集 **监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等指标监控,阈值告警通知一步到位。
> 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等指标监控,阈值告警通知一步到位。
> 支持更自由化的阈值规则(计算表达式),`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式及时送达。
> 我们将`Http,Jmx,Ssh,Snmp,Jdbc`等协议规范可配置化,您只需配置`YML`就能使用这些协议去自定义采集任何您想要的指标。
@@ -17,7 +17,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### 特点
-**监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控阈值告警通知一步到位。
-**监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。
- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。
-`Http,Jmx,Ssh,Snmp,Jdbc` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s``Docker` 等新的监控类型吗?
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
@@ -53,7 +53,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### 特点
-**监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控阈值告警通知一步到位。
-**监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。
- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。
-`Http,Jmx,Ssh,Snmp,Jdbc` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s``Docker` 等新的监控类型吗?
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
@@ -29,7 +29,7 @@ keywords: [open source monitoring system, alerting system, Linux monitoring]
### 特点
-**监控+告警+通知** 为一体,支持对应用服务,数据库,操作系统,中间件,云原生,网络等监控阈值告警通知一步到位。
-**监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。
- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。
-`Http,Jmx,Ssh,Snmp,Jdbc` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s``Docker` 等新的监控类型吗?
- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。
@@ -78,7 +78,7 @@ sidebar_label: 系统默认解析方式
**对应的监控模版YML可以配置为如下**
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example
@@ -69,7 +69,7 @@ sidebar_label: 教程一:适配一款HTTP协议监控
样例:自定义一个名称为`hertzbeat`的自定义监控类型,其使用HTTP协议采集指标数据。
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: hertzbeat
@@ -43,7 +43,7 @@ sidebar_label: 教程二:获取TOKEN后续认证使用
我们直接复用 app-hertzbeat.yml 里面的定义内容,修改为我们当前的监控类型`hertzbeat_auth`配置参数, 比如 `app, category等`
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: hertzbeat_token
@@ -105,7 +105,7 @@ metrics: ......
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: hertzbeat_token
@@ -235,7 +235,7 @@ metrics:
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: hertzbeat_token
@@ -98,7 +98,7 @@ sidebar_label: JsonPath解析方式
**对应的监控模版YML可以配置为如下**
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example
@@ -34,7 +34,7 @@ HTTP协议支持我们自定义HTTP请求路径,请求header,请求参数,
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example_http
@@ -65,7 +65,7 @@ SQL响应数据:
样例:自定义一个名称为example_sql的自定义监控类型,其使用JDBC协议采集指标数据。
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: db
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example_sql
@@ -36,7 +36,7 @@ sidebar_label: JMX协议自定义监控
```yaml
# The monitoring type categoryservice-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控 cn-云原生cloud native network-网络监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: service
# The monitoring type eg: linux windows tomcat mysql aws...
# 监控类型 eg: linux windows tomcat mysql aws...
@@ -28,7 +28,7 @@ sidebar_label: 自定义监控
```yaml
# The monitoring type categoryservice-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控 cn-云原生cloud native network-网络监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# The monitoring type eg: linux windows tomcat mysql aws...
# 监控类型 eg: linux windows tomcat mysql aws...
@@ -36,7 +36,7 @@ sidebar_label: SNMP协议自定义监控
```yaml
# The monitoring type categoryservice-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring
# 监控类型所属类别:service-应用服务监控 db-数据库监控 mid-中间件 custom-自定义监控 os-操作系统监控 cn-云原生cloud native network-网络监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: os
# The monitoring type eg: linux windows tomcat mysql aws...
# 监控类型 eg: linux windows tomcat mysql aws...
@@ -73,7 +73,7 @@ total used free buff_cache available
```yaml
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: os
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example_linux
@@ -69,7 +69,7 @@ sidebar_label: 教程案例
```yaml
# The monitoring type categoryservice-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
# 监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控 cn-云原生cloud native network-网络监控
# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等
category: custom
# The monitoring type eg: linux windows tomcat mysql aws...
# 监控类型 eg: linux windows tomcat mysql aws...
@@ -54,7 +54,7 @@ ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
| 参数名称 | 参数帮助描述 |
|-------------|------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| JMX端口 | JMX 对外提供的HTTP端口,默认为 11099。 |
| JMX URL | 可选,自定义 JMX URL 连接 |
| 用户名 | 认证时使用的用户名 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网站监控, HTTP API监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 |
| 相对路径 | 网站地址除IP端口外的后缀路径,例如 `www.tancloud.cn/console` 网站的相对路径为 `/console`。 |
| 请求方式 | 设置接口调用的请求方式:GET,POST,PUT,DELETE。 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源操作系统监控, CentOS操作系统监
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | Linux SSH对外提供的端口,默认为22。 |
| 用户名 | SSH连接用户名,可选 |
| 密码 | SSH连接密码,可选 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, 达梦数据库监控]
| 参数名称 | 参数帮助描述 |
| ------------ | ------------------------------------------------------------ |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为5236。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -53,7 +53,7 @@ firewall-cmd --reload
| 参数名称 | 参数帮助描述 |
| ------------ | ------------------------------------------------------------ |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为2375。 |
| 查询超时时间 | 设置获取Docker服务器API接口时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 器名称 | 一般是监控所有运行中的容器信息。 |
@@ -66,7 +66,7 @@ management:
| 参数名称 | 参数帮助描述 |
| ------------ |------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 应用服务对外提供的端口,默认为8080。 |
| 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 |
| Base Path | 暴露接口路径前缀,默认 /actuator |
@@ -14,7 +14,7 @@ keywords: [开源监控系统, 开源网站监控, SiteMap监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 |
| 网站地图 | 网站SiteMap地图地址的相对路径,例如:/sitemap.xml。 |
| 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 |
@@ -40,7 +40,7 @@ export HADOOP_OPTS= "$HADOOP_OPTS
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 |
| 用户名 | JMX连接用户名 |
| 密码 | JMX连接密码 |
@@ -50,7 +50,7 @@ predefinedMetrics:
| 参数名称 | 参数帮助描述 |
|--------|------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | IoTDB指标接口对外提供的端口,默认为9091。 |
| 超时时间 | HTTP请求查询超时时间 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
@@ -53,7 +53,7 @@ java -jar $JETTY_HOME/start.jar --add-module=jmx-remote
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 |
| 用户名 | JMX连接用户名 |
| 密码 | JMX连接密码 |
@@ -31,7 +31,7 @@ keywords: [开源监控系统, 开源JAVA监控, JVM虚拟机监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 |
| 用户名 | JMX连接用户名 |
| 密码 | JMX连接密码 |
@@ -35,7 +35,7 @@ export KAFKA_JMX_OPTS="-Djava.rmi.server.hostname=ip地址 -Dcom.sun.management.
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 查询超时时间 | 设置Kafka连接的超时时间,单位ms毫秒,默认3000毫秒。 |
| 用户名 | JMX连接用户名 |
| 密码 | JMX连接密码 |
@@ -41,7 +41,7 @@ kubectl create token --duration=1000h cluster-admin
| 参数名称 | 参数帮助描述 |
|-------------|------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| APiServer端口 | K8s APiServer端口,默认6443 |
| token | 授权Access Token |
| URL | 数据库连接URL,可选,若配置,则URL里面的数据库名称,用户名密码等参数会覆盖上面配置的参数 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源操作系统监控, Linux操作系统监控
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | Linux SSH对外提供的端口,默认为22。 |
| 用户名 | SSH连接用户名,可选 |
| 密码 | SSH连接密码,可选 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, MariaDB数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为3306。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Mysql数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为3306。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, OpenGauss数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为5432。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Oracle数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为1521。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网络监控, 网络PING监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| Ping超时时间 | 设置PING未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网络监控, 端口可用性监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 |
| 连接超时时间 | 端口连接的等待超时时间,单位毫秒,默认3000毫秒。 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, PostgreSQL数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为5432。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -27,7 +27,7 @@ rabbitmq-plugins enable rabbitmq_management
| 参数名称 | 参数帮助描述 |
|----------|---------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | RabbitMQ Management 对外提供的HTTP端口,默认为15672。 |
| 用户名 | 接口Basic认证时使用的用户名 |
| 密码 | 接口Basic认证时使用的密码 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Redis数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | redis对外提供的端口,默认为6379,sentinel节点默认26379 |
| 超时时间 | 设置redis info 查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -46,7 +46,7 @@ shenyu:
| 参数名称 | 参数帮助描述 |
|--------|------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 网关指标接口对外提供的端口,默认为8090。 |
| 超时时间 | HTTP请求响应超时时间 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
@@ -36,7 +36,7 @@ management:
| 参数名称 | 参数帮助描述 |
| ------------ |------------------------------------------------------|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 应用服务对外提供的端口,默认为8080。 |
| 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 |
| Base Path | 暴露接口路径前缀,默认 /actuator |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, SqlServer数据库监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 数据库对外提供的端口,默认为1433。 |
| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 |
| 数据库名称 | 数据库实例名称,可选。 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网站监控, SSL证书监控监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | 网站对外提供的端口,https一般默认为443。 |
| 相对路径 | 网站地址除IP端口外的后缀路径,例如 `www.tancloud.cn/console` 网站的相对路径为 `/console`。 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
@@ -14,7 +14,7 @@ keywords: [开源监控系统, 开源网站监控, Tomcat监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 查询超时时间 | 设置Tomcat连接的超时时间,单位ms毫秒,默认3000毫秒。 |
| 用户名 | JMX连接用户名 |
| 密码 | JMX连接密码 |
@@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源操作系统监控, Ubuntu监控]
| 参数名称 | 参数帮助描述 |
| ----------- | ----------- |
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| 端口 | Linux SSH对外提供的端口,默认为22。 |
| 用户名 | SSH连接用户名,可选 |
| 密码 | SSH连接密码,可选 |

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