diff --git a/.all-contributorsrc b/.all-contributorsrc index eb295b4a8e1..04f841d982a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1889,6 +1889,51 @@ "contributions": [ "doc" ] + }, + { + "login": "yykaue", + "name": "Limbo", + "avatar_url": "https://avatars.githubusercontent.com/u/22905143?v=4", + "profile": "https://github.com/yykaue", + "contributions": [ + "code" + ] + }, + { + "login": "irenhongyan", + "name": "哈哈哈哈哈哈哈哈哈", + "avatar_url": "https://avatars.githubusercontent.com/u/53438321?v=4", + "profile": "https://github.com/irenhongyan", + "contributions": [ + "code" + ] + }, + { + "login": "ileonli", + "name": "Leon Li", + "avatar_url": "https://avatars.githubusercontent.com/u/45332412?v=4", + "profile": "https://github.com/ileonli", + "contributions": [ + "code" + ] + }, + { + "login": "killme2008", + "name": "dennis zhuang", + "avatar_url": "https://avatars.githubusercontent.com/u/14142?v=4", + "profile": "http://fnil.net/", + "contributions": [ + "code" + ] + }, + { + "login": "kerwin612", + "name": "Kerwin Bryant", + "avatar_url": "https://avatars.githubusercontent.com/u/3371163?v=4", + "profile": "https://github.com/kerwin612", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/.github/workflows/backend-build-test.yml b/.github/workflows/backend-build-test.yml index 88bccc66387..5e31c48b5b0 100644 --- a/.github/workflows/backend-build-test.yml +++ b/.github/workflows/backend-build-test.yml @@ -49,6 +49,10 @@ jobs: java-version: 17 - name: Build with Maven run: mvn clean -B package -Prelease --file pom.xml + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Build Image env: IMAGE_PUSH: false diff --git a/README.md b/README.md index 1f21c29f2c3..c4c60246262 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,8 @@ [![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) -[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/repository/docker/apache/hertzbeat/general) +[![codecov](https://codecov.io/gh/apache/HertzBeat/branch/master/graph/badge.svg)](https://app.codecov.io/gh/apache/hertzbeat) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) @@ -160,13 +161,13 @@ Detailed config refer to [Install HertzBeat via Package](https://hertzbeat.apach Detailed steps refer to [CONTRIBUTING](CONTRIBUTING.md) -##### 4:Install All(hertzbeat+mysql+tsdb) via Docker-compose +##### 4:Install All(hertzbeat+postgresql+tsdb) via Docker-compose -Install the mysql/postgresql database, iotdb/tdengine/victoria-metrics database and hertzbeat at one time through [docker-compose deployment script](script/docker-compose). +Install the postgresql/mysql database, victoria-metrics/iotdb/tdengine database and hertzbeat at one time through [docker-compose deployment script](script/docker-compose). Detailed steps refer to [Install via Docker-Compose](script/docker-compose/README.md) -##### 5. Install All(hertzbeat+collector+mysql+tsdb) via kubernetes helm charts +##### 5. Install All(hertzbeat+collector+postgresql+tsdb) via kubernetes helm charts Install HertzBeat cluster in a Kubernetes cluster by Helm chart. @@ -446,6 +447,13 @@ Thanks to these wonderful people, welcome to join us: Bill Lau
Bill Lau

💻 lwyang
lwyang

📖 xfl12345
xfl12345

📖 + Limbo
Limbo

💻 + 哈哈哈哈哈哈哈哈哈
哈哈哈哈哈哈哈哈哈

💻 + + + Leon Li
Leon Li

💻 + dennis zhuang
dennis zhuang

💻 + Kerwin Bryant
Kerwin Bryant

💻 diff --git a/README_CN.md b/README_CN.md index 5d96a696456..fdf0304c510 100644 --- a/README_CN.md +++ b/README_CN.md @@ -14,7 +14,8 @@ [![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) -[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/repository/docker/apache/hertzbeat/general) +[![codecov](https://codecov.io/gh/apache/HertzBeat/branch/master/graph/badge.svg)](https://app.codecov.io/gh/apache/hertzbeat) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) @@ -159,13 +160,13 @@ docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MAN 详细步骤参考 [参与贡献之本地代码启动](CONTRIBUTING.md) -##### 方式四:Docker-Compose 统一安装 hertzbeat+mysql+tsdb +##### 方式四:Docker-Compose 统一安装 hertzbeat+postgresql+tsdb -通过 [Docker-Compose 部署脚本](script/docker-compose) 一次性把 mysql/postgresql 数据库, iotdb/tdengine/victoria-metrics 时序数据库和 hertzbeat 安装部署。 +通过 [Docker-Compose 部署脚本](script/docker-compose) 一次性把 postgresql/mysql 数据库, victoria-metrics/iotdb/tdengine 时序数据库和 hertzbeat 安装部署。 详细步骤参考 [通过Docker-Compose安装HertzBeat](script/docker-compose/README.md) -##### 方式五:Kubernetes Helm Charts 部署 hertzbeat+collector+mysql+tsdb +##### 方式五:Kubernetes Helm Charts 部署 hertzbeat+collector+postgresql+tsdb 通过 Helm Chart 一次性将 HertzBeat 集群组件部署到 Kubernetes 集群中。 @@ -445,6 +446,13 @@ Thanks these wonderful people, welcome to join us: Bill Lau
Bill Lau

💻 lwyang
lwyang

📖 xfl12345
xfl12345

📖 + Limbo
Limbo

💻 + 哈哈哈哈哈哈哈哈哈
哈哈哈哈哈哈哈哈哈

💻 + + + Leon Li
Leon Li

💻 + dennis zhuang
dennis zhuang

💻 + Kerwin Bryant
Kerwin Bryant

💻 diff --git a/alerter/src/main/java/org/apache/hertzbeat/alert/AlerterWorkerPool.java b/alerter/src/main/java/org/apache/hertzbeat/alert/AlerterWorkerPool.java index a8ebf4a1f40..78afb145767 100644 --- a/alerter/src/main/java/org/apache/hertzbeat/alert/AlerterWorkerPool.java +++ b/alerter/src/main/java/org/apache/hertzbeat/alert/AlerterWorkerPool.java @@ -34,9 +34,11 @@ public class AlerterWorkerPool { private ThreadPoolExecutor workerExecutor; + private ThreadPoolExecutor notifyExecutor; public AlerterWorkerPool() { initWorkExecutor(); + initNotifyExecutor(); } private void initWorkExecutor() { @@ -57,6 +59,24 @@ private void initWorkExecutor() { new ThreadPoolExecutor.AbortPolicy()); } + private void initNotifyExecutor() { + ThreadFactory threadFactory = new ThreadFactoryBuilder() + .setUncaughtExceptionHandler((thread, throwable) -> { + log.error("notifyExecutor has uncaughtException."); + log.error(throwable.getMessage(), throwable); + }) + .setDaemon(true) + .setNameFormat("notify-worker-%d") + .build(); + notifyExecutor = new ThreadPoolExecutor(6, + 10, + 10, + TimeUnit.SECONDS, + new SynchronousQueue<>(), + threadFactory, + new ThreadPoolExecutor.AbortPolicy()); + } + /** * Run the alerter task * @param runnable task @@ -65,4 +85,15 @@ private void initWorkExecutor() { public void executeJob(Runnable runnable) throws RejectedExecutionException { workerExecutor.execute(runnable); } + + /** + * Executes the given runnable task using the notifyExecutor. + * + * @param runnable the task to be executed + * @throws RejectedExecutionException if the task cannot be accepted for execution + */ + public void executeNotify(Runnable runnable) throws RejectedExecutionException { + notifyExecutor.execute(runnable); + } + } diff --git a/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java b/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java index 3c2214726e1..2aea1ea7cf1 100644 --- a/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java +++ b/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java @@ -55,25 +55,33 @@ public AlarmConvergeReduce(AlertConvergeDao alertConvergeDao) { @SuppressWarnings("unchecked") public boolean filterConverge(Alert currentAlert) { // ignore monitor status auto recover notice - if (currentAlert.getTags() != null && currentAlert.getTags().containsKey(CommonConstants.IGNORE)) { - return true; - } - if (currentAlert.getStatus() == CommonConstants.ALERT_STATUS_CODE_RESTORED) { + if ((currentAlert.getTags() != null && currentAlert.getTags().containsKey(CommonConstants.IGNORE)) + || currentAlert.getStatus() == CommonConstants.ALERT_STATUS_CODE_RESTORED) { // restored alert + boolean isHasIgnore = false; + Map tags = currentAlert.getTags(); + if (tags.containsKey(CommonConstants.IGNORE)) { + isHasIgnore = true; + tags.remove(CommonConstants.IGNORE); + } int alertHash = Objects.hash(CommonConstants.ALERT_PRIORITY_CODE_CRITICAL) - + Arrays.hashCode(currentAlert.getTags().keySet().toArray(new String[0])) - + Arrays.hashCode(currentAlert.getTags().values().toArray(new String[0])); + + Arrays.hashCode(tags.keySet().toArray(new String[0])) + + Arrays.hashCode(tags.values().toArray(new String[0])); converageAlertMap.remove(alertHash); alertHash = Objects.hash(CommonConstants.ALERT_PRIORITY_CODE_EMERGENCY) - + Arrays.hashCode(currentAlert.getTags().keySet().toArray(new String[0])) - + Arrays.hashCode(currentAlert.getTags().values().toArray(new String[0])); + + Arrays.hashCode(tags.keySet().toArray(new String[0])) + + Arrays.hashCode(tags.values().toArray(new String[0])); converageAlertMap.remove(alertHash); alertHash = Objects.hash(CommonConstants.ALERT_PRIORITY_CODE_WARNING) - + Arrays.hashCode(currentAlert.getTags().keySet().toArray(new String[0])) - + Arrays.hashCode(currentAlert.getTags().values().toArray(new String[0])); + + Arrays.hashCode(tags.keySet().toArray(new String[0])) + + Arrays.hashCode(tags.values().toArray(new String[0])); converageAlertMap.remove(alertHash); + if (isHasIgnore) { + tags.put(CommonConstants.IGNORE, CommonConstants.IGNORE); + } return true; } + CommonCacheService convergeCache = CacheFactory.getAlertConvergeCache(); List alertConvergeList = (List) convergeCache.get(CommonConstants.CACHE_ALERT_CONVERGE); if (alertConvergeList == null) { diff --git a/alerter/src/main/java/org/apache/hertzbeat/alert/service/impl/AlertDefineServiceImpl.java b/alerter/src/main/java/org/apache/hertzbeat/alert/service/impl/AlertDefineServiceImpl.java index 21d07b2e10f..b29add88a95 100644 --- a/alerter/src/main/java/org/apache/hertzbeat/alert/service/impl/AlertDefineServiceImpl.java +++ b/alerter/src/main/java/org/apache/hertzbeat/alert/service/impl/AlertDefineServiceImpl.java @@ -26,14 +26,17 @@ import java.util.Map; import java.util.Optional; import java.util.Set; +import java.util.function.Function; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; import org.apache.hertzbeat.alert.dao.AlertDefineBindDao; import org.apache.hertzbeat.alert.dao.AlertDefineDao; +import org.apache.hertzbeat.alert.dao.AlertMonitorDao; 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.entity.alerter.AlertDefineMonitorBind; +import org.apache.hertzbeat.common.entity.manager.Monitor; import org.apache.hertzbeat.common.util.JexlExpressionRunner; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -59,6 +62,9 @@ public class AlertDefineServiceImpl implements AlertDefineService { @Autowired private AlertDefineBindDao alertDefineBindDao; + @Autowired + private AlertMonitorDao alertMonitorDao; + private final Map alertDefineImExportServiceMap = new HashMap<>(); public AlertDefineServiceImpl(List alertDefineImExportServiceList) { @@ -147,7 +153,24 @@ public Page getAlertDefines(Specification specificatio @Override public List getBindAlertDefineMonitors(long alertDefineId) { - return alertDefineBindDao.getAlertDefineBindsByAlertDefineIdEquals(alertDefineId); + List defineMonitorBinds = alertDefineBindDao.getAlertDefineBindsByAlertDefineIdEquals(alertDefineId); + if (defineMonitorBinds == null || defineMonitorBinds.isEmpty()) { + return defineMonitorBinds; + } + List needLoadMonitorIds = defineMonitorBinds.stream() + .filter(bind -> bind.getMonitor() == null) + .map(AlertDefineMonitorBind::getMonitorId).toList(); + if (needLoadMonitorIds.isEmpty()) { + return defineMonitorBinds; + } + Map monitorMap = alertMonitorDao.findAllById(needLoadMonitorIds) + .stream().collect(Collectors.toMap(Monitor::getId, Function.identity())); + for (AlertDefineMonitorBind bind : defineMonitorBinds) { + if (bind.getMonitor() == null) { + bind.setMonitor(monitorMap.get(bind.getMonitorId())); + } + } + return defineMonitorBinds; } @Override diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImpl.java index 0d81a0733e1..38c0249624d 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImpl.java @@ -158,7 +158,7 @@ private DnsResolveResult dig(DnsProtocol dns) throws IOException { responseTimeStopWatch.start(); Name name = Name.fromString(dns.getAddress(), Name.root); - Message query = Message.newQuery(Record.newRecord(name, Type.ANY, DClass.ANY)); + Message query = Message.newQuery(Record.newRecord(name, Type.ANY, DClass.value(dns.getQueryClass()))); Resolver res = new SimpleResolver(dns.getDnsServerIP()); res.setTimeout(Duration.of(Long.parseLong(dns.getTimeout()), ChronoUnit.MILLIS)); res.setTCP(Boolean.parseBoolean(dns.getTcp())); @@ -195,7 +195,7 @@ private Map getHeaderInfo(Message message, Long responseTime) { private List getSectionInfo(Message message, int section) { List currentSetList = message.getSectionRRsets(section); - + if (CollectionUtils.isEmpty(currentSetList)) { return Lists.newArrayList(); } diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java index 2b8fecd23ad..7c1db0a60f4 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java @@ -133,7 +133,7 @@ public void collect(CollectRep.MetricsData.Builder builder, // 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)) { + if (!StringUtils.hasText(resp)) { log.info("http response entity is empty, status: {}.", statusCode); } Long responseTime = System.currentTimeMillis() - startTime; diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/imap/ImapCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/imap/ImapCollectImpl.java new file mode 100644 index 00000000000..4e2e547b857 --- /dev/null +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/imap/ImapCollectImpl.java @@ -0,0 +1,169 @@ +/* + * 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.imap; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.net.imap.IMAPClient; +import org.apache.commons.net.imap.IMAPSClient; +import org.apache.hertzbeat.collector.collect.AbstractCollect; +import org.apache.hertzbeat.collector.dispatch.DispatchConstants; +import org.apache.hertzbeat.collector.util.CollectUtil; +import org.apache.hertzbeat.common.constants.CommonConstants; +import org.apache.hertzbeat.common.entity.job.Metrics; +import org.apache.hertzbeat.common.entity.job.protocol.ImapProtocol; +import org.apache.hertzbeat.common.entity.message.CollectRep; +import org.apache.hertzbeat.common.util.CommonUtil; +import org.springframework.util.Assert; + +/** + * imap collect + */ +@Slf4j +public class ImapCollectImpl extends AbstractCollect { + + private static final String UTF_7_X = "X-MODIFIED-UTF-7"; + private static final String STATUS = "STATUS"; + private static final String STATUS_COMMAND = "(MESSAGES RECENT UNSEEN)"; + private static final String MESSAGES = "MESSAGES"; + private static final String RECENT = "RECENT"; + private static final String UNSEEN = "UNSEEN"; + private static final String RESPONSETIME = "responseTime"; + private static final String totalMessageCount = "TotalMessageCount"; + private static final String recentMessageCount = "RecentMessageCount"; + private static final String unseenMessageCount = "UnseenMessageCount"; + + @Override + public void preCheck(Metrics metrics) throws IllegalArgumentException { + ImapProtocol imapProtocol = metrics.getImap(); + Assert.notNull(metrics, "IMAP collect must has Imap params"); + Assert.notNull(metrics.getImap(), "IMAP collect must has Imap params"); + Assert.hasText(imapProtocol.getHost(), "IMAP host is required"); + Assert.hasText(imapProtocol.getPort(), "IMAP port is required"); + Assert.hasText(imapProtocol.getEmail(), "IMAP email is required"); + Assert.hasText(imapProtocol.getAuthorize(), "IMAP authorize code is required"); + Assert.hasText(imapProtocol.getFolderName(), "IMAP folder name is required"); + } + + @Override + public void collect(CollectRep.MetricsData.Builder builder, long monitorId, String app, Metrics metrics) { + long startTime = System.currentTimeMillis(); + ImapProtocol imapProtocol = metrics.getImap(); + IMAPClient imapClient = null; + boolean ssl = Boolean.parseBoolean(imapProtocol.getSsl()); + + try { + imapClient = createImapClient(imapProtocol, ssl); + // if Connected, then collect metrics + if (imapClient.isConnected()) { + long responseTime = System.currentTimeMillis() - startTime; + String folderName = imapProtocol.getFolderName(); + collectImapMetrics(builder, imapClient, metrics.getAliasFields(), folderName, responseTime); + } else { + builder.setCode(CollectRep.Code.UN_CONNECTABLE); + builder.setMsg("Peer connect failed,Timeout " + imapProtocol.getTimeout() + "ms"); + } + } catch (Exception e) { + String errorMsg = CommonUtil.getMessageFromThrowable(e); + log.error(errorMsg); + builder.setCode(CollectRep.Code.FAIL); + builder.setMsg(errorMsg); + } finally { + if (imapClient != null) { + try { + imapClient.logout(); + imapClient.disconnect(); + } catch (IOException e) { + String errorMsg = CommonUtil.getMessageFromThrowable(e); + log.error(errorMsg); + builder.setCode(CollectRep.Code.FAIL); + builder.setMsg(errorMsg); + } + } + } + } + + @Override + public String supportProtocol() { + return DispatchConstants.PROTOCOL_IMAP; + } + + private IMAPClient createImapClient(ImapProtocol imapProtocol, boolean ssl) throws Exception { + IMAPClient imapClient = null; + // determine whether to use SSL-encrypted connections + imapClient = new IMAPSClient(true); + if (!ssl) { + imapClient = new IMAPClient(); + } + // set timeout + int timeout = Integer.parseInt(imapProtocol.getTimeout()); + if (timeout > 0) { + imapClient.setConnectTimeout(timeout); + } + //set Charset + imapClient.setCharset(StandardCharsets.US_ASCII); + // connect to the IMAP server + String host = imapProtocol.getHost(); + int port = Integer.parseInt(imapProtocol.getPort()); + imapClient.connect(host, port); + // validate credentials + String email = imapProtocol.getEmail(); + String authorize = imapProtocol.getAuthorize(); + boolean isAuthenticated = imapClient.login(email, authorize); + if (!isAuthenticated) { + throw new Exception("IMAP client authentication failed"); + } + return imapClient; + + } + + private void collectImapMetrics(CollectRep.MetricsData.Builder builder, IMAPClient imapClient, List aliasFields, + String folderName, long responseTime) throws Exception { + Map resultsMap = new HashMap<>(); + resultsMap.put(RESPONSETIME, String.valueOf(responseTime)); + imapClient.sendCommand(STATUS + " \"" + CollectUtil.stringEncodeUtf7String(folderName, UTF_7_X) + "\" " + STATUS_COMMAND); + String[] response = imapClient.getReplyString().split("\\s+|\\(|\\)"); + for (int i = 0; i < response.length; i++) { + switch (response[i]) { + case MESSAGES: + resultsMap.put(folderName + totalMessageCount, response[i + 1]); + break; + case RECENT: + resultsMap.put(folderName + recentMessageCount, response[i + 1]); + break; + case UNSEEN: + resultsMap.put(folderName + unseenMessageCount, response[i + 1]); + break; + default: + break; + } + } + + CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder(); + for (String field : aliasFields) { + String fieldValue = resultsMap.get(field); + valueRowBuilder.addColumns(Objects.requireNonNullElse(fieldValue, CommonConstants.NULL_VALUE)); + } + builder.addValues(valueRowBuilder.build()); + } +} diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java index 4df916c6e61..45ab1b3dd7c 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java @@ -35,6 +35,7 @@ import org.apache.hertzbeat.collector.collect.common.cache.ConnectionCommonCache; import org.apache.hertzbeat.collector.collect.common.cache.MongodbConnect; import org.apache.hertzbeat.collector.dispatch.DispatchConstants; +import org.apache.hertzbeat.common.constants.CollectorConstants; import org.apache.hertzbeat.common.constants.CommonConstants; import org.apache.hertzbeat.common.entity.job.Metrics; import org.apache.hertzbeat.common.entity.job.protocol.MongodbProtocol; @@ -188,11 +189,20 @@ private MongoClient getClient(Metrics metrics, CacheIdentifier identifier) { if (mongoClient != null) { return mongoClient; } - // If the multiplexing fails, create a new connection to connect to mongodb - // Passwords may contain special characters and need to be encoded using JS-like encodeURIComponent, which uses java URLEncoder - String url = String.format("mongodb://%s:%s@%s:%s/%s?authSource=%s", mongodbProtocol.getUsername(), - URLEncoder.encode(mongodbProtocol.getPassword(), StandardCharsets.UTF_8), mongodbProtocol.getHost(), mongodbProtocol.getPort(), - mongodbProtocol.getDatabase(), mongodbProtocol.getAuthenticationDatabase()); + + String url = null; + if (CollectorConstants.MONGO_DB_ATLAS_MODEL.equals(mongodbProtocol.getModel())){ + url = String.format("mongodb+srv://%s:%s@%s/%s?authSource=%s", mongodbProtocol.getUsername(), + URLEncoder.encode(mongodbProtocol.getPassword(), StandardCharsets.UTF_8), mongodbProtocol.getHost(), + mongodbProtocol.getDatabase(), mongodbProtocol.getAuthenticationDatabase()); + } else { + // If the multiplexing fails, create a new connection to connect to mongodb + // Passwords may contain special characters and need to be encoded using JS-like encodeURIComponent, which uses java URLEncoder + url = String.format("mongodb://%s:%s@%s:%s/%s?authSource=%s", mongodbProtocol.getUsername(), + URLEncoder.encode(mongodbProtocol.getPassword(), StandardCharsets.UTF_8), mongodbProtocol.getHost(), mongodbProtocol.getPort(), + mongodbProtocol.getDatabase(), mongodbProtocol.getAuthenticationDatabase()); + } + // Use the Mongo Client Settings builder to configure timeouts and other configurations MongoClientSettings settings = MongoClientSettings.builder() .applyConnectionString(new ConnectionString(url)) diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/collect/telnet/TelnetCollectImpl.java b/collector/src/main/java/org/apache/hertzbeat/collector/collect/telnet/TelnetCollectImpl.java index 7f867a6907b..134e3d54d26 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/collect/telnet/TelnetCollectImpl.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/collect/telnet/TelnetCollectImpl.java @@ -64,7 +64,7 @@ public void collect(CollectRep.MetricsData.Builder builder, long monitorId, Stri if (telnetClient.isConnected()) { long responseTime = System.currentTimeMillis() - startTime; List aliasFields = metrics.getAliasFields(); - Map resultMap = execCmdAndParseResult(telnetClient, telnet.getCmd()); + Map resultMap = execCmdAndParseResult(telnetClient, telnet.getCmd(), app); resultMap.put(CollectorConstants.RESPONSE_TIME, Long.toString(responseTime)); if (resultMap.size() < aliasFields.size()) { log.error("telnet response data not enough: {}", resultMap); @@ -115,7 +115,7 @@ public String supportProtocol() { return DispatchConstants.PROTOCOL_TELNET; } - private static Map execCmdAndParseResult(TelnetClient telnetClient, String cmd) throws IOException { + private static Map execCmdAndParseResult(TelnetClient telnetClient, String cmd, String app) throws IOException { if (cmd == null || cmd.trim().length() == 0) { return new HashMap<>(16); } @@ -124,6 +124,11 @@ private static Map execCmdAndParseResult(TelnetClient telnetClie outputStream.flush(); String result = new String(telnetClient.getInputStream().readAllBytes()); String[] lines = result.split("\n"); + if (CollectorConstants.ZOOKEEPER_APP.equals(app) && CollectorConstants.ZOOKEEPER_ENVI_HEAD.equals(lines[0])) { + lines = Arrays.stream(lines) + .skip(1) + .toArray(String[]::new); + } boolean contains = lines[0].contains("="); return Arrays.stream(lines) .map(item -> { diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/CollectorInfoProperties.java b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/CollectorInfoProperties.java new file mode 100644 index 00000000000..d23d3f825c7 --- /dev/null +++ b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/CollectorInfoProperties.java @@ -0,0 +1,49 @@ +/* + * 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.dispatch; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * Collector info configuration Properties + */ +@Component +@ConfigurationProperties(prefix = CollectorInfoProperties.INFO_PREFIX) +public class CollectorInfoProperties { + protected static final String INFO_PREFIX = "collector.info"; + + private String version; + private String ip; + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } +} diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/DispatchConstants.java b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/DispatchConstants.java index 12967ccf017..5fb285ed5d5 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/DispatchConstants.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/DispatchConstants.java @@ -127,6 +127,10 @@ public interface DispatchConstants { * protocol redfish */ String PROTOCOL_REDFISH = "redfish"; + /** + * protocol imap + */ + String PROTOCOL_IMAP = "imap"; // Protocol type related - end diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java index 1677c78b9f3..118e8d5a2a2 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java @@ -227,6 +227,7 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col List aliasFields = metrics.getAliasFields(); Map aliasFieldValueMap = new HashMap<>(8); Map fieldValueMap = new HashMap<>(8); + Map stringTypefieldValueMap = new HashMap<>(8); Map aliasFieldUnitMap = new HashMap<>(8); CollectRep.ValueRow.Builder realValueRowBuilder = CollectRep.ValueRow.newBuilder(); for (CollectRep.ValueRow aliasRow : aliasRowList) { @@ -246,11 +247,14 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col } else { fieldValueMap.put(aliasField, aliasFieldValue); } + stringTypefieldValueMap.put(aliasField, aliasFieldValue); } else { fieldValueMap.put(aliasField, null); + stringTypefieldValueMap.put(aliasField, null); } } + for (Metrics.Field field : fields) { String realField = field.getField(); JexlExpression expression = fieldExpressionMap.get(realField); @@ -258,14 +262,22 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col String aliasFieldUnit = null; if (expression != null) { try { - for (Map.Entry unitEntry : aliasFieldUnitMap.entrySet()) { - if (expression.getSourceText().contains(unitEntry.getKey())) { - aliasFieldUnit = unitEntry.getValue(); - break; + Map context; + if (CommonConstants.TYPE_STRING == field.getType()) { + context = stringTypefieldValueMap; + } else { + for (Map.Entry unitEntry : aliasFieldUnitMap.entrySet()) { + if (expression.getSourceText().contains(unitEntry.getKey())) { + aliasFieldUnit = unitEntry.getValue(); + break; + } } + context = fieldValueMap; } + // Also executed when valueList is empty, covering pure string assignment expressions - Object objValue = JexlExpressionRunner.evaluate(expression, fieldValueMap); + Object objValue = JexlExpressionRunner.evaluate(expression, context); + if (objValue != null) { value = String.valueOf(objValue); } @@ -315,10 +327,6 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col if (CommonConstants.TYPE_NUMBER == field.getType()) { value = CommonUtil.parseDoubleStr(value, field.getUnit()); } - // Handle the case where the value is string type and value is numeric - if (CommonConstants.TYPE_STRING == field.getType() && CommonUtil.isNumeric(value)) { - value = CommonUtil.parseDoubleStr(value, field.getUnit()); - } if (value == null) { value = CommonConstants.NULL_VALUE; } @@ -327,6 +335,7 @@ private void calculateFields(Metrics metrics, CollectRep.MetricsData.Builder col aliasFieldValueMap.clear(); fieldValueMap.clear(); aliasFieldUnitMap.clear(); + stringTypefieldValueMap.clear(); collectData.addValues(realValueRowBuilder.build()); realValueRowBuilder.clear(); } diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/entrance/CollectServer.java b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/entrance/CollectServer.java index 8f052432892..9baabd1509e 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/entrance/CollectServer.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/dispatch/entrance/CollectServer.java @@ -24,6 +24,7 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; +import org.apache.hertzbeat.collector.dispatch.CollectorInfoProperties; import org.apache.hertzbeat.collector.dispatch.DispatchProperties; import org.apache.hertzbeat.collector.dispatch.entrance.internal.CollectJobService; import org.apache.hertzbeat.collector.dispatch.entrance.processor.CollectCyclicDataProcessor; @@ -37,7 +38,6 @@ import org.apache.hertzbeat.common.entity.dto.CollectorInfo; import org.apache.hertzbeat.common.entity.message.ClusterMsg; import org.apache.hertzbeat.common.support.CommonThreadPool; -import org.apache.hertzbeat.common.util.IpDomainUtil; import org.apache.hertzbeat.common.util.JsonUtil; import org.apache.hertzbeat.remoting.RemotingClient; import org.apache.hertzbeat.remoting.event.NettyEventListener; @@ -62,6 +62,8 @@ public class CollectServer implements CommandLineRunner { private final TimerDispatch timerDispatch; + private final CollectorInfoProperties infoProperties; + private RemotingClient remotingClient; private ScheduledExecutorService scheduledExecutor; @@ -69,7 +71,8 @@ public class CollectServer implements CommandLineRunner { public CollectServer(final CollectJobService collectJobService, final TimerDispatch timerDispatch, final DispatchProperties properties, - final CommonThreadPool threadPool) { + final CommonThreadPool threadPool, + final CollectorInfoProperties infoProperties) { if (properties == null || properties.getEntrance() == null || properties.getEntrance().getNetty() == null) { log.error("init error, please config dispatch entrance netty props in application.yml"); throw new IllegalArgumentException("please config dispatch entrance netty props"); @@ -81,6 +84,7 @@ public CollectServer(final CollectJobService collectJobService, this.collectJobService = collectJobService; this.timerDispatch = timerDispatch; this.collectJobService.setCollectServer(this); + this.infoProperties = infoProperties; this.init(properties, threadPool); } @@ -130,8 +134,9 @@ public void onChannelActive(Channel channel) { String mode = CollectServer.this.collectJobService.getCollectorMode(); CollectorInfo collectorInfo = CollectorInfo.builder() .name(identity) - .ip(IpDomainUtil.getLocalhostIp()) + .ip(infoProperties.getIp()) .mode(mode) + .version(infoProperties.getVersion()) // todo more info .build(); timerDispatch.goOnline(); diff --git a/collector/src/main/java/org/apache/hertzbeat/collector/util/CollectUtil.java b/collector/src/main/java/org/apache/hertzbeat/collector/util/CollectUtil.java index 5e7249bdf0f..c7bf5022adc 100644 --- a/collector/src/main/java/org/apache/hertzbeat/collector/util/CollectUtil.java +++ b/collector/src/main/java/org/apache/hertzbeat/collector/util/CollectUtil.java @@ -17,12 +17,14 @@ package org.apache.hertzbeat.collector.util; +import com.beetstra.jutf7.CharsetProvider; import com.fasterxml.jackson.core.type.TypeReference; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import java.nio.charset.StandardCharsets; import java.util.Arrays; import java.util.Iterator; import java.util.List; @@ -53,7 +55,7 @@ public final class CollectUtil { private static final String CRYING_PLACEHOLDER_REX = "\\^o\\^"; private static final String CRYING_PLACEHOLDER_REGEX = "(\\^o\\^)(\\w|-|$|\\.)+(\\^o\\^)"; private static final Pattern CRYING_PLACEHOLDER_REGEX_PATTERN = Pattern.compile(CRYING_PLACEHOLDER_REGEX); - private static final List UNIT_SYMBOLS = Arrays.asList("%", "G", "g", "M", "m", "K", "k", "B", "b"); + private static final List UNIT_SYMBOLS = Arrays.asList("%", "G", "g", "M", "m", "K", "k", "B", "b", "Ki", "Mi", "Gi"); /** * private constructor, not allow to create instance. @@ -102,7 +104,7 @@ public static DoubleAndUnit extractDoubleAndUnitFromStr(String str) { log.debug(e.getMessage()); } - if (!str.matches(DOUBLE_AND_UNIT_CHECK_REGEX)){ + if (!str.matches(DOUBLE_AND_UNIT_CHECK_REGEX)) { return doubleAndUnit; } // extract unit from str value, eg: 23.43GB, 33KB, 44.22G @@ -455,4 +457,24 @@ public static byte[] fromHexString(String hexString) { } return bytes; } + + /** + * convert original string to UTF-7 String + * @param original original text + * @param charset encode charset + * @return String + */ + public static String stringEncodeUtf7String(String original, String charset) { + return new String(original.getBytes(new CharsetProvider().charsetForName(charset)), StandardCharsets.US_ASCII); + } + + /** + * convert UTF-7 string to original String + * @param encoded encoded String + * @param charset encode charset + * @return String + */ + public static String utf7StringDecodeString(String encoded, String charset) { + return new String(encoded.getBytes(StandardCharsets.US_ASCII), new CharsetProvider().charsetForName(charset)); + } } diff --git a/collector/src/main/resources/META-INF/services/org.apache.hertzbeat.collector.collect.AbstractCollect b/collector/src/main/resources/META-INF/services/org.apache.hertzbeat.collector.collect.AbstractCollect index 38545f57d9d..b033c4f2a1d 100644 --- a/collector/src/main/resources/META-INF/services/org.apache.hertzbeat.collector.collect.AbstractCollect +++ b/collector/src/main/resources/META-INF/services/org.apache.hertzbeat.collector.collect.AbstractCollect @@ -23,3 +23,4 @@ org.apache.hertzbeat.collector.collect.pop3.Pop3CollectImpl org.apache.hertzbeat.collector.collect.httpsd.HttpsdImpl org.apache.hertzbeat.collector.collect.redfish.RedfishCollectImpl org.apache.hertzbeat.collector.collect.nebulagraph.NgqlCollectImpl +org.apache.hertzbeat.collector.collect.imap.ImapCollectImpl diff --git a/collector/src/main/resources/application.yml b/collector/src/main/resources/application.yml index 3c23dea6332..13d52e92bfa 100644 --- a/collector/src/main/resources/application.yml +++ b/collector/src/main/resources/application.yml @@ -38,6 +38,9 @@ spring: on-profile: cluster collector: + info: + version: ${COLLECTOR_VERSION:1.6.0} + ip: ${COLLECTOR_IP:} dispatch: entrance: netty: diff --git a/collector/src/test/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImplTest.java b/collector/src/test/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImplTest.java index 46601b81831..6ba1b09f3a5 100644 --- a/collector/src/test/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImplTest.java +++ b/collector/src/test/java/org/apache/hertzbeat/collector/collect/dns/DnsCollectImplTest.java @@ -18,6 +18,9 @@ package org.apache.hertzbeat.collector.collect.dns; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.util.Collections; import org.apache.hertzbeat.common.entity.job.Metrics; import org.apache.hertzbeat.common.entity.job.protocol.DnsProtocol; import org.apache.hertzbeat.common.entity.message.CollectRep; @@ -40,6 +43,8 @@ public void setup() { .dnsServerIP("8.8.8.8") .queryClass("IN") .address("www.google.com") + .timeout("3000") + .port("53") .build(); } @@ -49,8 +54,10 @@ public void testCollect() { long monitorId = 666; String app = "testDNS"; Metrics metrics = new Metrics(); + metrics.setName("question"); metrics.setDns(dnsProtocol); - + metrics.setAliasFields(Collections.singletonList("section")); dnsCollect.collect(builder, monitorId, app, metrics); + assertNotNull(builder.getValues(0).getColumns(0)); } } diff --git a/collector/src/test/java/org/apache/hertzbeat/collector/collect/imap/ImapCollectImplTest.java b/collector/src/test/java/org/apache/hertzbeat/collector/collect/imap/ImapCollectImplTest.java new file mode 100644 index 00000000000..eae79039afc --- /dev/null +++ b/collector/src/test/java/org/apache/hertzbeat/collector/collect/imap/ImapCollectImplTest.java @@ -0,0 +1,142 @@ +/* + * 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.imap; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import java.util.List; +import org.apache.commons.net.imap.IMAPClient; +import org.apache.commons.net.imap.IMAPSClient; +import org.apache.hertzbeat.common.entity.job.Metrics; +import org.apache.hertzbeat.common.entity.job.protocol.ImapProtocol; +import org.apache.hertzbeat.common.entity.message.CollectRep; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.MockedConstruction; +import org.mockito.Mockito; +import org.mockito.junit.jupiter.MockitoExtension; + +/** + * Test case for {@link ImapCollectImpl} + */ +@ExtendWith(MockitoExtension.class) +public class ImapCollectImplTest { + private Metrics metrics; + private CollectRep.MetricsData.Builder builder; + @Mock + private ImapProtocol imapProtocol; + @InjectMocks + private ImapCollectImpl imapCollect; + + @BeforeEach + void setUp() { + imapProtocol = ImapProtocol.builder() + .host("0.0.0.0") + .port("993") + .ssl("true") + .email("test@test.email.com") + .authorize("test") + .folderName("testFolder") + .timeout("6000") + .build(); + metrics = new Metrics(); + metrics.setName("testMailboxInfo"); + metrics.setImap(imapProtocol); + metrics.setAliasFields(List.of("responseTime", "testFolderTotalMessageCount", "testFolderRecentMessageCount", "testFolderUnseenMessageCount")); + builder = CollectRep.MetricsData.newBuilder(); + } + + @Test + void preCheck() { + assertDoesNotThrow(() -> { + imapCollect.preCheck(metrics); + }); + assertThrows(NullPointerException.class, () -> { + imapCollect.preCheck(null); + }); + metrics.setImap(null); + assertThrows(NullPointerException.class, () -> { + imapCollect.preCheck(null); + }); + } + + @Test + void enableSslCollect() { + String response = "* STATUS \"testFolder\" (MESSAGES 3 RECENT 2 UNSEEN 1)"; + MockedConstruction mocked = Mockito.mockConstruction(IMAPSClient.class, + (imapsClient, context) -> { + Mockito.doNothing().when(imapsClient).connect(Mockito.anyString(), Mockito.anyInt()); + Mockito.doAnswer(invocationOnMock -> true).when(imapsClient).login(Mockito.anyString(), Mockito.anyString()); + Mockito.doAnswer(invocationOnMock -> true).when(imapsClient).isConnected(); + Mockito.when(imapsClient.sendCommand(Mockito.anyString())).thenReturn(0); + Mockito.when(imapsClient.getReplyString()).thenReturn(response); + Mockito.doAnswer(invocationOnMock -> true).when(imapsClient).logout(); + Mockito.doNothing().when(imapsClient).disconnect(); + }); + + imapCollect.preCheck(metrics); + imapCollect.collect(builder, 1L, "testIMAP", metrics); + assertEquals(1, builder.getValuesCount()); + for (CollectRep.ValueRow valueRow : builder.getValuesList()) { + assertNotNull(valueRow.getColumns(0)); + assertEquals("3", valueRow.getColumns(1)); + assertEquals("2", valueRow.getColumns(2)); + assertEquals("1", valueRow.getColumns(3)); + + } + mocked.close(); + } + + @Test + void disableSslCollect() { + metrics.getImap().setSsl("false"); + String response = "* STATUS \"testFolder\" (MESSAGES 3 RECENT 2 UNSEEN 1)"; + MockedConstruction mocked = Mockito.mockConstruction(IMAPClient.class, + (imapClient, context) -> { + Mockito.doNothing().when(imapClient).connect(Mockito.anyString(), Mockito.anyInt()); + Mockito.doAnswer(invocationOnMock -> true).when(imapClient).login(Mockito.anyString(), Mockito.anyString()); + Mockito.doAnswer(invocationOnMock -> true).when(imapClient).isConnected(); + Mockito.when(imapClient.sendCommand(Mockito.anyString())).thenReturn(0); + Mockito.when(imapClient.getReplyString()).thenReturn(response); + Mockito.doAnswer(invocationOnMock -> true).when(imapClient).logout(); + Mockito.doNothing().when(imapClient).disconnect(); + }); + + imapCollect.preCheck(metrics); + imapCollect.collect(builder, 1L, "testIMAP", metrics); + assertEquals(1, builder.getValuesCount()); + for (CollectRep.ValueRow valueRow : builder.getValuesList()) { + assertNotNull(valueRow.getColumns(0)); + assertEquals("3", valueRow.getColumns(1)); + assertEquals("2", valueRow.getColumns(2)); + assertEquals("1", valueRow.getColumns(3)); + + } + mocked.close(); + } + + @Test + void supportProtocol() { + assertEquals("imap", imapCollect.supportProtocol()); + } +} diff --git a/collector/src/test/java/org/apache/hertzbeat/collector/collect/redis/RedisSingleCollectImplTest.java b/collector/src/test/java/org/apache/hertzbeat/collector/collect/redis/RedisSingleCollectImplTest.java index 2edda3c9ec9..010402aefcb 100644 --- a/collector/src/test/java/org/apache/hertzbeat/collector/collect/redis/RedisSingleCollectImplTest.java +++ b/collector/src/test/java/org/apache/hertzbeat/collector/collect/redis/RedisSingleCollectImplTest.java @@ -76,13 +76,29 @@ void getInstance() { @Test void collect() { + String info = """ + # CPU + used_cpu_sys:0.544635 + used_cpu_user:0.330690 + """; CollectRep.MetricsData.Builder builder = CollectRep.MetricsData.newBuilder(); List aliasField = new ArrayList<>(); aliasField.add("used_cpu_sys"); Metrics metrics = new Metrics(); metrics.setRedis(redisProtocol); + metrics.setName("cpu"); metrics.setAliasFields(aliasField); + metrics.setFields(List.of()); + + MockedStatic clientMockedStatic = Mockito.mockStatic(RedisClient.class); + clientMockedStatic.when(() -> RedisClient.create(Mockito.any(ClientResources.class), Mockito.any(RedisURI.class))) + .thenReturn(client); + Mockito.when(client.connect()).thenReturn(connection); + Mockito.when(connection.sync()).thenReturn(cmd); + Mockito.when(cmd.info(metrics.getName())).thenReturn(info); redisSingleCollect.collect(builder, 1L, "test", metrics); + assertEquals(builder.getValues(0).getColumns(0), "0.544635"); + clientMockedStatic.close(); } @Test @@ -133,5 +149,6 @@ void testCollect() { assertEquals(row.getColumns(0), redisMode); assertEquals(row.getColumns(1), version); } + clientMockedStatic.close(); } } diff --git a/collector/src/test/java/org/apache/hertzbeat/collector/util/CollectUtilTest.java b/collector/src/test/java/org/apache/hertzbeat/collector/util/CollectUtilTest.java index f0f70cf14e0..1b85ddce8cb 100644 --- a/collector/src/test/java/org/apache/hertzbeat/collector/util/CollectUtilTest.java +++ b/collector/src/test/java/org/apache/hertzbeat/collector/util/CollectUtilTest.java @@ -81,6 +81,15 @@ void extractDoubleAndUnitFromStr() { assertNull(res4.getValue()); assertNull(res4.getUnit()); + CollectUtil.DoubleAndUnit res5 = CollectUtil.extractDoubleAndUnitFromStr("200Ki"); + assertEquals(200, res5.getValue()); + assertEquals("Ki", res5.getUnit()); + CollectUtil.DoubleAndUnit res6 = CollectUtil.extractDoubleAndUnitFromStr("200Mi"); + assertEquals(200, res6.getValue()); + assertEquals("Mi", res6.getUnit()); + CollectUtil.DoubleAndUnit res7 = CollectUtil.extractDoubleAndUnitFromStr("200Gi"); + assertEquals(200, res7.getValue()); + assertEquals("Gi", res7.getUnit()); } diff --git a/common/pom.xml b/common/pom.xml index 4b8f2a12a2f..42a483ee239 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -116,5 +116,12 @@ org.apache.commons commons-collections4 + + + + com.beetstra.jutf7 + jutf7 + 1.0.0 + diff --git a/common/src/main/java/org/apache/hertzbeat/common/constants/AiConstants.java b/common/src/main/java/org/apache/hertzbeat/common/constants/AiConstants.java new file mode 100644 index 00000000000..bf8f0893009 --- /dev/null +++ b/common/src/main/java/org/apache/hertzbeat/common/constants/AiConstants.java @@ -0,0 +1,116 @@ +/* + * 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; + +/** + * AI constants + */ +public interface AiConstants { + + /** + * zhiPu constants + */ + interface ZhiPuConstants { + + /** + * zhiPu request url + */ + String URL = "https://open.bigmodel.cn/api/paas/v4/chat/completions"; + + /** + * request role param + */ + String REQUEST_ROLE = "user"; + + /** + * The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 1024 + */ + Integer MAX_TOKENS = 1024; + + /** + * The sampling temperature, which controls the randomness of the output, must be positive + * The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. The larger the value, + * the more random and creative the output will be. The smaller the value, the more stable or certain the output will be + * You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time + */ + double TEMPERATURE = 0.95; + + } + + /** + * alibaba Ai constants + */ + interface AliAiConstants { + + /** + * alibabaAi request url + */ + String URL = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation"; + + /** + * request role param + */ + String REQUEST_ROLE = "user"; + + /** + * The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 1024 + */ + Integer MAX_TOKENS = 1024; + + /** + * The sampling temperature, which controls the randomness of the output, must be positive + * The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. The larger the value, + * the more random and creative the output will be. The smaller the value, the more stable or certain the output will be + * You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time + */ + float TEMPERATURE = 0.9f; + + + } + + /** + * Kimi Ai constants + */ + interface KimiAiConstants { + + /** + * Kimi Ai URL + */ + String URL = "https://api.moonshot.cn/v1/chat/completions"; + + /** + * request role param + */ + String REQUEST_ROLE = "user"; + + /** + * The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 1024 + */ + Integer MAX_TOKENS = 1024; + + /** + * The sampling temperature, which controls the randomness of the output, must be positive + * The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. The larger the value, + * the more random and creative the output will be. The smaller the value, the more stable or certain the output will be + * You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time + */ + float TEMPERATURE = 0.9f; + + + } +} diff --git a/common/src/main/java/org/apache/hertzbeat/common/constants/AiTypeEnum.java b/common/src/main/java/org/apache/hertzbeat/common/constants/AiTypeEnum.java new file mode 100644 index 00000000000..6225b229756 --- /dev/null +++ b/common/src/main/java/org/apache/hertzbeat/common/constants/AiTypeEnum.java @@ -0,0 +1,54 @@ +/* + * 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; + +/** + * Ai type Enum + */ +public enum AiTypeEnum { + + /** + * 智普 + */ + zhiPu, + + /** + * alibabaAi + */ + alibabaAi, + + /** + * Moonshot AI + */ + kimiAi; + + + /** + * get type + */ + public static AiTypeEnum getTypeByName(String type) { + for (AiTypeEnum aiTypeEnum : values()) { + if (aiTypeEnum.name().equals(type)) { + return aiTypeEnum; + } + + } + return null; + } + +} diff --git a/common/src/main/java/org/apache/hertzbeat/common/constants/CollectorConstants.java b/common/src/main/java/org/apache/hertzbeat/common/constants/CollectorConstants.java index 13ffc3b83b5..ace1ea800bb 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/constants/CollectorConstants.java +++ b/common/src/main/java/org/apache/hertzbeat/common/constants/CollectorConstants.java @@ -42,5 +42,15 @@ public interface CollectorConstants { String POSTGRESQL_UN_REACHABLE_CODE = "08001"; String IPV6 = "ipv6"; + String IPV4 = "ipv4"; + + /** + * MongoDB Atlas model + */ + String MONGO_DB_ATLAS_MODEL = "mongodb-atlas"; + + String ZOOKEEPER_APP = "zookeeper"; + + String ZOOKEEPER_ENVI_HEAD = "Environment:"; } diff --git a/common/src/main/java/org/apache/hertzbeat/common/entity/dto/CollectorInfo.java b/common/src/main/java/org/apache/hertzbeat/common/entity/dto/CollectorInfo.java index 4807ab10b34..7c5a889e8cb 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/entity/dto/CollectorInfo.java +++ b/common/src/main/java/org/apache/hertzbeat/common/entity/dto/CollectorInfo.java @@ -38,9 +38,10 @@ public class CollectorInfo { @NotNull private String name; - @NotNull private String ip; - + + private String version; + @NotNull private String mode = CommonConstants.MODE_PUBLIC; } diff --git a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java index ef36438aaa0..dcde28bdb8e 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java +++ b/common/src/main/java/org/apache/hertzbeat/common/entity/job/Metrics.java @@ -33,6 +33,7 @@ import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol; import org.apache.hertzbeat.common.entity.job.protocol.HttpsdProtocol; import org.apache.hertzbeat.common.entity.job.protocol.IcmpProtocol; +import org.apache.hertzbeat.common.entity.job.protocol.ImapProtocol; import org.apache.hertzbeat.common.entity.job.protocol.JdbcProtocol; import org.apache.hertzbeat.common.entity.job.protocol.JmxProtocol; import org.apache.hertzbeat.common.entity.job.protocol.MemcachedProtocol; @@ -200,7 +201,7 @@ public class Metrics { */ private NginxProtocol nginx; /** - * Monitoring configuration information using the public Nginx protocol + * Monitoring configuration information using the public pop3 protocol */ private Pop3Protocol pop3; /** @@ -212,9 +213,13 @@ public class Metrics { */ private RedfishProtocol redfish; /** - * Monitoring configuration information using the public redfish protocol + * Monitoring configuration information using the public ngql protocol */ private NgqlProtocol ngql; + /** + * Monitoring configuration information using the public imap protocol + */ + private ImapProtocol imap; /** * collector use - Temporarily store subTask metrics response data diff --git a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/ImapProtocol.java b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/ImapProtocol.java new file mode 100644 index 00000000000..55444f7aeec --- /dev/null +++ b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/ImapProtocol.java @@ -0,0 +1,67 @@ +/* + * 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.job.protocol; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * imap protocol + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ImapProtocol { + /** + * Receiving server address + */ + private String host; + + /** + * Receiving server port + */ + private String port; + + /** + * TIME OUT PERIOD + */ + private String timeout; + + /** + * Whether to enable SSL encryption [Email Transmission] + */ + private String ssl = "false"; + + /** + * IMAP Email address + */ + private String email; + + /** + * Authorization code + */ + private String authorize; + /** + * Mailbox folder name + */ + private String folderName; + +} diff --git a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/MongodbProtocol.java b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/MongodbProtocol.java index b3be39e055f..1231737377f 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/MongodbProtocol.java +++ b/common/src/main/java/org/apache/hertzbeat/common/entity/job/protocol/MongodbProtocol.java @@ -42,6 +42,11 @@ public class MongodbProtocol { */ private String port; + /** + * Mongodb model + */ + private String model; + /** * Mongodb User name (optional) */ diff --git a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java index 9fa86bc10c7..78c5eb51ab1 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java +++ b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/Collector.java @@ -64,6 +64,9 @@ public class Collector { @NotNull private String ip; + @Schema(title = "collector version", description = "collector version") + private String version; + @Schema(title = "collector status: 0-online 1-offline") @Min(0) private byte status; diff --git a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java index 14215517b2f..274b055bc7a 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java +++ b/common/src/main/java/org/apache/hertzbeat/common/entity/manager/NoticeReceiver.java @@ -121,6 +121,11 @@ public class NoticeReceiver { example = "779294123", accessMode = READ_WRITE) private String tgUserId; + @Schema(title = "DingTalk,FeiShu,WeWork user id: The notification method is valid for DingTalk,FeiShu,WeWork Bot", + description = "DingTalk,FeiShu,WeWork user id: The notification method is valid for DingTalk,FeiShu,WeWork Bot", + example = "779294123", accessMode = READ_WRITE) + private String userId; + @Schema(title = "URL address: The notification method is valid for Slack", description = "URL address: The notification method is valid for Slack", example = "https://hooks.slack.com/services/XXXX/XXXX/XXXX", accessMode = READ_WRITE) diff --git a/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java b/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java index 21901f87485..4fffd211277 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java +++ b/common/src/main/java/org/apache/hertzbeat/common/util/IntervalExpressionUtil.java @@ -49,7 +49,7 @@ private IntervalExpressionUtil() { * @return true-yes false-no */ public static boolean validNumberIntervalExpress(Double numberValue, String expression) { - if (expression == null || "".equals(expression)) { + if (expression == null || expression.isEmpty()) { return true; } if (numberValue == null) { @@ -64,12 +64,12 @@ public static boolean validNumberIntervalExpress(Double numberValue, String expr } Double[] doubleValues = new Double[2]; if (NEGATIVE.equals(values[0])) { - doubleValues[0] = Double.MIN_VALUE; + doubleValues[0] = Double.NEGATIVE_INFINITY; } else { doubleValues[0] = Double.parseDouble(values[0]); } if (POSITIVE.equals(values[1])) { - doubleValues[1] = Double.MAX_VALUE; + doubleValues[1] = Double.POSITIVE_INFINITY; } else { doubleValues[1] = Double.parseDouble(values[1]); } diff --git a/common/src/main/java/org/apache/hertzbeat/common/util/IpDomainUtil.java b/common/src/main/java/org/apache/hertzbeat/common/util/IpDomainUtil.java index 598d871fc01..886a5200e18 100644 --- a/common/src/main/java/org/apache/hertzbeat/common/util/IpDomainUtil.java +++ b/common/src/main/java/org/apache/hertzbeat/common/util/IpDomainUtil.java @@ -29,7 +29,7 @@ import org.springframework.util.StringUtils; /** - * ipv4 ipv6 domain util + * ipv4 ipv6 domain util. */ @Slf4j public final class IpDomainUtil { @@ -40,7 +40,7 @@ public final class IpDomainUtil { private static final String LOCALHOST = "localhost"; /** - * HTTP header schema + * HTTP header schema. */ private static final Pattern DOMAIN_SCHEMA = Pattern.compile("^([hH][tT]{2}[pP]://|[hH][tT]{2}[pP][sS]://){1}[^\\s]*"); @@ -48,7 +48,7 @@ private IpDomainUtil() { } /** - * whether it is ip or domain + * whether it is ip or domain. * @param ipDomain ip domain string * @return true-yes false-no */ @@ -70,7 +70,7 @@ public static boolean validateIpDomain(String ipDomain) { } /** - * if domain or ip has http / https schema + * if domain or ip has http / https schema. * @param domainIp host * @return true or false */ @@ -82,7 +82,7 @@ public static boolean isHasSchema(String domainIp) { } /** - * get localhost IP + * get localhost IP. * @return ip */ public static String getLocalhostIp() { @@ -106,9 +106,9 @@ public static String getLocalhostIp() { } return null; } - + /** - * + * check IP address type. * @param ipDomain ip domain * @return IP address type */ @@ -120,7 +120,7 @@ public static String checkIpAddressType(String ipDomain){ } /** - * get current local host name + * get current local host name. * @return hostname */ public static String getCurrentHostName() { diff --git a/common/src/main/java/org/apache/hertzbeat/common/util/StrUtil.java b/common/src/main/java/org/apache/hertzbeat/common/util/StrUtil.java new file mode 100644 index 00000000000..b5acf8517bf --- /dev/null +++ b/common/src/main/java/org/apache/hertzbeat/common/util/StrUtil.java @@ -0,0 +1,43 @@ +/* + * 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 java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Objects; + +/** + * String processing tools + */ +public class StrUtil { + + /** + * Handle Comma Separated Data + * @param arg Comma separated data + * @return Data List + */ + public static List analysisArgToList(String arg) { + if (Objects.isNull(arg)) { + return Collections.emptyList(); + } + return Arrays.asList(arg.split("\\s*,\\s*")); + } + +} diff --git a/common/src/test/java/org/apache/hertzbeat/common/util/IntervalExpressionUtilTest.java b/common/src/test/java/org/apache/hertzbeat/common/util/IntervalExpressionUtilTest.java index c6abaf34d1c..91c8e0314a3 100644 --- a/common/src/test/java/org/apache/hertzbeat/common/util/IntervalExpressionUtilTest.java +++ b/common/src/test/java/org/apache/hertzbeat/common/util/IntervalExpressionUtilTest.java @@ -17,19 +17,54 @@ package org.apache.hertzbeat.common.util; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + /** * Test case for {@link IntervalExpressionUtil} */ class IntervalExpressionUtilTest { - @BeforeEach - void setUp() { - } + @Test + public void testValidNumberIntervalExpress() { + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(5.0, null)); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(5.0, "")); + + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(null, "(3,7)")); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(5.0, "(3,7)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(3.0, "(3,7)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(7.0, "(3,7)")); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(3.0, "[3,7]")); + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(7.0, "[3,7]")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(2.0, "[3,7]")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(8.0, "[3,7]")); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(3.0, "[3,7)")); + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(6.9999, "[3,7)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(7.0, "[3,7)")); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(4.0, "(3,7]")); + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(7.0, "(3,7]")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(3.0, "(3,7]")); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(-1000.0, "(-∞,5)")); + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(-1.0, "(-∞,5)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(5.0, "(-∞,5)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(10.0, "(-∞,5)")); + + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(1000.0, "(5,+∞)")); + assertTrue(IntervalExpressionUtil.validNumberIntervalExpress(10.0, "(5,+∞)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(5.0, "(5,+∞)")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(0.0, "(5,+∞)")); + + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(5.0, "(3,7")); + assertFalse(IntervalExpressionUtil.validNumberIntervalExpress(5.0, "[3,7)3,7]")); + } - @Test - void validNumberIntervalExpress() { - } } diff --git a/common/src/test/java/org/apache/hertzbeat/common/util/IpDomainUtilTest.java b/common/src/test/java/org/apache/hertzbeat/common/util/IpDomainUtilTest.java index 4e182a91a9d..a711d6515d8 100644 --- a/common/src/test/java/org/apache/hertzbeat/common/util/IpDomainUtilTest.java +++ b/common/src/test/java/org/apache/hertzbeat/common/util/IpDomainUtilTest.java @@ -17,9 +17,24 @@ package org.apache.hertzbeat.common.util; +import java.net.Inet4Address; +import java.net.InetAddress; +import java.net.NetworkInterface; +import java.net.SocketException; +import java.util.Collections; +import java.util.Enumeration; + +import org.apache.hertzbeat.common.constants.CollectorConstants; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.jupiter.api.Test; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; /** * Test case for {@link IpDomainUtil} @@ -56,4 +71,63 @@ void isHasSchema() { assertFalse(IpDomainUtil.isHasSchema("www.baidu.com")); assertFalse(IpDomainUtil.isHasSchema("https_www.baidu.com")); } + + @Test + void testGetLocalhostIp() throws SocketException { + + // Success + InetAddress mockedInetAddress = mock(Inet4Address.class); + when(mockedInetAddress.getHostAddress()).thenReturn("192.168.1.100"); + + NetworkInterface mockedNetworkInterface = mock(NetworkInterface.class); + when(mockedNetworkInterface.isLoopback()).thenReturn(false); + when(mockedNetworkInterface.isVirtual()).thenReturn(false); + when(mockedNetworkInterface.isUp()).thenReturn(true); + + Enumeration inetAddresses = Collections.enumeration(Collections.singletonList(mockedInetAddress)); + when(mockedNetworkInterface.getInetAddresses()).thenReturn(inetAddresses); + + Enumeration successNetworkInterfaces = Collections.enumeration(Collections.singletonList(mockedNetworkInterface)); + + try (MockedStatic mockedStaticNetworkInterface = Mockito.mockStatic(NetworkInterface.class)) { + mockedStaticNetworkInterface.when(NetworkInterface::getNetworkInterfaces).thenReturn(successNetworkInterfaces); + String localhostIp = IpDomainUtil.getLocalhostIp(); + + assertEquals("192.168.1.100", localhostIp); + } + + // no network interface + Enumeration noNetworkIFNetworkInterfaces = Collections.enumeration(Collections.emptyList()); + + try (MockedStatic mockedStaticNetworkInterface = Mockito.mockStatic(NetworkInterface.class)) { + mockedStaticNetworkInterface.when(NetworkInterface::getNetworkInterfaces).thenReturn(noNetworkIFNetworkInterfaces); + String localhostIp = IpDomainUtil.getLocalhostIp(); + + assertNull(localhostIp); + } + + // throw exception + try (MockedStatic mockedStaticNetworkInterface = Mockito.mockStatic(NetworkInterface.class)) { + mockedStaticNetworkInterface.when(NetworkInterface::getNetworkInterfaces).thenThrow(new RuntimeException("Test exception")); + String localhostIp = IpDomainUtil.getLocalhostIp(); + + assertNull(localhostIp); + } + + } + + @Test + void testCheckIpAddressType() { + + assertEquals(CollectorConstants.IPV4, IpDomainUtil.checkIpAddressType("192.168.1.1")); + assertEquals(CollectorConstants.IPV4, IpDomainUtil.checkIpAddressType("127.0.0.1")); + + assertEquals(CollectorConstants.IPV6, IpDomainUtil.checkIpAddressType("2001:0db8:85a3:0000:0000:8a2e:0370:7334")); + assertEquals(CollectorConstants.IPV6, IpDomainUtil.checkIpAddressType("::1")); + + assertEquals(CollectorConstants.IPV4, IpDomainUtil.checkIpAddressType("")); + assertEquals(CollectorConstants.IPV4, IpDomainUtil.checkIpAddressType(null)); + assertEquals(CollectorConstants.IPV4, IpDomainUtil.checkIpAddressType("invalid-ip")); + + } } diff --git a/e2e/Dockerfile b/e2e/Dockerfile index 9b2da0b31b4..38398e281cd 100644 --- a/e2e/Dockerfile +++ b/e2e/Dockerfile @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -FROM ghcr.io/linuxsuren/api-testing:v0.0.16 +FROM ghcr.io/linuxsuren/api-testing:v0.0.17 WORKDIR /workspace COPY . . diff --git a/e2e/data/monitor-http.json b/e2e/data/monitor-http.json index 06fd46b9a67..841610abc1a 100644 --- a/e2e/data/monitor-http.json +++ b/e2e/data/monitor-http.json @@ -1,80 +1,93 @@ - { - "detected": false, - "collector": "", - "monitor": { - "intervals": 60, - "tags": [], - "app": "api", - "host": "127.0.0.1", + "detected": false, + "collector": "", + "monitor": { + "intervals": 60, + "tags": [], + "app": "api", + "host": "127.0.0.1", "name": "{{.param.monitorHTTP}}" + }, + "params": [ + { + "display": true, + "field": "host", + "type": 1, + "paramValue": "127.0.0.1" }, - "params": [ - { - "field": "host", - "type": 1, - "value": "127.0.0.1" - }, - { - "field": "port", - "type": 0, - "value": 80 - }, - { - "field": "method", - "type": 1, - "value": "GET" - }, - { - "field": "uri", - "type": 1, - "value": "" - }, - { - "field": "ssl", - "type": 1, - "value": false - }, - { - "field": "headers", - "type": 3 - }, - { - "field": "params", - "type": 3 - }, - { - "field": "timeout", - "type": 0 - }, - { - "field": "contentType", - "type": 1 - }, - { - "field": "payload", - "type": 1 - }, - { - "field": "authType", - "type": 1 - }, - { - "field": "username", - "type": 1 - }, - { - "field": "password", - "type": 1 - }, - { - "field": "keyword", - "type": 1 - }, - { - "field": "successCode", - "type": 4, - "value": "200, 201" - } - ] -} + { + "display": true, + "field": "port", + "type": 0, + "paramValue": 80 + }, + { + "display": true, + "field": "httpMethod", + "type": 1, + "paramValue": "GET" + }, + { + "display": true, + "field": "uri", + "type": 1 + }, + { + "display": true, + "field": "ssl", + "type": 1, + "paramValue": false + }, + { + "display": true, + "field": "headers", + "type": 3 + }, + { + "display": true, + "field": "params", + "type": 3 + }, + { + "display": true, + "field": "timeout", + "type": 0 + }, + { + "display": true, + "field": "contentType", + "type": 1 + }, + { + "display": false, + "field": "payload", + "type": 1 + }, + { + "display": true, + "field": "authType", + "type": 1 + }, + { + "display": true, + "field": "username", + "type": 1 + }, + { + "display": true, + "field": "password", + "type": 1 + }, + { + "display": true, + "field": "keyword", + "type": 1 + }, + { + "display": true, + "field": "successCode", + "type": 4, + "paramValue": "200, 201" + } + ] +} \ No newline at end of file diff --git a/e2e/start.sh b/e2e/start.sh index 52a23b9821b..cb724733921 100755 --- a/e2e/start.sh +++ b/e2e/start.sh @@ -25,25 +25,5 @@ then fi docker-compose version -docker-compose -f "$file" up --build -d - -while true -do - docker-compose -f "$file" ps | grep testing - if [ $? -eq 1 ] - then - code=-1 - docker-compose -f "$file" logs | grep e2e-testing - docker-compose -f "$file" logs | grep e2e-testing | grep Usage - if [ $? -eq 1 ] - then - code=0 - echo "successed" - fi - - docker-compose -f "$file" down - set -e - exit $code - fi - sleep 1 -done +docker-compose -f "$file" down +docker-compose -f "$file" up --build testing --exit-code-from testing --remove-orphans diff --git a/e2e/testsuite.yaml b/e2e/testsuite.yaml index 0278321b97a..4435fc5f126 100644 --- a/e2e/testsuite.yaml +++ b/e2e/testsuite.yaml @@ -146,18 +146,15 @@ items: Authorization: Bearer {{.login.data.token}} - name: cancelHTTPMonitor request: - api: /api/monitors/manage + api: /api/monitors/manage?ids={{(index .listHTTPMonitor.data.content 0).id | int64}} query: - ids: "{{(index .listHTTPMonitor.data.content 0).id}}" type: JSON method: DELETE header: Authorization: Bearer {{.login.data.token}} - name: deleteHTTPMonitor request: - api: /api/monitors - query: - ids: "{{(index .listHTTPMonitor.data.content 0).id}}" + api: /api/monitors?ids={{(index .listHTTPMonitor.data.content 0).id | int64}} method: DELETE header: Authorization: Bearer {{.login.data.token}} @@ -168,9 +165,7 @@ items: Authorization: Bearer {{.login.data.token}} - name: deleteAlertDefine request: - api: /api/alert/defines - query: - ids: "{{(index .listAlertDefine.data.content 0).id}}" + api: /api/alert/defines?ids={{(index .listAlertDefines.data.content 0).id | int64}} method: DELETE header: Authorization: Bearer {{.login.data.token}} @@ -239,7 +234,7 @@ items: Content-type: application/json body: | { - "id": {{(index .listTags.data.content 0).id}}, + "id": {{(index .listTags.data.content 0).id | int64}}, "name": "{{randAlpha 3}}", "value": "{{randAlpha 3}}", "color": "#ff4081", @@ -252,9 +247,7 @@ items: code: "0" - name: deleteTag request: - api: /api/tag - query: - ids: "{{(index .listTags.data.content 0).id}}" + api: /api/tag?ids={{(index .listTags.data.content 0).id | int64}} method: DELETE header: Authorization: Bearer {{.login.data.token}} diff --git a/home/README.md b/home/README.md index 0e5fd92e6cf..ae1b5ccb71e 100644 --- a/home/README.md +++ b/home/README.md @@ -49,6 +49,12 @@ If you are using GitHub pages for hosting, this command is a convenient way to b GITHUB_HOST=gitee.com USE_SSH=true yarn deploy ``` +### Archive Version + +```shell +yarn docusaurus docs:version v1.5.x +``` + ## Directory Structure diff --git a/home/blog/2024-06-11-hertzbeat-v1.6.0-update.md b/home/blog/2024-06-11-hertzbeat-v1.6.0-update.md new file mode 100644 index 00000000000..6e7bf7749b1 --- /dev/null +++ b/home/blog/2024-06-11-hertzbeat-v1.6.0-update.md @@ -0,0 +1,147 @@ +# HertzBeat 1.6.0 Upgrade Guide + +**Note: This guide is applicable for upgrading from versions prior to 1.6.0 to version 1.6.0.** + +## Binary Installation Package Upgrade + +### Upgrade Java Environment + +Since version 1.6.0 uses Java 17 and the installation package no longer provides a built-in JDK version, use the new Hertzbeat according to the following situations: + +- When the default environment variable on your server is Java 17, you do not need to take any action for this step. +- When the default environment variable on your server is not Java 17, such as Java 8 or Java 11, and if there are no other applications on your server that require a lower version of Java, download the appropriate version from [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) according to your system, and search the engine for how to set a new environment variable pointing to the new Java 17. +- When the default environment variable on your server is not Java 17, such as Java 8 or Java 11, and if there are other applications on your server that require a lower version of Java, download the appropriate version from [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) according to your system, and rename the extracted folder to `java`, then copy it to the Hertzbeat extraction directory. + +### Upgrade Database + +Go to [https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration), choose the directory of your database and execute the corresponding `V160__update_column.sql` file for the upgrade SQL. + +### Upgrade Configuration Files + +Due to significant changes in `application.yml` and `sureness.yml`, it is recommended to directly use the new `yml` configuration files and then modify them based on your own needs. + +#### `application.yml` generally needs to modify the following parts: + +Default is: +```yaml + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE +``` +If you change to a MySQL database, here is an example: +```yaml + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: root + url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: mysql + properties: + eclipselink: + logging: + level: SEVERE +``` + +#### `sureness.yml` modification is optional, usually when you need to change account passwords: + +```yaml +# account info config +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 +account: + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] +``` + +### Add the corresponding database drivers + +Due to the Apache Foundation's requirements for license compliance, HertzBeat's installation package cannot include dependencies with GPL licenses such as MySQL, Oracle, etc. Users need to add them themselves. Users can download the drivers from the following links and copy them to the `ext-lib` directory of the installation: + +- MySQL: [https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip) +- Oracle (If you want to monitor Oracle, these two drivers are required): + - [https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar) + - [https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar](https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar) + +Next, run the start-up script as before to experience the latest HertzBeat 1.6.0! + +## Docker Upgrade - Mysql Database + +- Stop the HertzBeat container: + ``` + docker stop hertzbeat + ``` + +- Upgrade the database script: + - Go to [https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration), choose the directory of your database and execute the corresponding `V160__update_column.sql` file in MySQL. + +- Upgrade the configuration files: + - As mentioned, due to significant changes in `application.yml` and `sureness.yml`, it is recommended to directly mount and use the new `yml` configuration files, and then modify them based on your own needs. + +- Add the corresponding database drivers: + - Due to the Apache Foundation's license compliance requirements, HertzBeat's installation package cannot include MySQL, Oracle, and other GPL-licensed dependencies. Users need to add them themselves by downloading the driver jars from the above links and placing them in the local `ext-lib` directory, then mounting `ext-lib` to the container's `/opt/hertzbeat/ext-lib` directory when starting. + +Next, run HertzBeat using Docker as before to experience the latest HertzBeat 1.6.0! + +## Docker Installation Upgrade - H2 Built-in Database (Not recommended for production use) + +- Stop the HertzBeat container: + ``` + docker stop hertzbeat + ``` + +- Edit the H2 database files: + - Assuming you have mounted the H2 database files in the `data` directory to the local system, or copied the `/opt/hertzbeat/data` directory from the old container manually. + - Download the H2 driver jar from [https://mvnrepository.com/artifact/com.h2database/h2/2.2.220](https://mvnrepository.com/artifact/com.h2database/h2/2.2.220). + - Start the database locally using the H2 driver jar: + ``` + java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456 + ``` + +- Upgrade the configuration files: + - As mentioned, due to significant changes in `application.yml` and `sureness.yml`, it is recommended to directly mount and use the new `yml` configuration files, and then modify them based on your own needs. + +- Add the corresponding database drivers: + - As mentioned, due to the Apache Foundation's license compliance requirements, HertzBeat's installation package cannot include MySQL, Oracle, and other GPL-licensed dependencies. Users need to add them themselves by downloading the driver jars from the above links and placing them in the local `ext-lib` directory, then mounting `ext-lib` to the container's `/opt/hertzbeat/ext-lib` directory when starting. + +Next, run the Docker to start HertzBeat as before to experience the latest HertzBeat 1.6.0! + +## Upgrade via Export and Import + +If you do not want to go through the tedious script upgrade method mentioned above, you can directly export and import the monitoring tasks and threshold information from the old environment. + +- Deploy a new environment with the latest version. +- Export the monitoring tasks and threshold information from the old environment on the page \ No newline at end of file diff --git a/home/blog/2024-06-15-hertzbeat-v1.6.0.md b/home/blog/2024-06-15-hertzbeat-v1.6.0.md new file mode 100644 index 00000000000..4678774f9e4 --- /dev/null +++ b/home/blog/2024-06-15-hertzbeat-v1.6.0.md @@ -0,0 +1,395 @@ +--- +title: HertzBeat First Apache version v1.6.0 released now! +author: tom +author_title: tom +author_url: https://github.com/tomsun28 +author_image_url: https://avatars.githubusercontent.com/u/24788200?s=400&v=4 +tags: [opensource, practice] +keywords: [open source, monitoring, alerting] +--- + +**Hi guys, We are excited to announce that Apache HertzBeat (incubating) has released its first Apache version v1.6.0! 🎉.** + +Through nearly five months of community development iteration and two months of Apache Incubator incubation process, Apache HertzBeat (incubating) v1.6.0 is finally out. +In this version, we added monitoring for OpenAi, Redfish protocol servers, plugin mechanism, and support for NebulaGraph, Apache Yarn, HDFS, Hbase, Storm, and more functional features. +Due to license compatibility issues, we replaced multiple dependencies at the bottom layer, Hibernate -> EclipseLink, which is also a rare migration pitfall practice in the JPA ecosystem. +At the same time, some bugs were fixed and some functions were optimized, and more complete documents. Welcome everyone to try to use, put forward valuable opinions and suggestions, and promote the development of HertzBeat together. + + +**Of course, the most important thing is to give the best thanks to the contributors in the community!** + +Download Page: https://hertzbeat.apache.org/docs/download/ + +Upgrade Guide: https://hertzbeat.apache.org/blog/2024/06/11/hertzbeat-v1.6.0-update/ + +## What is HertzBeat? + +[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities. + +## Features + +* 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, web-based and with one-click monitoring and alerting, zero learning curve. +* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 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. +* Compatible with the `Prometheus` ecosystem and more, can monitoring what `Prometheus` can monitoring with few clicks on webui. +* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. +* Provides flexible alarm threshold rules and timely notifications delivered via `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`. +* Provides powerful status page building capabilities, easily communicate the real-time status of your service to users. + +> HertzBeat's powerful customization, multi-type support, high performance, easy expansion, and low coupling, aims to help users quickly build their own monitoring system. + +![hertzBeat](/img/docs/hertzbeat-arch.png) + +**Github: https://github.com/apache/hertzbeat** + +## HertzBeat's 1.6.0 Version Release! + +## Highlights +- HertzBeat is donated to the Apache Incubator. +- migrate repo, clean up code, license, add more help doc and more +- add dependency license doc +- [feature]Hertzbeat custom plugin. by @zqr10159 in #1973 +- [feature] add apache hugegraph monitor by @zhangshenghang in #1972 +- [improve][HIP] HIP-01: Implement refactoring AbstractCollect by @crossoverJie in #1966 +- [feature] Support monitoring of OpenAI accounts by @zuobiao-zhou in #1947 +- [feature] add apache yarn monitor by @zhangshenghang in #1937 +- [featrue]add apache hdfs monitor by @zhangshenghang in #1920 +- [feature] support use ngql query metrics from nebulaGraph by @LiuTianyou in #1917 +- [feature] support random jwt secret when not custom by @tomsun28 in #1897 +- feat Support Time Type to Tengine Data Storage by @Clownsw in #1890 +- [feature] support the VictoriaMetrics cluster by @xuziyang in #1880 +- [feature] support flyway database migration by @tomsun28 in #1875 +- [feature] Support Redfish protocol to monitoring server by @gjjjj0101 in #1867 +- [feature] add influxdb metrics monitoring by @TJxiaobao in #1730 +- [improve] use apache jexl replace of aviator by @tomsun28 in #1859 +- [feature] Add Linux process monitoring by @zhangshenghang in #1857 +- [feature] Add Apache Hbase RegionServer monitoring by @zhangshenghang in #1833 +- [improve] use eclipselink orm replace of hibernate orm by @tomsun28 in #1801 +- [feature]Add monitoring for Hbase Master by @zhangshenghang in #1820 +- [feature] Improve the import checkstyle by @crossoverJie in #1802 +- [Improve]When multiple lines are returned, each alarm is triggered instead of only the first alarm by @15613060203 in #1797 +- [improve]Add external lib folder to store mysql and oracle driver. by @zqr10159 in #1783 +- [feature:update-checkstyle] Limit the java file header by @YxYL6125 in #1799 +- monitor center add search type modal by @tomsun28 in #1699 +- mongodb monitoring support custom connection timeout param by @ZY945 in #1697 +- System config theme by @TJxiaobao in #1636 +- [feature] add storm monitor by @starmilkxin in #1673 +- add a online prometheus parser and a prometheus-like push style. by @vinci-897 in #1644 +- and more bugfix, doc, features power by our contributors, thanks to them. + +## What's Changed +* bugfix collector can not startup alone by @tomsun28 in https://github.com/apache/hertzbeat/pull/1633 +* translate some hertzbeat blog by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1635 +* Check class description by @ZY945 in https://github.com/apache/hertzbeat/pull/1638 +* translate class description to english by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1641 +* support monitor metrics name i18n: ClickHouse by @ZY945 in https://github.com/apache/hertzbeat/pull/1642 +* translate blog 20220601 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1646 +* add a online prometheus parser and a prometheus-like push style. by @vinci-897 in https://github.com/apache/hertzbeat/pull/1644 +* translate blog 20220320 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1647 +* support monitor metrics name i18n: DynamicTp by @ZY945 in https://github.com/apache/hertzbeat/pull/1649 +* translate blog 20220228 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1648 +* translate blog 20220310 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1651 +* translate blog 20220904 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1652 +* support monitor metrics name i18n: Airflow by @ZY945 in https://github.com/apache/hertzbeat/pull/1654 +* support monitor metrics name i18n: IoTDB by @ZY945 in https://github.com/apache/hertzbeat/pull/1659 +* Translate 2022-02-11-hertzbeat document by @wang1027-wqh in https://github.com/apache/hertzbeat/pull/1660 +* bugfix The annotation @Transactional specifies rollbackFor. by @handy-git in https://github.com/apache/hertzbeat/pull/1643 +* add handy-git as a contributor for code by @allcontributors in https://github.com/apache/hertzbeat/pull/1661 +* feature:Translate 2022-02-17-hertzbeat Document by @wang1027-wqh in https://github.com/apache/hertzbeat/pull/1662 +* support monitor metrics name i18n: rocketmq by @ZY945 in https://github.com/apache/hertzbeat/pull/1663 +* [doc] update relate doc and readme by @tomsun28 in https://github.com/apache/hertzbeat/pull/1667 +* bugfix monitoring mongodb not work in springboot3 by @ZY945 in https://github.com/apache/hertzbeat/pull/1668 +* [feature] add storm monitor by @starmilkxin in https://github.com/apache/hertzbeat/pull/1673 +* [bugfix] fixed the issue in http_sd where services were incorrectly reported as available when they were actually unavailable by @starmilkxin in https://github.com/apache/hertzbeat/pull/1678 +* remove mysql-oracle dependency jar from release package lib by @tomsun28 in https://github.com/apache/hertzbeat/pull/1680 +* System config theme by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1636 +* update webapp menu layout and doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1682 +* bugfix can not find mysql dependency when startup by @tomsun28 in https://github.com/apache/hertzbeat/pull/1686 +* support config common aes secret by @tomsun28 in https://github.com/apache/hertzbeat/pull/1683 +* [bugfix]fix the issue of add redis cluster node test error report(#1601) by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1684 +* add LiuTianyou as a contributor for code by @allcontributors in https://github.com/apache/hertzbeat/pull/1687 +* mongodb monitoring support custom connection timeout param by @ZY945 in https://github.com/apache/hertzbeat/pull/1697 +* bugfix old data decode error when use new common-secret by @tomsun28 in https://github.com/apache/hertzbeat/pull/1696 +* [bugfix] fix bug where reopening pop-up window still retained previously edited data after closing. by @starmilkxin in https://github.com/apache/hertzbeat/pull/1698 +* monitor center add search type modal by @tomsun28 in https://github.com/apache/hertzbeat/pull/1699 +* fix status page logo overflow by @tomsun28 in https://github.com/apache/hertzbeat/pull/1700 +* bugfix npe monitor jobid may be null by @tomsun28 in https://github.com/apache/hertzbeat/pull/1701 +* support custom main menus in monitor template by @tomsun28 in https://github.com/apache/hertzbeat/pull/1703 +* update home website doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1712 +* [Improve] change package group to org apache hertzbeat by @vinci-897 in https://github.com/apache/hertzbeat/pull/1724 +* [improve] initial license clean up by @tomsun28 in https://github.com/apache/hertzbeat/pull/1725 +* update manager and collector logback config(#1704) by @handy-git in https://github.com/apache/hertzbeat/pull/1723 +* fix(sec): upgrade com.h2database:h2 to by @WinterKi1ler in https://github.com/apache/hertzbeat/pull/1718 +* add WinterKi1ler as a contributor for code by @allcontributors in https://github.com/apache/hertzbeat/pull/1736 +* update asf branch protected check by @tomsun28 in https://github.com/apache/hertzbeat/pull/1738 +* [doc]Update star chart by @zqr10159 in https://github.com/apache/hertzbeat/pull/1737 +* [fixed] fixed click collector online offline button error by @miki-hmt in https://github.com/apache/hertzbeat/pull/1734 +* [improve] initial doc clean up by @tomsun28 in https://github.com/apache/hertzbeat/pull/1741 +* [Improvement]Support multiple receivers. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1731 +* [improvement]Add lisence. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1746 +* Backend LICENSE Initialize by @wang1027-wqh in https://github.com/apache/hertzbeat/pull/1744 +* Back-end dependency upgrade by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1743 +* [Improve] run hertzbeat in docker compose support dependen service condition by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/1748 +* [bugfix] fix statuspage index exception by @makechoicenow in https://github.com/apache/hertzbeat/pull/1747 +* remove unlicensed dependency 'wolfy87 eventemitter' by @alpha951 in https://github.com/apache/hertzbeat/pull/1745 +* [improve] auto label when pr, update asf config by @tomsun28 in https://github.com/apache/hertzbeat/pull/1749 +* [improve] update asf config set required status checks context by @tomsun28 in https://github.com/apache/hertzbeat/pull/1751 +* [improve] home add apache info by @a-little-fool in https://github.com/apache/hertzbeat/pull/1740 +* [doc] Change e2e path by @crossoverJie in https://github.com/apache/hertzbeat/pull/1758 +* fix : ingress tls inoperative by @PeixyJ in https://github.com/apache/hertzbeat/pull/1760 +* [refactor] method improvement rationale by @dukbong in https://github.com/apache/hertzbeat/pull/1757 +* [improve] create disclaimer file, add incubating in describe by @tomsun28 in https://github.com/apache/hertzbeat/pull/1764 +* [improve] update new hertzbeat brand logo, update doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1761 +* Complete the code comment translation of the common module by @Hi-Mr-Wind in https://github.com/apache/hertzbeat/pull/1766 +* Remove unnecessary if-else statement. by @dukbong in https://github.com/apache/hertzbeat/pull/1770 +* [doc] remove and translate chinese to english in warehous by @xuziyang in https://github.com/apache/hertzbeat/pull/1773 +* Replace deprecated methods with builder pattern for RedisURI construction by @dukbong in https://github.com/apache/hertzbeat/pull/1772 +* remove and translate chinese to english in collector,script,push,remoting and manager module by @MananPoojara in https://github.com/apache/hertzbeat/pull/1774 +* Added the function of sending SMS messages through Alibaba Cloud. by @lwqzz in https://github.com/apache/hertzbeat/pull/1768 +* [improve]Add frontend license. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1776 +* [test] Add RedisSingleCollectImplTest by @crossoverJie in https://github.com/apache/hertzbeat/pull/1784 +* [refactor] add override annotation by @handy-git in https://github.com/apache/hertzbeat/pull/1782 +* '[docs]bugfix: display syntax error of ipmi protocol' by @tomorrowshipyltm in https://github.com/apache/hertzbeat/pull/1793 +* [doc] translate alerter moudle code chinese to english by @tomsun28 in https://github.com/apache/hertzbeat/pull/1765 +* [refactor] database-related properties class, type changed to record by @xuziyang in https://github.com/apache/hertzbeat/pull/1786 +* Fix snmp template unit conversion problem by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1796 +* [doc] Add help documentation for clickhouse monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1798 +* [feature:update-checkstyle] Limit the java file header by @YxYL6125 in https://github.com/apache/hertzbeat/pull/1799 +* [improve]Add external lib folder to store mysql and oracle driver. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1783 +* [Improve]When multiple lines are returned, each alarm is triggered instead of only the first alarm by @15613060203 in https://github.com/apache/hertzbeat/pull/1797 +* [doc] add team page in website by @alpha951 in https://github.com/apache/hertzbeat/pull/1800 +* [feature] Improve the import checkstyle by @crossoverJie in https://github.com/apache/hertzbeat/pull/1802 +* [doc] Add help document for dns monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1804 +* [improve] preventing NPE by @dukbong in https://github.com/apache/hertzbeat/pull/1808 +* [refactor] change the warehouse properties the type to record by @xuziyang in https://github.com/apache/hertzbeat/pull/1806 +* Refactor: upgrade syntax to jdk17(instanceof & switch) by @Calvin979 in https://github.com/apache/hertzbeat/pull/1807 +* [test] Add NginxCollect test by @crossoverJie in https://github.com/apache/hertzbeat/pull/1809 +* [website] update team page by @tomsun28 in https://github.com/apache/hertzbeat/pull/1803 +* [test] Add RedisClusterCollectImplTest by @crossoverJie in https://github.com/apache/hertzbeat/pull/1789 +* [improve] Fix typo ReqStatusResponse by @crossoverJie in https://github.com/apache/hertzbeat/pull/1811 +* Comparing N objects for null with Assert.noNullElements(). by @dukbong in https://github.com/apache/hertzbeat/pull/1814 +* [doc] Add help document for elasticsearch monitoring and ftp monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1815 +* [doc] add help documentation for huawei switch monitoring by @Alanxtl in https://github.com/apache/hertzbeat/pull/1813 +* chore: upgrade the api-testing (e2e) to v0.0.16 by @LinuxSuRen in https://github.com/apache/hertzbeat/pull/1817 +* [Remove][Improve]Mail config by @zqr10159 in https://github.com/apache/hertzbeat/pull/1819 +* Remove and translate chinese to english in code by @dukbong in https://github.com/apache/hertzbeat/pull/1816 +* [feature]Add monitoring for Hbase Master by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1820 +* [doc] resolve code conflicts and coverage caused by pr(#1813) merge by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1821 +* [doc] Add help document for tidb and nacos monitoring by @Alanxtl in https://github.com/apache/hertzbeat/pull/1823 +* [improve] use eclipselink orm replace of hibernate orm by @tomsun28 in https://github.com/apache/hertzbeat/pull/1801 +* [improve] Add whitespace checkstyle by @crossoverJie in https://github.com/apache/hertzbeat/pull/1824 +* [bugfix] dns monitoring template add query class parameter by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1825 +* [Refactor] Preventing Unnecessary Object Creation and Using Utility Methods by @dukbong in https://github.com/apache/hertzbeat/pull/1818 +* [doc]Add and modify Doris FE Chinese and English documentation by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1828 +* [docs] Optimize: add help docs for UDP port & Springboot3 help doc by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1832 +* Code Simplification, Structure Changes, and Translation Work, Along with a Question by @dukbong in https://github.com/apache/hertzbeat/pull/1827 +* [doc] add help document for mongodb monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1834 +* [collector] fix: inverts the compareTo sort of MetricsCollect run queue by @Pzz-2021 in https://github.com/apache/hertzbeat/pull/1837 +* [doc]Doc add debian system by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1842 +* [feature] Add Apache Hbase RegionServer monitoring by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1833 +* [improve] Optimize websocket monitor by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1838 +* [refactor] Split the WarehouseProperties class by @xuziyang in https://github.com/apache/hertzbeat/pull/1830 +* [test] Add test for HttpsdImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1840 +* [fix] Fix the wrong comment by @xuziyang in https://github.com/apache/hertzbeat/pull/1843 +* [refactor] trans and use assert by @dukbong in https://github.com/apache/hertzbeat/pull/1841 +* [bugfix] modify the command in the mongodb monitoring template by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1844 +* [bigfix]Fix Debian system Top10 monitoring bug by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1846 +* [cleanup]Delete the corresponding Chinese comments by @hudongdong129 in https://github.com/apache/hertzbeat/pull/1847 +* [doc] translates chinese comment to english. by @dukbong in https://github.com/apache/hertzbeat/pull/1853 +* [doc] fix error and add help document for prometheus task by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1852 +* [feature] Add Linux process monitoring by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1857 +* [test] Add test for FtpCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1856 +* [improve] use apache jexl replace of aviator by @tomsun28 in https://github.com/apache/hertzbeat/pull/1859 +* [bugfix] jpa data save logic repair by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1863 +* [feature] add influxdb metrics monitoring by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1730 +* [doc] add help document for rocketmq by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1874 +* [improve] Imporve checkstyle of test code. by @crossoverJie in https://github.com/apache/hertzbeat/pull/1864 +* [feature] Support Redfish protocol to monitoring server by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/1867 +* Fix debian monitoring template issue about process monitoring by @LLP2333 in https://github.com/apache/hertzbeat/pull/1868 +* [bugfix] centos Top10 shows missing one by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1870 +* [improve] add website apache incubator footer by @tomsun28 in https://github.com/apache/hertzbeat/pull/1860 +* [doc] update help document by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1861 +* [featurn] support flyway database migration by @tomsun28 in https://github.com/apache/hertzbeat/pull/1875 +* [improve] Delete the timestamp field in the class MetricFamily.Metric by @xuziyang in https://github.com/apache/hertzbeat/pull/1878 +* [improve] Use java.lang.AutoCloseable instead of CacheCloseable by @crossoverJie in https://github.com/apache/hertzbeat/pull/1879 +* [bugfix]Fix top10 process command. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1876 +* [feature] support the VictoriaMetrics cluster by @xuziyang in https://github.com/apache/hertzbeat/pull/1880 +* [improve] Refactor common cache code by @crossoverJie in https://github.com/apache/hertzbeat/pull/1881 +* Eliminate Unnecessary Unboxing and Generics by @handy-git in https://github.com/apache/hertzbeat/pull/1882 +* [bugfix][doc]Add kafka sidebar. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1883 +* [doc] I18n for monitoring template yml metrics by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1888 +* [refactor] StoreProperties is no longer useful, delete it by @xuziyang in https://github.com/apache/hertzbeat/pull/1887 +* bugfix statistical metrics data matching fails by @tomsun28 in https://github.com/apache/hertzbeat/pull/1884 +* [doc] add help doc for flink monitoring by @HeartLinked in https://github.com/apache/hertzbeat/pull/1893 +* [doc] add almalinux documentation by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1892 +* [improve] Missing a generic by @crossoverJie in https://github.com/apache/hertzbeat/pull/1889 +* [bugfix] Fixed some metrics of Jexlespression not matching in Elasticsearch by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1894 +* feat(*): Support Time Type to Tengine Data Storage by @Clownsw in https://github.com/apache/hertzbeat/pull/1890 +* [feature] support random jwt secret when not custom by @tomsun28 in https://github.com/apache/hertzbeat/pull/1897 +* [doc] add opensuse doc by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1902 +* fix when manager restart, collect register error by @Ceilzcx in https://github.com/apache/hertzbeat/pull/1896 +* [bugfix] fix can not use empty collection as query params in eclipselink by @tomsun28 in https://github.com/apache/hertzbeat/pull/1900 +* [doc] update doc add download page and pic by @tomsun28 in https://github.com/apache/hertzbeat/pull/1904 +* [test] Add test for UdpCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1906 +* fix license by @yqxxgh in https://github.com/apache/hertzbeat/pull/1907 +* [improve] refactor code by @Ceilzcx in https://github.com/apache/hertzbeat/pull/1901 +* [type:bugfix] fix customized menu invalid bug #1898 by @Aias00 in https://github.com/apache/hertzbeat/pull/1908 +* [type:bugfix] fix HTTP API bug #1895 by @Aias00 in https://github.com/apache/hertzbeat/pull/1909 +* [test] Add test for WebsocketCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1912 +* [doc] translates chinese comment to english. by @westboy in https://github.com/apache/hertzbeat/pull/1914 +* [doc] Add HIP document and template by @crossoverJie in https://github.com/apache/hertzbeat/pull/1913 +* [improve] clean up home webapp unused code by @tomsun28 in https://github.com/apache/hertzbeat/pull/1915 +* [feature] support use ngql query metrics from nebulaGraph by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1917 +* [doc] Improve the Contribution Documentation. by @crossoverJie in https://github.com/apache/hertzbeat/pull/1918 +* [featrue]add apache hdfs monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1920 +* [doc] update hbase documentation description by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1921 +* [doc] Add documentation for nebulaGraph cluster monitoring and custom monitoring using NGQL, and clean up useless parameters by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1923 +* [test] Add test for TelnetCollectImplTest by @crossoverJie in https://github.com/apache/hertzbeat/pull/1924 +* fix(*): fix TdEngine Init not found Database by @Clownsw in https://github.com/apache/hertzbeat/pull/1891 +* [doc] update contribution and add run-build guide by @tomsun28 in https://github.com/apache/hertzbeat/pull/1919 +* bugfix collector startup error can not find JdbcClient by @tomsun28 in https://github.com/apache/hertzbeat/pull/1925 +* [doc] add help document for freebsd monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1928 +* [refactoring] Split AbstractHistoryDataStorage class by @xuziyang in https://github.com/apache/hertzbeat/pull/1926 +* [fix] fixed name error in monitoring template and improve NGQL protocol by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1931 +* [refactoring] Split AbstractRealTimeDataStorage class by @xuziyang in https://github.com/apache/hertzbeat/pull/1935 +* [bugfix] fix ssl-cert days_remaining and npe by @tomsun28 in https://github.com/apache/hertzbeat/pull/1934 +* [feature] add apache yarn monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1937 +* [doc] add help document for redhat monitoring and rocky linux monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1939 +* [test] Add test for NtpCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1940 +* [bugfix] fix alarm center tags display error by @tomsun28 in https://github.com/apache/hertzbeat/pull/1938 +* [improve] prepare for release hertzbeat v1.6.0 by @tomsun28 in https://github.com/apache/hertzbeat/pull/1929 +* add:Updated the Open Source Summer Project blog. by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1943 +* [feature] Support monitoring of OpenAI accounts by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1947 +* [refactoring] Inject a single instance of the data store by @xuziyang in https://github.com/apache/hertzbeat/pull/1944 +* [refactoring] AbstractHistoryDataStorage implement the DisposableBean by @xuziyang in https://github.com/apache/hertzbeat/pull/1946 +* [doc] update iotdb init document by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1948 +* [improve] update build script by @tomsun28 in https://github.com/apache/hertzbeat/pull/1949 +* [test] add test for NgqlCollectImpl by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1953 +* [bugfix]Replace monitors to alert. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1954 +* [improve] add llm, server menu and update doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1955 +* [improve][HIP] HIP-01: Refactoring AbstractCollect by @crossoverJie in https://github.com/apache/hertzbeat/pull/1930 +* [bugfix] fix ConnectionCommonCache possible npe by @crossoverJie in https://github.com/apache/hertzbeat/pull/1959 +* [doc] add help document for eulerOS monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1960 +* [fixbug] Fix the problem of no data for springboot3 monitoring by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1961 +* commit:fix the front-end popup cannot exit by @Yanshuming1 in https://github.com/apache/hertzbeat/pull/1957 +* [fixbug] expression rule adaptation by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1963 +* [doc] add help doc for influxdb-promql and kafka-promql monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1965 +* [doc]: update readme-cn docs by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1964 +* [improve][HIP] HIP-01: Implement refactoring AbstractCollect by @crossoverJie in https://github.com/apache/hertzbeat/pull/1966 +* [chore] update .gitignore to save .idea/icon.png by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1971 +* [improve][bugfix]: fix AlertTemplateUtilTest test exception and update code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1969 +* [feature] add apache hugegraph monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1972 +* [improve] Implement cascading parameter list for SNMP protocol by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1976 +* [improve] optimize DateUtil and add test case by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1974 +* [feature]Hertzbeat custom plugin. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1973 +* update login page and status page color by @lwjxy in https://github.com/apache/hertzbeat/pull/1977 +* [chore] update code style and add some comment by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1975 +* [doc]Hertzbeat plugin doc. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1980 +* [doc] update contributors and update status page style by @tomsun28 in https://github.com/apache/hertzbeat/pull/1981 +* [feature] Implement cascading parameter list by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1978 +* [doc]update threshold alarm doc by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1983 +* [chore] optimize code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1984 +* [fix] Compatible with MongoDB versions earlier than 3.6 by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/1988 +* [chore] optimize manager code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1993 +* [doc] Translate part of documentation development.md under `zh-cn` directory from `en` to `zh-cn` by @Thespica in https://github.com/apache/hertzbeat/pull/1995 +* [improve] http protocol prometheus parsing optimization by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1996 +* [feature] add at function for wechat by @Yanshuming1 in https://github.com/apache/hertzbeat/pull/1994 +* [improve] add common util test by @yuluo-yx in https://github.com/apache/hertzbeat/pull/2001 +* [improve] update release license notice and package by @tomsun28 in https://github.com/apache/hertzbeat/pull/2003 +* [bugfix] fix collector startup error classpath by @tomsun28 in https://github.com/apache/hertzbeat/pull/2004 +* [chore] optimize code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/2000 +* [improve] Bump up `eslint-plugin-jsdoc` to 48.2.5 to support node 20+ by @Thespica in https://github.com/apache/hertzbeat/pull/2005 +* [doc] fix doc highlighting by @boatrainlsz in https://github.com/apache/hertzbeat/pull/2006 +* [web-app]feature: case insensitive search by @JavaProgrammerLB in https://github.com/apache/hertzbeat/pull/2007 +* [feature] Support time calculation expressions. by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2009 +* [doc] add document for time expression by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2012 +* [feature] Add Apache Pulsar monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/2013 +* [doc] home verify release doc update by @tomsun28 in https://github.com/apache/hertzbeat/pull/2014 +* [Improve] Improve clickhouse monitor And Improve Pulsar monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/2015 +* [doc] translate help document for memcached monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2019 +* [improve] optimize collector httpsd discovery by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1991 +* [optimize] optimize code style and logic, add unit test by @yuluo-yx in https://github.com/apache/hertzbeat/pull/2010 +* [fix] Fix possible potential thread safe bugs by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/2021 +* [improve] add ci for home by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2024 +* [bugfix]Tag with empty value Shouldn't transform to Tag: by @JavaProgrammerLB in https://github.com/apache/hertzbeat/pull/2025 +* [bugfix] modify popup confirm to clear cache and cancel popup save by @Yanshuming1 in https://github.com/apache/hertzbeat/pull/2026 +* [improve] update monitor state desc by @tomsun28 in https://github.com/apache/hertzbeat/pull/2028 +* bugfix: fix overflow of integers by @Calvin979 in https://github.com/apache/hertzbeat/pull/2029 +* [improve] tips need update initial default password by @tomsun28 in https://github.com/apache/hertzbeat/pull/2030 +* [improve] deprecate support iotdb 0.* version by @Ceilzcx in https://github.com/apache/hertzbeat/pull/2032 +* [fixbug] required field check by @zhangshenghang in https://github.com/apache/hertzbeat/pull/2022 +* [improve] add IcmpCollectImplTest by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2033 +* [improve] fix code style by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2034 +* [improve] increase the length limit of the username field by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2035 +* [improve] Checkstyle include testSource by @crossoverJie in https://github.com/apache/hertzbeat/pull/2036 +* [bugfix] fix collector and frontend dependent license error by @tomsun28 in https://github.com/apache/hertzbeat/pull/2037 +* [improve] Add test for MemcachedCollectImpl by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2044 +* [imprve] Remove duplicate indices by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2045 +* [docs]: fix several typos in docs by @lw-yang in https://github.com/apache/hertzbeat/pull/2047 +* Add the missing parts of docs, fix layout, sync the English version with the Chinese version by @xfl12345 in https://github.com/apache/hertzbeat/pull/2048 +* [improve] add filename check in home ci by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2049 +* [improve] update dependency licenses and remove the aliyun sms depend by @tomsun28 in https://github.com/apache/hertzbeat/pull/2058 + +## New Contributors + +* @handy-git made their first contribution in https://github.com/apache/hertzbeat/pull/1643 +* @LiuTianyou made their first contribution in https://github.com/apache/hertzbeat/pull/1684 +* @WinterKi1ler made their first contribution in https://github.com/apache/hertzbeat/pull/1718 +* @miki-hmt made their first contribution in https://github.com/apache/hertzbeat/pull/1734 +* @gjjjj0101 made their first contribution in https://github.com/apache/hertzbeat/pull/1748 +* @makechoicenow made their first contribution in https://github.com/apache/hertzbeat/pull/1747 +* @alpha951 made their first contribution in https://github.com/apache/hertzbeat/pull/1745 +* @crossoverJie made their first contribution in https://github.com/apache/hertzbeat/pull/1758 +* @PeixyJ made their first contribution in https://github.com/apache/hertzbeat/pull/1760 +* @dukbong made their first contribution in https://github.com/apache/hertzbeat/pull/1757 +* @xuziyang made their first contribution in https://github.com/apache/hertzbeat/pull/1773 +* @MananPoojara made their first contribution in https://github.com/apache/hertzbeat/pull/1774 +* @lwqzz made their first contribution in https://github.com/apache/hertzbeat/pull/1768 +* @tomorrowshipyltm made their first contribution in https://github.com/apache/hertzbeat/pull/1793 +* @YxYL6125 made their first contribution in https://github.com/apache/hertzbeat/pull/1799 +* @15613060203 made their first contribution in https://github.com/apache/hertzbeat/pull/1797 +* @Alanxtl made their first contribution in https://github.com/apache/hertzbeat/pull/1813 +* @zhangshenghang made their first contribution in https://github.com/apache/hertzbeat/pull/1820 +* @zuobiao-zhou made their first contribution in https://github.com/apache/hertzbeat/pull/1832 +* @Pzz-2021 made their first contribution in https://github.com/apache/hertzbeat/pull/1837 +* @LLP2333 made their first contribution in https://github.com/apache/hertzbeat/pull/1868 +* @HeartLinked made their first contribution in https://github.com/apache/hertzbeat/pull/1893 +* @Aias00 made their first contribution in https://github.com/apache/hertzbeat/pull/1908 +* @westboy made their first contribution in https://github.com/apache/hertzbeat/pull/1914 +* @Yanshuming1 made their first contribution in https://github.com/apache/hertzbeat/pull/1957 +* @yuluo-yx made their first contribution in https://github.com/apache/hertzbeat/pull/1964 +* @lwjxy made their first contribution in https://github.com/apache/hertzbeat/pull/1977 +* @Thespica made their first contribution in https://github.com/apache/hertzbeat/pull/1995 +* @boatrainlsz made their first contribution in https://github.com/apache/hertzbeat/pull/2006 +* @JavaProgrammerLB made their first contribution in https://github.com/apache/hertzbeat/pull/2007 +* @lw-yang made their first contribution in https://github.com/apache/hertzbeat/pull/2047 +* @xfl12345 made their first contribution in https://github.com/apache/hertzbeat/pull/2048 + + +## Just one command to get started + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat``` + +```or use quay.io (if dockerhub network connect timeout)``` + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat``` + + +Detailed refer to HertzBeat Document https://hertzbeat.com/docs + + +---- + +**Github: https://github.com/apache/hertzbeat** + +Download Page: https://hertzbeat.apache.org/docs/download/ + +Upgrade Guide: https://hertzbeat.apache.org/blog/2024/06/11/hertzbeat-v1.6.0-update/ + +Have Fun! + +---- + +HertzBeat, Make Monitoring Easier! + +Apache HertzBeat Team diff --git a/home/docs/advanced/extend-http-default.md b/home/docs/advanced/extend-http-default.md index cb8cec5b7aa..abc9921e9ce 100644 --- a/home/docs/advanced/extend-http-default.md +++ b/home/docs/advanced/extend-http-default.md @@ -79,70 +79,199 @@ If there are multiple virtual machines, the multilayer format is: : **The corresponding monitoring template yml can be configured as follows** ```yaml -# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom -# Monitoring application type(consistent with the file name) eg: linux windows tomcat mysql aws... -app: example +# The monitoring type eg: linux windows tomcat mysql aws... +app: a_example +# The monitoring i18n name name: - zh-CN: 模拟应用类型 + zh-CN: 模拟应用 en-US: EXAMPLE APP +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 支持自定义监控,您只需配置监控模版 YML 就能适配一款自定义的监控类型。
定义流程如下:HertzBeat 页面 -> 监控模版菜单 -> 新增监控类型 -> 配置自定义监控模版YML -> 点击保存应用 -> 使用新监控类型添加监控。 + en-US: "HertzBeat supports custom monitoring, and you only need to configure the monitoring template YML to adapt to a custom monitoring type.
Definition process as follow: HertzBeat Pages -> Main Menu -> Monitor Template -> edit and save -> apply this template." + zh-TW: HertzBeat支持自定義監控,您只需配寘監控模版YML就能適配一款自定義的監控類型。
定義流程如下:HertzBeat頁面->監控模版選單->新增監控類型->配寘自定義監控模版YML ->點擊保存應用->使用新監控類型添加監控。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-point/ + en-US: https://hertzbeat.apache.org/docs/advanced/extend-point/ +# Input params define for monitoring(render web ui by the definition) params: - # field-field name identifier + # field-param field key - field: host - # name-parameter field display name + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-field type, style(most mappings are input label type attribute) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # required or not true-required false-optional + # 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 used to represent the range. + # when type is number, range is required range: '[0,65535]' + # required-true or false required: true - # port default + # default value defaultValue: 80 - # Prompt information of parameter input box - placeholder: 'Please enter the port' -# Metric group list + # param field input placeholder + placeholder: 'Please Input Port' + # field-param field key + - field: username + # name-param field display i18n name + name: + zh-CN: 用户名 + en-US: Username + # type-param field type(most mapping the html input type) + type: text + # when type is text, use limit to limit string length + limit: 50 + # required-true or false + required: false + # hide param-true or false + hide: true + # field-param field key + - field: password + # name-param field display i18n name + name: + zh-CN: 用户密码 + en-US: Password + # type-param field type(most mapping the html input tag) + type: password + # required-true or false + required: false + # hide param-true or false + hide: true + # field-param field key + - field: ssl + # name-param field display i18n name + name: + zh-CN: 启动SSL + en-US: SSL + # type-param field type(boolean mapping the html switch tag) + type: boolean + # required-true or false + required: false + # field-param field key + - field: method + # name-param field display i18n name + name: + zh-CN: 请求方式 + en-US: Method + # type-param field type(radio mapping the html radio tag) + type: radio + # required-true or false + required: true + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} + options: + - label: GET + value: GET + - label: POST + value: POST + - label: PUT + value: PUT + - label: DELETE + value: DELETE + # field-param field key + - field: headers + # name-param field display i18n name + name: + zh-CN: 请求Headers + en-US: Headers + # type-param field type(key-value mapping the html key-value input tags) + type: key-value + # required-true or false + required: false + # when type is key-value, use keyAlias to config key alias name + keyAlias: Header Name + # when type is key-value, use valueAlias to config value alias name + valueAlias: Header Value +# collect metrics config list metrics: -# The first monitoring Metric group cpu -# Note:the built-in monitoring Metrics have (responseTime - response time) + # metrics - cpu - name: cpu - # The smaller Metric group scheduling priority(0-127), the higher the priority. After completion of the high priority Metric group collection,the low priority Metric group will then be scheduled. Metric groups with the same priority will be scheduled in parallel. - # Metric group with a priority of 0 is an availability group which will be scheduled first. If the collection succeeds, the scheduling will continue otherwise interrupt scheduling. + # metrics name i18n label + i18n: + zh-CN: CPU 信息 + en-US: CPU Info + # 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 - # metrics fields list + # collect metrics content fields: - # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit + # field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: hostname type: 1 label: true + i18n: + zh-CN: 主机名称 + en-US: Host Name - field: usage type: 0 unit: '%' - - field: core + i18n: + zh-CN: 使用率 + en-US: Usage + - field: cores + type: 0 + i18n: + zh-CN: 核数 + en-US: Cores + - field: waitTime type: 0 -# protocol for monitoring and collection eg: sql, ssh, http, telnet, wmi, snmp, sdk + unit: s + i18n: + zh-CN: 主机名称 + en-US: Host Name + # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field + aliasFields: + - hostname + - core1 + - core2 + - usage + - allTime + - runningTime + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime + calculates: + - hostname=hostname + - cores=core1+core2 + - usage=usage + - waitTime=allTime-runningTime + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http -# Specific collection configuration when the protocol is HTTP protocol + # the config content when protocol is http http: - # host: ipv4 ipv6 domain name + # http host: ipv4 ipv6 domain host: ^_^host^_^ - # port + # http port port: ^_^port^_^ - # url request interface path + # http url url: /metrics/cpu - # request mode: GET POST PUT DELETE PATCH + # http method: GET POST PUT DELETE PATCH method: GET - # enable ssl/tls or not, that is to say, HTTP or HTTPS. The default is false + # if enabled https ssl: false - # parsing method for reponse data: default-system rules, jsonPath-jsonPath script, website-website availability Metric monitoring - # Hertzbeat default parsing is used here - parseType: default + # http request header content + headers: + ^_^headers^_^: ^_^headers^_^ + # http request params + params: + param1: param1 + param2: param2 + # http auth + authorization: + # http auth type: Basic Auth, Digest Auth, Bearer Token + type: Basic Auth + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule + parseType: jsonPath + parseScript: '$' ``` diff --git a/home/docs/advanced/extend-http-example-hertzbeat.md b/home/docs/advanced/extend-http-example-hertzbeat.md index 4c65e29b8da..80ddd938506 100644 --- a/home/docs/advanced/extend-http-example-hertzbeat.md +++ b/home/docs/advanced/extend-http-example-hertzbeat.md @@ -74,39 +74,34 @@ Here we define a custom monitoring type `app` named `hertzbeat` which use the HT ```yaml -# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom # The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat -# The monitoring i18n name name: - zh-CN: HertzBeat监控系统 - en-US: HertzBeat Monitor -# Input params define for monitoring(render web ui by the definition) + zh-CN: HertzBeat + en-US: HertzBeat +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 Hertzbeat 监控系统的通用指标进行测量监控。
您可以点击 “新建 HertzBeat监控系统” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor through general performance metric. You could click the "New HertzBeat Monitor" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對Hertzbeat監控系統的通用名額進行量測監控。
您可以點擊“新建HertzBeat監控系統”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat params: - # field-param field key - field: host - # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-param field type(most mapping the html input type) + zh-CN: 目标Host + en-US: Target Host 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 defaultValue: 1157 - field: ssl name: @@ -157,7 +152,7 @@ metrics: priority: 0 # collect metrics content fields: - # metrics content contains field-metric name, type-metric type:0-number,1-string, label-if is metrics label, unit-metric unit('%','ms','MB') + # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics, unit-metric unit('%','ms','MB') - field: app type: 1 label: true @@ -173,7 +168,7 @@ metrics: protocol: http # the config content when protocol is http http: - # http host: ipv4 ipv6 domain + # host: ipv4 ipv6 domain host: ^_^host^_^ # http port port: ^_^port^_^ diff --git a/home/docs/advanced/extend-http-example-token.md b/home/docs/advanced/extend-http-example-token.md index b9bbb61e72d..6cc09b6065c 100644 --- a/home/docs/advanced/extend-http-example-token.md +++ b/home/docs/advanced/extend-http-example-token.md @@ -52,60 +52,66 @@ A monitoring configuration definition file named after the monitoring type - her We directly reuse the definition content in `hertzbeat` and modify it to our current monitoring type `hertzbeat_auth` configuration parameters, such as `app, category, etc`. ```yaml -# This monitoring type belongs to the category: service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom -# Monitoring application type (consistent with the file name) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat_token +# The monitoring i18n name name: - en-GB: HertzBeat Monitoring (Token) - en-US: Hertz Beat Monitor (Token) + zh-CN: HertzBeat(Token) + en-US: HertzBeat(Token) +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 HertzBeat监控(Token)进行测量监控。
您可以点击 “新建 HertzBeat监控(Token)” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor(Token). You could click the "New HertzBeat Monitor(Token)" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對HertzBeat監控(Token)進行量測監控。
您可以點擊“新建HertzBeat監控(Token)”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat_token + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat_token +# Input params define for monitoring(render web ui by the definition) params: - # field - field name identifier - - field: host - # name - parameter field display name - name: - en-CN: Host Host - en-US: Host - # type-field type, style (mostly map input tag type attribute) - type: host - # Whether it is a required item true-required false-optional - required: true - - field: port - name: - en-CN: port - en-US: Port - type: number - # When the type is number, use range to represent the range - range: '[0,65535]' - required: true - # port default - defaultValue: 1157 - # Parameter input box prompt information - placeholder: 'Please enter the port' - - field: ssl - name: - en-CN: Enable SSL - en-US: SSL - # When the type is boolean, the front end uses switch to display the switch - type: boolean - required: false - - field: contentType - name: - en-CN: Content-Type - en-US: Content-Type - type: text - placeholder: 'Request Body Type' - required: false - - field: payload - name: - en-CN: request BODY - en-US: BODY - type: textarea - placeholder: 'Available When POST PUT' - required: false -# Index group list configuration under todo -metrics: .... - + # field-param field key + - field: host + # name-param field display i18n name + name: + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) + type: host + # required-true or false + required: true + - field: port + 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 + defaultValue: 1157 + placeholder: 'Please input port' + - field: ssl + name: + zh-CN: 启动SSL + en-US: SSL + # type-param field type(boolean mapping the html switch tag) + type: boolean + required: false + - field: contentType + name: + zh-CN: Content-Type + en-US: Content-Type + type: text + placeholder: 'Request Body Type' + required: false + - field: payload + name: + zh-CN: 请求BODY + en-US: BODY + type: textarea + placeholder: 'Available When POST PUT' + required: false +# collect metrics config list ``` ### Define metrics `auth` login request to get `token` @@ -114,92 +120,105 @@ metrics: .... ```yaml -# This monitoring type belongs to the category: service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom -# Monitoring application type (consistent with the file name) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat_token +# The monitoring i18n name name: - en-GB: HertzBeat Monitoring (Token) - en-US: Hertz Beat Monitor (Token) + zh-CN: HertzBeat(Token) + en-US: HertzBeat(Token) +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 HertzBeat监控(Token)进行测量监控。
您可以点击 “新建 HertzBeat监控(Token)” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor(Token). You could click the "New HertzBeat Monitor(Token)" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對HertzBeat監控(Token)進行量測監控。
您可以點擊“新建HertzBeat監控(Token)”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat_token + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat_token +# Input params define for monitoring(render web ui by the definition) params: - # field - field name identifier - - field: host - # name - parameter field display name - name: - en-CN: Host Host - en-US: Host - # type-field type, style (mostly map input tag type attribute) - type: host - # Whether it is a required item true-required false-optional - required: true - - field: port - name: - en-CN: port - en-US: Port - type: number - # When the type is number, use range to represent the range - range: '[0,65535]' - required: true - # port default - defaultValue: 1157 - # Parameter input box prompt information - placeholder: 'Please enter the port' - - field: ssl - name: - en-CN: Enable SSL - en-US: SSL - # When the type is boolean, the front end uses switch to display the switch - type: boolean - required: false - - field: contentType - name: - en-CN: Content-Type - en-US: Content-Type - type: text - placeholder: 'Request Body Type' - required: false - - field: payload - name: - en-CN: request BODY - en-US: BODY - type: textarea - placeholder: 'Available When POST PUT' - required: false -# List of metricss + # field-param field key + - field: host + # name-param field display i18n name + name: + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) + type: host + # required-true or false + required: true + - field: port + 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 + defaultValue: 1157 + placeholder: 'Please input port' + - field: ssl + name: + zh-CN: 启动SSL + en-US: SSL + # type-param field type(boolean mapping the html switch tag) + type: boolean + required: false + - field: contentType + name: + zh-CN: Content-Type + en-US: Content-Type + type: text + placeholder: 'Request Body Type' + required: false + - field: payload + name: + zh-CN: 请求BODY + en-US: BODY + type: textarea + placeholder: 'Available When POST PUT' + required: false +# collect metrics config list metrics: - # The first monitoring index group auth - # Note: Built-in monitoring metrics have (responseTime - response time) - - name: auth - # The smaller the index group scheduling priority (0-127), the higher the priority, and the index group with low priority will not be scheduled until the collection of index groups with high priority is completed, and the index groups with the same priority will be scheduled and collected in parallel - # The metrics with priority 0 is the availability metrics, that is, it will be scheduled first, and other metricss will continue to be scheduled if the collection is successful, and the scheduling will be interrupted if the collection fails - priority: 0 - # Specific monitoring metrics in the metrics - fields: - # metric information includes field name type field type: 0-number, 1-string , label-if is metrics label, unit: metric unit - - field: token - type: 1 - - field: refreshToken - type: 1 - # Monitoring and collection protocol eg: sql, ssh, http, telnet, wmi, snmp, sdk - protocol: http - # When the protocol is the http protocol, the specific collection configuration - http: - host: ^_^host^_^ - # port - port: ^_^port^_^ - # url request interface path - url: /api/account/auth/form - # Request method GET POST PUT DELETE PATCH - method: POST - # Whether to enable ssl/tls, that is, http or https, default false - ssl: ^_^ssl^_^ - payload: ^_^payload^_^ - # request header content - headers: - content-type: ^_^contentType^_^ - # Response data analysis method: default-system rules, jsonPath-jsonPath script, website-website usability metric monitoring - parseType: jsonPath - parseScript: '$.data' + # metrics - auth + - name: auth + # 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 + # 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 + - field: token + type: 1 + - field: refreshToken + type: 1 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: http + # the config content when protocol is http + http: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # http url + url: /api/account/auth/form + # http method: GET POST PUT DELETE PATCH + method: POST + # if enabled https + ssl: ^_^ssl^_^ + payload: ^_^payload^_^ + # http request header content + headers: + content-type: ^_^contentType^_^ + ^_^headers^_^: ^_^headers^_^ + # http request params + params: + ^_^params^_^: ^_^params^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule + parseType: jsonPath + parseScript: '$.data' + ``` @@ -244,134 +263,133 @@ metrics: ```yaml -# This monitoring type belongs to the category: service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom -# Monitoring application type (consistent with the file name) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat_token +# The monitoring i18n name name: - en-GB: HertzBeat Monitoring (Token) - en-US: Hertz Beat Monitor (Token) + zh-CN: HertzBeat(Token) + en-US: HertzBeat(Token) +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 HertzBeat监控(Token)进行测量监控。
您可以点击 “新建 HertzBeat监控(Token)” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor(Token). You could click the "New HertzBeat Monitor(Token)" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對HertzBeat監控(Token)進行量測監控。
您可以點擊“新建HertzBeat監控(Token)”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat_token + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat_token +# Input params define for monitoring(render web ui by the definition) params: - # field - field name identifier - - field: host - # name - parameter field display name - name: - en-CN: Host Host - en-US: Host - # type-field type, style (mostly map input tag type attribute) - type: host - # Whether it is a required item true-required false-optional - required: true - - field: port - name: - en-CN: port - en-US: Port - type: number - # When the type is number, use range to represent the range - range: '[0,65535]' - required: true - # port default - defaultValue: 1157 - # Parameter input box prompt information - placeholder: 'Please enter the port' - - field: ssl - name: - en-CN: Enable SSL - en-US: SSL - # When the type is boolean, the front end uses switch to display the switch - type: boolean - required: false - - field: contentType - name: - en-CN: Content-Type - en-US: Content-Type - type: text - placeholder: 'Request Body Type' - required: false - - field: payload - name: - en-CN: request BODY - en-US: BODY - type: textarea - placeholder: 'Available When POST PUT' - required: false -# List of metricss + # field-param field key + - field: host + # name-param field display i18n name + name: + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) + type: host + # required-true or false + required: true + - field: port + 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 + defaultValue: 1157 + placeholder: 'Please input port' + - field: ssl + name: + zh-CN: 启动SSL + en-US: SSL + # type-param field type(boolean mapping the html switch tag) + type: boolean + required: false + - field: contentType + name: + zh-CN: Content-Type + en-US: Content-Type + type: text + placeholder: 'Request Body Type' + required: false + - field: payload + name: + zh-CN: 请求BODY + en-US: BODY + type: textarea + placeholder: 'Available When POST PUT' + required: false +# collect metrics config list metrics: -# The first monitoring index group cpu -# Note: Built-in monitoring metrics have (responseTime - response time) - - name: auth - # The smaller the index group scheduling priority (0-127), the higher the priority, and the index group with low priority will not be scheduled until the collection of index groups with high priority is completed, and the index groups with the same priority will be scheduled and collected in parallel - # The metrics with priority 0 is the availability metrics, that is, it will be scheduled first, and other metricss will continue to be scheduled if the collection is successful, and the scheduling will be interrupted if the collection fails - priority: 0 - # Specific monitoring metrics in the metrics - fields: - # metric information includes field name type field type: 0-number, 1-string , label-if is metrics label, unit: metric unit - - field: token - type: 1 - - field: refreshToken - type: 1 - # Monitoring and collection protocol eg: sql, ssh, http, telnet, wmi, snmp, sdk - protocol: http - # When the protocol is the http protocol, the specific collection configuration - http: - host: ^_^host^_^ - # port - port: ^_^port^_^ - # url request interface path - url: /api/account/auth/form - # Request method GET POST PUT DELETE PATCH - method: POST - # Whether to enable ssl/tls, that is, http or https, default false - ssl: ^_^ssl^_^ - payload: ^_^payload^_^ - # request header content - headers: - content-type: ^_^contentType^_^ - ^_^headers^_^: ^_^headers^_^ - # Request parameter content - params: - ^_^params^_^: ^_^params^_^ - # Response data analysis method: default-system rules, jsonPath-jsonPath script, website-website usability metric monitoring - parseType: jsonPath - parseScript: '$.data' - - - - name: summary - # The smaller the index group scheduling priority (0-127), the higher the priority, and the index group with low priority will not be scheduled until the collection of index groups with high priority is completed, and the index groups with the same priority will be scheduled and collected in parallel - # The metrics with priority 0 is the availability metrics, that is, it will be scheduled first, and other metricss will continue to be scheduled if the collection is successful, and the scheduling will be interrupted if the collection fails - priority: 1 - # Specific monitoring metrics in the metrics - fields: - # metric information includes field name type field type: 0-number, 1-string , label-if is metrics label, unit: metric unit - - field: category - type: 1 - - field: app - type: 1 - - field: size - type: 0 - - field: status - type: 0 -# Monitoring and collection protocol eg: sql, ssh, http, telnet, wmi, snmp, sdk - protocol: http -# When the protocol is the http protocol, the specific collection configuration - http: - host: ^_^host^_^ - # port - port: ^_^port^_^ - # url request interface path - url: /api/summary - # Request method GET POST PUT DELETE PATCH - method: GET - # Whether to enable ssl/tls, that is, http or https, default false - ssl: ^_^ssl^_^ - # authentication - authorization: - # Authentication methods: Basic Auth, Digest Auth, Bearer Token - type: Bearer Token - bearerTokenToken: ^o^token^o^ - # Response data analysis method: default-system rules, jsonPath-jsonPath script, website-website usability metric monitoring - parseType: jsonPath - parseScript: '$.data.apps.*' + # metrics - auth + - name: auth + # 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 + # 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 + - field: token + type: 1 + - field: refreshToken + type: 1 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: http + # the config content when protocol is http + http: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # http url + url: /api/account/auth/form + # http method: GET POST PUT DELETE PATCH + method: POST + # if enabled https + ssl: ^_^ssl^_^ + payload: ^_^payload^_^ + # http request header content + headers: + content-type: ^_^contentType^_^ + ^_^headers^_^: ^_^headers^_^ + # http request params + params: + ^_^params^_^: ^_^params^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule + parseType: jsonPath + parseScript: '$.data' + + + - name: summary + priority: 1 + fields: + - field: app + type: 1 + label: true + - field: category + type: 1 + - field: status + type: 0 + - field: size + type: 0 + - field: availableSize + type: 0 + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /api/summary + method: GET + ssl: ^_^ssl^_^ + authorization: + type: Bearer Token + # ^o^xxx^o^ ^o^ substitution represents the value of the acquisition metric xxx of the previous priority + bearerTokenToken: ^o^token^o^ + parseType: jsonPath + parseScript: '$.data.apps.*' ``` diff --git a/home/docs/advanced/extend-http.md b/home/docs/advanced/extend-http.md index 242b63e8cf0..4df5fce33b0 100644 --- a/home/docs/advanced/extend-http.md +++ b/home/docs/advanced/extend-http.md @@ -39,94 +39,156 @@ eg:Define a custom monitoring type `app` named `example_http` which use the HT ```yaml # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom -# Monitoring application type(consistent with the file name) eg: linux windows tomcat mysql aws... -app: example_http +# The monitoring type eg: linux windows tomcat mysql aws... +app: a_example +# The monitoring i18n name name: - zh-CN: 模拟应用类型 + zh-CN: 模拟应用 en-US: EXAMPLE APP +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 支持自定义监控,您只需配置监控模版 YML 就能适配一款自定义的监控类型。
定义流程如下:HertzBeat 页面 -> 监控模版菜单 -> 新增监控类型 -> 配置自定义监控模版YML -> 点击保存应用 -> 使用新监控类型添加监控。 + en-US: "HertzBeat supports custom monitoring, and you only need to configure the monitoring template YML to adapt to a custom monitoring type.
Definition process as follow: HertzBeat Pages -> Main Menu -> Monitor Template -> edit and save -> apply this template." + zh-TW: HertzBeat支持自定義監控,您只需配寘監控模版YML就能適配一款自定義的監控類型。
定義流程如下:HertzBeat頁面->監控模版選單->新增監控類型->配寘自定義監控模版YML ->點擊保存應用->使用新監控類型添加監控。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-point/ + en-US: https://hertzbeat.apache.org/docs/advanced/extend-point/ +# Input params define for monitoring(render web ui by the definition) params: - # field-field name identifier + # field-param field key - field: host - # name-parameter field display name + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-field type, style(most mappings are input label type attribute) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # required or not true-required false-optional + # 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 used to represent the range. + # when type is number, range is required range: '[0,65535]' + # required-true or false required: true - # port default + # default value defaultValue: 80 - # Prompt information of parameter input box - placeholder: 'Please enter the port' + # param field input placeholder + placeholder: 'Please Input Port' + # field-param field key - field: username + # name-param field display i18n name name: zh-CN: 用户名 en-US: Username + # type-param field type(most mapping the html input type) type: text - # When type is text, use limit to indicate the string limit size + # when type is text, use limit to limit string length limit: 50 + # required-true or false required: false + # hide param-true or false + hide: true + # field-param field key - field: password + # name-param field display i18n name name: - zh-CN: 密码 + zh-CN: 用户密码 en-US: Password + # type-param field type(most mapping the html input tag) type: password + # required-true or false required: false + # hide param-true or false + hide: true + # field-param field key - field: ssl + # name-param field display i18n name name: zh-CN: 启动SSL - en-US: Enable SSL - # When type is boolean, front end uses switch to show the switch + en-US: SSL + # type-param field type(boolean mapping the html switch tag) type: boolean + # required-true or false required: false + # field-param field key - field: method + # name-param field display i18n name name: zh-CN: 请求方式 en-US: Method + # type-param field type(radio mapping the html radio tag) type: radio + # required-true or false required: true - # When type is radio or checkbox, option indicates the list of selectable values {name1:value1,name2:value2} + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} options: - - label: GET request + - label: GET value: GET - - label: POST request + - label: POST value: POST - - label: PUT request + - label: PUT value: PUT - - label: DELETE request + - label: DELETE value: DELETE -# Metric group list + # field-param field key + - field: headers + # name-param field display i18n name + name: + zh-CN: 请求Headers + en-US: Headers + # type-param field type(key-value mapping the html key-value input tags) + type: key-value + # required-true or false + required: false + # when type is key-value, use keyAlias to config key alias name + keyAlias: Header Name + # when type is key-value, use valueAlias to config value alias name + valueAlias: Header Value +# collect metrics config list metrics: -# The first monitoring Metric group cpu -# Note:the built-in monitoring Metrics have (responseTime - response time) + # metrics - cpu - name: cpu - # The smaller Metric group scheduling priority(0-127), the higher the priority. After completion of the high priority Metric group collection,the low priority Metric group will then be scheduled. Metric groups with the same priority will be scheduled in parallel. - # Metric group with a priority of 0 is an availability group which will be scheduled first. If the collection succeeds, the scheduling will continue otherwise interrupt scheduling. + # metrics name i18n label + i18n: + zh-CN: CPU 信息 + en-US: CPU Info + # 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 - # metrics fields list + # collect metrics content fields: - # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit + # field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: hostname type: 1 label: true + i18n: + zh-CN: 主机名称 + en-US: Host Name - field: usage type: 0 unit: '%' + i18n: + zh-CN: 使用率 + en-US: Usage - field: cores type: 0 + i18n: + zh-CN: 核数 + en-US: Cores - field: waitTime type: 0 unit: s -# (optional)Monitoring Metric alias mapping to the Metric name above. The field used to collect interface data is not the final Metric name directly. This alias is required for mapping conversion. + i18n: + zh-CN: 主机名称 + en-US: Host Name + # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field aliasFields: - hostname - core1 @@ -134,59 +196,73 @@ metrics: - usage - allTime - runningTime -# (optional)The Metric calculation expression works with the above alias to calculate the final required Metric value. -# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime calculates: - hostname=hostname - cores=core1+core2 - usage=usage - waitTime=allTime-runningTime -# protocol for monitoring and collection eg: sql, ssh, http, telnet, wmi, snmp, sdk + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http -# Specific collection configuration when the protocol is HTTP protocol + # the config content when protocol is http http: - # host: ipv4 ipv6 domain name + # http host: ipv4 ipv6 domain host: ^_^host^_^ - # port + # http port port: ^_^port^_^ - # url request interface path + # http url url: /metrics/cpu - # request mode: GET POST PUT DELETE PATCH + # http method: GET POST PUT DELETE PATCH method: GET - # enable ssl/tls or not, that is to say, HTTP or HTTPS. The default is false + # if enabled https ssl: false - # request header content + # http request header content headers: - apiVersion: v1 - # request parameter content + ^_^headers^_^: ^_^headers^_^ + # http request params params: param1: param1 param2: param2 - # authorization + # http auth authorization: - # authorization method: Basic Auth, Digest Auth, Bearer Token + # http auth type: Basic Auth, Digest Auth, Bearer Token type: Basic Auth basicAuthUsername: ^_^username^_^ basicAuthPassword: ^_^password^_^ - # parsing method for reponse data: default-system rules, jsonPath-jsonPath script, website-website availability Metric monitoring - # todo xmlPath-xmlPath script, prometheus-Prometheus data rules + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule parseType: jsonPath parseScript: '$' - name: memory + i18n: + zh-CN: 内存信息 + en-US: Memory Info priority: 1 fields: - field: hostname type: 1 label: true + i18n: + zh-CN: 主机名称 + en-US: Hostname - field: total type: 0 unit: kb + i18n: + zh-CN: 总量 + en-US: Total - field: usage type: 0 unit: '%' + i18n: + zh-CN: 使用率 + en-US: Usage - field: speed type: 0 + i18n: + zh-CN: 速率 + en-US: Speed protocol: http http: host: ^_^host^_^ @@ -195,7 +271,6 @@ metrics: method: GET headers: apiVersion: v1 - # query params,support time expression params: param1: param1 param2: param2 @@ -204,4 +279,5 @@ metrics: basicAuthUsername: ^_^username^_^ basicAuthPassword: ^_^password^_^ parseType: default + ``` diff --git a/home/docs/advanced/extend-point.md b/home/docs/advanced/extend-point.md index eba1811e4fc..6fdbdd636b7 100644 --- a/home/docs/advanced/extend-point.md +++ b/home/docs/advanced/extend-point.md @@ -36,6 +36,14 @@ app: example2 name: zh-CN: 模拟网站监测 en-US: EXAMPLE WEBSITE +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 支持自定义监控,您只需配置监控模版 YML 就能适配一款自定义的监控类型。
定义流程如下:HertzBeat 页面 -> 监控模版菜单 -> 新增监控类型 -> 配置自定义监控模版YML -> 点击保存应用 -> 使用新监控类型添加监控。 + en-US: "HertzBeat supports custom monitoring, and you only need to configure the monitoring template YML to adapt to a custom monitoring type.
Definition process as follow: HertzBeat Pages -> Main Menu -> Monitor Template -> edit and save -> apply this template." + zh-TW: HertzBeat支持自定義監控,您只需配寘監控模版YML就能適配一款自定義的監控類型。
定義流程如下:HertzBeat頁面->監控模版選單->新增監控類型->配寘自定義監控模版YML ->點擊保存應用->使用新監控類型添加監控。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-point/ + en-US: https://hertzbeat.apache.org/docs/advanced/extend-point/ # Input params define for monitoring(render web ui by the definition) params: # field-param field key diff --git a/home/docs/advanced/extend-tutorial.md b/home/docs/advanced/extend-tutorial.md index 9f21219a29f..03b73707789 100644 --- a/home/docs/advanced/extend-tutorial.md +++ b/home/docs/advanced/extend-tutorial.md @@ -82,6 +82,14 @@ app: hertzbeat name: zh-CN: HertzBeat监控系统 en-US: HertzBeat Monitor +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 Hertzbeat 监控系统的通用指标进行测量监控。
您可以点击 “新建 HertzBeat监控系统” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor through general performance metric. You could click the "New HertzBeat Monitor" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對Hertzbeat監控系統的通用名額進行量測監控。
您可以點擊“新建HertzBeat監控系統”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat # Input params define for monitoring(render web ui by the definition) params: # field-param field key diff --git a/home/docs/community/how-to-release.md b/home/docs/community/how-to-release.md index 026382cf94c..f92b328c8f7 100644 --- a/home/docs/community/how-to-release.md +++ b/home/docs/community/how-to-release.md @@ -434,7 +434,7 @@ One item of the email content is `Vote thread`, and the link is obtained here: h Send a voting email in the incubator community requires at least three `+1` and no `-1`. > `Send to`: general@incubator.apache.org
-> `cc`: dev@hertzbeat.apache.org、tison@apache.org、willem.jiang@gmail.com
+> `cc`: dev@hertzbeat.apache.org、private@hertzbeat.apache.org
> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
> `Body`: @@ -492,7 +492,6 @@ ChunJin Mu If there is no -1 after 72 hours, reply to the email as follows > `Send to`: general@incubator.apache.org
-> `cc`: dev@hertzbeat.apache.org
> `Body`: ``` @@ -505,27 +504,24 @@ Chunjin Mu Then the voting results will be counted, and the voting result email will be sent, as follows. > `Send to`: general@incubator.apache.org
-> `cc`: dev@hertzbeat.apache.org、tison@apache.org、willem.jiang@gmail.com
> `Title`: [RESULT][VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
> `Body`: ``` -Hi all, +Hi Incubator Community, -Thanks for your review and vote for "Release Apache HertzBeat (incubating) 1.6.0-rc1" -I'm happy to announce the vote has passed: +The vote to release Apache HertzBeat (incubating) 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes. 3 binding votes, no +0 or -1 votes. -Thanks for reviewing and voting. +3 (binding) +1, from: -- cc +- xxx no 0 or -1 votes. Vote thread: -https://lists.apache.org/thread/k3cvcbzxqs6qy62d1o6r9pqpykcgvvhm +https://lists.apache.org/thread/m1kyn4l30y55p6q39m0ys5djvdd73h0f Thanks everyone for your feedback and help with HertzBeat apache release. The HertzBeat team will take the steps to complete this release and will announce it soon. @@ -557,16 +553,20 @@ Open the official website address https://hertzbeat.apache.org/docs/download/ to #### 4.3 Generate a release on github -Create a tag named v1.6.0 based on the release-1.6.0-rc1 branch, and set this tag to latest release. +Update pre-release to create a tag named v1.6.0 based on the release-1.6.0-rc1 branch, and set this tag to latest release. + +:::tip +You can modify it on the original RC Release without creating a new Release. +::: Then enter Release Title and Describe - Release Title: ``` -v1.6.0-incubating +v1.6.0 ``` - Describe: ``` -Release-1.6.0-incubating +xxx release note: xxx ``` @@ -578,19 +578,25 @@ The rename the release-1.6.0-rc1 branch to release-1.6.0. > `Send to`: general@incubator.apache.org
> `cc`: dev@hertzbeat.apache.org
-> `Title`: [ANNOUNCE] Release Apache HertzBeat (incubating) 1.6.0
+> `Title`: [ANNOUNCE] Apache HertzBeat (incubating) 1.6.0 released
> `Body`: ``` -Hi all, +Hi Community, We are glad to announce the release of Apache HertzBeat (incubating) 1.6.0. -Once again I would like to express my thanks to your help. +Thanks again for your help. + +Apache HertzBeat (https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. -Apache HertzBeat(https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. +Download Link: +https://hertzbeat.apache.org/docs/download/ -Download Links: https://hertzbeat.apache.org/download/ -Release Notes: https://github.com/apache/hertzbeat/releases/tag/v1.6.0 +Release Note: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0 + +Website: +https://hertzbeat.apache.org/ HertzBeat Resources: - Issue: https://github.com/apache/hertzbeat/issues @@ -599,6 +605,7 @@ HertzBeat Resources: Apache HertzBeat Team + Best, ChunJin Mu ``` diff --git a/home/docs/community/new_committer_process.md b/home/docs/community/new_committer_process.md index b72ec6e30b7..64c3d4dd0f8 100644 --- a/home/docs/community/new_committer_process.md +++ b/home/docs/community/new_committer_process.md @@ -48,12 +48,11 @@ sidebar_position: 4 see **Committer Account Creation** - Wait until root says it is done - - PMC Chair enables svn and other access - - Add committer to the appropriate groups in JIRA and CWiki + - [Roster](https://whimsy.apache.org/roster/ppmc/hertzbeat) add the new committer -- Notify the committer of completion +- Announce the new committer - see **Committer Done Template** + see **Announce New Committer Template** ## Template @@ -73,11 +72,35 @@ Subject: [VOTE] New committer: ${NEW_COMMITTER_NAME} ```text Hi HertzBeat PPMC, -This is a formal vote about inviting ${NEW_COMMITTER_NAME} as our new committer. +This is a formal vote about inviting ${NEW_COMMITTER_NAME} as our community new committer. -${Work list}[1] +Work list: https://github.com/apache/hertzbeat/commits?author=${NEW_COMMITTER_NAME} -[1] https://github.com/apache/hertzbeat/commits?author=${NEW_COMMITTER_NAME} +Here is the list of ${NEW_COMMITTER_NAME}'s contributions in HertzBeat Community: + +> [27 commits](https://github.com/apache/hertzbeat/commits?author=xxx) +> +> 7,495 ++ 627 -- + +Submitted PR (27 commits) +- [ISSUE #4534] [feature] add new feature in hertzbeat #3445 +- xxx + +Submitted Issues (18 commits) + +- [bug] find some bugs in hertzbeat nodes #6565 +- xxx + +Please vote: + ++1: I support this proposal and will welcome ${NEW_COMMITTER_NAME} as a committer. ++0: I don't care. +-1: I object to this proposal and here are my reasons. + +This vote will be open for at least 7 days. + +Best Wishes, +ttt ``` Note that, Voting ends one week from today, i.e. @@ -210,36 +233,23 @@ Yours, The Apache HertzBeat PPMC ``` -### Committer Done Template +### Announce New Committer Template ```text -To: private@hertzbeat.apache.org, ${NEW_COMMITTER_EMAIL} -Subject: account request: ${NEW_COMMITTER_NAME} +To: dev@hertzbeat.apache.org, ${NEW_COMMITTER_EMAIL} +Subject: [ANNOUNCE] New committer: ${NEW_COMMITTER_NAME} ``` ```text -${NEW_COMMITTER_NAME}, as you know, the ASF Infrastructure has set up your -committer account with the username '${NEW_COMMITTER_APACHE_NAME}'. - -Please follow the instructions to set up your SSH, -svn password, svn configuration, email forwarding, etc. -https://www.apache.org/dev/#committers - -You have commit access to specific sections of the -ASF repository, as follows: - -The general "committers" at: - https://svn.apache.org/repos/private/committers - -If you have any questions during this phase, then please -see the following resources: +Hello Community, -Apache developer's pages: https://www.apache.org/dev/ -Incubator committer guide: https://incubator.apache.org/guides/committer.html +The Podling Project Management Committee (PPMC) for Apache HertzBeat (incubating) +has invited ${NEW_COMMITTER_NAME} to become a committer and we are pleased to +announce that he has accepted. -Naturally, if you don't understand anything be sure to ask us on the dev@hertzbeat.apache.org mailing list. -Documentation is maintained by volunteers and hence can be out-of-date and incomplete - of course -you can now help fix that. +${NEW_COMMITTER_NAME} is active in the Apache HertzBeat community, hope to see your +further interactions with the community! +Thanks for your contributions. -A PPMC member will announce your election to the dev list soon. +Best Wishes! ``` diff --git a/home/docs/download.md b/home/docs/download.md index e2af3cd9083..827784bea00 100644 --- a/home/docs/download.md +++ b/home/docs/download.md @@ -15,18 +15,23 @@ sidebar_label: Download ## The Latest Release :::tip -The Apache release coming soon! +Previous releases of HertzBeat may be affected by security issues, please use the latest one. ::: ----- -## Non-Apache Release +| Version | Date | Download | Release Notes | +|---------|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| +| v1.6.0 | 2024.06.10 | [apache-hertzbeat-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-1.6.0-incubating-src.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512) ) | [release note](https://github.com/apache/hertzbeat/releases/tag/v1.6.0) | -:::tip -These releases were made before the HertzBeat project joined the ASF Incubator. -These have not followed the usual ASF release process. -::: -| Version | Date | Source | Binary | Release Notes | -|---------|------------|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| -| v1.5.0 | 2024.03.08 | [source](https://github.com/apache/hertzbeat/archive/refs/tags/v1.5.0.zip) | [hertzbeat-1.5.0.tar.gz](https://github.com/apache/hertzbeat/releases/download/v1.5.0/hertzbeat-1.5.0.tar.gz)
[hertzbeat-collector-1.5.0.tar.gz](https://github.com/apache/hertzbeat/releases/download/v1.5.0/hertzbeat-collector-1.5.0.tar.gz) | [release note](https://github.com/apache/hertzbeat/releases/tag/v1.5.0) | +## Release Docker Image + +> Apache HertzBeat provides a docker image for each release. You can pull the image from the [Docker Hub](https://hub.docker.com/r/apache/hertzbeat). + +- HertzBeat https://hub.docker.com/r/apache/hertzbeat +- HertzBeat Collector https://hub.docker.com/r/apache/hertzbeat-collector + + +## All Archived Releases + +For older releases, please check the [archive](https://archive.apache.org/dist/incubator/hertzbeat/). diff --git a/home/docs/help/ai_config.md b/home/docs/help/ai_config.md new file mode 100644 index 00000000000..7e70ee668c5 --- /dev/null +++ b/home/docs/help/ai_config.md @@ -0,0 +1,43 @@ +--- +id: aiConfig +title: AI QuickStart +sidebar_label: AI QuickStartr +keywords: [AI] +--- + +> The dialogue with artificial intelligence is achieved by configuring aiConfig in the application.yml file + +### Configuration parameter description + +| Name of the parameter | Parameter help description | +|-----------------------|------------------------------| +| type | Choose a large AI model (such as Zhipu, Tongyi thousand questions...)| +| model | Select the model, which defaults to GLM-4 | +| api-key | Gets the api_key, without which you cannot talk to the large model | + +### Large model options and configuration details + +#### ZhiPu AI + +| Name of the parameter | Example | Link | +|--------------|-----------------------------------------------------|---------------------------------------------------------------| +| type | zhiPu (must be exactly the same as example) | | +| model | glm-4-0520、glm-4 、glm-4-air、glm-4-airx、 glm-4-flash | | +| api-key | xxxxx.xxxxxx | https://open.bigmodel.cn/login?redirect=%2Fusercenter%2Fapikeys | + +#### Alibaba AI + +| Name of the parameter | Example | Link | +|--------------|----------------------------------------------------------------------------------------------|---------------------------------------------------------------| +| type | alibabaAi (must be exactly the same as example) | | +| model | qwen-turbo、qwen-plus、qwen-max、qwen-max-0428、qwen-max-0403、qwen-max-0107、qwen-max-longcontext | https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction?spm=a2c4g.11186623.0.0.4e0246c1RQFKMH | +| api-key | xxxxxxxxxxx |https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key?spm=a2c4g.11186623.0.i10| + +#### Kimi AI + +| Name of the parameter | Example | Link | +|--------------|----------------------------------------------|---------------------------------------------------------------| +| type | kimiAi (must be exactly the same as example) | | +| model | moonshot-v1-8k、moonshot-v1-32k、moonshot-v1-128k | | +| api-key | xxxxxxxxxxx |https://platform.moonshot.cn/console/api-keys| + diff --git a/home/docs/help/flink_on_yarn.md b/home/docs/help/flink_on_yarn.md new file mode 100644 index 00000000000..0a81fb93c4f --- /dev/null +++ b/home/docs/help/flink_on_yarn.md @@ -0,0 +1,137 @@ +# Flink On Yarn Monitoring + +> Measurement and monitoring of general metrics for Flink stream engine in Yarn running mode. + +### Configuration Parameters + +| Parameter Name | Parameter Help Description | +| -------------------- | --------------------------------------------------------------------------- | +| Monitoring Host | The monitored peer's IPV4, IPV6, or domain name. Note ⚠️ do not include protocol headers (e.g., https://, http://). | +| Task Name | The name identifying this monitoring task. The name must be unique. | +| Yarn Port | The Yarn port, corresponding to the port in `yarn.resourcemanager.webapp.address`. | +| Query Timeout | The timeout for JVM connections, in milliseconds, default is 3000 ms. | +| Enable SSL | Whether to enable SSL | +| Username | Connection username | +| Password | Connection password | +| Monitoring Interval | Interval for periodic data collection, in seconds, minimum interval is 30 seconds. | +| Tags | Used for categorizing and managing monitoring resources. | +| Description | Additional notes and descriptions for this monitoring task. Users can add notes here. | + +### Collected Metrics + +#### Metrics Set: JobManager Metrics + +| Metric Name | Metric Unit | Metric Help Description | +| ------------------------------------------------------- | ----- | ---------------------------- | +| Status.JVM.Memory.NonHeap.Committed | Bytes | Non-heap memory committed | +| Status.JVM.Memory.Mapped.TotalCapacity | Bytes | Total capacity of mapped memory | +| Status.JVM.Memory.NonHeap.Used | Bytes | Non-heap memory used | +| Status.JVM.Memory.Metaspace.Max | Bytes | Maximum capacity of metaspace | +| Status.JVM.GarbageCollector.G1_Old_Generation.Count | Count | Count of old generation garbage collections | +| Status.JVM.Memory.Direct.MemoryUsed | Bytes | Direct memory used | +| Status.JVM.Memory.Mapped.MemoryUsed | Bytes | Mapped memory used | +| Status.JVM.GarbageCollector.G1_Young_Generation.Count | Count | Count of young generation garbage collections | +| Status.JVM.Memory.Direct.TotalCapacity | Bytes | Total capacity of direct memory | +| Status.JVM.GarbageCollector.G1_Old_Generation.Time | ms | Time spent on old generation garbage collections | +| Status.JVM.Memory.Heap.Committed | Bytes | Heap memory committed | +| Status.JVM.Memory.Mapped.Count | Count | Count of mapped memory | +| Status.JVM.Memory.Metaspace.Used | Bytes | Metaspace memory used | +| Status.JVM.Memory.Direct.Count | Count | Count of direct memory | +| Status.JVM.Memory.Heap.Used | Bytes | Heap memory used | +| Status.JVM.Memory.Heap.Max | Bytes | Maximum capacity of heap memory | +| Status.JVM.GarbageCollector.G1_Young_Generation.Time | ms | Time spent on young generation garbage collections | +| Status.JVM.Memory.NonHeap.Max | Bytes | Maximum capacity of non-heap memory | + +#### Metrics Set: JobManager Config + +| Metric Name | Metric Unit | Metric Help Description | +| --------------------------------------------- |-------------| ------------------------------------ | +| internal.jobgraph-path | - | Internal job graph path | +| env.java.home | - | Java environment path | +| classloader.check-leaked-classloader | - | Whether to check for leaked class loaders | +| env.java.opts | - | Java options | +| high-availability.cluster-id | - | High availability cluster ID | +| jobmanager.rpc.address | - | JobManager's RPC address | +| jobmanager.memory.jvm-overhead.min | Bytes | Minimum JVM overhead for JobManager | +| jobmanager.web.port | Port | JobManager's Web port | +| webclient.port | Port | Web client port | +| execution.savepoint.ignore-unclaimed-state | - | Whether to ignore unclaimed state | +| io.tmp.dirs | Path | Temporary file directories | +| parallelism.default | - | Default parallelism | +| taskmanager.memory.fraction | - | TaskManager memory fraction | +| taskmanager.numberOfTaskSlots | - | Number of task slots for TaskManager | +| yarn.application.name | - | Yarn application name | +| taskmanager.heap.mb | MB | Heap memory size for TaskManager | +| taskmanager.memory.process.size | GB | Process memory size for TaskManager | +| web.port | Port | Web port | +| classloader.resolve-order | - | Class loader resolve order | +| jobmanager.heap.mb | MB | Heap memory size for JobManager | +| jobmanager.memory.off-heap.size | Bytes | Off-heap memory size for JobManager | +| state.backend.incremental | - | Whether the state backend is incremental | +| execution.target | - | Execution target | +| jobmanager.memory.process.size | GB | Process memory size for JobManager | +| web.tmpdir | Path | Web temporary directory | +| yarn.ship-files | Path | Yarn shipped files | +| jobmanager.rpc.port | Port | JobManager's RPC port | +| internal.io.tmpdirs.use-local-default | - | Whether to use local default temporary directories | +| execution.checkpointing.interval | ms | Checkpointing interval | +| execution.attached | - | Whether to execute attached | +| internal.cluster.execution-mode | - | Internal cluster execution mode | +| execution.shutdown-on-attached-exit | - | Whether to shutdown on attached exit | +| pipeline.jars | Path | Pipeline JAR files | +| rest.address | - | REST address | +| state.backend | - | State backend type | +| jobmanager.memory.jvm-metaspace.size | Bytes | JVM metaspace size for JobManager | +| $internal.deployment.config-dir | Path | Internal deployment configuration directory | +| $internal.yarn.log-config-file | Path | Internal Yarn log configuration file path | +| jobmanager.memory.heap.size | Bytes | Heap memory size for JobManager | +| state.checkpoints.dir | Path | State checkpoints directory | +| jobmanager.memory.jvm-overhead.max | Bytes | Maximum JVM overhead for JobManager | + +#### TaskManager Metrics + +| Metric Name | Metric Unit | Metric Help Description | +| ------------------------------------------- | ----- | ----------------------------------- | +| Container ID | - | Container ID for uniquely identifying a container | +| Path | - | Container path | +| Data Port | Port | Data transmission port | +| JMX Port | Port | JMX (Java Management Extensions) port | +| Last Heartbeat | Timestamp | Last heartbeat time | +| All Slots | Count | Total number of task slots in the container | +| Free Slots | Count | Number of free task slots in the container | +| totalResourceCpuCores | Cores | Total number of CPU cores in the container | +| totalResourceTaskHeapMemory | MB | Total task heap memory size in the container | +| totalResourceManagedMemory | MB | Total managed memory size in the container | +| totalResourceNetworkMemory | MB | Total network memory size in the container | +| freeResourceCpuCores | Cores | Number of free CPU cores in the container | +| freeResourceTaskHeapMemory | MB | Free task heap memory size in the container | +| freeResourceTaskOffHeapMemory | MB | Free task off-heap memory size in the container | +| freeResourceManagedMemory | MB | Free managed memory size in the container | +| freeResourceNetworkMemory | MB | Free network memory size in the container | +| CPU Cores | Cores | Number of CPU cores | +| Physical MEM | MB | Size of physical memory | +| JVM Heap Size | MB | Size of JVM heap memory | +| Flink Managed MEM | MB | Size of Flink managed memory | +| Framework Heap | MB | Size of framework heap memory | +| Task Heap | MB | Size of task heap memory | +| Framework Off-Heap | MB | Size of framework off-heap memory | +| memoryConfigurationTaskOffHeap | Bytes | Task off-heap memory configuration | +| Network | MB | Network memory configuration | +| Managed Memory | MB | Managed memory configuration | +| JVM Metaspace | MB | Size of JVM metaspace | +| JVM Overhead | MB | JVM overhead | +| memoryConfigurationTotalFlinkMemory | Bytes | Total Flink memory configuration | +| memoryConfigurationTotalProcessMemory | Bytes | Total process memory configuration | + +#### TaskManager Metrics + +| Metric Name | Metric Unit | Metric Help Description | +| ------------------------------------------ | ----- | ----------------------------- | +| Status.Shuffle.Netty.TotalMemory | MB | Total memory used by Netty Shuffle | +| Status.Flink.Memory.Managed.Used | MB | Managed memory used by Flink | +| Status.JVM.Memory.Metaspace.Used | MB | Used JVM metaspace memory | +| Status.JVM.Memory.Metaspace.Max | MB | Maximum JVM metaspace memory | +| Status.JVM.Memory.Heap.Used | MB | Used JVM heap memory | +| Status.JVM.Memory.Heap.Max | MB | Maximum JVM heap memory | +| Status.Flink.Memory.Managed.Total | MB | Total managed memory by Flink | +| Status.Shuffle.Netty.UsedMemory | MB | Used memory by Netty Shuffle | \ No newline at end of file diff --git a/home/docs/help/imap.md b/home/docs/help/imap.md new file mode 100644 index 00000000000..9a4a9904897 --- /dev/null +++ b/home/docs/help/imap.md @@ -0,0 +1,47 @@ +--- +id: imap +title: Monitoring detailed mailbox info +sidebar_label: mailbox Monitor +keywords: [Open Source Monitoring System, Open Source Network Monitoring, mailbox Monitor] +--- + +> IMAP, or Internet Message Access Protocol, allows you to retrieve detailed information from your email server. +> You can click on `Create New QQ Email Monitoring` or `Create New Netease Email Monitoring` to configure, or select `More Actions` to import existing configurations. + +### Enable IMAP Service + +If you want to use this monitoring type to monitor your email information, please first enable the IMAP service in your email: + +For example, in QQ Mail (other emails are similar): + +1. Go to `Mail Settings` +2. Find and enable the `IMAP/SMTP option` in `General` +3. Obtain the IMAP server domain, port number, whether to use SSL, and authorization code from the help section +4. Use the above information to configure in HertzBeat and collect monitoring metrics + +### Configuration Parameters + +| Parameter Name | Parameter Help Description | +|:--------------------|------------------------------------------------------------------------------------------------------------| +| Monitoring Host | IMAP mail server domain. Note ⚠️ do not include protocol headers (e.g., https://, http://). | +| Task Name | The name that identifies this monitoring task, which needs to be unique. | +| Enable SSL | Whether to enable SSL. | +| Port | The port provided by the website. | +| Connection Timeout | The wait timeout for the port connection, in milliseconds, default is 6000 ms. | +| IMAP Email Address | The email address to be monitored. | +| Authorization Code | The authorization code provided by the email server. | +| Monitoring Interval | The interval time for periodic data collection, in seconds, the minimum interval can be set to 30 seconds. | +| Binding Tags | Classification management tags for monitoring resources. | +| Description Notes | Additional identification and description notes for this monitoring task, users can leave notes here. | + +### Collection Metrics + +Collect information on each folder in the email (custom folders can be configured), as the metrics collected for each folder are the same, only a common set of metrics is listed below + +#### Metrics Collection: (Folder Name in Email) + +| Metric Name | Metric Unit | Metric Help Description | +|----------------------|-------------|-------------------------------------------------------| +| Total message count | None | The total number of emails in this folder | +| Recent message count | None | The number of recently received emails in this folder | +| Unseen message count | None | The number of unread emails in this folder | diff --git a/home/docs/help/mongodb_atlas.md b/home/docs/help/mongodb_atlas.md new file mode 100644 index 00000000000..05f1f517b7c --- /dev/null +++ b/home/docs/help/mongodb_atlas.md @@ -0,0 +1,82 @@ +--- +id: mongodb_atlas +title: Monitoring MongoDB Atlas Database +sidebar_label: MongoDB Atlas Database +keywords: [open-source monitoring system, open-source database monitoring, MongoDB Atlas database monitoring] +--- +> Collect and monitor general performance metrics of MongoDB Atlas databases. + +### Configuration Parameters + + +| Parameter Name | Parameter Description | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| Target Host | The IP address, IPv4, IPv6, or domain name of the target to be monitored. Note: ⚠️ Do not include protocol headers (e.g., https://, http://). | +| Task Name | The name identifying this monitor, which must be unique. | +| Username | MongoDB username, optional. | +| Password | MongoDB password, optional. | +| Database | Name of the database. | +| Authentication Database | The name of the database storing user credentials. | +| Connection Timeout | Timeout for MongoDB connection when no response is received, in milliseconds (ms). Default is 6000 ms. | +| Cluster Mode | Value for MongoDB Atlas cluster: mongodb-atlas | +| Collection Interval | Interval for periodic data collection, in seconds. The minimum interval is 30 seconds. | +| Binding Tags | Used for categorizing and managing monitoring resources. | +| Description/Remarks | Additional labels and description for this monitor; users can add notes here. | + +### Collection Metrics + +#### Metric Set: Build Information + + +| Metric Name | Unit | Metric Description | +| ---------------- | ---- | --------------------------------- | +| version | None | MongoDB version information | +| gitVersion | None | Source code git version | +| sysInfo | None | System information | +| allocator | None | Memory allocator used by MongoDB | +| javascriptEngine | None | JavaScript engine used by MongoDB | + +#### Metric Set: Server Document + + +| Metric Name | Unit | Metric Description | +| ----------- | ---- | ------------------------------------------------- | +| delete | None | Number of deletions | +| insert | None | Number of insertions | +| update | None | Number of updates | +| query | None | Number of queries | +| getmore | None | Number of requests for remaining cursor documents | +| command | None | Total number of command operations | + +#### Metric Set: Network Operations + + +| Metric Name | Unit | Metric Description | +| ----------- | ---- | --------------------------------------------------- | +| Bytes In | None | Number of times a query needs to scan and sort data | +| Bytes Out | None | Number of write conflicts | +| Request Num | None | Number of requests | + +#### Metric Set: Connection Information + + +| Metric Name | Unit | Metric Description | +| ------------------------- | ---- | ------------------------------------ | +| Current Connections | None | Number of current active connections | +| Available Connections | None | Number of available connections | +| Total Created Connections | None | Total number of connections created | + +#### Metric Set: Database Statistics + + +| Metric Name | Unit | Metric Description | +| ----------------- | ----- | ------------------------- | +| Database Name | None | Name of the database | +| Collections | None | Number of collections | +| Views | None | Number of views | +| Objects | None | Number of documents | +| Document Avg Size | Bytes | Average size of documents | +| Document Size | Bytes | Total size of documents | +| Storage Size | Bytes | Size of storage used | +| Indexes | None | Number of indexes | +| Index Size | Bytes | Total size of indexes | diff --git a/home/docs/help/mysql.md b/home/docs/help/mysql.md index 3f07be99380..44e00ede3b2 100644 --- a/home/docs/help/mysql.md +++ b/home/docs/help/mysql.md @@ -7,6 +7,11 @@ keywords: [open source monitoring tool, open source database monitoring tool, mo > Collect and monitor the general performance Metrics of MySQL database. Support MYSQL5+. +### Add MYSQL jdbc driver jar + +- Download the MYSQL jdbc driver jar package, such as mysql-connector-java-8.1.0.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 +- Copy the jar package to the `hertzbeat/ext-lib` directory. + ### Configuration parameter | Parameter name | Parameter help description | diff --git a/home/docs/help/status.md b/home/docs/help/status.md new file mode 100644 index 00000000000..1e1b8251b8d --- /dev/null +++ b/home/docs/help/status.md @@ -0,0 +1,76 @@ +Here is the English translation of the provided text: + +--- + +id: status +title: Status Page +sidebar_label: Status Page +keywords: [Open Source Monitoring System, Open Source Website Monitoring, Status Page] +--- + +Quickly build a powerful status page with HertzBeat to easily communicate the real-time status of your product services to users. For example, see GitHub's service status page [https://www.githubstatus.com](https://www.githubstatus.com). + +It supports the linkage synchronization between component status and monitoring status, provides a fault event maintenance management mechanism, and more. This enhances your transparency and professionalism, builds user trust, and reduces communication costs. + +## 1. Set Organization Information + +The fields that need to be filled in are as follows: + +| Field Name | Field Description | Example | +|--------------|--------------------------------------------------|-----------------------------------------------------------------------------------------------------| +| Organization Name | Name of the organization | HertzBeat | +| Organization Description | Detailed description of the organization | Apache HertzBeat (incubating) is an easy-to-use and user-friendly open-source real-time monitoring and alerting system, no agent required, high-performance cluster, compatible with Prometheus, providing powerful custom monitoring and status page building capabilities. | +| Website Link | URL of the organization's website for more information | https://hertzbeat.apache.org/ | +| Logo Image | Path or URL of the organization's official logo image, preferably in .svg format | https://hertzbeat.apache.org/zh-cn/img/hertzbeat-logo.svg | +| Feedback Address | Address to receive feedback | https://github.com/apache/hertzbeat/issues | +| Theme Color | Main color tone of the status page | Click to select on the page | + +After filling in the organization information, click `Confirm`. + +![](/img/docs/help/status-3.png) + +## 2. Add Component + +After adding a component, the status page will display the status information of the component. + +Click `Add Component` to add the component to be monitored and fill in the following fields: + +| Field Name | Field Description | Example | +|-------------------|-----------------------------------------------------------------------------------------------------------|------------------------------------------| +| Service Component | Name of the component service | Development Environment ElasticSearch | +| Component Description | Detailed description of the component service | Development environment, ElasticSearch (ip:192.168.1.1) | +| Service Status Calculation Method | Method of calculating the service status of the component.
Automatic Calculation: Automatically calculate the status based on the monitored status of the component.
Manual Setting: Manually configure the component status. | Automatic Calculation / Manual Setting (Choose one) | +| Matching Tag | Status calculation associated tag, use the availability status data of all monitors associated with the tag to calculate the service status of the component. | Select the component tag on the page | + +### Set Status Calculation Time + +> Note: The service status is calculated every 300 seconds by default. + +Modify `application.yml`: + +```yaml +status: + calculate: + interval: 60 +``` + +![](/img/docs/help/status-4.png) + +## 3. Maintain Events + +When an event occurs, you can publish a notification on the status page. + +Click `Publish Event` + +![](/img/docs/help/status-1.png) + +| Field Name | Field Description | Example | +|--------------|-------------------------------------------------|------------------------------------------------------------| +| Event Name | Title of the event, should clearly reflect the core content of the event | "Server Downtime Event - April 5, 2023" | +| Affected Component | Select the components affected by this event | Select on the page | +| Process Status | Set the current status of the event for tracking the progress. Optional values: Investigating / Confirmed / Monitoring / Resolved | Confirmed | +| Publish Message | Official notification to convey to relevant parties, including event details, impact assessment, and countermeasures | Dear All, there is an issue with the development environment, the developers are urgently handling it, it is expected to be fixed within two hours. Please be patient, if you have urgent matters, please contact Tom: 130xxxx0000! | + +> Note: You can publish messages multiple times to keep the team updated on the current status. + +![](/img/docs/help/status-2.png) \ No newline at end of file diff --git a/home/docs/introduce.md b/home/docs/introduce.md index d559fa6ca34..98305d95ed5 100644 --- a/home/docs/introduce.md +++ b/home/docs/introduce.md @@ -11,7 +11,7 @@ slug: / [![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) -[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/repository/docker/apache/hertzbeat/general) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) [![QQ](https://img.shields.io/badge/QQ-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) diff --git a/home/docs/start/account-modify.md b/home/docs/start/account-modify.md index 64bba7d72df..81a1f573573 100644 --- a/home/docs/start/account-modify.md +++ b/home/docs/start/account-modify.md @@ -7,88 +7,110 @@ sidebar_label: Update Account Secret ## Update Account Apache HertzBeat (incubating) default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat -If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand. -The configuration file content refer to project repository[/script/sureness.yml](https://github.com/hertzbeat/hertzbeat/blob/master/script/sureness.yml) +If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand. Modify the following **part parameters** in sureness.yml:**[Note⚠️Other default sureness configuration parameters should be retained]** ```yaml resourceRole: - - /api/account/auth/refresh===post===[admin,user,guest] - - /api/apps/**===get===[admin,user,guest] - - /api/monitor/**===get===[admin,user,guest] - - /api/monitor/**===post===[admin,user] - - /api/monitor/**===put===[admin,user] - - /api/monitor/**===delete==[admin] - - /api/monitors/**===get===[admin,user,guest] - - /api/monitors/**===post===[admin,user] - - /api/monitors/**===put===[admin,user] - - /api/monitors/**===delete===[admin] - - /api/alert/**===get===[admin,user,guest] - - /api/alert/**===post===[admin,user] - - /api/alert/**===put===[admin,user] - - /api/alert/**===delete===[admin] - - /api/alerts/**===get===[admin,user,guest] - - /api/alerts/**===post===[admin,user] - - /api/alerts/**===put===[admin,user] - - /api/alerts/**===delete===[admin] - - /api/notice/**===get===[admin,user,guest] - - /api/notice/**===post===[admin,user] - - /api/notice/**===put===[admin,user] - - /api/notice/**===delete===[admin] - - /api/tag/**===get===[admin,user,guest] - - /api/tag/**===post===[admin,user] - - /api/tag/**===put===[admin,user] - - /api/tag/**===delete===[admin] - - /api/summary/**===get===[admin,user,guest] - - /api/summary/**===post===[admin,user] - - /api/summary/**===put===[admin,user] - - /api/summary/**===delete===[admin] + - /api/account/auth/refresh===post===[admin,user,guest] + - /api/apps/**===get===[admin,user,guest] + - /api/monitor/**===get===[admin,user,guest] + - /api/monitor/**===post===[admin,user] + - /api/monitor/**===put===[admin,user] + - /api/monitor/**===delete==[admin] + - /api/monitors/**===get===[admin,user,guest] + - /api/monitors/**===post===[admin,user] + - /api/monitors/**===put===[admin,user] + - /api/monitors/**===delete===[admin] + - /api/alert/**===get===[admin,user,guest] + - /api/alert/**===post===[admin,user] + - /api/alert/**===put===[admin,user] + - /api/alert/**===delete===[admin] + - /api/alerts/**===get===[admin,user,guest] + - /api/alerts/**===post===[admin,user] + - /api/alerts/**===put===[admin,user] + - /api/alerts/**===delete===[admin] + - /api/notice/**===get===[admin,user,guest] + - /api/notice/**===post===[admin,user] + - /api/notice/**===put===[admin,user] + - /api/notice/**===delete===[admin] + - /api/tag/**===get===[admin,user,guest] + - /api/tag/**===post===[admin,user] + - /api/tag/**===put===[admin,user] + - /api/tag/**===delete===[admin] + - /api/summary/**===get===[admin,user,guest] + - /api/summary/**===post===[admin,user] + - /api/summary/**===put===[admin,user] + - /api/summary/**===delete===[admin] + - /api/collector/**===get===[admin,user,guest] + - /api/collector/**===post===[admin,user] + - /api/collector/**===put===[admin,user] + - /api/collector/**===delete===[admin] + - /api/status/page/**===get===[admin,user,guest] + - /api/status/page/**===post===[admin,user] + - /api/status/page/**===put===[admin,user] + - /api/status/page/**===delete===[admin] -# Resources that need to be filtered and protected can be accessed directly without authentication -# /api/v1/source3===get means /api/v1/source3===get it can be accessed by anyone. Don't need to authentication +# config the resource restful api that need bypass auth protection +# rule: api===method +# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth. excludedResource: - - /api/account/auth/**===* - - /api/i18n/**===get - - /api/apps/hierarchy===get - # web ui the front-end static resource - - /===get - - /dashboard/**===get - - /monitors/**===get - - /alert/**===get - - /account/**===get - - /setting/**===get - - /passport/**===get - - /**/*.html===get - - /**/*.js===get - - /**/*.css===get - - /**/*.ico===get - - /**/*.ttf===get - - /**/*.png===get - - /**/*.gif===get - - /**/*.jpg===get - - /**/*.svg===get - - /**/*.json===get - # swagger ui resource - - /swagger-resources/**===get - - /v2/api-docs===get - - /v3/api-docs===get + - /api/alerts/report/**===* + - /api/account/auth/**===* + - /api/i18n/**===get + - /api/apps/hierarchy===get + - /api/push/**===* + - /api/status/page/public/**===* + # web ui resource + - /===get + - /dashboard/**===get + - /monitors/**===get + - /alert/**===get + - /account/**===get + - /setting/**===get + - /passport/**===get + - /status/**===get + - /**/*.html===get + - /**/*.js===get + - /**/*.css===get + - /**/*.ico===get + - /**/*.ttf===get + - /**/*.png===get + - /**/*.gif===get + - /**/*.jpg===get + - /**/*.svg===get + - /**/*.json===get + - /**/*.woff===get + - /**/*.eot===get + # swagger ui resource + - /swagger-resources/**===get + - /v2/api-docs===get + - /v3/api-docs===get + # h2 database + - /h2-console/**===* -# user account information -# Here is admin tom lili three accounts -# eg: admin includes[admin,user]roles, password is hertzbeat -# eg: tom includes[user], password is hertzbeat -# eg: lili includes[guest],text password is lili, salt password is 1A676730B0C7F54654B0E09184448289 +# account info config +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 account: - - appId: admin - credential: hertzbeat - role: [admin,user] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] ``` Modify the following **part parameters** in sureness.yml **[Note⚠️Other default sureness configuration parameters should be retained]**: @@ -97,19 +119,26 @@ Modify the following **part parameters** in sureness.yml **[Note⚠️Other defa # user account information # Here is admin tom lili three accounts -# eg: admin includes[admin,user]roles, password is hertzbeat -# eg: tom includes[user], password is hertzbeat -# eg: lili includes[guest], text password is lili, salt password is 1A676730B0C7F54654B0E09184448289 +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 account: - appId: admin credential: hertzbeat - role: [admin,user] + role: [admin] - appId: tom credential: hertzbeat role: [user] - appId: guest credential: hertzbeat role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] ``` ## Update Security Secret @@ -122,7 +151,7 @@ Update the `application.yml` file in the `config` directory, modify the `surenes ```yaml sureness: jwt: - secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R + secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx4sDJeFV643R LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp' diff --git a/home/docs/start/docker-deploy.md b/home/docs/start/docker-deploy.md index 7671366e9ad..db0da790be4 100644 --- a/home/docs/start/docker-deploy.md +++ b/home/docs/start/docker-deploy.md @@ -17,7 +17,7 @@ sidebar_label: Install via Docker 2. pull HertzBeat Docker mirror you can look up the mirror version TAG in [dockerhub mirror repository](https://hub.docker.com/r/apache/hertzbeat/tags) - or in [quay.io mirror repository](https://quay.io/repository/apache/hertzbeat) + or in [quay.io mirror repository](https://quay.io/repository/tancloud/hertzbeat) ```shell $ docker pull apache/hertzbeat $ docker pull apache/hertzbeat-collector @@ -29,13 +29,13 @@ sidebar_label: Install via Docker ``` 3. Mounted HertzBeat configuration file (optional) - Download and config `application.yml` in the host directory, eg:`$(pwd)/application.yml` + Mounted and config `application.yml` in the host directory, eg:`$(pwd)/application.yml` + ```-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml```` Download from [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) You can modify the configuration yml file according to your needs. - If you need to use email to send alarms, you need to replace the email server parameters `spring.mail` in `application.yml` - **Recommended** If you need to use an external Mysql database to replace the built-in H2 database, you need to replace the `spring.datasource` parameter in `application.yml` For specific steps, see [Using Mysql to replace H2 database](mysql-change) - - **Recommended** If you need to use the time series database TDengine to store metric data, you need to replace the `warehouse.store.td-engine` parameter in `application.yml` for specific steps, see [Using TDengine to store metrics data](tdengine-init) - - **Recommended** If you need to use the time series database IotDB to store the metric database, you need to replace the `warehouse.storeiot-db` parameter in `application.yml` For specific steps, see [Use IotDB to store metrics data](iotdb-init) + - **Recommended** If you need to use the time series database victoria-metrics to store metric data, you need to replace the `warehouse.store.victoria-metrics` parameter in `application.yml` for specific steps, see [Using victoria-metrics to store metrics data](victoria-metrics-init) 4. Mounted the account file(optional) HertzBeat default built-in three user accounts, respectively `admin/hertzbeat tom/hertzbeat guest/hertzbeat` @@ -66,6 +66,13 @@ $ docker run -d -p 1157:1157 -p 1158:1158 \ - `-v $(pwd)/logs:/opt/hertzbeat/logs` : (optional, if you don't have a need, just delete it) Mount the log file to the local host, to ensure the log will not be lost due creating or deleting container. - `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (optional, if you don't have a need, just delete it) Mount the local configuration file into the container which has been modified in the previous step, namely using the local configuration file to cover container configuration file. - `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (optional, if you don't have a need, just delete it) Mount account configuration file modified in the previous step into the container. Delete this command parameters if no needs. + - `-v $(pwd)/ext-lib:/opt/hertzbeat/ext-lib` : (optional, if you don't have a need, just delete it)Copy the driver jar to the corresponding directory of the host and mount it to the ext-lib directory according to the database connection such as mysql/oracle that you have downloaded + mysql:https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip + oracle:https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar + - `There is also a way to customize the data source connection driver without mounting`(optional)This approach is to put the data source drivers you need directly inside the container + - `docker cp $(pwd)/mysql-connector-java-8.0.18.jar hertzbeat:/opt/hertzbeat/ext-lib` Use the docker cp command to first download the data source driver cp into the container + - `docker restart hertzbeat` After the restart is successful, it can be used normally + - `docker commit -a "operator" -m "New custom data source drivers in the /ext-lib folder inside the container" hertzbeat hertzbeat:version`(optional, if you don't have a need, just delete it) If you want to create a custom image by yourself, run this command. -a The current operator -m describes the container that you have recreated - `--name hertzbeat` : Naming container name hertzbeat - `apache/hertzbeat` : Use the pulled latest HertzBeat official application mirror to start the container. **Use `quay.io/tancloud/hertzbeat` instead if you pull `quay.io` docker image.** @@ -113,24 +120,16 @@ Please refer to the following points to troubleshoot issues: > 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. > 3:`docker logs hertzbeat` Check whether the container log has errors. If you haven't solved the issue, report it to the communication group or community. -3. **Log an error TDengine connection or insert SQL failed** -> 1:Check whether database account and password configured is correct, the database is created. -> 2:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server. +3. **Historical monitoring charts have been missing data for a long time** +> 1:Check whether you configure victoria-metrics or Tdengine or IoTDB. No configuration means no historical chart data. +> 2: Check whether IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. -4. **Historical monitoring charts have been missing data for a long time** -> 1:Check whether you configure Tdengine or IoTDB. No configuration means no historical chart data. -> 2:Check whether Tdengine database `hertzbeat` is created. -> 3: Check whether IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. +4. If the history chart on the monitoring page is not displayed,popup [please configure time series database] +> As shown in the popup window,the premise of history chart display is that you need install and configure hertzbeat's dependency service database. +> Installation and initialization this database, please refer to [Using victoria-metrics to store metrics data](victoria-metrics-init) -5. If the history chart on the monitoring page is not displayed,popup [please configure time series database] -> As shown in the popup window,the premise of history chart display is that you need install and configure hertzbeat's dependency service - IoTDB or TDengine database. -> Installation and initialization this database refer to [TDengine Installation](tdengine-init) or [IoTDB Installation](iotdb-init) - -6. The historical picture of monitoring details is not displayed or has no data, and TDengine has been deployed -> Please confirm whether the installed TDengine version is near 2.4.0.12, version 3.0 and 2.2 are not compatible. - -7. The time series database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure dependent time series database] +5. The time series database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure dependent time series database] > Please check if the configuration parameters are correct -> Is iot-db or td-engine enable set to true -> Note⚠️If both hertzbeat and IotDB, TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed +> Is time-series database enable set to true +> Note⚠️If both hertzbeat and time-series database are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed > You can check the startup logs according to the logs directory diff --git a/home/docs/start/greptime-init.md b/home/docs/start/greptime-init.md index cfb148ecea7..92dec8f6d3d 100644 --- a/home/docs/start/greptime-init.md +++ b/home/docs/start/greptime-init.md @@ -1,14 +1,14 @@ --- id: greptime-init title: Use Time Series Database GreptimeDB to Store Metrics Data (Optional) -sidebar_label: Use GreptimeDB Store Metrics +sidebar_label: Metrics Store GreptimeDB --- Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) > It is recommended to use VictoriaMetrics as metrics storage. -GreptimeDB is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency. +[GreptimeDB](https://github.com/GreptimeTeam/greptimedb) is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency. It's designed to work on infrastructure of the cloud era, and users benefit from its elasticity and commodity storage. @@ -26,21 +26,24 @@ It's designed to work on infrastructure of the cloud era, and users benefit from 2. Install GreptimeDB with Docker ```shell -$ docker run -p 4000-4004:4000-4004 \ - -p 4242:4242 -v /opt/greptimedb:/tmp/greptimedb \ - --name greptime \ - greptime/greptimedb standalone start \ - --http-addr 0.0.0.0:4000 \ - --rpc-addr 0.0.0.0:4001 \ +$ docker run -p 127.0.0.1:4000-4003:4000-4003 \ + -v "$(pwd)/greptimedb:/tmp/greptimedb" \ + --name greptime --rm \ + greptime/greptimedb:latest standalone start \ + --http-addr 0.0.0.0:4000 \ + --rpc-addr 0.0.0.0:4001 \ + --mysql-addr 0.0.0.0:4002 \ + --postgres-addr 0.0.0.0:4003 ``` - `-v /opt/greptimedb:/tmp/greptimedb` is local persistent mount of greptimedb data directory. `/opt/greptimedb` should be replaced with the actual local directory. + + `-v "$(pwd)/greptimedb:/tmp/greptimedb"` is local persistent mount of greptimedb data directory. `$(pwd)/greptimedb` should be replaced with the actual local directory, default is the `greptimedb` directory under the current directory. use```$ docker ps``` to check if the database started successfully ### Configure the database connection in hertzbeat `application.yml` configuration file 1. Configure HertzBeat's configuration file - Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) - Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` Replace `warehouse.store.greptime` data source parameters, URL account and password. ```yaml @@ -52,9 +55,16 @@ warehouse: # enable greptime greptime: enabled: true - endpoint: localhost:4001 + grpc-endpoints: localhost:4001 + url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true + driver-class-name: com.mysql.cj.jdbc.Driver + username: greptime + password: greptime + expire-time: 30d ``` +The default database is `hertzbeat` in the `url`, and it will be created automatically. The `expire-time` specifies the TTL(time-to-live) of the auto-created database, it's 30 days by default. + 2. Restart HertzBeat ### FAQ diff --git a/home/docs/start/influxdb-init.md b/home/docs/start/influxdb-init.md index b752fc82a21..6e5aabcd91d 100644 --- a/home/docs/start/influxdb-init.md +++ b/home/docs/start/influxdb-init.md @@ -1,7 +1,7 @@ --- id: influxdb-init title: Use Time Series Database InfluxDB to Store Metrics Data (Optional) -sidebar_label: Use InfluxDB Store Metrics +sidebar_label: Metrics Store InfluxDB --- Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) @@ -43,7 +43,7 @@ Note⚠️ Need InfluxDB 1.x Version. ### Configure the database connection in hertzbeat `application.yml` configuration file 1. Configure HertzBeat's configuration file - Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + Modify `hertzbeat/config/application.yml` configuration file Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` Replace `warehouse.store.influxdb` data source parameters, URL account and password. diff --git a/home/docs/start/iotdb-init.md b/home/docs/start/iotdb-init.md index ee7a66a87f4..33b82a79183 100644 --- a/home/docs/start/iotdb-init.md +++ b/home/docs/start/iotdb-init.md @@ -1,7 +1,7 @@ --- id: iotdb-init title: Use Time Series Database IoTDB to Store Metrics Data (Optional) -sidebar_label: Use IoTDB Store Metrics +sidebar_label: Metrics Store IoTDB --- Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) diff --git a/home/docs/start/mysql-change.md b/home/docs/start/mysql-change.md index 1095f538b0c..dc48ce9bf60 100644 --- a/home/docs/start/mysql-change.md +++ b/home/docs/start/mysql-change.md @@ -1,7 +1,7 @@ --- id: mysql-change title: Use MYSQL Replace H2 Database to Store Metadata(Optional) -sidebar_label: Use MYSQL Instead of H2 +sidebar_label: Meta Store MYSQL --- MYSQL is a reliable relational database. In addition to default built-in H2 database, Apache HertzBeat (incubating) allow you to use MYSQL to store structured relational data such as monitoring information, alarm information and configuration information. @@ -35,6 +35,12 @@ MYSQL is a reliable relational database. In addition to default built-in H2 data 3. Check if hertzbeat database has been successfully created `show databases;` +### Add MYSQL jdbc driver jar + +- Download the MYSQL jdbc driver jar package, such as mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 +- Copy the jar package to the `hertzbeat/ext-lib` directory. + + ### Modify hertzbeat's configuration file application.yml and switch data source - Configure HertzBeat's configuration file @@ -43,27 +49,45 @@ MYSQL is a reliable relational database. In addition to default built-in H2 data Replace `spring.database` data source parameters, URL account and password. For example: - ```yaml - spring: - datasource: - driver-class-name: org.h2.Driver - username: sa - password: 123456 - url: jdbc:h2:./data/hertzbeat;MODE=MYSQL - ``` +```yaml +spring: + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE +``` Specific replacement parameters are as follows and you need to configure account according to the mysql environment: - ```yaml - spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: 123456 - url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false - platform: mysql +```yaml +spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: 123456 + url: jdbc:mysql://mysql:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false + hikari: + max-lifetime: 120000 jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform database: mysql - ``` + properties: + eclipselink: + logging: + level: SEVERE +``` -- It is recommended to set the host field in the MySQL URL or Redis URL to the public IP address when using Hertzbeat in docker. +- It is recommended to set the host field in the MySQL URL to the public IP address when using Hertzbeat in docker. **Start HertzBeat visit http://ip:1157/ on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat** diff --git a/home/docs/start/postgresql-change.md b/home/docs/start/postgresql-change.md index c78a24a1ca7..60956f42f77 100644 --- a/home/docs/start/postgresql-change.md +++ b/home/docs/start/postgresql-change.md @@ -1,7 +1,7 @@ --- id: postgresql-change -title: Use PostgreSQL Replace H2 Database to Store Metadata(Optional) -sidebar_label: Use PostgreSQL Instead of H2 +title: Use PostgreSQL Replace H2 Database to Store Metadata(Recommended) +sidebar_label: Meta Store PostgreSQL (Recommended) --- PostgreSQL is a RDBMS emphasizing extensibility and SQL compliance. In addition to default built-in H2 database, Apache HertzBeat (incubating) allow you to use PostgreSQL to store structured relational data such as monitoring information, alarm information and configuration information. @@ -46,28 +46,36 @@ spring: username: sa password: 123456 url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE ``` Specific replacement parameters are as follows and you need to configure account, ip, port according to the postgresql environment: ```yaml spring: - config: - activate: - on-profile: prod - datasource: - driver-class-name: org.postgresql.Driver - username: root - password: 123456 - url: jdbc:postgresql://127.0.0.1:5432/hertzbeat - hikari: - max-lifetime: 120000 - - jpa: - database: postgresql - hibernate: - ddl-auto: update - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect + datasource: + driver-class-name: org.postgresql.Driver + username: root + password: 123456 + url: jdbc:postgresql://postgresql:5432/hertzbeat + hikari: + max-lifetime: 120000 + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform + database: postgresql + properties: + eclipselink: + logging: + level: SEVERE ``` **Start HertzBeat visit http://ip:1157/ on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat** diff --git a/home/docs/start/quickstart.md b/home/docs/start/quickstart.md index 087e7db2367..56ecac4df45 100644 --- a/home/docs/start/quickstart.md +++ b/home/docs/start/quickstart.md @@ -38,12 +38,12 @@ Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.apache ##### 2:Install via package -1. Download the release package `hertzbeat-xx.tar.gz` [GITHUB Release](https://github.com/apache/hertzbeat/releases) +1. Download the release package `hertzbeat-xx.tar.gz` [Download Page](https://hertzbeat.apache.org/docs/download) 2. Configure the HertzBeat configuration yml file `hertzbeat/config/application.yml` (optional) 3. Run command `$ ./bin/startup.sh ` or `bin/startup.bat` 4. Access `http://localhost:1157` to start, default account: `admin/hertzbeat` 5. Deploy collector clusters(Optional) - - Download the release package `hertzbeat-collector-xx.tar.gz` to new machine [GITHUB Release](https://github.com/apache/hertzbeat/releases) + - Download the release package `hertzbeat-collector-xx.tar.gz` to new machine [Download Page](https://hertzbeat.apache.org/docs/download) - Configure the collector configuration yml file `hertzbeat-collector/config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port` ```yaml collector: @@ -59,7 +59,7 @@ Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.apache - Run command `$ ./bin/startup.sh ` or `bin/startup.bat` - Access `http://localhost:1157` and you will see the registered new collector in dashboard -Detailed config refer to [Install HertzBeat via Package](https://hertzbeat.apache.org/docs/start/package-deploy) +Detailed config refer to [Install HertzBeat via Package](package-deploy) ##### 3:Start via source code @@ -70,13 +70,13 @@ Detailed config refer to [Install HertzBeat via Package](https://hertzbeat.apach Detailed steps refer to [CONTRIBUTING](../community/contribution) -##### 4:Install All(hertzbeat+mysql+iotdb/tdengine) via Docker-compose +##### 4:Install All(hertzbeat+postgresql+tsdb) via Docker-compose -Install and deploy the mysql database, iotdb/tdengine database and hertzbeat at one time through [docker-compose deployment script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose). +Install and deploy the postgresql/mysql database, victoria-metrics/iotdb/tdengine database and hertzbeat at one time through [docker-compose deployment script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose). Detailed steps refer to [Install via Docker-Compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) -##### 5. Install All(hertzbeat+collector+mysql+iotdb) via kubernetes helm charts +##### 5. Install All(hertzbeat+collector+postgresql+tsdb) via kubernetes helm charts Install HertzBeat cluster in a Kubernetes cluster by Helm chart. diff --git a/home/docs/start/tdengine-init.md b/home/docs/start/tdengine-init.md index 1f73a4151eb..a56bc2cc71b 100644 --- a/home/docs/start/tdengine-init.md +++ b/home/docs/start/tdengine-init.md @@ -1,7 +1,7 @@ --- id: tdengine-init title: Use Time Series Database TDengine to Store Metrics Data (Optional) -sidebar_label: Use TDengine Store Metrics +sidebar_label: Metrics Store TDengine --- Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) @@ -77,7 +77,7 @@ Note⚠️ Need TDengine 3.x Version. ### Configure the database connection in hertzbeat `application.yml` configuration file 1. Configure HertzBeat's configuration file - Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + Modify `hertzbeat/config/application.yml` configuration file Note⚠️The docker container way need to mount application.yml file locally,while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` Replace `warehouse.store.td-engine` data source parameters, URL account and password. diff --git a/home/docs/start/upgrade.md b/home/docs/start/upgrade.md index 917b8ffbe54..8ad14d3b673 100644 --- a/home/docs/start/upgrade.md +++ b/home/docs/start/upgrade.md @@ -6,7 +6,7 @@ sidebar_label: Version Upgrade Guide **HertzBeat Release Version List** -- [Download Page](/docs/download) +- [Download Page](https://hertzbeat.apache.org/docs/download) - [Github Release](https://github.com/apache/hertzbeat/releases) - [DockerHub Release](https://hub.docker.com/r/apache/hertzbeat/tags) diff --git a/home/docs/start/victoria-metrics-init.md b/home/docs/start/victoria-metrics-init.md index 327bc4999af..455e91e86cf 100644 --- a/home/docs/start/victoria-metrics-init.md +++ b/home/docs/start/victoria-metrics-init.md @@ -1,7 +1,7 @@ --- id: victoria-metrics-init title: Use Time Series Database VictoriaMetrics to Store Metrics Data (Recommended) -sidebar_label: Use VictoriaMetrics Store Metrics(Recommended) +sidebar_label: Metrics Store VictoriaMetrics (Recommended) --- Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) diff --git a/home/i18n/en/code.json b/home/i18n/en/code.json index bdc5f8f778a..4acd764d488 100644 --- a/home/i18n/en/code.json +++ b/home/i18n/en/code.json @@ -263,7 +263,7 @@ "message": "Makes protocols such as Http, Jmx, Ssh, Snmp, Jdbc configurable, you can collect any metrics by simply configuring the yml online. {br} High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. {br} Flexible threshold rules and timely notifications delivered via discord slack email webhook more." }, "opensource-content": { - "message": "Apache HertzBeat (incubating)'s stand-alone and cluster version code are all open source, unlimited and anyone who are interested in it are very welcome to contribute. No matter how small the contribution is, whether it is a document code or a typo, we respect everyone and learn and grow together. {br} Hope that the code we participate in can be deployed to thousands of machines in this world.{github}" + "message": "Apache HertzBeat (incubating)'s stand-alone and cluster version code are all open source, unlimited and anyone who are interested in it are very welcome to contribute. No matter how small the contribution is, whether it is a document code or a typo, we respect everyone and learn and grow together. {br} Look forward our code to be deployed on thousands of machines worldwide.{github}" }, "slogan": { "message": "Open Source Real-time Monitoring System" diff --git a/home/i18n/en/docusaurus-plugin-content-docs/current.json b/home/i18n/en/docusaurus-plugin-content-docs/current.json index 3b3bfb01c1e..5d132403609 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/current.json +++ b/home/i18n/en/docusaurus-plugin-content-docs/current.json @@ -1,6 +1,6 @@ { "version.label": { - "message": "v1.5.x", + "message": "v1.6.x", "description": "The label for version current" }, "sidebar.docs.category.quickstart": { @@ -23,6 +23,11 @@ "message": "SSH Protocol", "description": "The label for category ssh in sidebar docs" }, + + "sidebar.docs.category.telnet": { + "message": "TELNET Protocol", + "description": "The label for category telnet in sidebar docs" + }, "sidebar.docs.category.help": { "message": "Help", "description": "The label for category help in sidebar docs" @@ -118,5 +123,9 @@ "sidebar.docs.category.llm": { "message": "Ai LLM Monitor", "description": "The label for category llm in sidebar docs" + }, + "sidebar.docs.category.aiConfig": { + "message": "Ai LLM Config", + "description": "The label for category aiConfig in sidebar docs" } } diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.0.0.json b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.0.0.json deleted file mode 100644 index 25ce5a4c627..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.0.0.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "version.label": { - "message": "v1.0.0", - "description": "The label for version v1.0.0" - }, - "sidebar.docs.category.快速入门": { - "message": "快速入门", - "description": "The label for category 快速入门 in sidebar docs" - }, - "sidebar.docs.category.自定义监控": { - "message": "自定义监控", - "description": "The label for category 自定义监控 in sidebar docs" - }, - "sidebar.docs.category.HTTP协议": { - "message": "HTTP协议", - "description": "The label for category HTTP协议 in sidebar docs" - }, - "sidebar.docs.category.JDBC协议": { - "message": "JDBC协议", - "description": "The label for category JDBC协议 in sidebar docs" - }, - "sidebar.docs.category.SSH协议": { - "message": "SSH协议", - "description": "The label for category SSH协议 in sidebar docs" - }, - "sidebar.docs.category.帮助文档": { - "message": "帮助文档", - "description": "The label for category 帮助文档 in sidebar docs" - }, - "sidebar.docs.category.应用服务监控": { - "message": "应用服务监控", - "description": "The label for category 应用服务监控 in sidebar docs" - }, - "sidebar.docs.category.数据库监控": { - "message": "数据库监控", - "description": "The label for category 数据库监控 in sidebar docs" - }, - "sidebar.docs.category.操作系统": { - "message": "操作系统", - "description": "The label for category 操作系统 in sidebar docs" - }, - "sidebar.docs.category.中间件": { - "message": "中间件", - "description": "The label for category 中间件 in sidebar docs" - }, - "sidebar.docs.category.阈值告警配置": { - "message": "阈值告警配置", - "description": "The label for category 阈值告警配置 in sidebar docs" - }, - "sidebar.docs.category.告警通知配置": { - "message": "告警通知配置", - "description": "The label for category 告警通知配置 in sidebar docs" - }, - "sidebar.docs.category.Others": { - "message": "Others", - "description": "The label for category Others in sidebar docs" - } -} diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x.json b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x.json deleted file mode 100644 index acf391b1c3a..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "version.label": { - "message": "v1.1.x", - "description": "The label for version v1.1.x" - }, - "sidebar.docs.category.快速入门": { - "message": "快速入门", - "description": "The label for category 快速入门 in sidebar docs" - }, - "sidebar.docs.category.自定义监控": { - "message": "自定义监控", - "description": "The label for category 自定义监控 in sidebar docs" - }, - "sidebar.docs.category.HTTP协议": { - "message": "HTTP协议", - "description": "The label for category HTTP协议 in sidebar docs" - }, - "sidebar.docs.category.JDBC协议": { - "message": "JDBC协议", - "description": "The label for category JDBC协议 in sidebar docs" - }, - "sidebar.docs.category.SSH协议": { - "message": "SSH协议", - "description": "The label for category SSH协议 in sidebar docs" - }, - "sidebar.docs.category.帮助文档": { - "message": "帮助文档", - "description": "The label for category 帮助文档 in sidebar docs" - }, - "sidebar.docs.category.应用服务监控": { - "message": "应用服务监控", - "description": "The label for category 应用服务监控 in sidebar docs" - }, - "sidebar.docs.category.数据库监控": { - "message": "数据库监控", - "description": "The label for category 数据库监控 in sidebar docs" - }, - "sidebar.docs.category.操作系统": { - "message": "操作系统", - "description": "The label for category 操作系统 in sidebar docs" - }, - "sidebar.docs.category.中间件": { - "message": "中间件", - "description": "The label for category 中间件 in sidebar docs" - }, - "sidebar.docs.category.云原生": { - "message": "云原生", - "description": "The label for category 云原生 in sidebar docs" - }, - "sidebar.docs.category.阈值告警配置": { - "message": "阈值告警配置", - "description": "The label for category 阈值告警配置 in sidebar docs" - }, - "sidebar.docs.category.告警通知配置": { - "message": "告警通知配置", - "description": "The label for category 告警通知配置 in sidebar docs" - }, - "sidebar.docs.category.Others": { - "message": "Others", - "description": "The label for category Others in sidebar docs" - }, - "sidebar.docs.category.Quickstart": { - "message": "Quickstart", - "description": "The label for category Quickstart in sidebar docs" - } -} diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-example-hertzbeat.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-example-hertzbeat.md deleted file mode 100644 index a8fca72f848..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-example-hertzbeat.md +++ /dev/null @@ -1,223 +0,0 @@ ---- -id: extend-http-example-hertzbeat -title: Tutorial 1 Adapting a monitoring type based on HTTP protocol -sidebar_label: Tutorial 1 Adapting an HTTP protocol monitoring ---- - -Through this tutorial, we describe step by step how to add a monitoring type based on the http protocol under the hertzbeat monitoring tool. - -Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring] (extend-point) and [http Protocol Customization] (extend-http). - - -### HTTP protocol parses the general response structure to obtain metric data - -> In many scenarios, we need to monitor the provided HTTP API interface and obtain the index value returned by the interface. In this article, we use the http custom protocol to parse our common http interface response structure, and obtain the fields in the returned body as metric data. - - -``` -{ - "code": 200, - "msg": "success", - "data": {} -} - -``` -As above, usually our background API interface will design such a general return. The same is true for the background of the hertzbeat system. Today, we will use the hertzbeat API as an example, add a new monitoring type **hertzbeat**, and monitor and collect its system summary statistics API -`http://localhost:1157/api/summary`, the response data is: - -``` -{ - "msg": null, - "code": 0, - "data": { - "apps": [ - { - "category": "service", - "app": "jvm", - "status": 0, - "size": 2, - "availableSize": 0, - "unManageSize": 2, - "unAvailableSize": 0, - "unReachableSize": 0 - }, - { - "category": "service", - "app": "website", - "status": 0, - "size": 2, - "availableSize": 0, - "unManageSize": 2, - "unAvailableSize": 0, - "unReachableSize": 0 - } - ] - } -} -``` - -**This time we get the metric data such as `category`, `app`, `status`, `size`, `availableSize` under the app. ** - - -### Add corresponding application definition YML and parameter definition YML - -1. Custom monitoring type needs to add configuration YML file - -A monitoring configuration definition file named after the monitoring type - for example: app-hertzbeat.yml needs to be located in the installation directory /hertzbeat/define/ - -2. Configure the monitoring configuration definition file app-hertzbeat.yml - -The monitoring configuration definition file is used to define the collection type, which protocol collection method needs to be used, the collection metrics, protocol configuration parameters, etc. We directly reuse the definition content in app-api.yml and modify it to our current monitoring type `hertzbeat` configuration parameters, as follows: Note⚠️We get `category`, `app` in the interface response data this time, Fields such as `status`, `size`, `availableSize` are used as metric data. - -```yaml -# This monitoring type belongs to the category: service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring -category: custom -# Monitoring application type name (consistent with the file name) eg: linux windows tomcat mysql aws... -app: hertzbeat -name: - en-GB: HertzBeat Monitoring Tool - en-US: Hertz Beat Monitor -params: - - field: host - name: - en-CN: Host Host - en-US: Host - type: host - required: true - - field: port - name: - en-CN: port - en-US: Port - type: number - range: '[0,65535]' - required: true - defaultValue: 1157 - - field: ssl - name: - en-GB: Enable HTTPS - en-US: HTTPS - type: boolean - required: true - - field: timeout - name: - en-CN: Timeout (ms) - en-US: Timeout(ms) - type: number - required: false - hide: true - - field: authType - name: - en-CN: Authentication method - en-US: Auth Type - type: radio - required: false - hide: true - options: - - label: Basic Auth - value: Basic Auth - - label: Digest Auth - value: Digest Auth - - field: username - name: - en-CN: username - en-US: Username - type: text - limit: 20 - required: false - hide: true - - field: password - name: - en-CN: Password - en-US: Password - type: password - required: false - hide: true -# List of metricss -metrics: - # The first monitoring metrics summary - # Note: Built-in monitoring metrics have (responseTime - response time) - - name: summary - priority: 0 - fields: - # metric information includes field name type field type: 0-number, 1-string , label-if is metrics label, unit: metric unit - - field: responseTime - type: 0 - unit: ms - - field: app - type: 1 - instance: true - - field: category - type: 1 - - field: status - type: 0 - - field: size - type: 0 - - field: availableSize - type: 0 -# Monitoring and collection protocol eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here - protocol: http -# When the protocol is the http protocol, the specific collection configuration - http: - host: ^_^host^_^ - # port - port: ^_^port^_^ - # url request interface path, we don’t need to enter parameters here, it’s written as /api/summary - url: /api/summary - timeout: ^_^timeout^_^ - # Request method GET POST PUT DELETE PATCH, hardcoded as - method: GET - # Whether to enable ssl/tls, that is, http or https, default false - ssl: ^_^ssl^_^ - # authentication - authorization: - # Authentication methods: Basic Auth, Digest Auth, Bearer Token - type: ^_^authType^_^ - basicAuthUsername: ^_^username^_^ - basicAuthPassword: ^_^password^_^ - digestAuthUsername: ^_^username^_^ - digestAuthPassword: ^_^password^_^ - # Response data parsing method: default-system rules, jsonPath-jsonPath script, website-website usability metric monitoring, we use jsonpath here to parse the response data - parseType: jsonPath - parseScript: '$.data.apps.*' - -``` - -**The addition is complete, now we restart the hertzbeat system. We can see that the system page has added a `hertzbeat` monitoring type. ** - - -![](/img/docs/advanced/extend-http-example-1.png) - - -### The system page adds the monitoring of `hertzbeat` monitoring type - -> We click Add `HertzBeat Monitoring Tool`, configure monitoring IP, port, collection cycle, account password in advanced settings, etc., click OK to add monitoring. - - -![](/img/docs/advanced/extend-http-example-2.png) - - -![](/img/docs/advanced/extend-http-example-3.png) - -> After a certain period of time (depending on the collection cycle), we can see the specific metric data and historical charts in the monitoring details! - - -![](/img/docs/advanced/extend-http-example-4.png) - - - -### Set threshold alarm notification - -> Next, we can set the threshold normally. After the alarm is triggered, we can view it in the alarm center, add recipients, set alarm notifications, etc. Have Fun!!! - - ----- - -#### over! - -This is the end of the practice of custom monitoring of the HTTP protocol. The HTTP protocol also has other parameters such as headers and params. We can define it like postman, and the playability is also very high! - -If you think hertzbeat is a good open source project, please star us on GitHub Gitee, thank you very much. Thanks for the old iron support. Refill! - -**github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-point.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-point.md deleted file mode 100644 index 73b79b6d126..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-point.md +++ /dev/null @@ -1,192 +0,0 @@ ---- -id: extend-point -title: Custom Monitoring -sidebar_label: Custom Monitoring ---- -> HertzBeat has custom monitoring ability. You only need to configure two YML file to fit a custom monitoring type. -> Custom monitoring currently supports [HTTP protocol](extend-http),[JDBC protocol](extend-jdbc)(mysql,mariadb,postgresql...), [SSH protocol](extend-ssh), JMX protocol, SNMP protocol. And it will support more general protocols in the future. - -### Custom Steps - -In order to configure a custom monitoring type, you need to add and configure YML file. -1. Monitoring configuration definition file named after monitoring type - eg:example.yml should be in the installation directory /hertzbeat/app/ -2. Restart hertzbeat system, we successfully fit a new custom monitoring type. - -------- -Configuration usages of the file are detailed below. - -### Monitoring configuration definition file - -> Monitoring configuration definition file is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. - -eg:Define a custom monitoring type named example which use the HTTP protocol to collect data. -The file name: example.yml in /define/example.yml - -```yaml -# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring -category: custom -# Monitoring application type(consistent with the file name) eg: linux windows tomcat mysql aws... -app: example -name: - zh-CN: 模拟应用类型 - en-US: EXAMPLE APP -param: - # field-field name identifier - - field: host - # name-parameter field display name - name: - zh-CN: 主机Host - en-US: Host - # type-field type, style(most mappings are input label type attribute) - type: host - # required or not true-required false-optional - required: true - - field: port - name: - zh-CN: 端口 - en-US: Port - type: number - # When type is number, range is used to represent the range. - range: '[0,65535]' - required: true - # port default - defaultValue: 80 - # Prompt information of parameter input box - placeholder: 'Please enter the port' - - field: username - name: - zh-CN: 用户名 - en-US: Username - type: text - # When type is text, use limit to indicate the string limit size - limit: 20 - required: false - - field: password - name: - zh-CN: 密码 - en-US: Password - type: password - required: false - - field: ssl - name: - zh-CN: 启动SSL - en-US: Enable SSL - # When type is boolean, front end uses switch to show the switch - type: boolean - required: false - - field: method - name: - zh-CN: 请求方式 - en-US: Method - type: radio - required: true - # When type is radio or checkbox, option indicates the list of selectable values {name1:value1,name2:value2} - options: - - label: GET request - value: GET - - label: POST request - value: POST - - label: PUT request - value: PUT - - label: DELETE request - value: DELETE -# Metric group list -metrics: -# The first monitoring Metric group cpu -# Note:: the built-in monitoring Metrics have (responseTime - response time) - - name: cpu - # The smaller Metric group scheduling priority(0-127), the higher the priority. After completion of the high priority Metric group collection,the low priority Metric group will then be scheduled. Metric groups with the same priority will be scheduled in parallel. - # Metric group with a priority of 0 is an availability group which will be scheduled first. If the collection succeeds, the scheduling will continue otherwise interrupt scheduling. - priority: 0 - # metrics fields list - fields: - # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit - - field: hostname - type: 1 - instance: true - - field: usage - type: 0 - unit: '%' - - field: cores - type: 0 - - field: waitTime - type: 0 - unit: s -# (optional)Monitoring Metric alias mapping to the Metric name above. The field used to collect interface data is not the final Metric name directly. This alias is required for mapping conversion. - aliasFields: - - hostname - - core1 - - core2 - - usage - - allTime - - runningTime -# (optional)The Metric calculation expression works with the above alias to calculate the final required Metric value. -# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime - calculates: - - hostname=hostname - - cores=core1+core2 - - usage=usage - - waitTime=allTime-runningTime -# protocol for monitoring and collection eg: sql, ssh, http, telnet, wmi, snmp, sdk - protocol: http -# Specific collection configuration when the protocol is HTTP protocol - http: - # host: ipv4 ipv6 domain name - host: ^_^host^_^ - # port - port: ^_^port^_^ - # url request interface path - url: /metrics/cpu - # request mode GET POST PUT DELETE PATCH - method: GET - # enable ssl/tls or not, tthat is to say, HTTP or HTTPS. The default is false - ssl: false - # request header content - headers: - apiVersion: v1 - # request parameter content - params: - param1: param1 - param2: param2 - # authorization - authorization: - # authorization method : Basic Auth, Digest Auth, Bearer Token - type: Basic Auth - basicAuthUsername: ^_^username^_^ - basicAuthPassword: ^_^password^_^ - # parsing method for reponse data: default-system rules, jsonPath-jsonPath script, website-website availability Metric monitoring - # todo xmlPath-xmlPath script,prometheus-Prometheus data rules - parseType: jsonPath - parseScript: '$' - - - name: memory - priority: 1 - fields: - - field: hostname - type: 1 - instance: true - - field: total - type: 0 - unit: kb - - field: usage - type: 0 - unit: '%' - - field: speed - type: 0 - protocol: http - http: - host: ^_^host^_^ - port: ^_^port^_^ - url: /metrics/memory - method: GET - headers: - apiVersion: v1 - params: - param1: param1 - param2: param2 - authorization: - type: Basic Auth - basicAuthUsername: ^_^username^_^ - basicAuthPassword: ^_^password^_^ - parseType: default -``` diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-tutorial.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-tutorial.md deleted file mode 100644 index 59ceae28e58..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-tutorial.md +++ /dev/null @@ -1,226 +0,0 @@ ---- -id: extend-tutorial -title: Quick Tutorial Customize and adapt a monitoring based on HTTP protocol -sidebar_label: Quick Tutorial ---- - -Through this tutorial, we describe step by step how to customize and adapt a monitoring type based on the http protocol under the hertzbeat monitoring tool. - -Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring] (extend-point) and [http Protocol Customization] (extend-http). - - -### HTTP protocol parses the general response structure to obtain metric data - -> In many scenarios, we need to monitor the provided HTTP API interface and obtain the index value returned by the interface. In this article, we use the http custom protocol to parse our common http interface response structure, and obtain the fields in the returned body as metric data. - - -``` -{ - "code": 200, - "msg": "success", - "data": {} -} - -``` -As above, usually our background API interface will design such a general return. The same is true for the background of the hertzbeat system. Today, we will use the hertzbeat API as an example, add a new monitoring type **hertzbeat**, and monitor and collect its system summary statistics API -`http://localhost:1157/api/summary`, the response data is: - -``` -{ - "msg": null, - "code": 0, - "data": { - "apps": [ - { - "category": "service", - "app": "jvm", - "status": 0, - "size": 2, - "availableSize": 0, - "unManageSize": 2, - "unAvailableSize": 0, - "unReachableSize": 0 - }, - { - "category": "service", - "app": "website", - "status": 0, - "size": 2, - "availableSize": 0, - "unManageSize": 2, - "unAvailableSize": 0, - "unReachableSize": 0 - } - ] - } -} -``` - -**This time we get the metric data such as `category`, `app`, `status`, `size`, `availableSize` under the app. ** - - -### Add corresponding application definition YML and parameter definition YML - -1. Custom monitoring type needs to add configuration YML file - -A monitoring configuration definition file named after the monitoring type - for example: app-hertzbeat.yml needs to be located in the installation directory /hertzbeat/define/ - -Define which parameters we need to enter on the page. The general HTTP protocol parameters mainly include ip, port, headers, params, uri, account password, etc. We directly reuse the parameter definition content in param-api.yml and delete our No need to enter parameters such as uri parameters and keyword keywords. - -Define what type of collection is, which protocol collection method needs to be used, what metrics are collected, protocol configuration parameters, etc. We directly reuse the definition content in app-api.yml and modify it to our current monitoring type `hertzbeat` configuration parameters, as follows: Note⚠️We get `category`, `app` in the interface response data this time, Fields such as `status`, `size`, `availableSize` are used as metric data. - -```yaml -# This monitoring type belongs to the category: service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring -category: custom -# Monitoring application type name (consistent with the file name) eg: linux windows tomcat mysql aws... -app: hertzbeat -name: - en-GB: HertzBeat Monitoring Tool - en-US: Hertz Beat Monitor -params: - - field: host - name: - en-CN: Host Host - en-US: Host - type: host - required: true - - field: port - name: - en-CN: port - en-US: Port - type: number - range: '[0,65535]' - required: true - defaultValue: 1157 - - field: ssl - name: - en-GB: Enable HTTPS - en-US: HTTPS - type: boolean - required: true - - field: timeout - name: - en-CN: Timeout (ms) - en-US: Timeout(ms) - type: number - required: false - hide: true - - field: authType - name: - en-CN: Authentication method - en-US: Auth Type - type: radio - required: false - hide: true - options: - - label: Basic Auth - value: Basic Auth - - label: Digest Auth - value: Digest Auth - - field: username - name: - en-CN: username - en-US: Username - type: text - limit: 20 - required: false - hide: true - - field: password - name: - en-CN: Password - en-US: Password - type: password - required: false - hide: true -# List of metricss -metrics: - # The first monitoring metrics summary - # Note: Built-in monitoring metrics have (responseTime - response time) - - name: summary - # The smaller the index group scheduling priority (0-127), the higher the priority, and the index group with low priority will not be scheduled until the collection of index groups with high priority is completed, and the index groups with the same priority will be scheduled and collected in parallel - # The metrics with priority 0 is the availability metrics, that is, it will be scheduled first, and other metricss will continue to be scheduled if the collection is successful, and the scheduling will be interrupted if the collection fails - priority: 0 - # Specific monitoring metrics in the metrics - fields: - # metric information includes field name type field type: 0-number, 1-string , label-if is metrics label, unit: metric unit - - field: responseTime - type: 0 - unit: ms - - field: app - type: 1 - instance: true - - field: category - type: 1 - - field: status - type: 0 - - field: size - type: 0 - - field: availableSize - type: 0 -# Monitoring and collection protocol eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here - protocol: http -# When the protocol is the http protocol, the specific collection configuration - http: - host: ^_^host^_^ - # port - port: ^_^port^_^ - # url request interface path, we don’t need to enter parameters here, it’s written as /api/summary - url: /api/summary - timeout: ^_^timeout^_^ - # Request method GET POST PUT DELETE PATCH, hardcoded as - method: GET - # Whether to enable ssl/tls, that is, http or https, default false - ssl: ^_^ssl^_^ - # authentication - authorization: - # Authentication methods: Basic Auth, Digest Auth, Bearer Token - type: ^_^authType^_^ - basicAuthUsername: ^_^username^_^ - basicAuthPassword: ^_^password^_^ - digestAuthUsername: ^_^username^_^ - digestAuthPassword: ^_^password^_^ - # Response data parsing method: default-system rules, jsonPath-jsonPath script, website-website usability metric monitoring, we use jsonpath here to parse the response data - parseType: jsonPath - parseScript: '$.data.apps.*' - -``` - -**The addition is complete, now we restart the hertzbeat system. We can see that the system page has added a `hertzbeat` monitoring type. ** - - -![](/img/docs/advanced/extend-http-example-1.png) - - -### The system page adds the monitoring of `hertzbeat` monitoring type - -> We click Add `HertzBeat Monitoring Tool`, configure monitoring IP, port, collection cycle, account password in advanced settings, etc., click OK to add monitoring. - - -![](/img/docs/advanced/extend-http-example-2.png) - - -![](/img/docs/advanced/extend-http-example-3.png) - -> After a certain period of time (depending on the collection cycle), we can see the specific metric data and historical charts in the monitoring details! - - -![](/img/docs/advanced/extend-http-example-4.png) - - - -### Set threshold alarm notification - -> Next, we can set the threshold normally. After the alarm is triggered, we can view it in the alarm center, add a new recipient, set alarm notification, etc. Have Fun!!! - - ----- - -#### over! - -This is the end of the practice of custom monitoring of the HTTP protocol. The HTTP protocol also has other parameters such as headers and params. We can define it like postman, and the playability is also very high! - -If you think hertzbeat is a good open source project, please star us on GitHub Gitee, thank you very much. Thanks for the old iron support. Refill! - -**github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_threshold.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_threshold.md deleted file mode 100644 index 893f674164d..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_threshold.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: alert_threshold -title: Threshold alarm configuration -sidebar_label: Threshold alarm configuration ---- - -> Configure the alarm threshold (warning alarm, critical alarm, emergency alarm) for the monitoring Metrics, and the system calculates and triggers the alarm according to the threshold configuration and the collected Metric data. - -### Operation steps - -1. **【Alarm configuration】->【Add new threshold】-> 【Confirm after configuration】** - -![threshold](/img/docs/help/alert-threshold-1.png) - -As shown above: - -**Metric object**:Select the monitoring Metric object for which we need to configure the threshold. Eg:website monitoring type -> summary Metric set -> responseTime-response time Metric -**Threshold trigger expression**:Calculate and judge whether to trigger the threshold according to this expression. See the page prompts for expression environment variables and operators. Eg:set the response time greater than 50 to trigger an alarm, and the expression is `responseTime > 50`. For detailed help on threshold expression, see [Threshold expression help](alert_threshold_expr) -**Alarm level**:The alarm level that triggers the threshold, from low to high: warning, critical, emergency. -**Trigger times**:How many times will the threshold be triggered before the alarm is really triggered. -**Notification template**:Notification information Template sent after alarm triggering, See page prompts for template environment variables, eg:`${app}.${metrics}.${metric} Metric's value is ${responseTime}, greater than 50 triggers an alarm` -**Global default**: Set whether this threshold is valid for such global Metrics, and the default is No. After adding a new threshold, you need to associate the threshold with the monitoring object, so that the threshold will take effect for this monitoring. -**Enable alarm**:This alarm threshold configuration is enabled or disabled. - -2. **Threshold association monitoring⚠️ 【Alarm configuration】-> 【Threshold just set】-> 【Configure associated monitoring】-> 【Confirm after configuration】** - -> **Note⚠️ After adding a new threshold, you need to associate the threshold with the monitoring object(That is, to set this threshold for which monitoring is effective), so that the threshold will take effect for this monitoring.**。 - -![threshold](/img/docs/help/alert-threshold-2.png) - -![threshold](/img/docs/help/alert-threshold-3.png) - -**After the threshold alarm is configured, the alarm information that has been successfully triggered can be seen in 【alarm center】.** -**If you need to notify the relevant personnel of the alarm information by email, Wechat, DingDing and Feishu, it can be configured in 【alarm notification】.** - -Other issues can be fed back through the communication group ISSUE! diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_threshold_expr.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_threshold_expr.md deleted file mode 100644 index e211514cad2..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_threshold_expr.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -id: alert_threshold_expr -title: Threshold trigger expression -sidebar_label: Threshold trigger expression ---- - -> When we configure the threshold alarm, we need to configure the threshold trigger expression. The system calculates whether to trigger the alarm according to the expression and the monitoring index value. Here is a detailed introduction to the use of the expression. - -#### Operators supported by expressions - -``` -equals(str1,str2) -== -< -<= -> ->= -!= -( ) -+ -- -&& -|| -``` - -Rich operators allow us to define expressions freely. -Note⚠️ For the equality of string, please use `equals(str1,str2)`, while for the equality judgment of number, please use == or != - -#### Supported environment variables -> Environment variables, i.e. supported variables such as Metric values, are used in the expression. When the threshold value is calculated and judged, the variables will be replaced with actual values for calculation. - -Non fixed environment variables:These variables will change dynamically according to the monitoring Metric object we choose. For example, if we choose **response time Metric of website monitoring**, the environment variables will have `responseTime - This is the response time variable` -If we want to set **when the response time of website monitoring is greater than 400** to trigger an alarm,the expression is `responseTime>400` - -Fixed environment variables(Rarely used):`instance : Row instance value` -This variable is mainly used to calculate multiple instances. For example, we collected `usage`(`usage is non fixed environment variables`) of disk C and disk D, but we only want to set the alarm when **the usage of C disk is greater than 80**. Then the expression is `equals(instance,"c")&&usage>80` - -#### Expression setting case - -1. Website monitoring -> Trigger alarm when the response time is greater than or equal to 400ms -`responseTime>=400` -2. API monitoring -> Trigger alarm when the response time is greater than 3000ms -`responseTime>3000` -3. Entire site monitoring -> Trigger alarm when URL(instance) path is `https://baidu.com/book/3` and the response time is greater than 200ms -`equals(instance,"https://baidu.com/book/3")&&responseTime>200` -4. MYSQL monitoring -> status Metric group -> Trigger alarm when hreads_running(number of running threads) Metric is greater than 7 -`threads_running>7` - -Other issues can be fed back through the communication group ISSUE! diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_webhook.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_webhook.md deleted file mode 100644 index 0a7af9ada21..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_webhook.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: alert_webhook -title: Alert WebHook callback notification -sidebar_label: Alert webHook notification -keywords: [open source monitoring tool, open source alerter, open source webhook notification] ---- - -> After the threshold is triggered send alarm information and call the Webhook interface through post request to notify the recipient. - -### Operation steps - -1. **【Alarm notification】->【Add new recipient】 ->【Select WebHook notification method】-> 【Set WebHook callback address】 -> 【Confirm】** - -![email](/img/docs/help/alert-notice-5.png) - -2. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】** - -> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.** - -![email](/img/docs/help/alert-notice-4.png) - -### WebHook callback POST body BODY content - -Content format:JSON -```json -{ - "id":76456, - "target":"available", - "alertDefineId":232, - "priority":0, - "content":"监控紧急可用性告警: UN_CONNECTABLE", - "tag": { - "monitorId": 3543534545, - "monitorName":"API_poetry.didi.top" - }, - "status":0, - "times":1, - "gmtCreate":"2022-02-25T13:32:13", - "gmtUpdate":"2022-02-25T13:32:13" -} -``` - -| | | -|-----|-----| -| id | integer($int64) title: Alarm record entity primary key index ID | -| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field | -| alertDefineId integer($int64) title: Alarm definition ID associated with the alarm | -| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow | -| content | string title: The actual content of the alarm notification | -| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed | -| times | integer($int32) title: Alarm threshold trigger times | -| firstTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) | -| lastTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) | -| nextEvalInterval | integer($int64) title: Alarm evaluation interval (milliseconds) | -| tags | example: {key1:value1} | -| gmtCreate | string($date-time) title: Record the latest creation time (timestamp in milliseconds) | -| gmtUpdate | string($date-time) | - - - -### Webhook notification common issues - -1. WebHook callback did not take effect -> Please check whether there is any triggered alarm information in the alarm center. -> Please check whether the configured webhook callback address is correct. - -Other issues can be fed back through the communication group ISSUE! diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/introduce.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/introduce.md deleted file mode 100644 index 41f747b723b..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/introduce.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -id: introduce -title: HertzBeat -sidebar_label: Introduce -slug: / ---- - -> An open source, real-time monitoring tool with custom-monitor and agentless. - -[![discord](https://img.shields.io/badge/chat-on%20discord-brightgreen)](https://discord.gg/Fb6M73htGr) -[![QQ](https://img.shields.io/badge/qq-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/web-monitor.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/ping-connect.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/port-available.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/database-monitor.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/os-monitor.svg) -![hertzbeat](https://img.shields.io/badge/monitor-cloud%20native-brightgreen) -![hertzbeat](https://img.shields.io/badge/monitor-middleware-blueviolet) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/custom-monitor.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/threshold.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/alert.svg) - - - -## 🎡 Introduction - -> [HertzBeat](https://github.com/apache/hertzbeat) is an open source, real-time monitoring tool with custom-monitor and agentless. Support web service, database, os, middleware and more. -> HertzBeat supports more liberal threshold alarm configuration (calculation expression), supports alarm notification, alarm template, `Discord` `Slack` `Telegram` `Email` `DingDing` `WeChat` `FeiShu` `Webhook` `SMS` and more. -> Most important is HertzBeat supports [Custom Monitoring](https://hertzbeat.com/docs/advanced/extend-point), just by configuring the YML file, we can customize the monitoring types and metrics what we need. -> HertzBeat is modular, `manager, collector, scheduler, warehouse, alerter` modules are decoupled for easy understanding and custom development. -> Welcome to join us to build hertzbeat together. - -> `HertzBeat`'s multi-type support, easy expansion, low coupling, hope to help developers and micro teams to quickly build their own monitoring tool. - ----- - - -![hertzbeat](/img/home/1.png) - -![hertzbeat](/img/home/9.png) - ----- - -## 🥐 Architecture - -- **[manager](https://github.com/apache/hertzbeat/tree/master/manager)** Provide monitoring management, system management basic services. -> Provides monitoring management, monitoring configuration management, system user management, etc. -- **[collector](https://github.com/apache/hertzbeat/tree/master/collector)** Provide metrics data collection services. -> Use common protocols to remotely collect and obtain peer-to-peer metrics data. -- **[scheduler](https://github.com/apache/hertzbeat/tree/master/scheduler)** Provide monitoring task scheduling service. -> Collection task management, scheduling and distribution of one-time tasks and periodic tasks. -- **[warehouse](https://github.com/apache/hertzbeat/tree/master/warehouse)** Provide monitoring data warehousing services. -> Metrics data management, data query, calculation and statistics. -- **[alerter](https://github.com/apache/hertzbeat/tree/master/alerter)** Provide alert service. -> Alarm calculation trigger, monitoring status linkage, alarm configuration, and alarm notification. -- **[web-app](https://github.com/apache/hertzbeat/tree/master/web-app)** Provide web ui. -> Angular Web UI. - - -![hertzBeat](/img/docs/hertzbeat-arch.png) - -## ⛄ Supported - -- [Website](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-website.yml), [Port Telnet](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-port.yml), - [Http Api](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-api.yml), [Ping Connect](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ping.yml), - [Jvm](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-fullsite.yml), - [Ssl Certificate](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-springboot2.yml), - [FTP Server](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ftp.yml) -- [Mysql](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-postgresql.yml), - [MariaDB](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-redis.yml), - [ElasticSearch](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-sqlserver.yml), - [Oracle](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-mongodb.yml), - [DM](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-opengauss.yml), - [ClickHouse](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-iotdb.yml) -- [Linux](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ubuntu.yml), - [CentOS](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-windows.yml) -- [Tomcat](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-nacos.yml), - [Zookeeper](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-rabbitmq.yml), - [Flink](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-kafka.yml), - [ShenYu](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-dynamic_tp.yml), - [Jetty](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-activemq.yml) -- [Kubernetes](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-docker.yml) -- And More Your Custom Define. -- Notified Support `Discord` `Slack` `Telegram` `Email` `DingDing` `WeChat` `FeiShu` `Webhook` `SMS`. - diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/contact.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/contact.md deleted file mode 100644 index b1394fa3be9..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/contact.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -id: contact -title: Join discussion -sidebar_label: Discussion ---- - -> If you need any help or want to exchange suggestions during the use process, you can discuss and exchange through ISSUE or Github Discussion. - -[GITHUB ISSUES](https://github.com/apache/hertzbeat/issues) - -##### Github Discussion - -Welcome to Discuss in [Github Discussion](https://github.com/apache/hertzbeat/discussions) - diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/developer.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/developer.md deleted file mode 100644 index ff9ad490b89..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/developer.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -id: developer -title: Contributors -sidebar_label: Contributors ---- - -## ✨ HertzBeat Members - - - - - - - - - - - - -
tomsun28
tomsun28

💻 📖 🎨
会编程的王学长
会编程的王学长

💻 📖 🎨
zcx
zcx

💻 🐛 🎨
进击的阿晨
进击的阿晨

💻 🎨 🐛
铁甲小宝
铁甲小宝

🐛 💻 📖
cuipiheqiuqiu
cuipiheqiuqiu

💻 ⚠️ 🎨
- -## ✨ HertzBeat Contributors - -Thanks these wonderful people, welcome to join us: [Contributor Guide](contributing) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tomsun28
tomsun28

💻 📖 🎨
会编程的王学长
会编程的王学长

💻 📖 🎨
MaxKey
MaxKey

💻 🎨 🤔
观沧海
观沧海

💻 🎨 🐛
yuye
yuye

💻 📖
jx10086
jx10086

💻 🐛
winnerTimer
winnerTimer

💻 🐛
goo-kits
goo-kits

💻 🐛
brave4Time
brave4Time

💻 🐛
WalkerLee
WalkerLee

💻 🐛
jianghang
jianghang

💻 🐛
ChineseTony
ChineseTony

💻 🐛
wyt199905
wyt199905

💻
卫傅庆
卫傅庆

💻 🐛
zklmcookle
zklmcookle

💻
DevilX5
DevilX5

📖 💻
tea
tea

💻
yangshihui
yangshihui

💻 🐛
DreamGirl524
DreamGirl524

💻 📖
gzwlly
gzwlly

📖
cuipiheqiuqiu
cuipiheqiuqiu

💻 ⚠️ 🎨
lambert
lambert

💻
mroldx
mroldx

📖
woshiniusange
woshiniusange

📖
VampireAchao
VampireAchao

💻
zcx
zcx

💻 🐛 🎨
CharlieXCL
CharlieXCL

📖
Privauto
Privauto

💻 📖
emrys
emrys

📖
SxLiuYu
SxLiuYu

🐛
All Contributors
All Contributors

📖
铁甲小宝
铁甲小宝

💻 📖
click33
click33

📖
蒋小小
蒋小小

📖
Kevin Huang
Kevin Huang

📖
铁甲小宝
铁甲小宝

🐛 💻 📖
Captain Jack
Captain Jack

📖
haibo.duan
haibo.duan

⚠️ 💻
assassin
assassin

🐛 💻
Reverse wind
Reverse wind

⚠️ 💻
luxx
luxx

💻
Ikko Ashimine
Ikko Ashimine

📖
leizenan
leizenan

💻
BKing
BKing

📖
xingshuaiLi
xingshuaiLi

📖
wangke6666
wangke6666

📖
刺猬
刺猬

🐛 💻
Haste
Haste

💻
zhongshi.yi
zhongshi.yi

📖
Qi Zhang
Qi Zhang

📖
MrAndyMing
MrAndyMing

📖
idongliming
idongliming

💻
Zichao Lin
Zichao Lin

💻 📖
liudonghua
liudonghua

💻 🤔
Jerry
Jerry

💻 ⚠️ 🤔
yanhom
yanhom

📖
fsl
fsl

💻
xttttv
xttttv

📖
NavinKumarBarnwal
NavinKumarBarnwal

💻
Zakkary
Zakkary

📖
sunxinbo
sunxinbo

💻 ⚠️
ldzbook
ldzbook

📖 🐛
余与雨
余与雨

💻 ⚠️
MysticalDream
MysticalDream

💻 ⚠️
zhouyoulin12
zhouyoulin12

💻 ⚠️
jerjjj
jerjjj

💻
wjl110
wjl110

💻
Sean
Sean

📖
chenyiqin
chenyiqin

💻 ⚠️
hudongdong129
hudongdong129

💻 ⚠️ 📖
TherChenYang
TherChenYang

💻 ⚠️
HattoriHenzo
HattoriHenzo

💻 ⚠️
ycilry
ycilry

📖
aoshiguchen
aoshiguchen

📖
蔡本祥
蔡本祥

💻
浮游
浮游

💻
Grass-Life
Grass-Life

💻
xiaohe428
xiaohe428

💻 📖
TableRow
TableRow

📖
ByteIDance
ByteIDance

💻
- - - - - - diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/sponsor.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/sponsor.md deleted file mode 100644 index 76fed132af4..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/sponsor.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: sponsor -title: Sponsor -sidebar_label: Sponsor ---- - - -**Hertzbeat is completely free for individuals or enterprises. If you like this project and are willing to help, buy us a cup of coffee** - - -![wechat-alipay](/img/docs/pay.png) - - -Thanks [JiShi Information(build a new microwave + optical transaction network)](https://www.flarespeed.com) sponsored server node. -Thanks [TianShang cloud computing(new wisdom cloud)](https://www.tsyvps.com/aff/BZBEGYLX) sponsored server node. -Thanks [Postcat(An Open source development tool)](https://datayi.cn/w/xRxVBBko) sponsored. - - - - diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/docker-deploy.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/docker-deploy.md deleted file mode 100644 index 71beb5fb87f..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/docker-deploy.md +++ /dev/null @@ -1,231 +0,0 @@ ---- -id: docker-deploy -title: Install HertzBeat via Docker -sidebar_label: Install via Docker ---- - -> Recommend to use docker deploy HertzBeat - -1. Download and install the Docker environment - Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/)。 - After the installation you can check if the Docker version normally output at the terminal. - ``` - $ docker -v - Docker version 20.10.12, build e91ed57 - ``` - -2. pull HertzBeat Docker mirror - you can look up the mirror version TAG in [official mirror repository](https://hub.docker.com/r/apache/hertzbeat/tags) - ``` - $ docker pull apache/hertzbeat - ``` -3. Configure HertzBeat's configuration file(optional) - Create application.yml in the host directory,eg:/opt/application.yml - The configuration file content refer to project repository[/script/application.yml](https://gitee.com/hertzbeat/hertzbeat/raw/master/script/application.yml),modify service parameters, IP port account password in `td-engine` - Note⚠️(If use email to alert, please replace the mail server parameter. If use MYSQL data source, replace the datasource parameters inside refer to[H2 database switch to MYSQL](mysql-change)) - Specific replacement parameters is as follows: -```yaml -warehouse: - store: - td-engine: - enabled: true - driver-class-name: com.taosdata.jdbc.rs.RestfulDriver - url: jdbc:TAOS-RS://localhost:6041/hertzbeat - username: root - password: taosdata - iot-db: - enabled: false - host: 127.0.0.1 - rpc-port: 6667 - username: root - password: root - # org.apache.iotdb.session.util.Version: V_O_12 || V_0_13 - version: V_0_13 - # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0 - query-timeout-in-ms: -1 - # default '7776000000'(90days,unit:ms,-1:no-expire) - expire-time: '7776000000' - -spring: - mail: - # Attention: this is mail server address. - host: smtp.exmail.qq.com - username: example@tancloud.cn - # Attention: this is not email account password, this requires an email authorization code - password: example - port: 465 -``` - -4. Configure the user configuration file(optional, user-defined user password) - HertzBeat default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat - If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand. - Create sureness.yml in the host directory,eg:/opt/sureness.yml - The configuration file content refer to project repository[/script/sureness.yml](https://gitee.com/hertzbeat/hertzbeat/blob/master/script/sureness.yml) - -```yaml - -resourceRole: - - /api/account/auth/refresh===post===[admin,user,guest] - - /api/apps/**===get===[admin,user,guest] - - /api/monitor/**===get===[admin,user,guest] - - /api/monitor/**===post===[admin,user] - - /api/monitor/**===put===[admin,user] - - /api/monitor/**===delete==[admin] - - /api/monitors/**===get===[admin,user,guest] - - /api/monitors/**===post===[admin,user] - - /api/monitors/**===put===[admin,user] - - /api/monitors/**===delete===[admin] - - /api/alert/**===get===[admin,user,guest] - - /api/alert/**===post===[admin,user] - - /api/alert/**===put===[admin,user] - - /api/alert/**===delete===[admin] - - /api/alerts/**===get===[admin,user,guest] - - /api/alerts/**===post===[admin,user] - - /api/alerts/**===put===[admin,user] - - /api/alerts/**===delete===[admin] - - /api/notice/**===get===[admin,user,guest] - - /api/notice/**===post===[admin,user] - - /api/notice/**===put===[admin,user] - - /api/notice/**===delete===[admin] - - /api/tag/**===get===[admin,user,guest] - - /api/tag/**===post===[admin,user] - - /api/tag/**===put===[admin,user] - - /api/tag/**===delete===[admin] - - /api/summary/**===get===[admin,user,guest] - - /api/summary/**===post===[admin,user] - - /api/summary/**===put===[admin,user] - - /api/summary/**===delete===[admin] - -# Resources that need to be filtered and protected can be accessed directly without authentication -# /api/v1/source3===get means /api/v1/source3===get it can be accessed by anyone. Don't need to authentication -excludedResource: - - /api/account/auth/**===* - - /api/i18n/**===get - - /api/apps/hierarchy===get - # web ui the front-end static resource - - /===get - - /dashboard/**===get - - /monitors/**===get - - /alert/**===get - - /account/**===get - - /setting/**===get - - /passport/**===get - - /**/*.html===get - - /**/*.js===get - - /**/*.css===get - - /**/*.ico===get - - /**/*.ttf===get - - /**/*.png===get - - /**/*.gif===get - - /**/*.jpg===get - - /**/*.svg===get - - /**/*.json===get - # swagger ui resource - - /swagger-resources/**===get - - /v2/api-docs===get - - /v3/api-docs===get - -# user account information -# Here is admin tom lili three accounts -# eg: admin includes[admin,user]roles, password is hertzbeat -# eg: tom includes[user], password is hertzbeat -# eg: lili includes[guest],text password is lili, salt password is 1A676730B0C7F54654B0E09184448289 -account: - - appId: admin - credential: hertzbeat - role: [admin,user] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] -``` - - Modify the following **part parameters** in sureness.yml **[Note⚠️Other default sureness configuration parameters should be retained]**: - -```yaml - -# user account information -# Here is admin tom lili three accounts -# eg: admin includes[admin,user]roles, password is hertzbeat -# eg: tom includes[user], password is hertzbeat -# eg: lili includes[guest], text password is lili, salt password is 1A676730B0C7F54654B0E09184448289 -account: - - appId: admin - credential: hertzbeat - role: [admin,user] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] -``` - -6. Start the HertzBeat Docker container - -```shell -$ docker run -d -p 1157:1157 \ - -e LANG=zh_CN.UTF-8 \ - -e TZ=Asia/Shanghai \ - -v /opt/data:/opt/hertzbeat/data \ - -v /opt/logs:/opt/hertzbeat/logs \ - -v /opt/application.yml:/opt/hertzbeat/config/application.yml \ - -v /opt/sureness.yml:/opt/hertzbeat/config/sureness.yml \ - --name hertzbeat apache/hertzbeat -``` - - This command starts a running HertzBeat Docker container, and the container port 1157 is mapped to the host machine 1157. If existing processes on the host use the port, please modify host mapped port. - - `docker run -d` : Run a container in the background via Docker - - `-p 1157:1157` : Mapping container ports to the host - - `-e LANG=zh_CN.UTF-8` : (optional) set the LANG - - `-e TZ=Asia/Shanghai` : (optional) set the TimeZone - - `-v /opt/data:/opt/hertzbeat/data` : (optional,data persistence) Important⚠️ Mount the H2 database file to the local host, to ensure that the data is not lost because of creating or deleting container. - - `-v /opt/logs:/opt/hertzbeat/logs` : (optional,if you don't have a need,just delete it) Mount the log file to the local host, to guarantee the log will not be lost because of creating or deleting container. - - `-v /opt/application.yml:/opt/hertzbeat/config/application.yml` : (optional,if you don't have a need,just delete it) Mount the local configuration file into the container which has been modified in the previous step, namely using the local configuration file to cover container configuration file. We need to modify MYSQL, TDengine configuration information in the configuration file to connect to an external service. - - `-v /opt/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (optional,if you don't have a need,just delete it) Mount account configuration file modified in the previous step into the container. Delete this command parameters if have no modify account needs. - - `--name hertzbeat` : Naming container name hertzbeat - - `apache/hertzbeat` : Use the pulled latest HertzBeat official application mirror to start the container. version can be looked up in [official mirror repository](https://hub.docker.com/r/apache/hertzbeat/tags) - -7. Begin to explore HertzBeat - visit http://ip:1157/ on the browser. You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat. - -**HAVE FUN** - -### FAQ - -**The most common problem is network problems, please check in advance** - -1. **MYSQL, TDENGINE, IoTDB and HertzBeat are deployed on the same host by Docker,HertzBeat use localhost or 127.0.0.1 connect to the database but fail** -The problems lies in Docker container failed to visit and connect localhost port. Beacuse the docker default network mode is Bridge mode which can't access loacl machine through localhost. -> Solution A:Configure application.yml. Change database connection address from localhost to external IP of the host machine. -> Solution B:Use the Host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....` - -2. **According to the process deploy,visit http://ip:1157/ no interface** -Please refer to the following points to troubleshoot issues: -> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully. -> 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. -> 3:`docker logs hertzbeat` Check whether the container log has errors. If you haven't solved the issue, report it to the communication group or community. - -3. **Log an error TDengine connection or insert SQL failed** -> 1:Check whether database account and password configured is correct, the database is created. -> 2:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server. - -4. **Historical monitoring charts have been missing data for a long time** -> 1:Check whether you configure Tdengine or IoTDB. No configuration means no historical chart data. -> 2:Check whether Tdengine database `hertzbeat` is created. -> 3: Check whether IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. - -5. If the history chart on the monitoring page is not displayed,popup [please configure time series database] -> As shown in the popup window,the premise of history chart display is that you need install and configure hertzbeat's dependency service - IoTDB or TDengine database. -> Installation and initialization this database refer to [TDengine Installation](tdengine-init) or [IoTDB Installation](iotdb-init) - -6. The historical picture of monitoring details is not displayed or has no data, and TDengine has been deployed -> Please confirm whether the installed TDengine version is near 2.4.0.12, version 3.0 and 2.2 are not compatible. - -7. The time series database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure dependent time series database] -> Please check if the configuration parameters are correct -> Is iot-db or td-engine enable set to true -> Note⚠️If both hertzbeat and IotDB, TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed -> You can check the startup logs according to the logs directory diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/iotdb-init.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/iotdb-init.md deleted file mode 100644 index b776767ab41..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/iotdb-init.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -id: iotdb-init -title: The time series database IoTDB installation -sidebar_label: IoTDB init (optional) ---- - -HertzBeat's historical data storage relies on the time series database IoTDB or TDengine, you can choose one of them to initialize, or not to install (note ⚠️If you don't install it, there will be no historical chart data) - -Apache IoTDB is a software system that integrates the collection, storage, management and analysis of IoT time series data. We use it to store and analyze the collected historical data of monitoring metrics. - -Note ⚠️ IoTDB is optional, if not configured, there will be no historical chart data. Support V0.12 - V0.13 version, recommend to use V0.13.* version - -> If you already have an IoTDB environment, you can skip directly to the YML configuration step. - - -### Install IoTDB via Docker -> Refer to the official website [installation tutorial](https://iotdb.apache.org/UserGuide/V0.13.x/QuickStart/WayToGetIoTDB.html) -1. Download and install Docker environment - Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). - After the installation you can check if the Docker version normally output at the terminal. - ``` - $ docker -v - Docker version 20.10.12, build e91ed57 - ``` -2. Install IoTDB via Docker - -```shell -$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ - -v /opt/iotdb/data:/iotdb/data \ - --name iotdb \ - apache/iotdb:0.13.3-node -``` - - `-v /opt/iotdb/data:/iotdb/data` is local persistent mount of TDengine data directory.`/iotdb/data` should be replaced with the actual local directory. - use```$ docker ps``` to check if the database started successfully - -3. Configure the database connection in hertzbeat `application.yml`configuration file - - Modify `hertzbeat/config/application.yml` configuration file - Note⚠️The docker container way need to mount application.yml file locally,while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` - Replace `warehouse.store.iot-db` data source parameters, HOST account and password. - -``` -warehouse: - store: - iot-db: - enabled: true - host: 127.0.0.1 - rpc-port: 6667 - username: root - password: root - # V_O_12 || V_0_13 - version: V_0_13 - # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0 - query-timeout-in-ms: -1 - # default '7776000000'(90days,unit:ms,-1:no-expire) - expire-time: '7776000000' -``` - -### FAQ - -1. Do both the time series databases IoTDB and TDengine need to be configured? Can they both be used? -> You don't need to configure all of them, you can choose one of them. Use the enable parameter to control whether it is used or not. You can also install and configure neither, which only affects the historical chart data. - -2. The historical chart of the monitoring page is not displayed, and pops up [Unable to provide historical chart data, please configure to rely on the time series database] -> As shown in the pop-up window, the premise of displaying the history chart is to install and configure the dependent services of hertzbeat - IotDB database or TDengine database - -3. The TDengine database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure the dependent time series database] -> Please check if the configuration parameters are correct -> Is td-engine enable set to true -> Note⚠️If both hertzbeat and TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed -> You can check the startup logs according to the logs directory diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/mysql-change.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/mysql-change.md deleted file mode 100644 index 5fd8b79915a..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/mysql-change.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: mysql-change -title: Dependent Relational Database H2 Switch to MYSQL -sidebar_label: H2 Switch to MYSQL ---- -MYSQL is a reliable relational database. In addition to default built-in H2 database, HertzBeat allow you to use MYSQL to store structured relational data such as monitoring information, alarm information and configuration information. - -> If you have the MYSQL environment, can be directly to database creation step. - -### Install MYSQL via Docker -1. Download and install the Docker environment - Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/)。 - After the installation you can check if the Docker version normally output at the terminal. - ``` - $ docker -v - Docker version 20.10.12, build e91ed57 - ``` -2. Install MYSQl with Docker - ``` - $ docker run -d --name mysql -p 3306:3306 -v /opt/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7 - ``` - `-v /opt/data:/var/lib/mysql` is local persistent mount of mysql data directory. `/opt/data` should be replaced with the actual local directory. - use```$ docker ps```to check if the database started successfully - -### Database creation -1. Enter MYSQL or use the client to connect MYSQL service - `mysql -uroot -p123456` -2. Create database named hertzbeat - `create database hertzbeat;` -3. Check if hertzbeat database has been successfully created - `show databases;` - -### Modify hertzbeat's configuration file application.yml and switch data source - -1. Configure HertzBeat's configuration file - Modify `hertzbeat/config/application.yml` configuration file - Note⚠️The docker container way need to mount application.yml file locally,while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` - Replace `spring.database` data source parameters, URL account and password. -```yaml -spring: - datasource: - driver-class-name: org.h2.Driver - username: sa - password: 123456 - url: jdbc:h2:./data/hertzbeat;MODE=MYSQL -``` - Specific replacement parameters is as follows and you need to configure account according to the mysql environment: -```yaml -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: 123456 - url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false -``` - -**Start HertzBeat visit http://ip:1157/ on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/package-deploy.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/package-deploy.md deleted file mode 100644 index bb12d776d4d..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/package-deploy.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -id: package-deploy -title: Install HertzBeat via Package -sidebar_label: Install via Package ---- -> You can install and run HertzBeat on Linux Windows Mac system, and CPU supports X86/ARM64. Due to the installation package itself does not include the JAVA runtime environment, you need to prepare JAVA runtime environment in advance. - -1. Install JAVA runtime environment-refer to[official website](http://www.oracle.com/technetwork/java/javase/downloads/index.html) - requirement:JDK11 ENV - download JAVA installation package: [mirror website](https://repo.huaweicloud.com/java/jdk/) - After installation use command line to check whether you install it successfully. - ``` - $ java -version - java version "11.0.12" - Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) - Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode) - - ``` -2. Download HertzBeat installation package - Download installation package corresponding to your system environment - - download from [GITEE Release](https://gitee.com/hertzbeat/hertzbeat/releases) repository - - download from [GITHUB Release](https://github.com/apache/hertzbeat/releases) repository - -3. Configure HertzBeat's configuration file(optional) - Unzip the installation package to the host eg: /opt/hertzbeat - ``` - $ tar zxvf hertzbeat-[version number].tar.gz - ``` - Modify the configuration file `hertzbeat/config/application.yml` - Replace `warehouse` service parameter, IP port account and password - Note⚠️(If use email to alert, please replace the mail server parameter. If use MYSQL data source, replace the datasource parameters inside refer to[H2 database switch to MYSQL](mysql-change)) - Specific replacement parameters is as follows: -```yaml -warehouse: - store: - td-engine: - enabled: true - driver-class-name: com.taosdata.jdbc.rs.RestfulDriver - url: jdbc:TAOS-RS://localhost:6041/hertzbeat - username: root - password: taosdata - iot-db: - enabled: false - host: 127.0.0.1 - rpc-port: 6667 - username: root - password: root - # org.apache.iotdb.session.util.Version: V_O_12 || V_0_13 - version: V_0_13 - # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0 - query-timeout-in-ms: -1 - # default '7776000000'(90days,unit:ms,-1:no-expire) - expire-time: '7776000000' - -spring: - mail: - # Attention: this is mail server address. - host: smtp.exmail.qq.com - username: example@tancloud.cn - # Attention: this is not email account password, this requires an email authorization code - password: example - port: 465 -``` - -4. Configure the user configuration file(optional, user-defined user password) - HertzBeat default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat - If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand. - Modify the following **part parameters** in sureness.yml:**[Note⚠️Other default sureness configuration parameters should be retained]** - -```yaml - -# user account information -# Here is admin tom lili three accounts -# eg: admin includes[admin,user]roles, password is hertzbeat -# eg: tom includes[user], password is hertzbeat -# eg: lili includes[guest], text password is lili, salt password is 1A676730B0C7F54654B0E09184448289 -account: - - appId: admin - credential: hertzbeat - role: [admin,user] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] - -``` - -5. Deploy/Start - Execute the startup script startup.sh in the installation directory hertzbeat/bin/ - ``` - $ ./startup.sh - ``` -6. Begin to explore HertzBeat - visit http://ip:1157/ on the browser. You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat. - -**HAVE FUN** - -### FAQ - -1. **According to the process deploy,visit http://ip:1157/ no interface** - Please refer to the following points to troubleshoot issues: -> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully. -> 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`. -> 3:Check whether the running log has errors in `hertzbeat/logs/` directory. If you haven't solved the issue, report it to the communication group or community. - -2. **Log an error TDengine connection or insert SQL failed** -> 1:Check whether database account and password configured is correct, the database is created. -> 2:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server. - -3. **Historical monitoring charts have been missing data for a long time** -> 1:Check whether you configure Tdengine or IoTDB. No configuration means no historical chart data. -> 2:Check whether Tdengine database `hertzbeat` is created. -> 3: Check whether IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. - -4. **The historical picture of monitoring details is not displayed or has no data, and TDengine has been deployed** -> Please confirm whether the installed TDengine version is near 2.4.0.12, version 3.0 and 2.2 are not compatible. - -5. **The time series database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure dependent time series database]** -> Please check if the configuration parameters are correct -> Is iot-db or td-engine enable set to true -> Note⚠️If both hertzbeat and IotDB, TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed -> You can check the startup logs according to the logs directory diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/quickstart.md b/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/quickstart.md deleted file mode 100644 index 43115358593..00000000000 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/quickstart.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: quickstart -title: Quick Start -sidebar_label: Quick Start ---- - -### 🐕 Quick Start - -- If you want to deploy HertzBeat local, please refer to the following Deployment Documentation for operation. - -### 🍞 Install HertzBeat - -> HertzBeat supports installation through source code, docker or package, cpu support X86/ARM64. - -##### 1:Install quickly via docker - -1. Just one command to get started: `docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat` - -2. Access `localhost:1157` to start, default account: `admin/hertzbeat` - -Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.com/docs/start/docker-deploy) - -##### 2:Install via package - -1. Download the installation package [GITEE Release](https://gitee.com/hertzbeat/hertzbeat/releases) [GITHUB Release](https://github.com/apache/hertzbeat/releases) -2. Need Jdk Environment, `jdk11` -3. [optional]Configure the HertzBeat configuration yml file `hertzbeat/config/application.yml` -4. Run shell `$ ./startup.sh ` -5. Access `localhost:1157` to start, default account: `admin/hertzbeat` - -Detailed config refer to [Install HertzBeat via Package](https://hertzbeat.com/docs/start/package-deploy) - -##### 3:Start via source code - -1. Local source code debugging needs to start the back-end project manager and the front-end project web-app. -2. Backend:need `maven3+`, `java11`, `lombok`, start the manager service. -3. Web:need `nodejs npm angular-cli` environment, Run `ng serve --open` in `web-app` directory after backend startup. -4. Access `localhost:4200` to start, default account: `admin/hertzbeat` - -Detailed steps refer to [CONTRIBUTING](../others/contributing) - -##### 4:Install All(hertzbeat+mysql+iotdb/tdengine) via Docker-compose - -Install and deploy the mysql database, iotdb/tdengine database and hertzbeat at one time through [docker-compose deployment script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose). - -Detailed steps refer to [Install via Docker-Compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) - -**HAVE FUN** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-11-hertzbeat-v1.6.0-update.md b/home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-11-hertzbeat-v1.6.0-update.md new file mode 100644 index 00000000000..f6bd48ae1a5 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-11-hertzbeat-v1.6.0-update.md @@ -0,0 +1,258 @@ +# HertzBeat 1.6.0 升级指南 + +### 注意:该指适用于1.6.0之前的版本向1.6.0版本升级 + +### 二进制安装包升级 + +1. 升级Java环境 + +由于1.6.0版本使用Java17,且安装包不再提供内置jdk的版本,参考以下情况使用新版Hertzbeat。 + +- 当你的服务器中默认环境变量为Java17时,这一步你无需任何操作。 +- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**没有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并在搜索引擎搜索如何设置新的环境变量指向新的Java17。 +- 当你的服务器中默认环境变量不为Java17时,如Java8、Java11,若你服务器中**有**其他应用需要低版本Java,根据你的系统,到 [https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html) 选择相应的发行版下载,并将解压后的文件夹重命名为java,复制到Hertzbeat的解压目录下。 +2. 升级数据库 + +打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration), +选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件执行升级sql。 + +3. 升级配置文件 + +由于 `application.yml`和 `sureness.yml`更新变动较大,建议直接使用新的yml配置文件,然后在自己的需求基础上进行修改。 + +- `application.yml`一般需要修改以下部分 + + 默认为: +```yaml + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE +``` +如若修改为mysql数据库,给出一个示例: +```yaml + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: root + url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: mysql + properties: + eclipselink: + logging: + level: SEVERE +``` + +- `sureness.yml`修改是可选的,一般在你需要修改账号密码时 +```yaml +# account info config +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 +account: + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] +``` + + +4. 添加相应的数据库驱动 + + 由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动,复制到安装目录下`ext-lib`中。 +mysql:[https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.zip) +oracle(如果你要监控oracle,这两个驱动是必须的) +[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar) +[https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar](https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar?utm_source=mavenlibs.com) +接下来,像之前那样运行启动脚本,即可体验最新的HertzBeat1.6.0! + +### Docker 方式升级 - Mysql数据库 + +1. 关闭 HertzBeat 容器 +``` +docker stop hertzbeat +``` + +2. 升级数据库脚本 + +打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration), +选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 Mysql 执行升级sql。 + +3. 升级配置文件 + +由于 `application.yml`和 `sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。 + +- `application.yml`一般需要修改以下部分 + + 默认为: +```yaml + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: root + url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: mysql + properties: + eclipselink: + logging: + level: SEVERE +``` + +- `sureness.yml`修改是可选的,一般在你需要修改账号密码时 +```yaml +# account info config +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 +account: + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] +``` + +4. 添加相应的数据库驱动 + + 由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动 jar 放到本地 `ext-lib`目录下,然后启动时将`ext-lib`挂载到容器的 `/opt/hertzbeat/ext-lib`目录。 +mysql:[https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.zip) +oracle(如果你要监控oracle,这两个驱动是必须的) +[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar) +[https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar](https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar?utm_source=mavenlibs.com) +接下来,像之前那样 Docker 运行启动 HertzBeat,即可体验最新的HertzBeat1.6.0! + +### Docker安装升级 - H2内置数据库(生产环境不推荐使用H2) + +1. 关闭 HertzBeat 容器 +``` +docker stop hertzbeat +``` + +2. 编辑H2数据库文件 + + 前题你已经将 H2 数据库文件 data 目录挂载到本地,或者启动老容器手动将 /opt/hertzbeat/data 目录拷贝出来。 + 下载 h2 驱动 jar [https://mvnrepository.com/artifact/com.h2database/h2/2.2.220](https://mvnrepository.com/artifact/com.h2database/h2/2.2.220) + 使用 h2 驱动 jar 本地启动数据库 +``` +java -jar h2-2.2.220.jar -url jdbc:h2:file:./hertzbeat -user sa -password 123456 +``` +打开[https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/db/migration), +选择你使用的数据库的目录下相应的 `V160__update_column.sql`文件在 H2 执行升级sql。 + +3. 升级配置文件 + +由于 `application.yml`和 `sureness.yml`更新变动较大,建议直接挂载使用新的yml配置文件,然后在自己的需求基础上进行修改。 + +- `application.yml`一般需要修改以下部分 + + 默认为: +```yaml + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE +``` + +- `sureness.yml`修改是可选的,一般在你需要修改账号密码时 +```yaml +# account info config +# eg: admin has role [admin,user], password is hertzbeat +# eg: tom has role [user], password is hertzbeat +# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289 +account: + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] +``` + + +4. 添加相应的数据库驱动 + + 由于apache基金会对于license合规的要求,HertzBeat的安装包不能包含mysql,oracle等gpl许可的依赖,需要用户自行添加,用户可通过以下链接自行下载驱动 jar 放到本地 `ext-lib`目录下,然后启动时将`ext-lib`挂载到容器的 `/opt/hertzbeat/ext-lib`目录。 +mysql:[https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip](https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.18.zip) +oracle(如果你要监控oracle,这两个驱动是必须的) +[https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar](https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar) +[https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar](https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar?utm_source=mavenlibs.com) +接下来,像之前那样 Docker 运行启动,即可体验最新的HertzBeat1.6.0! + +### 通过导出导入升级 +> 若不想如上繁琐的脚本升级方式,可以直接将老环境的监控任务和阈值信息导出导入 + + +1. 部署一套最新版本的新环境 +2. 在页面上将老环境的监控任务和阈值信息导出。 +3. 在页面上将监控任务和阈值信息文件导入。 + +⚠️注意此方式只保留了老环境的监控任务信息和阈值信息,没有其它数据。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-15-hertzbeat-v1.6.0.md b/home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-15-hertzbeat-v1.6.0.md new file mode 100644 index 00000000000..41267f8f964 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-blog/2024-06-15-hertzbeat-v1.6.0.md @@ -0,0 +1,397 @@ +--- +title: HertzBeat 的第一个 Apache 版本 v1.6.0 发布! +author: tom +author_title: tom +author_url: https://github.com/tomsun28 +author_image_url: https://avatars.githubusercontent.com/u/24788200?s=400&v=4 +tags: [opensource, practice] +keywords: [open source, monitoring, alerting] +--- + +**Hi 朋友们,我们很高兴地宣布,Apache HertzBeat (incubating) 的了第一个Apache版本 v1.6.0 发布啦!🎉.** + +经过近五个月的社区开发迭代贡献和两个月的Apache Incubator孵化过程,Apache HertzBeat (incubating) v1.6.0 终于出来了。 +这个版本我们增加了对OpenAi监控,Redfish协议服务器,插件机制,支持了NebulaGraph, Apache Yarn, HDFS, Hbase, Storm等更多功能特性。 +由于License兼容问题,我们在底层替换了ORM框架,计算框架等多个依赖,Hibernate -> EclipseLink, 这也算是JPA生态下为数不多的迁移踩坑实践。 +同时修复了一些bug和优化了一些功能,更完善的文档。欢迎大家尝试使用,提出宝贵意见和建议,共同推动HertzBeat的发展。🎉 + +**当然,最重要的是给在社区的贡献者们致以最好的感谢!** + +下载页面: https://hertzbeat.apache.org/docs/download/ + +升级指南: https://hertzbeat.apache.org/blog/2024/06/11/hertzbeat-v1.6.0-update/ + +## 什么是 HertzBeat? + +[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating)是一个易用友好的开源实时监控告警系统,无需 Agent,高性能集群,兼容 Prometheus,提供强大的自定义监控和状态页构建能力。 + +### 特点 + +- 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web 服务器,云原生,网络,自定义等监控阈值告警通知一步到位。 +- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。 +- 将 `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s` 或 `Docker` 等新的监控类型吗? +- 兼容 `Prometheus` 的系统生态并且更多,只需页面操作就可以监控 `Prometheus` 所能监控的。 +- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。 +- 自由的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱` 等方式消息及时送达。 +- 提供强大的状态页构建能力,轻松向用户传达您产品服务的实时状态。 + + +> `HertzBeat`的强大自定义,多类型支持,高性能,易扩展,低耦合,希望能帮助用户快速搭建自有监控系统。 + +![hertzBeat](/img/docs/hertzbeat-arch.png) + +**Github: https://github.com/apache/hertzbeat** + +## HertzBeat's 1.6.0 Version Release! + +## 亮点更新 + +- HertzBeat is donated to the Apache Incubator. +- migrate repo, clean up code, license, add more help doc and more +- add dependency license doc +- [feature]Hertzbeat custom plugin. by @zqr10159 in #1973 +- [feature] add apache hugegraph monitor by @zhangshenghang in #1972 +- [improve][HIP] HIP-01: Implement refactoring AbstractCollect by @crossoverJie in #1966 +- [feature] Support monitoring of OpenAI accounts by @zuobiao-zhou in #1947 +- [feature] add apache yarn monitor by @zhangshenghang in #1937 +- [featrue]add apache hdfs monitor by @zhangshenghang in #1920 +- [feature] support use ngql query metrics from nebulaGraph by @LiuTianyou in #1917 +- [feature] support random jwt secret when not custom by @tomsun28 in #1897 +- feat Support Time Type to Tengine Data Storage by @Clownsw in #1890 +- [feature] support the VictoriaMetrics cluster by @xuziyang in #1880 +- [feature] support flyway database migration by @tomsun28 in #1875 +- [feature] Support Redfish protocol to monitoring server by @gjjjj0101 in #1867 +- [feature] add influxdb metrics monitoring by @TJxiaobao in #1730 +- [improve] use apache jexl replace of aviator by @tomsun28 in #1859 +- [feature] Add Linux process monitoring by @zhangshenghang in #1857 +- [feature] Add Apache Hbase RegionServer monitoring by @zhangshenghang in #1833 +- [improve] use eclipselink orm replace of hibernate orm by @tomsun28 in #1801 +- [feature]Add monitoring for Hbase Master by @zhangshenghang in #1820 +- [feature] Improve the import checkstyle by @crossoverJie in #1802 +- [Improve]When multiple lines are returned, each alarm is triggered instead of only the first alarm by @15613060203 in #1797 +- [improve]Add external lib folder to store mysql and oracle driver. by @zqr10159 in #1783 +- [feature:update-checkstyle] Limit the java file header by @YxYL6125 in #1799 +- monitor center add search type modal by @tomsun28 in #1699 +- mongodb monitoring support custom connection timeout param by @ZY945 in #1697 +- System config theme by @TJxiaobao in #1636 +- [feature] add storm monitor by @starmilkxin in #1673 +- add a online prometheus parser and a prometheus-like push style. by @vinci-897 in #1644 +- and more bugfix, doc, features power by our contributors, thanks to them. + +## What's Changed + +* bugfix collector can not startup alone by @tomsun28 in https://github.com/apache/hertzbeat/pull/1633 +* translate some hertzbeat blog by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1635 +* Check class description by @ZY945 in https://github.com/apache/hertzbeat/pull/1638 +* translate class description to english by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1641 +* support monitor metrics name i18n: ClickHouse by @ZY945 in https://github.com/apache/hertzbeat/pull/1642 +* translate blog 20220601 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1646 +* add a online prometheus parser and a prometheus-like push style. by @vinci-897 in https://github.com/apache/hertzbeat/pull/1644 +* translate blog 20220320 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1647 +* support monitor metrics name i18n: DynamicTp by @ZY945 in https://github.com/apache/hertzbeat/pull/1649 +* translate blog 20220228 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1648 +* translate blog 20220310 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1651 +* translate blog 20220904 to English by @vinci-897 in https://github.com/apache/hertzbeat/pull/1652 +* support monitor metrics name i18n: Airflow by @ZY945 in https://github.com/apache/hertzbeat/pull/1654 +* support monitor metrics name i18n: IoTDB by @ZY945 in https://github.com/apache/hertzbeat/pull/1659 +* Translate 2022-02-11-hertzbeat document by @wang1027-wqh in https://github.com/apache/hertzbeat/pull/1660 +* bugfix The annotation @Transactional specifies rollbackFor. by @handy-git in https://github.com/apache/hertzbeat/pull/1643 +* add handy-git as a contributor for code by @allcontributors in https://github.com/apache/hertzbeat/pull/1661 +* feature:Translate 2022-02-17-hertzbeat Document by @wang1027-wqh in https://github.com/apache/hertzbeat/pull/1662 +* support monitor metrics name i18n: rocketmq by @ZY945 in https://github.com/apache/hertzbeat/pull/1663 +* [doc] update relate doc and readme by @tomsun28 in https://github.com/apache/hertzbeat/pull/1667 +* bugfix monitoring mongodb not work in springboot3 by @ZY945 in https://github.com/apache/hertzbeat/pull/1668 +* [feature] add storm monitor by @starmilkxin in https://github.com/apache/hertzbeat/pull/1673 +* [bugfix] fixed the issue in http_sd where services were incorrectly reported as available when they were actually unavailable by @starmilkxin in https://github.com/apache/hertzbeat/pull/1678 +* remove mysql-oracle dependency jar from release package lib by @tomsun28 in https://github.com/apache/hertzbeat/pull/1680 +* System config theme by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1636 +* update webapp menu layout and doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1682 +* bugfix can not find mysql dependency when startup by @tomsun28 in https://github.com/apache/hertzbeat/pull/1686 +* support config common aes secret by @tomsun28 in https://github.com/apache/hertzbeat/pull/1683 +* [bugfix]fix the issue of add redis cluster node test error report(#1601) by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1684 +* add LiuTianyou as a contributor for code by @allcontributors in https://github.com/apache/hertzbeat/pull/1687 +* mongodb monitoring support custom connection timeout param by @ZY945 in https://github.com/apache/hertzbeat/pull/1697 +* bugfix old data decode error when use new common-secret by @tomsun28 in https://github.com/apache/hertzbeat/pull/1696 +* [bugfix] fix bug where reopening pop-up window still retained previously edited data after closing. by @starmilkxin in https://github.com/apache/hertzbeat/pull/1698 +* monitor center add search type modal by @tomsun28 in https://github.com/apache/hertzbeat/pull/1699 +* fix status page logo overflow by @tomsun28 in https://github.com/apache/hertzbeat/pull/1700 +* bugfix npe monitor jobid may be null by @tomsun28 in https://github.com/apache/hertzbeat/pull/1701 +* support custom main menus in monitor template by @tomsun28 in https://github.com/apache/hertzbeat/pull/1703 +* update home website doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1712 +* [Improve] change package group to org apache hertzbeat by @vinci-897 in https://github.com/apache/hertzbeat/pull/1724 +* [improve] initial license clean up by @tomsun28 in https://github.com/apache/hertzbeat/pull/1725 +* update manager and collector logback config(#1704) by @handy-git in https://github.com/apache/hertzbeat/pull/1723 +* fix(sec): upgrade com.h2database:h2 to by @WinterKi1ler in https://github.com/apache/hertzbeat/pull/1718 +* add WinterKi1ler as a contributor for code by @allcontributors in https://github.com/apache/hertzbeat/pull/1736 +* update asf branch protected check by @tomsun28 in https://github.com/apache/hertzbeat/pull/1738 +* [doc]Update star chart by @zqr10159 in https://github.com/apache/hertzbeat/pull/1737 +* [fixed] fixed click collector online offline button error by @miki-hmt in https://github.com/apache/hertzbeat/pull/1734 +* [improve] initial doc clean up by @tomsun28 in https://github.com/apache/hertzbeat/pull/1741 +* [Improvement]Support multiple receivers. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1731 +* [improvement]Add lisence. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1746 +* Backend LICENSE Initialize by @wang1027-wqh in https://github.com/apache/hertzbeat/pull/1744 +* Back-end dependency upgrade by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1743 +* [Improve] run hertzbeat in docker compose support dependen service condition by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/1748 +* [bugfix] fix statuspage index exception by @makechoicenow in https://github.com/apache/hertzbeat/pull/1747 +* remove unlicensed dependency 'wolfy87 eventemitter' by @alpha951 in https://github.com/apache/hertzbeat/pull/1745 +* [improve] auto label when pr, update asf config by @tomsun28 in https://github.com/apache/hertzbeat/pull/1749 +* [improve] update asf config set required status checks context by @tomsun28 in https://github.com/apache/hertzbeat/pull/1751 +* [improve] home add apache info by @a-little-fool in https://github.com/apache/hertzbeat/pull/1740 +* [doc] Change e2e path by @crossoverJie in https://github.com/apache/hertzbeat/pull/1758 +* fix : ingress tls inoperative by @PeixyJ in https://github.com/apache/hertzbeat/pull/1760 +* [refactor] method improvement rationale by @dukbong in https://github.com/apache/hertzbeat/pull/1757 +* [improve] create disclaimer file, add incubating in describe by @tomsun28 in https://github.com/apache/hertzbeat/pull/1764 +* [improve] update new hertzbeat brand logo, update doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1761 +* Complete the code comment translation of the common module by @Hi-Mr-Wind in https://github.com/apache/hertzbeat/pull/1766 +* Remove unnecessary if-else statement. by @dukbong in https://github.com/apache/hertzbeat/pull/1770 +* [doc] remove and translate chinese to english in warehous by @xuziyang in https://github.com/apache/hertzbeat/pull/1773 +* Replace deprecated methods with builder pattern for RedisURI construction by @dukbong in https://github.com/apache/hertzbeat/pull/1772 +* remove and translate chinese to english in collector,script,push,remoting and manager module by @MananPoojara in https://github.com/apache/hertzbeat/pull/1774 +* Added the function of sending SMS messages through Alibaba Cloud. by @lwqzz in https://github.com/apache/hertzbeat/pull/1768 +* [improve]Add frontend license. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1776 +* [test] Add RedisSingleCollectImplTest by @crossoverJie in https://github.com/apache/hertzbeat/pull/1784 +* [refactor] add override annotation by @handy-git in https://github.com/apache/hertzbeat/pull/1782 +* '[docs]bugfix: display syntax error of ipmi protocol' by @tomorrowshipyltm in https://github.com/apache/hertzbeat/pull/1793 +* [doc] translate alerter moudle code chinese to english by @tomsun28 in https://github.com/apache/hertzbeat/pull/1765 +* [refactor] database-related properties class, type changed to record by @xuziyang in https://github.com/apache/hertzbeat/pull/1786 +* Fix snmp template unit conversion problem by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1796 +* [doc] Add help documentation for clickhouse monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1798 +* [feature:update-checkstyle] Limit the java file header by @YxYL6125 in https://github.com/apache/hertzbeat/pull/1799 +* [improve]Add external lib folder to store mysql and oracle driver. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1783 +* [Improve]When multiple lines are returned, each alarm is triggered instead of only the first alarm by @15613060203 in https://github.com/apache/hertzbeat/pull/1797 +* [doc] add team page in website by @alpha951 in https://github.com/apache/hertzbeat/pull/1800 +* [feature] Improve the import checkstyle by @crossoverJie in https://github.com/apache/hertzbeat/pull/1802 +* [doc] Add help document for dns monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1804 +* [improve] preventing NPE by @dukbong in https://github.com/apache/hertzbeat/pull/1808 +* [refactor] change the warehouse properties the type to record by @xuziyang in https://github.com/apache/hertzbeat/pull/1806 +* Refactor: upgrade syntax to jdk17(instanceof & switch) by @Calvin979 in https://github.com/apache/hertzbeat/pull/1807 +* [test] Add NginxCollect test by @crossoverJie in https://github.com/apache/hertzbeat/pull/1809 +* [website] update team page by @tomsun28 in https://github.com/apache/hertzbeat/pull/1803 +* [test] Add RedisClusterCollectImplTest by @crossoverJie in https://github.com/apache/hertzbeat/pull/1789 +* [improve] Fix typo ReqStatusResponse by @crossoverJie in https://github.com/apache/hertzbeat/pull/1811 +* Comparing N objects for null with Assert.noNullElements(). by @dukbong in https://github.com/apache/hertzbeat/pull/1814 +* [doc] Add help document for elasticsearch monitoring and ftp monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1815 +* [doc] add help documentation for huawei switch monitoring by @Alanxtl in https://github.com/apache/hertzbeat/pull/1813 +* chore: upgrade the api-testing (e2e) to v0.0.16 by @LinuxSuRen in https://github.com/apache/hertzbeat/pull/1817 +* [Remove][Improve]Mail config by @zqr10159 in https://github.com/apache/hertzbeat/pull/1819 +* Remove and translate chinese to english in code by @dukbong in https://github.com/apache/hertzbeat/pull/1816 +* [feature]Add monitoring for Hbase Master by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1820 +* [doc] resolve code conflicts and coverage caused by pr(#1813) merge by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1821 +* [doc] Add help document for tidb and nacos monitoring by @Alanxtl in https://github.com/apache/hertzbeat/pull/1823 +* [improve] use eclipselink orm replace of hibernate orm by @tomsun28 in https://github.com/apache/hertzbeat/pull/1801 +* [improve] Add whitespace checkstyle by @crossoverJie in https://github.com/apache/hertzbeat/pull/1824 +* [bugfix] dns monitoring template add query class parameter by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1825 +* [Refactor] Preventing Unnecessary Object Creation and Using Utility Methods by @dukbong in https://github.com/apache/hertzbeat/pull/1818 +* [doc]Add and modify Doris FE Chinese and English documentation by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1828 +* [docs] Optimize: add help docs for UDP port & Springboot3 help doc by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1832 +* Code Simplification, Structure Changes, and Translation Work, Along with a Question by @dukbong in https://github.com/apache/hertzbeat/pull/1827 +* [doc] add help document for mongodb monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1834 +* [collector] fix: inverts the compareTo sort of MetricsCollect run queue by @Pzz-2021 in https://github.com/apache/hertzbeat/pull/1837 +* [doc]Doc add debian system by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1842 +* [feature] Add Apache Hbase RegionServer monitoring by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1833 +* [improve] Optimize websocket monitor by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1838 +* [refactor] Split the WarehouseProperties class by @xuziyang in https://github.com/apache/hertzbeat/pull/1830 +* [test] Add test for HttpsdImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1840 +* [fix] Fix the wrong comment by @xuziyang in https://github.com/apache/hertzbeat/pull/1843 +* [refactor] trans and use assert by @dukbong in https://github.com/apache/hertzbeat/pull/1841 +* [bugfix] modify the command in the mongodb monitoring template by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1844 +* [bigfix]Fix Debian system Top10 monitoring bug by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1846 +* [cleanup]Delete the corresponding Chinese comments by @hudongdong129 in https://github.com/apache/hertzbeat/pull/1847 +* [doc] translates chinese comment to english. by @dukbong in https://github.com/apache/hertzbeat/pull/1853 +* [doc] fix error and add help document for prometheus task by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1852 +* [feature] Add Linux process monitoring by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1857 +* [test] Add test for FtpCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1856 +* [improve] use apache jexl replace of aviator by @tomsun28 in https://github.com/apache/hertzbeat/pull/1859 +* [bugfix] jpa data save logic repair by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1863 +* [feature] add influxdb metrics monitoring by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1730 +* [doc] add help document for rocketmq by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1874 +* [improve] Imporve checkstyle of test code. by @crossoverJie in https://github.com/apache/hertzbeat/pull/1864 +* [feature] Support Redfish protocol to monitoring server by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/1867 +* Fix debian monitoring template issue about process monitoring by @LLP2333 in https://github.com/apache/hertzbeat/pull/1868 +* [bugfix] centos Top10 shows missing one by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1870 +* [improve] add website apache incubator footer by @tomsun28 in https://github.com/apache/hertzbeat/pull/1860 +* [doc] update help document by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1861 +* [featurn] support flyway database migration by @tomsun28 in https://github.com/apache/hertzbeat/pull/1875 +* [improve] Delete the timestamp field in the class MetricFamily.Metric by @xuziyang in https://github.com/apache/hertzbeat/pull/1878 +* [improve] Use java.lang.AutoCloseable instead of CacheCloseable by @crossoverJie in https://github.com/apache/hertzbeat/pull/1879 +* [bugfix]Fix top10 process command. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1876 +* [feature] support the VictoriaMetrics cluster by @xuziyang in https://github.com/apache/hertzbeat/pull/1880 +* [improve] Refactor common cache code by @crossoverJie in https://github.com/apache/hertzbeat/pull/1881 +* Eliminate Unnecessary Unboxing and Generics by @handy-git in https://github.com/apache/hertzbeat/pull/1882 +* [bugfix][doc]Add kafka sidebar. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1883 +* [doc] I18n for monitoring template yml metrics by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1888 +* [refactor] StoreProperties is no longer useful, delete it by @xuziyang in https://github.com/apache/hertzbeat/pull/1887 +* bugfix statistical metrics data matching fails by @tomsun28 in https://github.com/apache/hertzbeat/pull/1884 +* [doc] add help doc for flink monitoring by @HeartLinked in https://github.com/apache/hertzbeat/pull/1893 +* [doc] add almalinux documentation by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1892 +* [improve] Missing a generic by @crossoverJie in https://github.com/apache/hertzbeat/pull/1889 +* [bugfix] Fixed some metrics of Jexlespression not matching in Elasticsearch by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1894 +* feat(*): Support Time Type to Tengine Data Storage by @Clownsw in https://github.com/apache/hertzbeat/pull/1890 +* [feature] support random jwt secret when not custom by @tomsun28 in https://github.com/apache/hertzbeat/pull/1897 +* [doc] add opensuse doc by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1902 +* fix when manager restart, collect register error by @Ceilzcx in https://github.com/apache/hertzbeat/pull/1896 +* [bugfix] fix can not use empty collection as query params in eclipselink by @tomsun28 in https://github.com/apache/hertzbeat/pull/1900 +* [doc] update doc add download page and pic by @tomsun28 in https://github.com/apache/hertzbeat/pull/1904 +* [test] Add test for UdpCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1906 +* fix license by @yqxxgh in https://github.com/apache/hertzbeat/pull/1907 +* [improve] refactor code by @Ceilzcx in https://github.com/apache/hertzbeat/pull/1901 +* [type:bugfix] fix customized menu invalid bug #1898 by @Aias00 in https://github.com/apache/hertzbeat/pull/1908 +* [type:bugfix] fix HTTP API bug #1895 by @Aias00 in https://github.com/apache/hertzbeat/pull/1909 +* [test] Add test for WebsocketCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1912 +* [doc] translates chinese comment to english. by @westboy in https://github.com/apache/hertzbeat/pull/1914 +* [doc] Add HIP document and template by @crossoverJie in https://github.com/apache/hertzbeat/pull/1913 +* [improve] clean up home webapp unused code by @tomsun28 in https://github.com/apache/hertzbeat/pull/1915 +* [feature] support use ngql query metrics from nebulaGraph by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1917 +* [doc] Improve the Contribution Documentation. by @crossoverJie in https://github.com/apache/hertzbeat/pull/1918 +* [featrue]add apache hdfs monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1920 +* [doc] update hbase documentation description by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1921 +* [doc] Add documentation for nebulaGraph cluster monitoring and custom monitoring using NGQL, and clean up useless parameters by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1923 +* [test] Add test for TelnetCollectImplTest by @crossoverJie in https://github.com/apache/hertzbeat/pull/1924 +* fix(*): fix TdEngine Init not found Database by @Clownsw in https://github.com/apache/hertzbeat/pull/1891 +* [doc] update contribution and add run-build guide by @tomsun28 in https://github.com/apache/hertzbeat/pull/1919 +* bugfix collector startup error can not find JdbcClient by @tomsun28 in https://github.com/apache/hertzbeat/pull/1925 +* [doc] add help document for freebsd monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1928 +* [refactoring] Split AbstractHistoryDataStorage class by @xuziyang in https://github.com/apache/hertzbeat/pull/1926 +* [fix] fixed name error in monitoring template and improve NGQL protocol by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1931 +* [refactoring] Split AbstractRealTimeDataStorage class by @xuziyang in https://github.com/apache/hertzbeat/pull/1935 +* [bugfix] fix ssl-cert days_remaining and npe by @tomsun28 in https://github.com/apache/hertzbeat/pull/1934 +* [feature] add apache yarn monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1937 +* [doc] add help document for redhat monitoring and rocky linux monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1939 +* [test] Add test for NtpCollectImpl by @crossoverJie in https://github.com/apache/hertzbeat/pull/1940 +* [bugfix] fix alarm center tags display error by @tomsun28 in https://github.com/apache/hertzbeat/pull/1938 +* [improve] prepare for release hertzbeat v1.6.0 by @tomsun28 in https://github.com/apache/hertzbeat/pull/1929 +* add:Updated the Open Source Summer Project blog. by @TJxiaobao in https://github.com/apache/hertzbeat/pull/1943 +* [feature] Support monitoring of OpenAI accounts by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1947 +* [refactoring] Inject a single instance of the data store by @xuziyang in https://github.com/apache/hertzbeat/pull/1944 +* [refactoring] AbstractHistoryDataStorage implement the DisposableBean by @xuziyang in https://github.com/apache/hertzbeat/pull/1946 +* [doc] update iotdb init document by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1948 +* [improve] update build script by @tomsun28 in https://github.com/apache/hertzbeat/pull/1949 +* [test] add test for NgqlCollectImpl by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1953 +* [bugfix]Replace monitors to alert. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1954 +* [improve] add llm, server menu and update doc by @tomsun28 in https://github.com/apache/hertzbeat/pull/1955 +* [improve][HIP] HIP-01: Refactoring AbstractCollect by @crossoverJie in https://github.com/apache/hertzbeat/pull/1930 +* [bugfix] fix ConnectionCommonCache possible npe by @crossoverJie in https://github.com/apache/hertzbeat/pull/1959 +* [doc] add help document for eulerOS monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1960 +* [fixbug] Fix the problem of no data for springboot3 monitoring by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1961 +* commit:fix the front-end popup cannot exit by @Yanshuming1 in https://github.com/apache/hertzbeat/pull/1957 +* [fixbug] expression rule adaptation by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1963 +* [doc] add help doc for influxdb-promql and kafka-promql monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/1965 +* [doc]: update readme-cn docs by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1964 +* [improve][HIP] HIP-01: Implement refactoring AbstractCollect by @crossoverJie in https://github.com/apache/hertzbeat/pull/1966 +* [chore] update .gitignore to save .idea/icon.png by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1971 +* [improve][bugfix]: fix AlertTemplateUtilTest test exception and update code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1969 +* [feature] add apache hugegraph monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1972 +* [improve] Implement cascading parameter list for SNMP protocol by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1976 +* [improve] optimize DateUtil and add test case by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1974 +* [feature]Hertzbeat custom plugin. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1973 +* update login page and status page color by @lwjxy in https://github.com/apache/hertzbeat/pull/1977 +* [chore] update code style and add some comment by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1975 +* [doc]Hertzbeat plugin doc. by @zqr10159 in https://github.com/apache/hertzbeat/pull/1980 +* [doc] update contributors and update status page style by @tomsun28 in https://github.com/apache/hertzbeat/pull/1981 +* [feature] Implement cascading parameter list by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/1978 +* [doc]update threshold alarm doc by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1983 +* [chore] optimize code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1984 +* [fix] Compatible with MongoDB versions earlier than 3.6 by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/1988 +* [chore] optimize manager code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1993 +* [doc] Translate part of documentation development.md under `zh-cn` directory from `en` to `zh-cn` by @Thespica in https://github.com/apache/hertzbeat/pull/1995 +* [improve] http protocol prometheus parsing optimization by @zhangshenghang in https://github.com/apache/hertzbeat/pull/1996 +* [feature] add at function for wechat by @Yanshuming1 in https://github.com/apache/hertzbeat/pull/1994 +* [improve] add common util test by @yuluo-yx in https://github.com/apache/hertzbeat/pull/2001 +* [improve] update release license notice and package by @tomsun28 in https://github.com/apache/hertzbeat/pull/2003 +* [bugfix] fix collector startup error classpath by @tomsun28 in https://github.com/apache/hertzbeat/pull/2004 +* [chore] optimize code style by @yuluo-yx in https://github.com/apache/hertzbeat/pull/2000 +* [improve] Bump up `eslint-plugin-jsdoc` to 48.2.5 to support node 20+ by @Thespica in https://github.com/apache/hertzbeat/pull/2005 +* [doc] fix doc highlighting by @boatrainlsz in https://github.com/apache/hertzbeat/pull/2006 +* [web-app]feature: case insensitive search by @JavaProgrammerLB in https://github.com/apache/hertzbeat/pull/2007 +* [feature] Support time calculation expressions. by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2009 +* [doc] add document for time expression by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2012 +* [feature] Add Apache Pulsar monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/2013 +* [doc] home verify release doc update by @tomsun28 in https://github.com/apache/hertzbeat/pull/2014 +* [Improve] Improve clickhouse monitor And Improve Pulsar monitor by @zhangshenghang in https://github.com/apache/hertzbeat/pull/2015 +* [doc] translate help document for memcached monitoring by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2019 +* [improve] optimize collector httpsd discovery by @yuluo-yx in https://github.com/apache/hertzbeat/pull/1991 +* [optimize] optimize code style and logic, add unit test by @yuluo-yx in https://github.com/apache/hertzbeat/pull/2010 +* [fix] Fix possible potential thread safe bugs by @gjjjj0101 in https://github.com/apache/hertzbeat/pull/2021 +* [improve] add ci for home by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2024 +* [bugfix]Tag with empty value Shouldn't transform to Tag: by @JavaProgrammerLB in https://github.com/apache/hertzbeat/pull/2025 +* [bugfix] modify popup confirm to clear cache and cancel popup save by @Yanshuming1 in https://github.com/apache/hertzbeat/pull/2026 +* [improve] update monitor state desc by @tomsun28 in https://github.com/apache/hertzbeat/pull/2028 +* bugfix: fix overflow of integers by @Calvin979 in https://github.com/apache/hertzbeat/pull/2029 +* [improve] tips need update initial default password by @tomsun28 in https://github.com/apache/hertzbeat/pull/2030 +* [improve] deprecate support iotdb 0.* version by @Ceilzcx in https://github.com/apache/hertzbeat/pull/2032 +* [fixbug] required field check by @zhangshenghang in https://github.com/apache/hertzbeat/pull/2022 +* [improve] add IcmpCollectImplTest by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2033 +* [improve] fix code style by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2034 +* [improve] increase the length limit of the username field by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2035 +* [improve] Checkstyle include testSource by @crossoverJie in https://github.com/apache/hertzbeat/pull/2036 +* [bugfix] fix collector and frontend dependent license error by @tomsun28 in https://github.com/apache/hertzbeat/pull/2037 +* [improve] Add test for MemcachedCollectImpl by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2044 +* [imprve] Remove duplicate indices by @zuobiao-zhou in https://github.com/apache/hertzbeat/pull/2045 +* [docs]: fix several typos in docs by @lw-yang in https://github.com/apache/hertzbeat/pull/2047 +* Add the missing parts of docs, fix layout, sync the English version with the Chinese version by @xfl12345 in https://github.com/apache/hertzbeat/pull/2048 +* [improve] add filename check in home ci by @LiuTianyou in https://github.com/apache/hertzbeat/pull/2049 +* [improve] update dependency licenses and remove the aliyun sms depend by @tomsun28 in https://github.com/apache/hertzbeat/pull/2058 + +## New Contributors + +* @handy-git made their first contribution in https://github.com/apache/hertzbeat/pull/1643 +* @LiuTianyou made their first contribution in https://github.com/apache/hertzbeat/pull/1684 +* @WinterKi1ler made their first contribution in https://github.com/apache/hertzbeat/pull/1718 +* @miki-hmt made their first contribution in https://github.com/apache/hertzbeat/pull/1734 +* @gjjjj0101 made their first contribution in https://github.com/apache/hertzbeat/pull/1748 +* @makechoicenow made their first contribution in https://github.com/apache/hertzbeat/pull/1747 +* @alpha951 made their first contribution in https://github.com/apache/hertzbeat/pull/1745 +* @crossoverJie made their first contribution in https://github.com/apache/hertzbeat/pull/1758 +* @PeixyJ made their first contribution in https://github.com/apache/hertzbeat/pull/1760 +* @dukbong made their first contribution in https://github.com/apache/hertzbeat/pull/1757 +* @xuziyang made their first contribution in https://github.com/apache/hertzbeat/pull/1773 +* @MananPoojara made their first contribution in https://github.com/apache/hertzbeat/pull/1774 +* @lwqzz made their first contribution in https://github.com/apache/hertzbeat/pull/1768 +* @tomorrowshipyltm made their first contribution in https://github.com/apache/hertzbeat/pull/1793 +* @YxYL6125 made their first contribution in https://github.com/apache/hertzbeat/pull/1799 +* @15613060203 made their first contribution in https://github.com/apache/hertzbeat/pull/1797 +* @Alanxtl made their first contribution in https://github.com/apache/hertzbeat/pull/1813 +* @zhangshenghang made their first contribution in https://github.com/apache/hertzbeat/pull/1820 +* @zuobiao-zhou made their first contribution in https://github.com/apache/hertzbeat/pull/1832 +* @Pzz-2021 made their first contribution in https://github.com/apache/hertzbeat/pull/1837 +* @LLP2333 made their first contribution in https://github.com/apache/hertzbeat/pull/1868 +* @HeartLinked made their first contribution in https://github.com/apache/hertzbeat/pull/1893 +* @Aias00 made their first contribution in https://github.com/apache/hertzbeat/pull/1908 +* @westboy made their first contribution in https://github.com/apache/hertzbeat/pull/1914 +* @Yanshuming1 made their first contribution in https://github.com/apache/hertzbeat/pull/1957 +* @yuluo-yx made their first contribution in https://github.com/apache/hertzbeat/pull/1964 +* @lwjxy made their first contribution in https://github.com/apache/hertzbeat/pull/1977 +* @Thespica made their first contribution in https://github.com/apache/hertzbeat/pull/1995 +* @boatrainlsz made their first contribution in https://github.com/apache/hertzbeat/pull/2006 +* @JavaProgrammerLB made their first contribution in https://github.com/apache/hertzbeat/pull/2007 +* @lw-yang made their first contribution in https://github.com/apache/hertzbeat/pull/2047 +* @xfl12345 made their first contribution in https://github.com/apache/hertzbeat/pull/2048 + + +## 一条命令即可开始 + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat``` + +```或者试用 quay.io (如果 DockerHub 网络超时)``` + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat``` + + +详细参考 HertzBeat 官网文档 https://hertzbeat.com/docs + + +---- + +**Github: https://github.com/apache/hertzbeat** + +下载页面: https://hertzbeat.apache.org/docs/download/ + +升级指南: https://hertzbeat.apache.org/blog/2024/06/11/hertzbeat-v1.6.0-update/ + +Have Fun! + +---- + +HertzBeat, Make Monitoring Easier! + +Apache HertzBeat Team diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current.json b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current.json index b495d3f5e07..cbf88685925 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current.json +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current.json @@ -1,6 +1,6 @@ { "version.label": { - "message": "v1.5.x", + "message": "v1.6.x", "description": "The label for version current" }, "sidebar.docs.category.quickstart": { @@ -23,6 +23,10 @@ "message": "SSH协议", "description": "The label for category ssh in sidebar docs" }, + "sidebar.docs.category.telnet": { + "message": "TELNET协议", + "description": "The label for category telnet in sidebar docs" + }, "sidebar.docs.category.help": { "message": "帮助文档", "description": "The label for category help in sidebar docs" @@ -122,5 +126,9 @@ "sidebar.docs.category.llm": { "message": "Ai大模型监控", "description": "The label for category llm in sidebar docs" + }, + "sidebar.docs.category.aiConfig": { + "message": "Ai大模型配置", + "description": "The label for category aiConfig in sidebar docs" } } diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md index 31fe0ac98f7..5f8db64d1be 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-default.md @@ -78,73 +78,199 @@ sidebar_label: 系统默认解析方式 **对应的监控模版YML可以配置为如下** ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... -app: example +# The monitoring type eg: linux windows tomcat mysql aws... +app: a_example +# The monitoring i18n name name: - zh-CN: 模拟应用类型 + zh-CN: 模拟应用 en-US: EXAMPLE APP -# 监控参数定义. field 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换 -# 强制固定必须参数 - host +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 支持自定义监控,您只需配置监控模版 YML 就能适配一款自定义的监控类型。
定义流程如下:HertzBeat 页面 -> 监控模版菜单 -> 新增监控类型 -> 配置自定义监控模版YML -> 点击保存应用 -> 使用新监控类型添加监控。 + en-US: "HertzBeat supports custom monitoring, and you only need to configure the monitoring template YML to adapt to a custom monitoring type.
Definition process as follow: HertzBeat Pages -> Main Menu -> Monitor Template -> edit and save -> apply this template." + zh-TW: HertzBeat支持自定義監控,您只需配寘監控模版YML就能適配一款自定義的監控類型。
定義流程如下:HertzBeat頁面->監控模版選單->新增監控類型->配寘自定義監控模版YML ->點擊保存應用->使用新監控類型添加監控。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-point/ + en-US: https://hertzbeat.apache.org/docs/advanced/extend-point/ +# Input params define for monitoring(render web ui by the definition) params: - # field-字段名称标识符 + # field-param field key - field: host - # name-参数字段显示名称 + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-字段类型,样式(大部分映射input标签type属性) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # 是否是必输项 true-必填 false-可选 + # 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 - # 当type为number时,用range表示范围 + # when type is number, range is required range: '[0,65535]' + # required-true or false required: true - # 端口默认值 + # default value defaultValue: 80 - # 参数输入框提示信息 - placeholder: '请输入端口' + # param field input placeholder + placeholder: 'Please Input Port' + # field-param field key + - field: username + # name-param field display i18n name + name: + zh-CN: 用户名 + en-US: Username + # type-param field type(most mapping the html input type) + type: text + # when type is text, use limit to limit string length + limit: 50 + # required-true or false + required: false + # hide param-true or false + hide: true + # field-param field key + - field: password + # name-param field display i18n name + name: + zh-CN: 用户密码 + en-US: Password + # type-param field type(most mapping the html input tag) + type: password + # required-true or false + required: false + # hide param-true or false + hide: true + # field-param field key + - field: ssl + # name-param field display i18n name + name: + zh-CN: 启动SSL + en-US: SSL + # type-param field type(boolean mapping the html switch tag) + type: boolean + # required-true or false + required: false + # field-param field key + - field: method + # name-param field display i18n name + name: + zh-CN: 请求方式 + en-US: Method + # type-param field type(radio mapping the html radio tag) + type: radio + # required-true or false + required: true + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} + options: + - label: GET + value: GET + - label: POST + value: POST + - label: PUT + value: PUT + - label: DELETE + value: DELETE + # field-param field key + - field: headers + # name-param field display i18n name + name: + zh-CN: 请求Headers + en-US: Headers + # type-param field type(key-value mapping the html key-value input tags) + type: key-value + # required-true or false + required: false + # when type is key-value, use keyAlias to config key alias name + keyAlias: Header Name + # when type is key-value, use valueAlias to config value alias name + valueAlias: Header Value # collect metrics config list -# 采集指标配置列表 metrics: - # First monitoring metric group cpu - # Note: The built-in monitoring metrics include (responseTime - response time) + # metrics - cpu - name: cpu - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + # metrics name i18n label + i18n: + zh-CN: CPU 信息 + en-US: CPU Info + # 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 - # 具体监控指标列表 + # collect metrics content fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 + # field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: hostname type: 1 label: true + i18n: + zh-CN: 主机名称 + en-US: Host Name - field: usage type: 0 unit: '%' - - field: core + i18n: + zh-CN: 使用率 + en-US: Usage + - field: cores + type: 0 + i18n: + zh-CN: 核数 + en-US: Cores + - field: waitTime type: 0 -# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk + unit: s + i18n: + zh-CN: 主机名称 + en-US: Host Name + # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field + aliasFields: + - hostname + - core1 + - core2 + - usage + - allTime + - runningTime + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime + calculates: + - hostname=hostname + - cores=core1+core2 + - usage=usage + - waitTime=allTime-runningTime + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http -# 当protocol为http协议时具体的采集配置 + # the config content when protocol is http http: - # 主机host: ipv4 ipv6 域名 + # http host: ipv4 ipv6 domain host: ^_^host^_^ - # 端口 + # http port port: ^_^port^_^ - # url请求接口路径 + # http url url: /metrics/cpu - # 请求方式 GET POST PUT DELETE PATCH + # http method: GET POST PUT DELETE PATCH method: GET - # 是否启用ssl/tls,即是http还是https,默认false + # if enabled https ssl: false - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控 - # 这里使用HertzBeat默认解析 - parseType: default + # http request header content + headers: + ^_^headers^_^: ^_^headers^_^ + # http request params + params: + param1: param1 + param2: param2 + # http auth + authorization: + # http auth type: Basic Auth, Digest Auth, Bearer Token + type: Basic Auth + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule + parseType: jsonPath + parseScript: '$' ``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md index 160adf031c9..357cbd133ca 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-hertzbeat.md @@ -69,18 +69,25 @@ sidebar_label: 教程一:适配一款HTTP协议监控 样例:自定义一个名称为`hertzbeat`的自定义监控类型,其使用HTTP协议采集指标数据。 ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat name: - zh-CN: HertzBeat监控系统 - en-US: HertzBeat Monitor + zh-CN: HertzBeat + en-US: HertzBeat +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 Hertzbeat 监控系统的通用指标进行测量监控。
您可以点击 “新建 HertzBeat监控系统” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor through general performance metric. You could click the "New HertzBeat Monitor" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對Hertzbeat監控系統的通用名額進行量測監控。
您可以點擊“新建HertzBeat監控系統”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat params: - field: host name: - zh-CN: 主机Host - en-US: Host + zh-CN: 目标Host + en-US: Target Host type: host required: true - field: port @@ -131,21 +138,16 @@ params: type: password required: false hide: true -# collect metrics config list -# 采集指标配置列表 metrics: - # metrics - summary - # 监控指标 - summary + # the first metrics summary + # attention: Built-in monitoring metrics contains (responseTime - Response time) - name: summary - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + # 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 - # 具体监控指标列表 + # collect metrics content fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - - field: responseTime - type: 0 - unit: ms + # metrics content contains field-metric name, type-metric type:0-number,1-string, instance-if is metrics, unit-metric unit('%','ms','MB') - field: app type: 1 label: true @@ -156,33 +158,33 @@ metrics: - field: size type: 0 - field: availableSize - type: 0 -# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk, 我们这里使用HTTP协议 + type: 0 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here protocol: http -# 当protocol为http协议时具体的采集配置 + # the config content when protocol is http http: - # 主机host: ipv4 ipv6 域名 + # host: ipv4 ipv6 domain host: ^_^host^_^ - # 端口 + # http port port: ^_^port^_^ - # url请求接口路径,我们这里不需要输入传参,写死为 /api/summary + # http url, we don't need to enter a parameter here, just set the fixed value to /api/summary url: /api/summary timeout: ^_^timeout^_^ - # 请求方式 GET POST PUT DELETE PATCH,写死为 + # http method: GET POST PUT DELETE PATCH, default fixed value is GET method: GET - # 是否启用ssl/tls,即是http还是https,默认false + # if enabled https, default value is false ssl: ^_^ssl^_^ - # 认证 + # http auth authorization: - # 认证方式: Basic Auth, Digest Auth, Bearer Token + # http auth type: Basic Auth, Digest Auth, Bearer Token type: ^_^authType^_^ basicAuthUsername: ^_^username^_^ basicAuthPassword: ^_^password^_^ digestAuthUsername: ^_^username^_^ digestAuthPassword: ^_^password^_^ - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控,我们这里使用jsonpath来解析响应数据 + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, we use jsonpath to parse response data here parseType: jsonPath - parseScript: '$.data.apps.*' + parseScript: '$.data.apps.*' ``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-token.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-token.md index 94f49c01f61..b7a665a60b9 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-token.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-example-token.md @@ -43,41 +43,49 @@ sidebar_label: 教程二:获取TOKEN后续认证使用 我们直接复用 app-hertzbeat.yml 里面的定义内容,修改为我们当前的监控类型`hertzbeat_auth`配置参数, 比如 `app, category等`。 ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat_token +# The monitoring i18n name name: - zh-CN: HertzBeat监控(Token) - en-US: HertzBeat Monitor(Token) + zh-CN: HertzBeat(Token) + en-US: HertzBeat(Token) +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 HertzBeat监控(Token)进行测量监控。
您可以点击 “新建 HertzBeat监控(Token)” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor(Token). You could click the "New HertzBeat Monitor(Token)" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對HertzBeat監控(Token)進行量測監控。
您可以點擊“新建HertzBeat監控(Token)”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat_token + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat_token +# Input params define for monitoring(render web ui by the definition) params: - # field-字段名称标识符 + # field-param field key - field: host - # name-参数字段显示名称 + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-字段类型,样式(大部分映射input标签type属性) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # 是否是必输项 true-必填 false-可选 + # required-true or false required: true - field: port name: zh-CN: 端口 en-US: Port + # type-param field type(most mapping the html input type) type: number - # 当type为number时,用range表示范围 + # when type is number, range is required range: '[0,65535]' required: true - # 端口默认值 defaultValue: 1157 - # 参数输入框提示信息 - placeholder: '请输入端口' + placeholder: 'Please input port' - field: ssl name: zh-CN: 启动SSL en-US: SSL - # 当type为boolean时,前端用switch展示开关 + # type-param field type(boolean mapping the html switch tag) type: boolean required: false - field: contentType @@ -94,9 +102,6 @@ params: type: textarea placeholder: 'Available When POST PUT' required: false -# 采集指标配置列表 todo 下方配置 -metrics: ...... - ``` ### 定义监控指标`auth`登录请求获取`token` @@ -105,41 +110,49 @@ metrics: ...... ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat_token +# The monitoring i18n name name: - zh-CN: HertzBeat监控(Token) - en-US: HertzBeat Monitor(Token) + zh-CN: HertzBeat(Token) + en-US: HertzBeat(Token) +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 HertzBeat监控(Token)进行测量监控。
您可以点击 “新建 HertzBeat监控(Token)” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor(Token). You could click the "New HertzBeat Monitor(Token)" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對HertzBeat監控(Token)進行量測監控。
您可以點擊“新建HertzBeat監控(Token)”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat_token + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat_token +# Input params define for monitoring(render web ui by the definition) params: - # field-字段名称标识符 + # field-param field key - field: host - # name-参数字段显示名称 + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-字段类型,样式(大部分映射input标签type属性) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # 是否是必输项 true-必填 false-可选 + # required-true or false required: true - field: port name: zh-CN: 端口 en-US: Port + # type-param field type(most mapping the html input type) type: number - # 当type为number时,用range表示范围 + # when type is number, range is required range: '[0,65535]' required: true - # 端口默认值 defaultValue: 1157 - # 参数输入框提示信息 - placeholder: '请输入端口' + placeholder: 'Please input port' - field: ssl name: zh-CN: 启动SSL en-US: SSL - # 当type为boolean时,前端用switch展示开关 + # type-param field type(boolean mapping the html switch tag) type: boolean required: false - field: contentType @@ -156,40 +169,43 @@ params: type: textarea placeholder: 'Available When POST PUT' required: false -# 采集指标配置列表 +# collect metrics config list metrics: - # 第一个监控指标 auth - # 注意:内置监控指标有 (responseTime - 响应时间) + # metrics - auth - name: auth - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + # 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 - # 具体监控指标列表 + # collect metrics content fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: token type: 1 - field: refreshToken type: 1 - # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http - # 当protocol为http协议时具体的采集配置 + # the config content when protocol is http http: - # 主机host: ipv4 ipv6 域名 + # http host: ipv4 ipv6 domain host: ^_^host^_^ - # 端口 + # http port port: ^_^port^_^ - # url请求接口路径 + # http url url: /api/account/auth/form - # 请求方式 GET POST PUT DELETE PATCH + # http method: GET POST PUT DELETE PATCH method: POST - # 是否启用ssl/tls,即是http还是https,默认false + # if enabled https ssl: ^_^ssl^_^ payload: ^_^payload^_^ - # 请求头内容 + # http request header content headers: content-type: ^_^contentType^_^ - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控 + ^_^headers^_^: ^_^headers^_^ + # http request params + params: + ^_^params^_^: ^_^params^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule parseType: jsonPath parseScript: '$.data' @@ -235,41 +251,49 @@ metrics: ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... app: hertzbeat_token +# The monitoring i18n name name: - zh-CN: HertzBeat监控(Token) - en-US: HertzBeat Monitor(Token) + zh-CN: HertzBeat(Token) + en-US: HertzBeat(Token) +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 HertzBeat监控(Token)进行测量监控。
您可以点击 “新建 HertzBeat监控(Token)” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor(Token). You could click the "New HertzBeat Monitor(Token)" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對HertzBeat監控(Token)進行量測監控。
您可以點擊“新建HertzBeat監控(Token)”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat_token + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat_token +# Input params define for monitoring(render web ui by the definition) params: - # field-字段名称标识符 + # field-param field key - field: host - # name-参数字段显示名称 + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-字段类型,样式(大部分映射input标签type属性) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # 是否是必输项 true-必填 false-可选 + # required-true or false required: true - field: port name: zh-CN: 端口 en-US: Port + # type-param field type(most mapping the html input type) type: number - # 当type为number时,用range表示范围 + # when type is number, range is required range: '[0,65535]' required: true - # 端口默认值 defaultValue: 1157 - # 参数输入框提示信息 - placeholder: '请输入端口' + placeholder: 'Please input port' - field: ssl name: zh-CN: 启动SSL en-US: SSL - # 当type为boolean时,前端用switch展示开关 + # type-param field type(boolean mapping the html switch tag) type: boolean required: false - field: contentType @@ -286,83 +310,72 @@ params: type: textarea placeholder: 'Available When POST PUT' required: false -# 采集指标配置列表 +# collect metrics config list metrics: -# 第一个监控指标 cpu -# 注意:内置监控指标有 (responseTime - 响应时间) + # metrics - auth - name: auth - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + # 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 - # 具体监控指标列表 + # collect metrics content fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: token type: 1 - field: refreshToken type: 1 - # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http - # 当protocol为http协议时具体的采集配置 + # the config content when protocol is http http: - # 主机host: ipv4 ipv6 域名 + # http host: ipv4 ipv6 domain host: ^_^host^_^ - # 端口 + # http port port: ^_^port^_^ - # url请求接口路径 + # http url url: /api/account/auth/form - # 请求方式 GET POST PUT DELETE PATCH + # http method: GET POST PUT DELETE PATCH method: POST - # 是否启用ssl/tls,即是http还是https,默认false + # if enabled https ssl: ^_^ssl^_^ payload: ^_^payload^_^ - # 请求头内容 + # http request header content headers: content-type: ^_^contentType^_^ ^_^headers^_^: ^_^headers^_^ - # 请求参数内容 + # http request params params: ^_^params^_^: ^_^params^_^ - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控 + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule parseType: jsonPath parseScript: '$.data' - name: summary - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 priority: 1 - # 具体监控指标列表 fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - - field: category - type: 1 - field: app type: 1 + label: true + - field: category + type: 1 + - field: status + type: 0 - field: size type: 0 - - field: status + - field: availableSize type: 0 -# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http -# 当protocol为http协议时具体的采集配置 http: - # 主机host: ipv4 ipv6 域名 host: ^_^host^_^ - # 端口 port: ^_^port^_^ - # url请求接口路径 url: /api/summary - # 请求方式 GET POST PUT DELETE PATCH method: GET - # 是否启用ssl/tls,即是http还是https,默认false ssl: ^_^ssl^_^ - # 认证 authorization: - # 认证方式: Basic Auth, Digest Auth, Bearer Token type: Bearer Token + # ^o^xxx^o^ ^o^ substitution represents the value of the acquisition metric xxx of the previous priority bearerTokenToken: ^o^token^o^ - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控 parseType: jsonPath parseScript: '$.data.apps.*' diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md index ae29f265574..fef3c3d2fa8 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http-jsonpath.md @@ -98,9 +98,8 @@ sidebar_label: JsonPath解析方式 **对应的监控模版YML可以配置为如下** ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... +# 监控应用类型 eg: linux windows tomcat mysql aws... app: example name: zh-CN: 模拟应用类型 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md index 21b8015da77..9a0dca41ae3 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-http.md @@ -34,98 +34,158 @@ HTTP协议支持我们自定义HTTP请求路径,请求header,请求参数, ```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... -app: example_http +# The monitoring type eg: linux windows tomcat mysql aws... +app: a_example +# The monitoring i18n name name: - zh-CN: 模拟应用类型 + zh-CN: 模拟应用 en-US: EXAMPLE APP -# 监控参数定义. field 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换 -# 强制固定必须参数 - host +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 支持自定义监控,您只需配置监控模版 YML 就能适配一款自定义的监控类型。
定义流程如下:HertzBeat 页面 -> 监控模版菜单 -> 新增监控类型 -> 配置自定义监控模版YML -> 点击保存应用 -> 使用新监控类型添加监控。 + en-US: "HertzBeat supports custom monitoring, and you only need to configure the monitoring template YML to adapt to a custom monitoring type.
Definition process as follow: HertzBeat Pages -> Main Menu -> Monitor Template -> edit and save -> apply this template." + zh-TW: HertzBeat支持自定義監控,您只需配寘監控模版YML就能適配一款自定義的監控類型。
定義流程如下:HertzBeat頁面->監控模版選單->新增監控類型->配寘自定義監控模版YML ->點擊保存應用->使用新監控類型添加監控。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-point/ + en-US: https://hertzbeat.apache.org/docs/advanced/extend-point/ +# Input params define for monitoring(render web ui by the definition) params: - # field-字段名称标识符 + # field-param field key - field: host - # name-参数字段显示名称 + # name-param field display i18n name name: - zh-CN: 主机Host - en-US: Host - # type-字段类型,样式(大部分映射input标签type属性) + zh-CN: 目标Host + en-US: Target Host + # type-param field type(most mapping the html input type) type: host - # 是否是必输项 true-必填 false-可选 + # 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 - # 当type为number时,用range表示范围 + # when type is number, range is required range: '[0,65535]' + # required-true or false required: true - # 端口默认值 + # default value defaultValue: 80 - # 参数输入框提示信息 - placeholder: '请输入端口' + # param field input placeholder + placeholder: 'Please Input Port' + # field-param field key - field: username + # name-param field display i18n name name: zh-CN: 用户名 en-US: Username + # type-param field type(most mapping the html input type) type: text - # 当type为text时,用limit表示字符串限制大小 + # when type is text, use limit to limit string length limit: 50 + # required-true or false required: false + # hide param-true or false + hide: true + # field-param field key - field: password + # name-param field display i18n name name: - zh-CN: 密码 + zh-CN: 用户密码 en-US: Password + # type-param field type(most mapping the html input tag) type: password + # required-true or false required: false + # hide param-true or false + hide: true + # field-param field key - field: ssl + # name-param field display i18n name name: zh-CN: 启动SSL - en-US: Enable SSL - # 当type为boolean时,前端用switch展示开关 + en-US: SSL + # type-param field type(boolean mapping the html switch tag) type: boolean + # required-true or false required: false + # field-param field key - field: method + # name-param field display i18n name name: zh-CN: 请求方式 en-US: Method + # type-param field type(radio mapping the html radio tag) type: radio + # required-true or false required: true - # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} options: - - label: GET请求 + - label: GET value: GET - - label: POST请求 + - label: POST value: POST - - label: PUT请求 + - label: PUT value: PUT - - label: DELETE请求 + - label: DELETE value: DELETE -# 采集指标配置列表 + # field-param field key + - field: headers + # name-param field display i18n name + name: + zh-CN: 请求Headers + en-US: Headers + # type-param field type(key-value mapping the html key-value input tags) + type: key-value + # required-true or false + required: false + # when type is key-value, use keyAlias to config key alias name + keyAlias: Header Name + # when type is key-value, use valueAlias to config value alias name + valueAlias: Header Value +# collect metrics config list metrics: -# 第一个监控指标 cpu -# 注意:内置监控指标有 (responseTime - 响应时间) + # metrics - cpu - name: cpu - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + # metrics name i18n label + i18n: + zh-CN: CPU 信息 + en-US: CPU Info + # 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 - # 具体监控指标列表 + # collect metrics content fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 + # field-metric name, i18n-metric name i18n label, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field - field: hostname type: 1 label: true + i18n: + zh-CN: 主机名称 + en-US: Host Name - field: usage type: 0 unit: '%' + i18n: + zh-CN: 使用率 + en-US: Usage - field: cores type: 0 + i18n: + zh-CN: 核数 + en-US: Cores - field: waitTime type: 0 unit: s -# (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换 + i18n: + zh-CN: 主机名称 + en-US: Host Name + # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field aliasFields: - hostname - core1 @@ -133,59 +193,73 @@ metrics: - usage - allTime - runningTime -# (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值 -# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime calculates: - hostname=hostname - cores=core1+core2 - usage=usage - waitTime=allTime-runningTime -# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk protocol: http -# 当protocol为http协议时具体的采集配置 + # the config content when protocol is http http: - # 主机host: ipv4 ipv6 域名 + # http host: ipv4 ipv6 domain host: ^_^host^_^ - # 端口 + # http port port: ^_^port^_^ - # url请求接口路径 + # http url url: /metrics/cpu - # 请求方式 GET POST PUT DELETE PATCH + # http method: GET POST PUT DELETE PATCH method: GET - # 是否启用ssl/tls,即是http还是https,默认false + # if enabled https ssl: false - # 请求头内容 + # http request header content headers: - apiVersion: v1 - # 请求参数内容 + ^_^headers^_^: ^_^headers^_^ + # http request params params: param1: param1 param2: param2 - # 认证 + # http auth authorization: - # 认证方式: Basic Auth, Digest Auth, Bearer Token + # http auth type: Basic Auth, Digest Auth, Bearer Token type: Basic Auth basicAuthUsername: ^_^username^_^ basicAuthPassword: ^_^password^_^ - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控 - # todo xmlPath-xmlPath脚本,prometheus-Prometheus数据规则 + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule parseType: jsonPath parseScript: '$' - name: memory + i18n: + zh-CN: 内存信息 + en-US: Memory Info priority: 1 fields: - field: hostname type: 1 label: true + i18n: + zh-CN: 主机名称 + en-US: Hostname - field: total type: 0 unit: kb + i18n: + zh-CN: 总量 + en-US: Total - field: usage type: 0 unit: '%' + i18n: + zh-CN: 使用率 + en-US: Usage - field: speed type: 0 + i18n: + zh-CN: 速率 + en-US: Speed protocol: http http: host: ^_^host^_^ @@ -194,7 +268,6 @@ metrics: method: GET headers: apiVersion: v1 - # 查询参数,支持使用时间表达式 params: param1: param1 param2: param2 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-point.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-point.md index c951f1bc190..d2b0ee36cdc 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-point.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-point.md @@ -38,6 +38,14 @@ app: example2 name: zh-CN: 模拟网站监测 en-US: EXAMPLE WEBSITE +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 支持自定义监控,您只需配置监控模版 YML 就能适配一款自定义的监控类型。
定义流程如下:HertzBeat 页面 -> 监控模版菜单 -> 新增监控类型 -> 配置自定义监控模版YML -> 点击保存应用 -> 使用新监控类型添加监控。 + en-US: "HertzBeat supports custom monitoring, and you only need to configure the monitoring template YML to adapt to a custom monitoring type.
Definition process as follow: HertzBeat Pages -> Main Menu -> Monitor Template -> edit and save -> apply this template." + zh-TW: HertzBeat支持自定義監控,您只需配寘監控模版YML就能適配一款自定義的監控類型。
定義流程如下:HertzBeat頁面->監控模版選單->新增監控類型->配寘自定義監控模版YML ->點擊保存應用->使用新監控類型添加監控。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-point/ + en-US: https://hertzbeat.apache.org/docs/advanced/extend-point/ # 监控所需输入参数定义(根据定义渲染页面UI) # Input params define for monitoring(render web ui by the definition) params: diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md index c536fabf6c4..22578d67854 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/advanced/extend-tutorial.md @@ -79,6 +79,14 @@ app: hertzbeat name: zh-CN: HertzBeat监控系统 en-US: HertzBeat Monitor +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 Hertzbeat 监控系统的通用指标进行测量监控。
您可以点击 “新建 HertzBeat监控系统” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors HertzBeat Monitor through general performance metric. You could click the "New HertzBeat Monitor" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat對Hertzbeat監控系統的通用名額進行量測監控。
您可以點擊“新建HertzBeat監控系統”並進行配寘,或者選擇“更多操作”,導入已有配寘。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/hertzbeat + en-US: https://hertzbeat.apache.org/docs/help/hertzbeat # Input params define for monitoring(render web ui by the definition) # 监控所需输入参数定义(根据定义渲染页面UI) params: diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/contribution.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/contribution.md index 314571f8fc9..8cd528bb7e5 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/contribution.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/contribution.md @@ -27,15 +27,15 @@ sidebar_position: 0 > 在 HertzBeat 社区,贡献方式有很多: -- 💻**代码**:可以帮助社区完成一些任务、编写新的feature或者是修复一些bug; +- 💻**代码**:可以帮助社区完成一些任务、编写新的 feature 或者是修复一些 bug; -- ⚠️**测试**:可以来参与测试代码的编写,包括了单元测试、集成测试、e2e测试; +- ⚠️**测试**:可以来参与测试代码的编写,包括了单元测试、集成测试、e2e 测试; - 📖**文档**:可以编写或完善文档,来帮助用户更好地了解和使用 HertzBeat; - 📝**博客**:可以撰写 HertzBeat 的相关文章,来帮助社区更好地推广; -- 🤔**讨论**:可以参与 HertzBeat 新的feature的讨论,将您的想法跟 HertzBeat 融合; +- 🤔**讨论**:可以参与 HertzBeat 新的 feature 的讨论,将您的想法跟 HertzBeat 融合; - 💡**布道**:可以帮助宣传或推广 HertzBeat 社区,在 meetup 或 summit 中演讲; @@ -62,31 +62,31 @@ sidebar_position: 0 #### 前端启动 -1. 需要 `nodejs yarn` 环境, Make sure `Node.js >= 18` +1. 需要 `nodejs yarn` 环境, 确保 `Node.js >= 18` 2. 进入 `web-app` 目录: `cd web-app` -3. 安装yarn: `npm install -g yarn` +3. 安装 yarn: `npm install -g yarn` 4. 在前端工程目录 `web-app` 下执行: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app` 5. 全局安装 `angular-cli`: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com` -6. 待本地后端启动后,在web-app目录下启动本地前端 `ng serve --open` +6. 待本地后端启动后,在 web-app 目录下启动本地前端 `ng serve --open` -7. 浏览器访问 localhost:4200 即可开始,默认账号密码 admin/hertzbeat** +7. 浏览器访问 localhost:4200 即可开始,默认账号密码 **admin/hertzbeat** ### 寻找任务 -寻找您感兴趣的Issue!在我们的GitHub仓库和邮件列表中,我们经常会发布一些带有 good first issue 或者 status: volunteer wanted 标签的issue,这些issue都欢迎贡献者的帮助。 -其中good first issue往往门槛较低、适合新手。 +寻找您感兴趣的 Issue!在我们的 GitHub 仓库和邮件列表中,我们经常会发布一些带有 good first issue 或者 status: volunteer wanted 标签的 issue,这些issue都欢迎贡献者的帮助。 +其中 good first issue 往往门槛较低、适合新手。 -当然,如果您有好的想法,也可以直接在GitHub Discussion 中提出或者联系社区。 +当然,如果您有好的想法,也可以直接在 GitHub Discussion 中提出或者联系社区。 ### 提交 Pull Request 1. 首先您需要 Fork 目标仓库 [hertzbeat repository](https://github.com/apache/hertzbeat). -2. 然后 用git命令 将代码下载到本地: +2. 然后 用 git 命令 将代码下载到本地: ```shell git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended ``` @@ -95,7 +95,7 @@ git clone git@github.com:${YOUR_USERNAME}/hertzbeat.git #Recommended ```shell git checkout -b a-feature-branch #Recommended ``` -5. 提交 commit , commit 描述信息需要符合约定格式: [module name or type name]feature or bugfix or doc: custom message. +5. 提交 commit, commit 描述信息需要符合约定格式: [module name or type name]feature or bugfix or doc: custom message. ```shell git add git commit -m '[docs]feature: necessary instructions' #Recommended @@ -135,7 +135,7 @@ git checkout master git pull upstream master ``` -### 如何成为Committer? +### 如何成为 Committer? 通过上述步骤,您就是 HertzBeat 的贡献者了。重复前面的步骤,在社区中保持活跃,坚持下去,您就能成为 Committer! diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/how-to-release.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/how-to-release.md index a6e74b7d366..0af99b19c08 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/how-to-release.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/how-to-release.md @@ -494,7 +494,6 @@ ChunJin Mu 如果72小时后没有-1,回复邮件如下 > `Send to`: general@incubator.apache.org
-> `cc`: dev@hertzbeat.apache.org
> `Body`: ``` @@ -507,27 +506,24 @@ Chunjin Mu 然后将统计投票结果,并发送投票结果邮件,如下所示。 > `Send to`: general@incubator.apache.org
-> `cc`: dev@hertzbeat.apache.org、tison@apache.org、willem.jiang@gmail.com
> `Title`: [RESULT][VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
> `Body`: ``` -Hi all, +Hi Incubator Community, -Thanks for your review and vote for "Release Apache HertzBeat (incubating) 1.6.0-rc1" -I'm happy to announce the vote has passed: +The vote to release Apache HertzBeat (incubating) 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes. 3 binding votes, no +0 or -1 votes. -Thanks for reviewing and voting. +3 (binding) +1, from: -- cc +- xxx no 0 or -1 votes. Vote thread: -https://lists.apache.org/thread/k3cvcbzxqs6qy62d1o6r9pqpykcgvvhm +https://lists.apache.org/thread/m1kyn4l30y55p6q39m0ys5djvdd73h0f Thanks everyone for your feedback and help with HertzBeat apache release. The HertzBeat team will take the steps to complete this release and will announce it soon. @@ -558,41 +554,51 @@ https://github.com/apache/hertzbeat/blob/master/home/i18n/zh-cn/docusaurus-plugi #### 4.3 Github 生成 Release -基于 release-1.6.0-rc1 分支创建一个名为 v1.6.0 的标签,并将此标签设置为 latest release。 +基于 release-1.6.0-rc1 分支修改创建一个名为 v1.6.0 的标签,并将此标签设置为 latest release。 + +:::tip +在原有的 Release 上面修改,无需重新创建 Release。 +::: 然后输入发版标题和描述 - 发版标题: ``` -v1.6.0-incubating +v1.6.0 ``` - 描述: ``` -Release-1.6.0-incubating +xxx release note: xxx ``` 然后点击`Publish release`按钮。 -然后将 release-1.6.0-rc1 分支重命名 为release-1.6.0。 +然后将 release-1.6.0-rc1 分支重命名 为 release-1.6.0。 #### 4.4 发送新版本公告邮件 > `Send to`: general@incubator.apache.org
> `cc`: dev@hertzbeat.apache.org
-> `Title`: [ANNOUNCE] Release Apache HertzBeat (incubating) 1.6.0
+> `Title`: [ANNOUNCE] Apache HertzBeat (incubating) 1.6.0 released
> `Body`: ``` -Hi all, +Hi Community, We are glad to announce the release of Apache HertzBeat (incubating) 1.6.0. -Once again I would like to express my thanks to your help. +Thanks again for your help. + +Apache HertzBeat (https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +Download Link: +https://hertzbeat.apache.org/docs/download/ -Apache HertzBeat(https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. +Release Note: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0 -Download Links: https://hertzbeat.apache.org/download/ -Release Notes: https://github.com/apache/hertzbeat/releases/tag/v1.6.0 +Website: +https://hertzbeat.apache.org/ HertzBeat Resources: - Issue: https://github.com/apache/hertzbeat/issues diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/new_committer_process.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/new_committer_process.md index 188b68b3688..a388728d5b5 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/new_committer_process.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/community/new_committer_process.md @@ -48,12 +48,11 @@ sidebar_position: 4 参见 **Committer账户创建模板** - 等待root告诉我们已经完成 - - PMC主席开启svn和其他访问权限 - - 在JIRA和CWiki中将Committer添加到适当的组中 + - [Roster](https://whimsy.apache.org/roster/ppmc/hertzbeat) 添加新的 committer -- 通知Committer完成 +- Announce New Committer - 参见 **Committer完成模板** + 参见 **Announce New Committer Template** ## 模板 @@ -73,11 +72,35 @@ Subject: [VOTE] New committer: ${NEW_COMMITTER_NAME} ```text Hi HertzBeat PPMC, -This is a formal vote about inviting ${NEW_COMMITTER_NAME} as our new committer. +This is a formal vote about inviting ${NEW_COMMITTER_NAME} as our community new committer. -${Work list}[1] +Work list: https://github.com/apache/hertzbeat/commits?author=${NEW_COMMITTER_NAME} -[1] https://github.com/apache/hertzbeat/commits?author=${NEW_COMMITTER_NAME} +Here is the list of ${NEW_COMMITTER_NAME}'s contributions in HertzBeat Community: + +> [27 commits](https://github.com/apache/hertzbeat/commits?author=xxx) +> +> 7,495 ++ 627 -- + +Submitted PR (27 commits) +- [ISSUE #4534] [feature] add new feature in hertzbeat #3445 +- xxx + +Submitted Issues (18 commits) + +- [bug] find some bugs in hertzbeat nodes #6565 +- xxx + +Please vote: + ++1: I support this proposal and will welcome ${NEW_COMMITTER_NAME} as a committer. ++0: I don't care. +-1: I object to this proposal and here are my reasons. + +This vote will be open for at least 7 days. + +Best Wishes, +ttt ``` 注意,投票将在今天一周后结束,即 @@ -210,36 +233,236 @@ Yours, The Apache HertzBeat PPMC ``` -### Committer完成模板 +### Announce New Committer Template ```text -To: private@hertzbeat.apache.org, ${NEW_COMMITTER_EMAIL} -Subject: account request: ${NEW_COMMITTER_NAME} +To: dev@hertzbeat.apache.org, ${NEW_COMMITTER_EMAIL} +Subject: [ANNOUNCE] New committer: ${NEW_COMMITTER_NAME} ``` ```text -${NEW_COMMITTER_NAME}, as you know, the ASF Infrastructure has set up your -committer account with the username '${NEW_COMMITTER_APACHE_NAME}'. +Hello Community, + +The Podling Project Management Committee (PPMC) for Apache HertzBeat (incubating) +has invited ${NEW_COMMITTER_NAME} to become a committer and we are pleased to +announce that he has accepted. + +${NEW_COMMITTER_NAME} is active in the Apache HertzBeat community, hope to see your +further interactions with the community! +Thanks for your contributions. + +Best Wishes! +``` + +## 详细步骤 + +### 接受邀请 +当通过PMC内部投票后,PMC会向您索要个人邮箱,之后您会收到一封邮件,邮件会指引您进行下一步操作,内容为: +``` +Hello xxxx, + +The HertzBeat Project Management Committee (PPMC) +hereby offers you committer privileges to the project. +These privileges are offered on the understanding that +you'll use them reasonably and with common sense. +We like to work on trust rather than unnecessary constraints. + +Being a committer enables you to more easily make +changes without needing to go through the patch +submission process. + +Being a committer does not require you to +participate any more than you already do. It does +tend to make one even more committed. You will +probably find that you spend more time here. + +Of course, you can decline and instead remain as a +contributor, participating as you do now. + +A. This personal invitation is a chance for you to +accept or decline in private. Either way, please +let us know in reply to the private@hertzbeat.apache.org +address only. + +B. If you accept, the next step is to register an iCLA: + 1. Details of the iCLA and the forms are found + through this link: https://www.apache.org/licenses/#clas + + 2. Instructions for its completion and return to + the Secretary of the ASF are found at + https://www.apache.org/licenses/#submitting + + 3. When you transmit the completed iCLA, request + to notify the Apache HertzBeat and choose a + unique Apache ID. Look to see if your preferred + ID is already taken at + https://people.apache.org/committer-index.html + This will allow the Secretary to notify the PMC + when your iCLA has been recorded. + +When recording of your iCLA is noted, you will +receive a follow-up message with the next steps for +establishing you as a committer. +``` + +如果您接受邀请,请回复该邮件,记住要**回复全部**,回复内容为: + +``` +hi, i accept. Thanks for invitaion. +``` + +随后您会收到一封邮件,里面描述这如何具体步骤,也可以根据我们的文档继续进行操作。 + +### ICLA签署流程 + +接受邀请后,会收到邮件,邮件会指引签署iCLA。 + +1. 下载iCLA申请表 + +打开访问:[https://www.apache.org/licenses/#clas](https://www.apache.org/licenses/#clas) + +找到`CLAs`点击进入页面 + +![](/img/docs/community/clas-web.png) + +找到`ICLA(个人贡献者许可协议)`,点击[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) + +![](/img/docs/community/icla-web.png) -Please follow the instructions to set up your SSH, -svn password, svn configuration, email forwarding, etc. -https://www.apache.org/dev/#committers +跳转后,会显示需要签署的协议,这里可以在网页上直接填写,也可以下载后填写。 -You have commit access to specific sections of the -ASF repository, as follows: +![](/img/docs/community/icla-pdf.png) -The general "committers" at: - https://svn.apache.org/repos/private/committers +2. 填写iCLA -If you have any questions during this phase, then please -see the following resources: +> tips: 签名时需要手写签名,其他的可以直接填写后打印。 -Apache developer's pages: https://www.apache.org/dev/ -Incubator committer guide: https://incubator.apache.org/guides/committer.html +需要填写的内容: -Naturally, if you don't understand anything be sure to ask us on the dev@hertzbeat.apache.org mailing list. -Documentation is maintained by volunteers and hence can be out-of-date and incomplete - of course -you can now help fix that. +![](/img/docs/community/icla-content-1.png) +![](/img/docs/community/icla-content-2.png) + +在PDF中需要填写的字段: + - `Full name` + - `Public name` + - `Postal Address` + - `Country` + - `E-Mail` + - `(optional) preferred Apache id(s)` + - `(optional) notify project` + - `Date` + +> 填写样例 +> ![](/img/docs/community/icla-content-3.png) +> ![](/img/docs/community/icla-content-4.png) + +3. 打印并签署 + +![](/img/docs/community/icla-content-5.png) + +`Please sign`字段需要将文件打印出来然后手写签名,内容为自己姓名的全拼。 + +4. 将签名后的文件拍照或扫描转为PDF,并重命名为`姓名拼音-icla.pdf` + +5. 发送邮件到指定邮箱 + +邮件发送到`secretary@apache.org`,抄送到`private@hertzbeat.apache.org`。 + +**发送模板** + +主题:`Accept to become a Hertzbeat(incubating) committer` + +正文: -A PPMC member will announce your election to the dev list soon. ``` +Hello Apache, + I am willing contribute to the ASF. The attachment is my ICLA information. My Github account is : https://github.com/xxxx. +Thanks ! +``` + +大概1-5个工作日你就会收到一封来自`root@apache.org`的邮件。 + +当您收到邮件标题为:`Welcome to the Apache Software Foundation`的邮件,恭喜你,你已经获取到Apache ID了! + +### 设置Apache密码 + +在网站 [https://id.apache.org/reset/enter](https://id.apache.org/reset/enter) 输入您的Apache ID + +![](/img/docs/community/account-1.png) + +点击`Send Email`后会提示发送成功。 + +在您提供给PMC的邮箱中会收到一封来自`root@apache.org`重置密码的邮件,标题为`Password reset request for xxx from Apache ID`,在邮件正文中会有重置密码的链接,我们点击链接设置密码。 + +### 将Apache账号和GitHub账号关联 + +访问: https://whimsy.apache.org/roster/committer/${APACHE_ID} +- `${APACHE_ID}`替换成你的Apache ID + +登录后可以看到这个内容`Link GitHub username to ASF id`,点击跳转 + +![](/img/docs/community/account-2.png) + +输入您的Apache的账号和密码并登录 + +![](/img/docs/community/account-3.png) + +点击 `Authenticate with GitHub` + +![](/img/docs/community/account-4.png) + +点击`Authorize apache`授权给Apache + +![](/img/docs/community/account-5.png) + +点击`Send GitHub Invitation!` 发送GitHub邀请邮件 + +![](/img/docs/community/account-6.png) + +邮箱中会收到一封邮件,点击`Join @apache` +> 这里邮箱指的是您提供给PMC的那个邮箱地址 + +![](/img/docs/community/account-7.png) + +点击`Join The Apache Software Foundation`,加入GitHub加入Apache组织,会自动跳转到GitHub页面 + +![](/img/docs/community/account-8.png) +![](/img/docs/community/account-9.png) + +回到Apache页面,提示GitHub启用多重身份认证,在GitHub页面启用双重身份认证 +> GitHub双重身份认证介绍,[点击跳转官方文档](https://docs.github.com/zh/authentication/securing-your-account-with-two-factor-authentication-2fa/about-two-factor-authentication) + +![](/img/docs/community/account-10.png) + +启动完成之后等几分钟,提示已经绑定完成 + +![](/img/docs/community/account-11.png) + +至此您的GitHub账号与Apache账号就绑定完成了。 + +最后一步,联系PMC主席开启svn和其他访问权限。 + + +## 邮箱绑定 + +### GMail邮箱绑定 + +邮箱地址:[https://mail.google.com/](https://mail.google.com/) + +进入设置页面,并点击`添加其他电子邮件地址`` + +![](/img/docs/community/email-1.png) + +填写您的apache邮箱,按照指引点击下一步 + +![](/img/docs/community/email-2.png) +![](/img/docs/community/email-3.png) +![](/img/docs/community/email-4.png) + +设置为默认发送邮箱(可选) + +![](/img/docs/community/email-5.png) + +配置完成。 + +最后一步,别忘了订阅开发邮箱。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/download.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/download.md index cdd992917ec..dedb919ebfc 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/download.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/download.md @@ -15,18 +15,23 @@ sidebar_label: Download ## 最新版本 :::tip -Apache 版本即将到来! +以前版本的 HertzBeat 可能会受到安全问题的影响,请考虑使用最新版本。 ::: ----- -## 非 Apache 版本 +| 版本 | 日期 | 下载 | Release Notes | +|---------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| +| v1.6.0 | 2024.06.10 | [apache-hertzbeat-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-1.6.0-incubating-src.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512) ) | [release note](https://github.com/apache/hertzbeat/releases/tag/v1.6.0) | -:::tip -这些版本是在 HertzBeat 项目加入 ASF 孵化器之前发布的。 -这些版本没有遵循 ASF 发布流程。 -::: -| Version | Date | Source | Binary | Release Notes | -|---------|------------|----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| -| v1.5.0 | 2024.03.08 | [source](https://github.com/apache/hertzbeat/archive/refs/tags/v1.5.0.zip) | [hertzbeat-1.5.0.tar.gz](https://github.com/apache/hertzbeat/releases/download/v1.5.0/hertzbeat-1.5.0.tar.gz)
[hertzbeat-collector-1.5.0.tar.gz](https://github.com/apache/hertzbeat/releases/download/v1.5.0/hertzbeat-collector-1.5.0.tar.gz) | [release note](https://github.com/apache/hertzbeat/releases/tag/v1.5.0) | +## Docker 镜像版本 + +> Apache HertzBeat 为每个版本制作了 Docker 镜像. 你可以从 [Docker Hub](https://hub.docker.com/r/apache/hertzbeat) 拉取使用. + +- HertzBeat https://hub.docker.com/r/apache/hertzbeat +- HertzBeat Collector https://hub.docker.com/r/apache/hertzbeat-collector + + +## 归档版本 + +在这里查看所有归档版本:[archive](https://archive.apache.org/dist/incubator/hertzbeat/). diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/ai_config.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/ai_config.md new file mode 100644 index 00000000000..2f74143873f --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/ai_config.md @@ -0,0 +1,43 @@ +--- +id: aiConfig +title: AI 快速入门 +sidebar_label: AI 快速入门 +keywords: [人工智能 AI] +--- + +> 通过配置application.yml文件里面的aiConfig实现与人工智能的对话 + +### 配置参数说明 + +| 参数名称 | 参数帮助描述 | +| ----------- |------------------------------| +| type | 选择AI大模型(如智普、通义千问...) | +| model | 选择模型,默认为GLM-4 | +| api-key | 获取api_key,如果没有该配置,无法与大模型进行对话 | + +### 大模型选项与配置详解 + +#### 智普AI + +| 参数名称 | 示例 | 链接 | +|--------------|-----------------------------------------------------|----| +| type | zhiPu(必须和示例完全相同) | 无 | +| model | glm-4-0520、glm-4 、glm-4-air、glm-4-airx、 glm-4-flash | 无 | +| api-key | xxxxx.xxxxxx | https://open.bigmodel.cn/login?redirect=%2Fusercenter%2Fapikeys | + +#### 阿里巴巴AI + +| 参数名称 | 示例 | 链接 | +|--------------|----------------------------------------------------|----| +| type | alibabaAi(必须和示例完全相同) | 无 | +| model | qwen-turbo、qwen-plus、qwen-max、qwen-max-0428、qwen-max-0403、qwen-max-0107、qwen-max-longcontext | https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction?spm=a2c4g.11186623.0.0.4e0246c1RQFKMH | +| api-key | xxxxxxxxxxx | https://help.aliyun.com/zh/dashscope/developer-reference/activate-dashscope-and-create-an-api-key?spm=a2c4g.11186623.0.i10 | + +#### 月之暗面AI + +| 参数名称 | 示例 | 链接 | +|--------------|----------------------------------------------------|-----------------------------------------------| +| type | kimiAi(必须和示例完全相同) | 无 | +| model | moonshot-v1-8k、moonshot-v1-32k、moonshot-v1-128k | 无 | +| api-key | xxxxxxxxxxx | https://platform.moonshot.cn/console/api-keys | + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/flink_on_yarn.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/flink_on_yarn.md new file mode 100644 index 00000000000..da2ebd82cfb --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/flink_on_yarn.md @@ -0,0 +1,148 @@ +--- +id: flink_on_yarn +title: 监控:Flink On Yarn +sidebar_label: Flink On Yarn Monitor +keywords: [开源监控系统, 开源 Flink On Yarn 监控] +--- + +> 对Yarn运行模式下的Flink流引擎的通用指标进行测量监控。 +> 监控指标对应的中文含义在本说明文档描述,页面监控显示的指标均为Flink原生指标没有翻译成中文,怕引发歧义。 + +### 配置参数 + + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------------------- | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| Yarn端口 | Yarn的端口,对应配置项:`yarn.resourcemanager.webapp.address`中的端口 | +| 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 | +| 启动SSL | 是否启用SSL | +| 用户名 | 连接用户名 | +| 密码 | 连接密码 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:JobManager Metrics + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------------------------------------------------- | -------- | ------------------ | +| Status.JVM.Memory.NonHeap.Committed | 字节 | 非堆内存的提交量 | +| Status.JVM.Memory.Mapped.TotalCapacity | 字节 | 映射内存的总容量 | +| Status.JVM.Memory.NonHeap.Used | 字节 | 非堆内存的使用量 | +| Status.JVM.Memory.Metaspace.Max | 字节 | 元空间的最大容量 | +| Status.JVM.GarbageCollector.G1_Old_Generation.Count | 字节 | 老年代垃圾收集次数 | +| Status.JVM.Memory.Direct.MemoryUsed | 字节 | 直接内存的使用量 | +| Status.JVM.Memory.Mapped.MemoryUsed | 字节 | 映射内存的使用量 | +| Status.JVM.GarbageCollector.G1_Young_Generation.Count | 字节 | 年轻代垃圾收集次数 | +| Status.JVM.Memory.Direct.TotalCapacity | 字节 | 直接内存的总容量 | +| Status.JVM.GarbageCollector.G1_Old_Generation.Time | 字节 | 老年代垃圾收集时间 | +| Status.JVM.Memory.Heap.Committed | 字节 | 堆内存的提交量 | +| Status.JVM.Memory.Mapped.Count | - | 映射内存的数量 | +| Status.JVM.Memory.Metaspace.Used | 字节 | 元空间的使用量 | +| Status.JVM.Memory.Direct.Count | - | 直接内存的数量 | +| Status.JVM.Memory.Heap.Used | 字节 | 堆内存的使用量 | +| Status.JVM.Memory.Heap.Max | 字节 | 堆内存的最大容量 | +| Status.JVM.GarbageCollector.G1_Young_Generation.Time | 字节 | 年轻代垃圾收集时间 | +| Status.JVM.Memory.NonHeap.Max | 字节 | 非堆内存的最大容量 | + +#### 指标集合:JobManager Config + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------------------------ | -------- | ---------------------------- | +| internal.jobgraph-path | - | 内部作业图路径 | +| env.java.home | - | Java 环境路径 | +| classloader.check-leaked-classloader | - | 是否检查类加载器 | +| env.java.opts | - | Java 选项 | +| high-availability.cluster-id | - | 高可用性集群 ID | +| jobmanager.rpc.address | - | JobManager 的 RPC 地址 | +| jobmanager.memory.jvm-overhead.min | 字节 | JobManager 的 JVM 开销最小值 | +| jobmanager.web.port | 端口号 | JobManager 的 Web 端口 | +| webclient.port | 端口号 | Web 客户端端口 | +| execution.savepoint.ignore-unclaimed-state | - | 是否忽略未声明的状态 | +| io.tmp.dirs | 路径 | 临时文件目录 | +| parallelism.default | - | 默认并行度 | +| taskmanager.memory.fraction | - | TaskManager 内存占比 | +| taskmanager.numberOfTaskSlots | - | TaskManager 的任务槽数量 | +| yarn.application.name | - | Yarn 应用名称 | +| taskmanager.heap.mb | MB | TaskManager 堆内存大小 | +| taskmanager.memory.process.size | GB | TaskManager 进程内存大小 | +| web.port | 端口号 | Web 端口 | +| classloader.resolve-order | - | 类加载器解析顺序 | +| jobmanager.heap.mb | MB | JobManager 堆内存大小 | +| jobmanager.memory.off-heap.size | 字节 | JobManager 堆外内存大小 | +| state.backend.incremental | - | 状态后端是否增量 | +| execution.target | - | 执行目标 | +| jobmanager.memory.process.size | GB | JobManager 进程内存大小 | +| web.tmpdir | 路径 | Web 临时目录 | +| yarn.ship-files | 路径 | Yarn 传输文件 | +| jobmanager.rpc.port | 端口号 | JobManager 的 RPC 端口 | +| internal.io.tmpdirs.use-local-default | - | 是否使用本地默认临时目录 | +| execution.checkpointing.interval | 毫秒 | 检查点间隔 | +| execution.attached | - | 是否附加执行 | +| internal.cluster.execution-mode | - | 内部集群执行模式 | +| execution.shutdown-on-attached-exit | - | 是否在附加退出时关闭 | +| pipeline.jars | 路径 | 管道 JAR 文件 | +| rest.address | - | REST 地址 | +| state.backend | - | 状态后端类型 | +| jobmanager.memory.jvm-metaspace.size | 字节 | JobManager JVM 元空间大小 | +| $internal.deployment.config-dir | 路径 | 内部部署配置目录 | +| $internal.yarn.log-config-file | 路径 | 内部 Yarn 日志配置文件路径 | +| jobmanager.memory.heap.size | 字节 | JobManager 堆内存大小 | +| state.checkpoints.dir | 路径 | 状态检查点目录 | +| jobmanager.memory.jvm-overhead.max | 字节 | JobManager 的 JVM 开销最大值 | + +#### TaskManager + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------------------- | -------- | ------------------------------------- | +| Container ID | - | 容器 ID,用于唯一标识一个容器 | +| Path | - | 容器路径 | +| Data Port | 端口号 | 数据传输端口 | +| JMX Port | 端口号 | JMX(Java Management Extensions)端口 | +| Last Heartbeat | 时间戳 | 最后一次心跳时间 | +| All Slots | 数量 | 容器中所有任务槽的数量 | +| Free Slots | 数量 | 容器中空闲任务槽的数量 | +| totalResourceCpuCores | 核心数 | 容器总的CPU核心数 | +| totalResourceTaskHeapMemory | MB | 容器总的任务堆内存大小 | +| totalResourceManagedMemory | MB | 容器总的托管内存大小 | +| totalResourceNetworkMemory | MB | 容器总的网络内存大小 | +| freeResourceCpuCores | 核心数 | 容器中空闲的CPU核心数 | +| freeResourceTaskHeapMemory | MB | 容器中空闲的任务堆内存大小 | +| freeResourceTaskOffHeapMemory | MB | 容器中空闲的任务堆外内存大小 | +| freeResourceManagedMemory | MB | 容器中空闲的托管内存大小 | +| freeResourceNetworkMemory | MB | 容器中空闲的网络内存大小 | +| CPU Cores | 核心数 | CPU核心数 | +| Physical MEM | MB | 物理内存大小 | +| JVM Heap Size | MB | JVM堆内存大小 | +| Flink Managed MEM | MB | Flink管理的内存大小 | +| Framework Heap | MB | 框架堆内存大小 | +| Task Heap | MB | 任务堆内存大小 | +| Framework Off-Heap | MB | 框架堆外内存大小 | +| memoryConfigurationTaskOffHeap | Byte | 任务堆外内存配置 | +| Network | MB | 网络内存配置 | +| Managed Memory | MB | 托管内存配置 | +| JVM Metaspace | MB | JVM元空间大小 | +| JVM Overhead | MB | JVM开销 | +| memoryConfigurationTotalFlinkMemory | Byte | Flink总内存配置 | +| memoryConfigurationTotalProcessMemory | Byte | 进程总内存配置 | + +#### TaskManager Metrics + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------------------- | -------- | -------------------------- | +| Status.Shuffle.Netty.TotalMemory | MB | Netty Shuffle 使用的总内存 | +| Status.Flink.Memory.Managed.Used | MB | Flink 管理的已用内存 | +| Status.JVM.Memory.Metaspace.Used | MB | JVM 元空间已使用的内存 | +| Status.JVM.Memory.Metaspace.Max | MB | JVM 元空间的最大内存 | +| Status.JVM.Memory.Heap.Used | MB | JVM 堆内存已使用的内存 | +| Status.JVM.Memory.Heap.Max | MB | JVM 堆内存的最大容量 | +| Status.Flink.Memory.Managed.Total | MB | Flink 管理的内存总量 | +| Status.Shuffle.Netty.UsedMemory | MB | Netty Shuffle 使用的内存 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/imap.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/imap.md new file mode 100644 index 00000000000..4b04a003ed6 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/imap.md @@ -0,0 +1,47 @@ +--- +id: imap +title: 监控:邮箱详细信息监控 +sidebar_label: 邮箱信息监控 +keywords: [开源监控系统, 开源网络监控, 邮箱信息监控] +--- + +> IMAP,即Internet Message Access Protocol(互联网邮件访问协议),您可以通过这种协议从邮件服务器上获取邮箱的详细信息 +> 您可以点击`新建 QQ 邮箱监控`或`新建网易邮箱监控`并进行配置,或者选择`更多操作`,导入已有配置。 + +### 启用 IMAP 服务 + +如果您想使用此监控类型来监控您的邮箱信息,请先在您的邮箱上开启 IMAP 服务: + +以 QQ 邮箱为例 (其它邮箱类似): + +1. 进入`邮箱设置` +2. 在`常规`中找到开启 `IMAP/SMTP选项` +3. 在帮助中得到 IMAP 服务器域名,端口号,是否使用 SSL,以及授权码 +4. 使用以上信息在 HertzBeat 中进行配置,采集监控指标 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|:----------|--------------------------------------------------| +| 监控Host | IMAP 邮件服务器域名。注意⚠️不带协议头 (例如: https://, http://) 。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 启动 SSL | 是否启用 SSL。 | +| 端口 | 网站对外提供的端口。 | +| 连接超时时间 | 端口连接的等待超时时间,单位毫秒,默认6000毫秒。 | +| IMAP 邮箱地址 | 要进行监控的邮箱地址。 | +| 授权码 | 邮箱服务器提供的授权码。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 对监控资源的分类管理标签。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +对邮箱中各文件夹信息进行采集(可自行配置自定义的文件夹),由于各文件夹采集的指标相同,以下只列出一组通用的指标集合 + +#### 指标集合:(邮箱中文件夹名称) + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|---------------| +| 邮件总数 | | 该文件夹下所有邮件数量 | +| 最近收到邮件总数 | | 该文件夹下最近收到邮件数量 | +| 未读邮件总数 | | 该文件夹下未读邮件数量 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mongodb_atlas.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mongodb_atlas.md new file mode 100644 index 00000000000..c2d24ed8c22 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mongodb_atlas.md @@ -0,0 +1,82 @@ +--- +id: mongodb_atlas +title: 监控:MongoDB Atlas 数据库 +sidebar_label: MongoDB Atlas 数据库 +keywords: [ 开源监控系统, 开源数据库监控, MongoDB Atlas 数据库监控 ] +--- +> 对MongoDB Atlas 数据库的通用性能指标进行采集监控。 + +### 配置参数 + + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------------------- | +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 用户名 | MongoDB用户名,可选。 | +| 密码 | MongoDB密码,可选。 | +| 数据库 | 数据库名称 | +| 认证数据库 | 存储用户凭据的数据库名称。 | +| 连接超时时间 | 设置连接MongoDB未响应数据时的超时时间,单位ms毫秒,默认6000毫秒。 | +| 集群模式 | MongoDB Atlas集群取值为:mongodb-atlas | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:构建信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------------- | -------- | ----------------------------- | +| version | 无 | MongoDB版本信息 | +| gitVersion | 无 | 源代码git版本 | +| sysInfo | 无 | 系统信息 | +| allocator | 无 | MongoDB所使用的内存分配器 | +| javascriptEngine | 无 | MongoDB所使用的JavaScript引擎 | + +#### 指标集合:服务器文档 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------- | +| delete | 无 | 已删除数 | +| insert | 无 | 已插入数 | +| update | 无 | 更新数 | +| query | 无 | 查询数 | +| getmore | 无 | 光标中剩余文档的请求数 | +| command | 无 | 执行命令操作的总数 | + +#### 指标集合:网络操作 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | -------- | ---------------------------------- | +| Bytes In | 无 | 执行查询时需要扫描并进行排序的次数 | +| Bytes Out | 无 | 写冲突的次数 | +| Request Num | 无 | 请求数 | + +#### 指标集合: 连接信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------- | -------- | ------------------ | +| Current Connections | 无 | 当前正在进行连接数 | +| Available Connections | 无 | 可用连接数 | +| Total Created Connections | 无 | 创建的连接总数 | + +#### 指标集合:数据库统计 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------------- | -------- | ---------------- | +| Database Name | 无 | 数据库名称 | +| Collections | 无 | 集合数 | +| Views | 无 | 视图数 | +| Objects | 无 | 文档数 | +| Document Avg Size | Bytes | 文档平均大小 | +| Document Size | Bytes | 文档大小 | +| Storage Size | Bytes | 使用存储空间大小 | +| Indexes | 无 | 索引数 | +| Index Size | Bytes | 索引大小 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mysql.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mysql.md index dc23f3d6fa5..f93b2fdd736 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mysql.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/mysql.md @@ -7,6 +7,11 @@ keywords: [开源监控系统, 开源数据库监控, Mysql数据库监控] > 对MYSQL数据库的通用性能指标进行采集监控。支持MYSQL5+。 +### 添加 MYSQL jdbc 驱动 jar + +- 下载 MYSQL jdbc driver jar, 例如 mysql-connector-java-8.1.0.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 +- 将此 jar 包拷贝放入 HertzBeat 的安装目录下的 `ext-lib` 目录下. + ### 配置参数 | 参数名称 | 参数帮助描述 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/status.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/status.md new file mode 100644 index 00000000000..ebae858ee4c --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/help/status.md @@ -0,0 +1,73 @@ +--- +id: status +title: 状态页面 +sidebar_label: 状态页面 +keywords: [开源监控系统, 开源网站监控, 状态页面] +--- + +利用 HertzBeat 快速构建强大的状态页面,轻松向用户传达您产品服务的实时状态。例如,Github 的服务状态页 [https://www.githubstatus.com](https://www.githubstatus.com)。 + +支持状态页组件状态和监控状态联动同步,提供故障事件维护管理机制等功能。提高您的透明度和专业度,增强用户信任,降低沟通成本。 + +## 1. 设置组织信息 + +需要填写的字段如下: + +| 字段名称 | 字段说明 | 举例 | +|------|-----------------------------------------|---------------------------------------------------------------------------------------------------| +| 组织名称 | 组织的名称 | HertzBeat | +| 组织介绍 | 组织的详细介绍 | Apache HertzBeat (incubating) 是一个易用友好的开源实时监控告警系统,无需 Agent,高性能集群,兼容 Prometheus,提供强大的自定义监控和状态页构建能力。 | +| 网站链接 | 组织网站的 URL,便于访问者获取更多信息 | https://hertzbeat.apache.org/ | +| 标志图片 | 组织官方标志或 Logo 的图片文件路径或 URL,建议使用 .svg 格式 | https://hertzbeat.apache.org/zh-cn/img/hertzbeat-logo.svg | +| 反馈地址 | 接收问题反馈的地址 | https://github.com/apache/hertzbeat/issues | +| 主题颜色 | 状态页面的主色调。 | 在页面中点击选择 | + +填写完组织信息后,点击 `确定`。 + +![](/img/docs/help/status-3.png) + +## 2. 新增组件 + +新增组件后,状态页面将显示组件的状态信息。 + +点击 `新增组件` 添加需要监控的组件,并填写以下字段: + +| 字段名称 | 字段说明 | 举例 | +|------|-----------------------------------------------------------------------------------------|------------------------------------| +| 服务组件 | 组件服务名称 | 开发环境 ElasticSearch | +| 组件描述 | 组件服务的详细描述信息 | 开发环境,ElasticSearch (ip:192.168.1.1) | +| 服务状态统计方式 | 计算组件服务状态的方式。
自动计算:根据组件监控的状态自动计算显示状态。
手动设置:手动配置组件状态。 | 自动计算 / 手动设置 二选一 | +| 匹配标签 | 状态计算关联标签,使用标签关联的所有监控可用性状态数据来计算组件服务状态。 | 在页面选择组件的标签 | + +### 设置状态统计时间 + +> 提示:服务状态默认每 300 秒统计一次。 + +修改 `application.yml`: + +```yaml +status: + calculate: + interval: 60 +``` + +![](/img/docs/help/status-4.png) + +## 3. 维护事件 + +当事件发生时,可以在状态页面发布通知。 + +点击 `发布事件` + +![](/img/docs/help/status-1.png) + +| 字段名称 | 字段说明 | 举例 | +|----------|-----------------------------------------------|------------------------------------------------| +| 事件名称 | 事件的标题,应简洁明了地反映事件的核心内容。 | "服务器宕机事件 - 2023 年 4 月 5 日" | +| 影响组件 | 选择受此事件影响的组件。 | 在页面中选择 | +| 过程状态 | 设置事件当前状态,便于追踪处理进度。可选值:调查中 / 已确认 / 观察中 / 已修复 | 已确认 | +| 发布消息 | 向相关方传达的正式通知,包括事件详情、影响评估和应对措施。 | Dear All,开发环境异常,开发人员正在紧急处理,预计两小时内修复。请耐心等待,如有紧急事项请联系 Tom:130xxxx0000! | + +> 提示:可以多次发布消息,及时向团队汇报当前状态。 + +![](/img/docs/help/status-2.png) \ No newline at end of file diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md index 4faa4312308..cd0274a5f98 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/introduce.md @@ -11,7 +11,7 @@ slug: / [![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) -[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/repository/docker/apache/hertzbeat/general) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) [![QQ](https://img.shields.io/badge/QQ-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/account-modify.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/account-modify.md index 710ae8cbee5..028138275cb 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/account-modify.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/account-modify.md @@ -9,86 +9,109 @@ sidebar_label: 更新账户和密钥 Apache HertzBeat (incubating) 默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat 若需要新增删除修改账户或密码,可以通过配置 `sureness.yml` 实现,若无此需求可忽略此步骤 修改位于安装目录下的 `/hertzbeat/config/sureness.yml` 的配置文件,docker环境目录为`opt/hertzbeat/config/sureness.yml`,建议提前挂载映射 -配置文件内容参考 项目仓库[/script/sureness.yml](https://github.com/apache/hertzbeat/blob/master/script/sureness.yml) +配置文件内容参考如下 ```yaml resourceRole: - - /api/account/auth/refresh===post===[admin,user,guest] - - /api/apps/**===get===[admin,user,guest] - - /api/monitor/**===get===[admin,user,guest] - - /api/monitor/**===post===[admin,user] - - /api/monitor/**===put===[admin,user] - - /api/monitor/**===delete==[admin] - - /api/monitors/**===get===[admin,user,guest] - - /api/monitors/**===post===[admin,user] - - /api/monitors/**===put===[admin,user] - - /api/monitors/**===delete===[admin] - - /api/alert/**===get===[admin,user,guest] - - /api/alert/**===post===[admin,user] - - /api/alert/**===put===[admin,user] - - /api/alert/**===delete===[admin] - - /api/alerts/**===get===[admin,user,guest] - - /api/alerts/**===post===[admin,user] - - /api/alerts/**===put===[admin,user] - - /api/alerts/**===delete===[admin] - - /api/notice/**===get===[admin,user,guest] - - /api/notice/**===post===[admin,user] - - /api/notice/**===put===[admin,user] - - /api/notice/**===delete===[admin] - - /api/tag/**===get===[admin,user,guest] - - /api/tag/**===post===[admin,user] - - /api/tag/**===put===[admin,user] - - /api/tag/**===delete===[admin] - - /api/summary/**===get===[admin,user,guest] - - /api/summary/**===post===[admin,user] - - /api/summary/**===put===[admin,user] - - /api/summary/**===delete===[admin] + - /api/account/auth/refresh===post===[admin,user,guest] + - /api/apps/**===get===[admin,user,guest] + - /api/monitor/**===get===[admin,user,guest] + - /api/monitor/**===post===[admin,user] + - /api/monitor/**===put===[admin,user] + - /api/monitor/**===delete==[admin] + - /api/monitors/**===get===[admin,user,guest] + - /api/monitors/**===post===[admin,user] + - /api/monitors/**===put===[admin,user] + - /api/monitors/**===delete===[admin] + - /api/alert/**===get===[admin,user,guest] + - /api/alert/**===post===[admin,user] + - /api/alert/**===put===[admin,user] + - /api/alert/**===delete===[admin] + - /api/alerts/**===get===[admin,user,guest] + - /api/alerts/**===post===[admin,user] + - /api/alerts/**===put===[admin,user] + - /api/alerts/**===delete===[admin] + - /api/notice/**===get===[admin,user,guest] + - /api/notice/**===post===[admin,user] + - /api/notice/**===put===[admin,user] + - /api/notice/**===delete===[admin] + - /api/tag/**===get===[admin,user,guest] + - /api/tag/**===post===[admin,user] + - /api/tag/**===put===[admin,user] + - /api/tag/**===delete===[admin] + - /api/summary/**===get===[admin,user,guest] + - /api/summary/**===post===[admin,user] + - /api/summary/**===put===[admin,user] + - /api/summary/**===delete===[admin] + - /api/collector/**===get===[admin,user,guest] + - /api/collector/**===post===[admin,user] + - /api/collector/**===put===[admin,user] + - /api/collector/**===delete===[admin] + - /api/status/page/**===get===[admin,user,guest] + - /api/status/page/**===post===[admin,user] + - /api/status/page/**===put===[admin,user] + - /api/status/page/**===delete===[admin] # 需要被过滤保护的资源,不认证鉴权直接访问 # /api/v1/source3===get 表示 /api/v1/source3===get 可以被任何人访问 无需登录认证鉴权 excludedResource: - - /api/account/auth/**===* - - /api/i18n/**===get - - /api/apps/hierarchy===get - # web ui 前端静态资源 - - /===get - - /dashboard/**===get - - /monitors/**===get - - /alert/**===get - - /account/**===get - - /setting/**===get - - /passport/**===get - - /**/*.html===get - - /**/*.js===get - - /**/*.css===get - - /**/*.ico===get - - /**/*.ttf===get - - /**/*.png===get - - /**/*.gif===get - - /**/*.jpg===get - - /**/*.svg===get - - /**/*.json===get - # swagger ui 资源 - - /swagger-resources/**===get - - /v2/api-docs===get - - /v3/api-docs===get + - /api/alerts/report/**===* + - /api/account/auth/**===* + - /api/i18n/**===get + - /api/apps/hierarchy===get + - /api/push/**===* + - /api/status/page/public/**===* + # web ui resource + - /===get + - /dashboard/**===get + - /monitors/**===get + - /alert/**===get + - /account/**===get + - /setting/**===get + - /passport/**===get + - /status/**===get + - /**/*.html===get + - /**/*.js===get + - /**/*.css===get + - /**/*.ico===get + - /**/*.ttf===get + - /**/*.png===get + - /**/*.gif===get + - /**/*.jpg===get + - /**/*.svg===get + - /**/*.json===get + - /**/*.woff===get + - /**/*.eot===get + # swagger ui resource + - /swagger-resources/**===get + - /v2/api-docs===get + - /v3/api-docs===get + # h2 database + - /h2-console/**===* # 用户账户信息 # 下面有 admin tom lili 三个账户 -# eg: admin 拥有[admin,user]角色,密码为hertzbeat -# eg: tom 拥有[user],密码为hertzbeat -# eg: lili 拥有[guest],明文密码为lili, 加盐密码为1A676730B0C7F54654B0E09184448289 +# eg: admin 拥有[admin]角色,密码为 hertzbeat +# eg: tom 拥有[user],密码为 hertzbeat +# eg: lili 拥有[guest],明文密码为 hertzbeat, 加盐 123 后密码为 94C6B34E7A199A9F9D4E1F208093B489 account: - - appId: admin - credential: hertzbeat - role: [admin,user] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] ``` 修改`sureness.yml`的如下**部分参数**:**[注意⚠️sureness配置的其它默认参数需保留]** @@ -99,17 +122,24 @@ account: # 下面有 admin tom lili 三个账户 # eg: admin 拥有[admin,user]角色,密码为hertzbeat # eg: tom 拥有[user],密码为hertzbeat -# eg: lili 拥有[guest],明文密码为lili, 加盐密码为1A676730B0C7F54654B0E09184448289 +# eg: lili 拥有[guest],明文密码为 hertzbeat, 加盐 123 后密码为 94C6B34E7A199A9F9D4E1F208093B489 account: - - appId: admin - credential: hertzbeat - role: [admin,user] - - appId: tom - credential: hertzbeat - role: [user] - - appId: guest - credential: hertzbeat - role: [guest] + - appId: admin + credential: hertzbeat + role: [admin] + - appId: tom + credential: hertzbeat + role: [user] + - appId: guest + credential: hertzbeat + role: [guest] + - appId: lili + # credential = MD5(password + salt) + # plain password: hertzbeat + # attention: digest authentication does not support salted encrypted password accounts + credential: 94C6B34E7A199A9F9D4E1F208093B489 + salt: 123 + role: [user] ``` ## 更新安全密钥 @@ -121,7 +151,7 @@ account: ```yaml sureness: jwt: - secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV643R + secret: 'CyaFv0bwq2Eik0jdrKUtsA6bx4sDJeFV643R LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp' diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/docker-deploy.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/docker-deploy.md index 89cb46ef951..a5c1e86c884 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/docker-deploy.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/docker-deploy.md @@ -19,7 +19,7 @@ sidebar_label: Docker方式部署 2. 拉取HertzBeat Docker镜像 镜像版本TAG可查看 [dockerhub 官方镜像仓库](https://hub.docker.com/r/apache/hertzbeat/tags) - 或者使用 [quay.io 镜像仓库](https://quay.io/repository/apache/hertzbeat) + 或者使用 [quay.io 镜像仓库](https://quay.io/repository/tancloud/hertzbeat) ```shell $ docker pull apache/hertzbeat @@ -52,8 +52,7 @@ sidebar_label: Docker方式部署 下载源 [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) - 若需使用邮件发送告警,需替换 `application.yml` 里面的邮件服务器参数 - **推荐**若需使用外置Mysql数据库替换内置H2数据库,需替换`application.yml`里面的`spring.datasource`参数 具体步骤参见 [H2数据库切换为MYSQL](mysql-change)) - - **推荐**若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.td-engine`参数 具体步骤参见 [使用TDengine存储指标数据](tdengine-init) - - **推荐**若需使用时序数据库IotDB来存储指标数据库,需替换`application.yml`里面的`warehouse.storeiot-db`参数 具体步骤参见 [使用IotDB存储指标数据](iotdb-init) + - **推荐**若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.victoria-metrics`参数 具体步骤参见 [使用victoria-metrics存储指标数据](victoria-metrics-init) 5. 挂载并配置HertzBeat用户配置文件,自定义用户密码(可选) HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat @@ -85,8 +84,16 @@ $ docker run -d -p 1157:1157 -p 1158:1158 \ - `-v $(pwd)/logs:/opt/hertzbeat/logs` : (可选,不需要可删除)挂载日志文件到本地主机,保证日志不会因为容器的创建删除而丢失,方便查看 - `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (可选,不需要可删除)挂载上上一步修改的本地配置文件到容器中,即使用本地配置文件覆盖容器配置文件。我们需要修改此配置文件的MYSQL,TDengine配置信息来连接外部服务。 - `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (可选,不需要可删除)挂载上一步修改的账户配置文件到容器中,若无修改账户需求可删除此命令参数。 + - `-v $(pwd)/ext-lib:/opt/hertzbeat/ext-lib` : (可选,不需要可删除)根据自己下载的mysql/oracle等数据库连接驱动jar复制到宿主机相应目录并挂载到ext-lib目录 + mysql:https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.25.zip + oracle:https://download.oracle.com/otn-pub/otn_software/jdbc/234/ojdbc8.jar https://repo.mavenlibs.com/maven/com/oracle/database/nls/orai18n/21.5.0.0/orai18n-21.5.0.0.jar + - `还有一种自定义数据源连接驱动不需要挂载的方式`(可选)这种方式是把自己需要的数据源驱动直接放到容器内部 + - `docker cp $(pwd)/mysql-connector-java-8.0.18.jar hertzbeat:/opt/hertzbeat/ext-lib` 使用docker cp 命令先把自己下载好的数据源驱动cp到容器内部 + - `docker restart hertzbeat` 重启成功后就要可以正常使用了 + - `docker commit -a "operator" -m "在容器内部/ext-lib文件夹下新增了自定义的数据源驱动" hertzbeat hertzbeat:版本号自己定义`(可选) 如果想自己做一个自定义镜像可以使用此命令 ,-a 当前操作人 -m 对自己重做的容器进行描述 - - 注意⚠️ 挂载文件时,前面参数为你自定义本地文件地址,后面参数为docker容器内文件地址(固定) + + - 注意⚠️ 挂载文件时,前面参数为你自定义本地文件地址,后面参数为docker容器内文件地址(固定) - `--name hertzbeat` : 命名容器名称 hertzbeat @@ -141,23 +148,14 @@ $ docker run -d \ > 二:HertzBeat的配置文件 `application.yml` 里面的依赖服务IP账户密码等配置是否正确 > 三:若都无问题可以 `docker logs hertzbeat` 查看容器日志是否有明显错误,提issue或交流群或社区反馈 -3. **日志报错TDengine连接或插入SQL失败** -> 一:排查配置的数据库账户密码是否正确,数据库是否创建 -> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter - -4. **监控历史图表长时间都一直无数据** -> 一:Tdengine或IoTDB是否配置,未配置则无历史图表数据 -> 二:Tdengine的数据库`hertzbeat`是否创建 -> 三: HertzBeat的配置文件 `application.yml` 里面的依赖服务 IotDB或Tdengine IP账户密码等配置是否正确 - -5. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库] +3. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库] > 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - -> 安装初始化此数据库参考 [TDengine安装初始化](tdengine-init) 或 [IoTDB安装初始化](iotdb-init) +> 安装初始化此时序数据库 -6. 安装配置了时序数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库] -> 请检查配置参数是否正确 -> iot-db 或td-engine enable 是否设置为true -> 注意⚠️若hertzbeat和IotDB,TDengine都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP +4. 安装配置了时序数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库] +> 请检查配置的时许数据库参数是否正确 +> 时序数据库对应的 enable 是否设置为true +> 注意⚠️若hertzbeat和外置数据库都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP > 可根据logs目录下启动日志排查 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/greptime-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/greptime-init.md index c83f0638605..57cf7603a16 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/greptime-init.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/greptime-init.md @@ -1,14 +1,14 @@ --- id: greptime-init -title: 依赖时序数据库服务GreptimeDB安装初始化 -sidebar_label: 使用GreptimeDB存储指标数据(可选) +title: 依赖时序数据库服务 GreptimeDB 安装初始化(可选) +sidebar_label: 指标数据存储 GreptimeDB --- Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) > 我们推荐使用并长期支持 VictoriaMetrics 作为存储。 -GreptimeDB is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency. +[GreptimeDB](https://github.com/GreptimeTeam/greptimedb) is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency. It's designed to work on infrastructure of the cloud era, and users benefit from its elasticity and commodity storage. **⚠️ 若不配置时序数据库,则只会留最近一小时历史数据** @@ -25,21 +25,24 @@ It's designed to work on infrastructure of the cloud era, and users benefit from 2. Docker安装GreptimeDB ```shell -$ docker run -p 4000-4004:4000-4004 \ - -p 4242:4242 -v /opt/greptimedb:/tmp/greptimedb \ - --name greptime \ - greptime/greptimedb standalone start \ - --http-addr 0.0.0.0:4000 \ - --rpc-addr 0.0.0.0:4001 +$ docker run -p 127.0.0.1:4000-4003:4000-4003 \ + -v "$(pwd)/greptimedb:/tmp/greptimedb" \ + --name greptime --rm \ + greptime/greptimedb:latest standalone start \ + --http-addr 0.0.0.0:4000 \ + --rpc-addr 0.0.0.0:4001 \ + --mysql-addr 0.0.0.0:4002 \ + --postgres-addr 0.0.0.0:4003 ``` - `-v /opt/greptimedb:/tmp/greptimedb` 为greptimedb数据目录本地持久化挂载,需将`/opt/greptimedb`替换为实际本地存在的目录 + `-v "$(pwd)/greptimedb:/tmp/greptimedb` 为 greptimedb 数据目录本地持久化挂载,需将 `$(pwd)/greptimedb` 替换为实际本地存在的目录,默认使用执行命令的当前目录下的 `greptimedb` 目录作为数据目录。 + 使用```$ docker ps```查看数据库是否启动成功 ### 在hertzbeat的`application.yml`配置文件配置此数据库连接 1. 配置HertzBeat的配置文件 - 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 **修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.greptime`数据源参数,URL账户密码,并启用`enabled`为`true`** @@ -52,9 +55,16 @@ warehouse: enabled: false greptime: enabled: true - endpoint: localhost:4001 + grpc-endpoints: localhost:4001 + url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true + driver-class-name: com.mysql.cj.jdbc.Driver + username: greptime + password: greptime + expire-time: 30d ``` +默认数据库是 URL 中配置的 `hertzbeat` ,将自动创建。 `expire-time` 是自动创建的数据库的 TTL (数据过期)时间,默认为 30 天。 + 2. 重启 HertzBeat ### 常见问题 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/influxdb-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/influxdb-init.md index 427f07af423..91d30eef74d 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/influxdb-init.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/influxdb-init.md @@ -1,7 +1,7 @@ --- id: influxdb-init -title: 依赖时序数据库服务InfluxDB安装初始化 -sidebar_label: 使用InfluxDB存储指标数据(可选) +title: 依赖时序数据库服务InfluxDB安装初始化(可选) +sidebar_label: 指标数据存储InfluxDB --- Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) @@ -45,7 +45,7 @@ $ docker run -p 8086:8086 \ ### 在hertzbeat的`application.yml`配置文件配置此数据库连接 1. 配置HertzBeat的配置文件 - 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + 修改位于 `hertzbeat/config/application.yml` 的配置文件 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 **修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.influxdb`数据源参数,URL账户密码,并启用`enabled`为`true`** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/iotdb-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/iotdb-init.md index b4888e2af03..b4c924f6d9f 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/iotdb-init.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/iotdb-init.md @@ -1,7 +1,7 @@ --- id: iotdb-init -title: 依赖时序数据库服务IoTDB安装初始化 -sidebar_label: 使用IoTDB存储指标数据(可选) +title: 依赖时序数据库服务IoTDB安装初始化(可选) +sidebar_label: 指标数据存储IoTDB --- Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/mysql-change.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/mysql-change.md index b25a8408387..7c8f4f64c92 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/mysql-change.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/mysql-change.md @@ -1,7 +1,7 @@ --- id: mysql-change -title: 关系型数据库使用 Mysql 替换依赖的 H2 存储系统元数据 -sidebar_label: 元数据使用Mysql存储(可选) +title: 关系型数据库使用 Mysql 替换依赖的 H2 存储系统元数据(可选) +sidebar_label: 元数据存储Mysql --- MYSQL是一款值得信赖的关系型数据库,Apache HertzBeat (incubating) 除了支持使用默认内置的H2数据库外,还可以切换为使用MYSQL存储监控信息,告警信息,配置信息等结构化关系数据。 @@ -37,53 +37,59 @@ MYSQL是一款值得信赖的关系型数据库,Apache HertzBeat (incubating) 3. 查看hertzbeat数据库是否创建成功 `show databases;` +### 添加 MYSQL jdbc 驱动 jar + +- 下载 MYSQL jdbc driver jar, 例如 mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 +- 将此 jar 包拷贝放入 HertzBeat 的安装目录下的 `ext-lib` 目录下. + ### 修改hertzbeat的配置文件application.yml切换数据源 -- 配置HertzBeat的配置文件 +- 配置 HertzBeat 的配置文件 修改位于 `hertzbeat/config/application.yml` 的配置文件 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 替换里面的`spring.database`数据源参数,IP端口账户密码驱动 ⚠️注意`application.yml`文件内容需完整,除下方修改内容外其他参数需保留,完整内容见[/script/application.yml](https://github.com/hertzbeat/hertzbeat/raw/master/script/application.yml) 需修改部分原参数: - ```yaml - spring: - datasource: - driver-class-name: org.h2.Driver - username: sa - password: 123456 - url: jdbc:h2:./data/hertzbeat;MODE=MYSQL - ``` - 具体替换参数如下,需根据mysql环境配置账户密码IP: - ```yaml - spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: 123456 - url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false - platform: mysql - jpa: - database: mysql - ``` - -- 通过docker启动时,建议修改host为宿主机的外网IP地址,包括mysql连接字符串和redis。 - -**启动 HertzBeat 浏览器访问 http://ip:1157/ 开始使用HertzBeat进行监控告警,默认账户密码 admin/hertzbeat** - -### 常见问题 - -1. 缺少hibernate的mysql方言,导致启动异常 Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set - -如果上述配置启动系统,出现` Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set`异常, -需要在`application.yml`文件中增加以下配置: +```yaml +spring: + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE +``` + 具体替换参数如下,需根据mysql环境配置账户密码IP: ```yaml spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: 123456 + url: jdbc:mysql://mysql:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false + hikari: + max-lifetime: 120000 jpa: - hibernate: - ddl-auto: update + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: mysql properties: - hibernate: - dialect: org.hibernate.dialect.MySQL5InnoDBDialect + eclipselink: + logging: + level: SEVERE ``` + +- 通过docker启动时,建议修改host为宿主机的外网IP地址,包括mysql连接字符串。 + +**启动 HertzBeat 浏览器访问 http://ip:1157/ 开始使用HertzBeat进行监控告警,默认账户密码 admin/hertzbeat** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/postgresql-change.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/postgresql-change.md index 3d554d84f0a..a1835610a02 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/postgresql-change.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/postgresql-change.md @@ -1,7 +1,7 @@ --- id: postgresql-change -title: 关系型数据库使用 PostgreSQL 替换依赖的 H2 存储系统元数据 -sidebar_label: 元数据使用PostgreSQL存储(可选) +title: 关系型数据库使用 PostgreSQL 替换依赖的 H2 存储系统元数据(推荐) +sidebar_label: 元数据存储PostgreSQL(推荐) --- PostgreSQL是一个功能强大,开源的关系型数据库管理系统(RDBMS)。Apache HertzBeat (incubating) 除了支持使用默认内置的H2数据库外,还可以切换为使用PostgreSQL存储监控信息,告警信息,配置信息等结构化关系数据。 @@ -57,28 +57,36 @@ spring: username: sa password: 123456 url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + hikari: + max-lifetime: 120000 + + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE ``` 具体替换参数如下,需根据 PostgreSQL 环境配置账户密码IP: ```yaml spring: - config: - activate: - on-profile: prod - datasource: - driver-class-name: org.postgresql.Driver - username: root - password: 123456 - url: jdbc:postgresql://127.0.0.1:5432/hertzbeat - hikari: - max-lifetime: 120000 - - jpa: - database: postgresql - hibernate: - ddl-auto: update - properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect + datasource: + driver-class-name: org.postgresql.Driver + username: root + password: 123456 + url: jdbc:postgresql://postgresql:5432/hertzbeat + hikari: + max-lifetime: 120000 + jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform + database: postgresql + properties: + eclipselink: + logging: + level: SEVERE ``` **启动 HertzBeat 浏览器访问 http://ip:1157/ 开始使用HertzBeat进行监控告警,默认账户密码 admin/hertzbeat** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/quickstart.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/quickstart.md index 8bee9dd1041..3702a89d87d 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/quickstart.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/quickstart.md @@ -38,12 +38,12 @@ docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MAN #### 方式二:通过安装包安装 -1. 下载您系统环境对应的安装包`hertzbeat-xx.tar.gz` [GITHUB Release](https://github.com/apache/hertzbeat/releases) +1. 下载您系统环境对应的安装包`hertzbeat-xx.tar.gz` [Download Page](https://hertzbeat.apache.org/docs/download) 2. 配置 HertzBeat 的配置文件 `hertzbeat/config/application.yml`(可选) 3. 部署启动 `$ ./bin/startup.sh ` 或 `bin/startup.bat` 4. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` 5. 部署采集器集群(可选) - - 下载您系统环境对应采集器安装包`hertzbeat-collector-xx.tar.gz`到规划的另一台部署主机上 [GITHUB Release](https://github.com/apache/hertzbeat/releases) + - 下载您系统环境对应采集器安装包`hertzbeat-collector-xx.tar.gz`到规划的另一台部署主机上 [Download Page](https://hertzbeat.apache.org/docs/download) - 配置采集器的配置文件 `hertzbeat-collector/config/application.yml` 里面的连接主HertzBeat服务的对外IP,端口,当前采集器名称(需保证唯一性)等参数 `identity` `mode` (public or private) `manager-host` `manager-port` ```yaml collector: @@ -70,55 +70,16 @@ docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MAN 详细步骤参考 [参与贡献之本地代码启动](../community/contribution) -##### 方式四:Docker-Compose 统一安装 hertzbeat+mysql+iotdb/tdengine +##### 方式四:Docker-Compose 统一安装 hertzbeat+postgresql+tsdb -通过 [docker-compose部署脚本](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) 一次性把 mysql 数据库, iotdb/tdengine 时序数据库和 hertzbeat 安装部署。 +通过 [docker-compose部署脚本](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) 一次性把 postgresql/mysql 数据库, victoria-metrics/iotdb/tdengine 时序数据库和 hertzbeat 安装部署。 详细步骤参考 [docker-compose部署方案](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/README.md) -##### 方式五:Kubernetes Helm Charts 部署 hertzbeat+collector+mysql+iotdb +##### 方式五:Kubernetes Helm Charts 部署 hertzbeat+collector+postgresql+tsdb 通过 Helm Chart 一次性将 HertzBeat 集群组件部署到 Kubernetes 集群中。 详细步骤参考 [Artifact Hub](https://artifacthub.io/packages/helm/hertzbeat/hertzbeat) **HAVE FUN** - -### 🐵 依赖服务部署(可选) - -> HertzBeat依赖于 **关系型数据库** H2(默认已内置无需安装) 或 [Mysql](mysql-change) 和 **时序性数据库** [TDengine2+](tdengine-init) 或 [IOTDB](iotdb-init) (可选) - -**注意⚠️ 若需要部署时序数据库,IotDB 和 TDengine 任选其一即可!** - -##### 安装Mysql(可选) - -1. docker安装Mysql - ` $ docker run -d --name mysql -p 3306:3306 -v /opt/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7` - `-v /opt/data:/var/lib/mysql` - 为mysql数据目录本地持久化挂载,需将`/opt/data`替换为实际本地存在的目录 -2. 创建名称为hertzbeat的数据库 - `create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;` -3. 在hertzbeat的配置文件`application.yml`配置Mysql数据库替换H2内置数据库连接参数 - -详细步骤参考 [使用Mysql替换内置H2数据库](mysql-change) - -##### 安装TDengine(可选) - -1. docker安装TDengine - `docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp --name tdengine tdengine/tdengine:3.0.4.0` -2. 创建名称为hertzbeat的数据库 -3. 在hertzbeat的配置文件`application.yml`配置tdengine连接 - -详细步骤参考 [使用时序数据库TDengine存储指标数据(可选)](tdengine-init) - -##### 安装IotDB(可选) - -1. Docker安装IoTDB - -```shell -$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ - -v /opt/iotdb/data:/iotdb/data \ - --name iotdb \ - apache/iotdb:0.13.3-node -``` - -详细步骤参考 [使用时序数据库IoTDB存储指标数据(可选)](iotdb-init) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/tdengine-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/tdengine-init.md index 7fcd8fd460e..b64743d1f7b 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/tdengine-init.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/tdengine-init.md @@ -1,7 +1,7 @@ --- id: tdengine-init -title: 依赖时序数据库服务TDengine安装初始化 -sidebar_label: 使用TDengine存储指标数据(可选) +title: 依赖时序数据库服务TDengine安装初始化(可选) +sidebar_label: 指标数据存储TDengine --- Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) @@ -91,7 +91,7 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ ### 在hertzbeat的`application.yml`配置文件配置此数据库连接 1. 配置HertzBeat的配置文件 - 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + 修改位于 `hertzbeat/config/application.yml` 的配置文件 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 **修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.td-engine`数据源参数,URL账户密码,并启用`enabled`为`true`** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/upgrade.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/upgrade.md index 0effd531384..461065fa003 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/upgrade.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/upgrade.md @@ -6,7 +6,7 @@ sidebar_label: 版本更新指引 **Apache HertzBeat (incubating) 的发布版本列表** -- [下载页面](/docs/download) +- [下载页面](https://hertzbeat.apache.org/docs/download) - [Github Release](https://github.com/apache/hertzbeat/releases) - [DockerHub Release](https://hub.docker.com/r/apache/hertzbeat/tags) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/victoria-metrics-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/victoria-metrics-init.md index 7668cefcaf3..abc8a1f94b2 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/victoria-metrics-init.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/start/victoria-metrics-init.md @@ -1,7 +1,7 @@ --- id: victoria-metrics-init title: 依赖时序数据库服务VictoriaMetrics安装初始化 -sidebar_label: 使用VictoriaMetrics存储指标数据(推荐) +sidebar_label: 指标数据存储VictoriaMetrics(推荐) --- Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.0.0.json b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.0.0.json deleted file mode 100644 index 25ce5a4c627..00000000000 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.0.0.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "version.label": { - "message": "v1.0.0", - "description": "The label for version v1.0.0" - }, - "sidebar.docs.category.快速入门": { - "message": "快速入门", - "description": "The label for category 快速入门 in sidebar docs" - }, - "sidebar.docs.category.自定义监控": { - "message": "自定义监控", - "description": "The label for category 自定义监控 in sidebar docs" - }, - "sidebar.docs.category.HTTP协议": { - "message": "HTTP协议", - "description": "The label for category HTTP协议 in sidebar docs" - }, - "sidebar.docs.category.JDBC协议": { - "message": "JDBC协议", - "description": "The label for category JDBC协议 in sidebar docs" - }, - "sidebar.docs.category.SSH协议": { - "message": "SSH协议", - "description": "The label for category SSH协议 in sidebar docs" - }, - "sidebar.docs.category.帮助文档": { - "message": "帮助文档", - "description": "The label for category 帮助文档 in sidebar docs" - }, - "sidebar.docs.category.应用服务监控": { - "message": "应用服务监控", - "description": "The label for category 应用服务监控 in sidebar docs" - }, - "sidebar.docs.category.数据库监控": { - "message": "数据库监控", - "description": "The label for category 数据库监控 in sidebar docs" - }, - "sidebar.docs.category.操作系统": { - "message": "操作系统", - "description": "The label for category 操作系统 in sidebar docs" - }, - "sidebar.docs.category.中间件": { - "message": "中间件", - "description": "The label for category 中间件 in sidebar docs" - }, - "sidebar.docs.category.阈值告警配置": { - "message": "阈值告警配置", - "description": "The label for category 阈值告警配置 in sidebar docs" - }, - "sidebar.docs.category.告警通知配置": { - "message": "告警通知配置", - "description": "The label for category 告警通知配置 in sidebar docs" - }, - "sidebar.docs.category.Others": { - "message": "Others", - "description": "The label for category Others in sidebar docs" - } -} diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.1.x.json b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.1.x.json deleted file mode 100644 index acf391b1c3a..00000000000 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.1.x.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "version.label": { - "message": "v1.1.x", - "description": "The label for version v1.1.x" - }, - "sidebar.docs.category.快速入门": { - "message": "快速入门", - "description": "The label for category 快速入门 in sidebar docs" - }, - "sidebar.docs.category.自定义监控": { - "message": "自定义监控", - "description": "The label for category 自定义监控 in sidebar docs" - }, - "sidebar.docs.category.HTTP协议": { - "message": "HTTP协议", - "description": "The label for category HTTP协议 in sidebar docs" - }, - "sidebar.docs.category.JDBC协议": { - "message": "JDBC协议", - "description": "The label for category JDBC协议 in sidebar docs" - }, - "sidebar.docs.category.SSH协议": { - "message": "SSH协议", - "description": "The label for category SSH协议 in sidebar docs" - }, - "sidebar.docs.category.帮助文档": { - "message": "帮助文档", - "description": "The label for category 帮助文档 in sidebar docs" - }, - "sidebar.docs.category.应用服务监控": { - "message": "应用服务监控", - "description": "The label for category 应用服务监控 in sidebar docs" - }, - "sidebar.docs.category.数据库监控": { - "message": "数据库监控", - "description": "The label for category 数据库监控 in sidebar docs" - }, - "sidebar.docs.category.操作系统": { - "message": "操作系统", - "description": "The label for category 操作系统 in sidebar docs" - }, - "sidebar.docs.category.中间件": { - "message": "中间件", - "description": "The label for category 中间件 in sidebar docs" - }, - "sidebar.docs.category.云原生": { - "message": "云原生", - "description": "The label for category 云原生 in sidebar docs" - }, - "sidebar.docs.category.阈值告警配置": { - "message": "阈值告警配置", - "description": "The label for category 阈值告警配置 in sidebar docs" - }, - "sidebar.docs.category.告警通知配置": { - "message": "告警通知配置", - "description": "The label for category 告警通知配置 in sidebar docs" - }, - "sidebar.docs.category.Others": { - "message": "Others", - "description": "The label for category Others in sidebar docs" - }, - "sidebar.docs.category.Quickstart": { - "message": "Quickstart", - "description": "The label for category Quickstart in sidebar docs" - } -} diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.4.x/introduce.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.4.x/introduce.md index ac4a9dc2e5e..b9767924b38 100644 --- a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.4.x/introduce.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.4.x/introduce.md @@ -11,7 +11,7 @@ slug: / [![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) -[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/repository/docker/apache/hertzbeat/general) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) [![QQ](https://img.shields.io/badge/QQ-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-http-default.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-default.md similarity index 91% rename from home/versioned_docs/version-v1.1.x/advanced/extend-http-default.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-default.md index b8bf2688dbf..31fe0ac98f7 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-http-default.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-default.md @@ -3,7 +3,7 @@ id: extend-http-default title: HTTP协议系统默认解析方式 sidebar_label: 系统默认解析方式 --- -> HTTP接口调用获取响应数据后,用HertzBeat默认的解析方式去解析响应数据。 +> HTTP接口调用获取响应数据后,用 Apache HertzBeat (incubating) 默认的解析方式去解析响应数据。 **此需接口响应数据结构符合HertzBeat指定的数据结构规则** @@ -75,7 +75,7 @@ sidebar_label: 系统默认解析方式 ] ``` -**对应的监控配置定义文件YML可以配置为如下** +**对应的监控模版YML可以配置为如下** ```yaml # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 @@ -110,10 +110,11 @@ params: defaultValue: 80 # 参数输入框提示信息 placeholder: '请输入端口' +# collect metrics config list # 采集指标配置列表 metrics: -# 第一个监控指标 cpu -# 注意:内置监控指标有 (responseTime - 响应时间) + # First monitoring metric group cpu + # Note: The built-in monitoring metrics include (responseTime - response time) - name: cpu # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 @@ -123,7 +124,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-http-example-hertzbeat.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-example-hertzbeat.md similarity index 86% rename from home/versioned_docs/version-v1.1.x/advanced/extend-http-example-hertzbeat.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-example-hertzbeat.md index d1bdf5089fb..160adf031c9 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-http-example-hertzbeat.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-example-hertzbeat.md @@ -4,7 +4,7 @@ title: 教程一:适配一款基于HTTP协议的监控类型 sidebar_label: 教程一:适配一款HTTP协议监控 --- -通过此教程我们一步一步描述如何在hertzbeat监控系统下新增适配一款基于http协议的监控类型。 +通过此教程我们一步一步描述如何在 Apache HertzBeat (incubating) 监控系统下新增适配一款基于http协议的监控类型。 阅读此教程前我们希望您已经从[自定义监控](extend-point)和[http协议自定义](extend-http)了解熟悉了怎么自定义类型,指标,协议等。 @@ -59,15 +59,14 @@ sidebar_label: 教程一:适配一款HTTP协议监控 **我们这次获取其app下的 `category`,`app`,`status`,`size`,`availableSize`等指标数据。** -### 新增对应的应用定义YML和参数定义YML +### 新增自定义监控模版YML -1. 自定义监控类型需新增配置YML文件 +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** -用监控类型命名的监控配置定义文件 - 例如:app-hertzbeat.yml 需位于安装目录 /hertzbeat/define/ 下 +> 监控模版YML用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 +> 即我们通过自定义这个监控模版,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 -2. 配置监控配置定义文件 app-hertzbeat.yml - -监控配置定义文件是用来定义采集类型是啥,需要用哪种协议采集方式,采集的指标是啥,协议的配置参数等。我们直接复用 app-api.yml 里面的定义内容,修改为我们当前的监控类型`hertzbeat`配置参数即可,如下:注意⚠️我们这次获取接口响应数据中的`category`,`app`,`status`,`size`,`availableSize`等字段作为指标数据。 +样例:自定义一个名称为`hertzbeat`的自定义监控类型,其使用HTTP协议采集指标数据。 ```yaml # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 @@ -122,7 +121,7 @@ params: zh-CN: 用户名 en-US: Username type: text - limit: 20 + limit: 50 required: false hide: true - field: password @@ -132,10 +131,11 @@ params: type: password required: false hide: true +# collect metrics config list # 采集指标配置列表 metrics: - # 第一个监控指标 summary - # 注意:内置监控指标有 (responseTime - 响应时间) + # metrics - summary + # 监控指标 - summary - name: summary # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 @@ -148,7 +148,7 @@ metrics: unit: ms - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status @@ -223,5 +223,3 @@ HTTP协议的自定义监控的实践就到这里,HTTP协议还带其他参数 如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯! **github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-http-example-token.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-example-token.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/advanced/extend-http-example-token.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-example-token.md index aaedeabcb57..94f49c01f61 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-http-example-token.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-example-token.md @@ -37,9 +37,7 @@ sidebar_label: 教程二:获取TOKEN后续认证使用 ### 新增自定义监控类型`hertzbeat_token` -1. 自定义监控类型需新增配置YML文件,我们直接复用教程一的 `hertzbeat` 监控类型,在其基础上修改 - -用监控类型命名的监控配置定义文件 - app-hertzbeat_token.yml 需位于安装目录 /hertzbeat/define/ 下 +1. 自定义监控类型需新增配置监控模版YML,我们直接复用教程一的 `hertzbeat` 监控类型,在其基础上修改 监控配置定义文件是用来定义采集类型是啥,需要用哪种协议采集方式,采集的指标是啥,协议的配置参数等。 我们直接复用 app-hertzbeat.yml 里面的定义内容,修改为我们当前的监控类型`hertzbeat_auth`配置参数, 比如 `app, category等`。 @@ -389,5 +387,3 @@ HTTP协议的自定义监控的实践就到这里,HTTP协议还带其他参数 如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯! **github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-http-jsonpath.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-jsonpath.md similarity index 78% rename from home/versioned_docs/version-v1.1.x/advanced/extend-http-jsonpath.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-jsonpath.md index 03f13c7dc3b..ae29f265574 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-http-jsonpath.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http-jsonpath.md @@ -7,23 +7,23 @@ sidebar_label: JsonPath解析方式 注意⚠️ 响应数据为JSON格式 -**使用JsonPath脚本将响应数据解析成符合HertzBeat指定的数据结构规则的数据** +**使用JsonPath脚本将响应数据解析成符合 Apache HertzBeat (incubating) 指定的数据结构规则的数据** #### JsonPath操作符 [JSONPath在线验证](https://www.jsonpath.cn) -| JSONPATH | 帮助描述 | -| ----------- | ----------- | -| $ | 根对象或元素 | -| @ | 当前对象或元素 | -| . or [] | 子元素操作符 | -| .. | 递归匹配所有子元素 | -| * | 通配符. 匹配所有对象或元素. | -| [] | 下标运算符,JsonPath索引从0开始 | -| [,] | 连接运算符,将多个结果拼成数组返回,JSONPath允许使用别名. | -| [start:end:step] | 数组切片运算符 | -| ?() | 过滤器(脚本)表达式. | -| () | 脚本表达式. | +| JSONPATH | 帮助描述 | +|------------------|-----------------------------------| +| $ | 根对象或元素 | +| @ | 当前对象或元素 | +| . or [] | 子元素操作符 | +| .. | 递归匹配所有子元素 | +| * | 通配符. 匹配所有对象或元素. | +| [] | 下标运算符,JsonPath索引从0开始 | +| [,] | 连接运算符,将多个结果拼成数组返回,JSONPath允许使用别名. | +| [start:end:step] | 数组切片运算符 | +| ?() | 过滤器(脚本)表达式. | +| () | 脚本表达式. | #### HertzBeat数据格式规范 单层格式:key-value @@ -95,7 +95,7 @@ sidebar_label: JsonPath解析方式 ``` 此数据结构符合HertzBeat的数据格式规范,成功提取指标`type,num`值。 -**对应的监控配置定义文件YML可以配置为如下** +**对应的监控模版YML可以配置为如下** ```yaml # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 @@ -130,10 +130,11 @@ params: defaultValue: 80 # 参数输入框提示信息 placeholder: '请输入端口' +# collect metrics config list # 采集指标配置列表 metrics: -# 第一个监控指标 person -# 注意:内置监控指标有 (responseTime - 响应时间) + # metrics - cpu + # 监控指标 - cpu - name: cpu # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 @@ -143,7 +144,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - field: type type: 1 - instance: true + label: true - field: num type: 0 # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-http.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http.md similarity index 87% rename from home/versioned_docs/version-v1.1.x/advanced/extend-http.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http.md index 5f585d27b09..21b8015da77 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-http.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-http.md @@ -6,7 +6,7 @@ sidebar_label: HTTP协议自定义监控 > 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用HTTP协议自定义指标监控。 ### HTTP协议采集流程 -【**HTTP接口调用**】->【**响应校验**】->【**响应数据解析**】->【**默认方式解析|JsonPath脚本解析 | XmlPath解析(todo) | Prometheus解析(todo)**】->【**指标数据提取**】 +【**HTTP接口调用**】->【**响应校验**】->【**响应数据解析**】->【**默认方式解析|JsonPath脚本解析 | XmlPath解析(todo) | Prometheus解析**】->【**指标数据提取**】 由流程可见,我们自定义一个HTTP协议的监控类型,需要配置HTTP请求参数,配置获取哪些指标,对响应数据配置解析方式和解析脚本。 HTTP协议支持我们自定义HTTP请求路径,请求header,请求参数,请求方式,请求体等。 @@ -17,20 +17,21 @@ HTTP协议支持我们自定义HTTP请求路径,请求header,请求参数, ### 自定义步骤 -配置自定义监控类型需新增配置一个YML文件 -1. 用监控类型命名的监控配置定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/ 下 -2. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。 +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) ------- -下面详细介绍下YML文件的配置用法,请注意看使用注释。 -### 监控配置定义文件YML +下面详细介绍下监控模版YML的配置用法,请注意看使用注释。 + +### 监控模版YML -> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 -> 即我们通过自定义这个YML文件,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 +> 监控模版YML用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 +> 即我们通过自定义这个监控模版,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 样例:自定义一个名称为example_http的自定义监控类型,其使用HTTP协议采集指标数据。 -文件名称: example_http.yml 位于 /define/example_http.yml + ```yaml # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 @@ -71,7 +72,7 @@ params: en-US: Username type: text # 当type为text时,用limit表示字符串限制大小 - limit: 20 + limit: 50 required: false - field: password name: @@ -115,7 +116,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' @@ -176,7 +177,7 @@ metrics: fields: - field: hostname type: 1 - instance: true + label: true - field: total type: 0 unit: kb @@ -193,6 +194,7 @@ metrics: method: GET headers: apiVersion: v1 + # 查询参数,支持使用时间表达式 params: param1: param1 param2: param2 diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-jdbc.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-jdbc.md similarity index 91% rename from home/versioned_docs/version-v1.1.x/advanced/extend-jdbc.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-jdbc.md index ef09e2a68f1..6ff4b9bbed1 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-jdbc.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-jdbc.md @@ -39,31 +39,30 @@ SQL查询回来的数据字段和我们需要的指标映射,就能获取对 SQL响应数据: | key | value | -| ----------- | ----------- | -| one | 243 | -| two | 435 | -| three | 332 | -| four | 643 | +|----------|-------| +| one | 243 | +| two | 435 | +| three | 332 | +| four | 643 | 这里指标字段就能和响应数据的key映射,获取对应的value为其采集监控数据。 ### 自定义步骤 -配置自定义监控类型需新增配置YML文件 +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) -1. 用监控类型命名的监控配置定义文件 - 例如:example_sql.yml 需位于安装目录 /hertzbeat/define/ 下 -2. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。 ------- 下面详细介绍下文件的配置用法,请注意看使用注释。 -### 监控配置定义文件 +### 监控模版YML > 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 -> 即我们通过自定义这个YML文件,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 +> 即我们通过自定义这个YML,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 -样例:自定义一个名称为example_sql的自定义监控类型,其使用JDBC协议采集指标数据。 -文件名称: example_sql.yml 位于 /define/example_sql.yml +样例:自定义一个名称为example_sql的自定义监控类型,其使用JDBC协议采集指标数据。 ```yaml # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 @@ -102,7 +101,7 @@ params: zh-CN: 用户名 en-US: Username type: text - limit: 20 + limit: 50 required: false - field: password name: @@ -127,7 +126,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - field: version type: 1 - instance: true + label: true - field: port type: 1 - field: datadir diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-jmx.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-jmx.md new file mode 100644 index 00000000000..cca1bcfb726 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-jmx.md @@ -0,0 +1,238 @@ +--- +id: extend-jmx +title: JMX协议自定义监控 +sidebar_label: JMX协议自定义监控 +--- +> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用JMX协议自定义指标监控。 +> JMX协议自定义监控可以让我们很方便的通过配置 JMX Mbean Object 就能监控采集到我们想监控的 Mbean 指标 + +### JMX协议采集流程 +【**对端JAVA应用暴露JMX服务**】->【**HertzBeat直连对端JMX服务**】->【**获取配置的 Mbean Object 数据**】->【**指标数据提取**】 + +由流程可见,我们自定义一个JMX协议的监控类型,需要配置JMX请求参数,配置获取哪些指标,配置查询Object信息。 + +### 数据解析方式 + +通过配置监控模版YML的指标`field`, `aliasFields`, `jmx` 协议的 `objectName` 来和对端系统暴露的 `Mbean`对象信息映射解析。 + + + +### 自定义步骤 + +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) + +------- +下面详细介绍下监控模版的配置用法,请注意看使用注释。 + +### 监控模版YML + +> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 +> 即我们通过自定义这个YML,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 + +样例:自定义一个名称为 `example_jvm` 的自定义监控类型,其使用JMX协议采集指标数据。 + + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +# 监控类型所属类别: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... +app: example_jvm +# The monitoring i18n name +# 监控类型国际化名称 +name: + zh-CN: 自定义JVM虚拟机 + en-US: CUSTOM JVM +# Input params define for monitoring(render web ui by the definition) +# 监控所需输入参数定义(根据定义渲染页面UI) +params: + # field-param field key + # field-字段名称标识符 + - field: host + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 主机Host + en-US: Host + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: host + # required-true or false + # 是否是必输项 true-必填 false-可选 + required: true + # field-param field key + # field-变量字段标识符 + - field: port + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 端口 + en-US: Port + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: number + # when type is number, range is required + # 当type为number时,用range表示范围 + range: '[0,65535]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # default value + # 端口默认值 + defaultValue: 9999 + # field-param field key + # field-变量字段标识符 + - field: url + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: JMX URL + en-US: JMX URL + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: text + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: false + # hide param-true or false + # 是否隐藏字段 true or false + hide: true + # param field input placeholder + # 参数输入框提示信息 + placeholder: 'service:jmx:rmi:///jndi/rmi://host:port/jmxrmi' + # field-param field key + # field-变量字段标识符 + - field: username + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 用户名 + en-US: Username + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: text + # when type is text, use limit to limit string length + # 当type为text时,用limit表示字符串限制大小 + limit: 50 + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: false + # hide param-true or false + # 是否隐藏字段 true or false + hide: true + # field-param field key + # field-变量字段标识符 + - field: password + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 密码 + en-US: Password + # type-param field type(most mapping the html input tag) + # type-字段类型,样式(大部分映射input标签type属性) + type: password + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: false + # hide param-true or false + # 是否隐藏字段 true or false + hide: true +# collect metrics config list +# 采集指标配置列表 +metrics: + # metrics - basic + # 监控指标 - basic + - 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的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + priority: 0 + # collect metrics content + # 具体监控指标列表 + fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-if is metrics label + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + - field: VmName + type: 1 + - field: VmVendor + type: 1 + - field: VmVersion + type: 1 + - field: Uptime + type: 0 + unit: ms + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + # 用于监控的协议,例: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: jmx + # the config content when protocol is jmx + jmx: + # host: ipv4 ipv6 domain + # 主机host: ipv4 ipv6 域名 + host: ^_^host^_^ + # port + # 端口 + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + # jmx mbean object name + # jmx mbean 对象名称 + objectName: java.lang:type=Runtime + url: ^_^url^_^ + + - name: memory_pool + priority: 1 + fields: + - field: name + type: 1 + label: true + - field: committed + type: 0 + unit: MB + - field: init + type: 0 + unit: MB + - field: max + type: 0 + unit: MB + - field: used + type: 0 + unit: MB + units: + - committed=B->MB + - init=B->MB + - max=B->MB + - used=B->MB + # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field + # (可选)监控指标别名, 做为中间字段与采集数据字段和指标字段映射转换 + aliasFields: + - Name + - Usage->committed + - Usage->init + - Usage->max + - Usage->used + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + # (可选)指标映射转换计算表达式,与上面的别名一起作用,计算出最终需要的指标值 + # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime + calculates: + - name=Name + - committed=Usage->committed + - init=Usage->init + - max=Usage->max + - used=Usage->used + protocol: jmx + jmx: + # host: ipv4 ipv6 domain + # 主机host: ipv4 ipv6 域名 + host: ^_^host^_^ + # port + # 端口 + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + objectName: java.lang:type=MemoryPool,name=* + url: ^_^url^_^ +``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-ngql.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-ngql.md new file mode 100644 index 00000000000..b5685eb3b16 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-ngql.md @@ -0,0 +1,171 @@ +--- +id: extend-ngql +title: NQGL自定义监控 +sidebar_label: NGQL自定义监控 +--- + +> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用NGQL自定义指标监控。 +> NGQL自定义监控可以让我们很方便的使用NGQL或者OpenCypher从NebulaGraph图数据库中查询指标数据,支持NebulaGraph 3.X版本。 + +### 数据解析方式 + +NGQL查询回来的数据字段和我们需要的指标映射,就能获取对应的指标数据,目前映射解析方式有四种: filterCount, oneRow, multiRow, columns + +#### **filterCount** + +> 对查询返回的结果按照指定字段进行过滤后,统计数量,通常用于 `SHOW ...` 语句中,如果可以使用NGQL语句直接返回数量的,建议使用NGQL语句统计数量。 +> commands字段语法格式: aliasField#NGQL#filterName#filterValue +> `aliasField`: 对应监控模板中的`aliasFields`中的值 +> `NGQL`: 查询语句 +> `filterName`: 过滤属性名称(可选) +> `filterValue`: 过滤属性值(可选) + +例如: +- online_meta_count#SHOW HOSTS META#Status#ONLINE + 对 `SHOW HOSTS META` 返回的结果中统计滤Status==ONLINE的数量 +- online_meta_count#SHOW HOSTS META## + 统计 `SHOW HOSTS META` 返回的行数 + +#### **oneRow** + +> 查询一行数据, 通过查询返回结果集的列名称,和查询的字段映射 + +例如: + +- 查询的指标字段为:a,b +- 查询NGQL:match (v:metrics) return v.metrics.a as a,v.metrics.b as b; + +这里指标字段就能和响应数据一一映射为一行采集数据。 + +注意事项: + +- 使用 `oneRow` 方式时单条查询语句返回多行结果时只会使用第一行结果映射到指标字段; +- 当 `commands` 字段包含两条及两条以上查询语句时,如果多条查询语句返回的字段相同时,后一条语句返回的字段会覆盖前一条; +- 定义 `commands` 时建议使用 limit 语句限制返回结果集的行数; + +#### **multiRow** + +> 查询多行数据, 通过查询返回结果集的列名称,和查询的字段映射 + +例如: +- 查询的指标字段为:a,b +- 查询NGQL:match (v:metrics) return v.metrics.a as a,v.metrics.b as b; +这里指标字段就能和响应数据一一映射为多行采集数据。 + +注意事项: + +- 使用 `multiRow` 方式时,`commands` 字段只能包含一条查询语句 + +#### **columns** + +> 采集一行指标数据, 通过查询的两列数据(key-value),key和查询的字段匹配,value为查询字段的值 + +注意事项: + +- 使用 `columns` 方式时,会默认使用结果集的前两列映射采集数据,第一列数据对应指标名称,第二列对应指标值; +- 当 `commands` 字段包含两条及两条以上查询语句时,如果多条查询语句返回的第一列数据有重复,会使用保留最后一条的结果; + +### 自定义步骤 + +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) + +------- +下面详细介绍下文件的配置用法,请注意看使用注释。 + +### 监控模版YML + +> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 +> 即我们通过自定义这个YML,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 + +样例:自定义一个名称为example_ngql的自定义监控类型,其使用NGQL采集指标数据。 + +```yaml +# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 +category: db +# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... +app: example_ngql +name: + zh-CN: NGQL自定义监控应用 + en-US: NGQL Custom APP +# 监控参数定义. field 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换 +# 这个部分通常不用修改 +params: + # field-param field key + - field: host + name: + zh-CN: 目标Host + en-US: Target Host + type: host + required: true + - field: graphPort + name: + zh-CN: graph端口 + en-US: graphPort + type: number + range: '[0,65535]' + required: true + defaultValue: 9669 + - field: username + name: + zh-CN: 用户名 + en-US: Username + type: text + required: true + - field: password + name: + zh-CN: 密码 + en-US: Password + type: password + required: true + - field: spaceName + name: + zh-CN: 图空间 + en-US: Space Name + type: text + required: false + - field: timeout + name: + zh-CN: 连接超时时间(ms) + en-US: Connect Timeout(ms) + type: number + unit: ms + range: '[0,100000]' + required: true + defaultValue: 6000 +# 采集指标配置列表 +metrics: + - name: base_info + i18n: + zh-CN: 节点统计 + en-US: Vertex statistics + priority: 0 + fields: + - field: tag1 + type: 1 + i18n: + zh-CN: tag1 + en-US: tag1 + - field: tag1 + type: 1 + i18n: + zh-CN: tag2 + en-US: tag2 + aliasFields: + - tag1 + - tag2 + protocol: ngql + ngql: + host: ^_^host^_^ + username: ^_^username^_^ + password: ^_^password^_^ + port: ^_^graphPort^_^ + spaceName: ^_^spaceName^_^ + parseType: columns + # 定义采集数据使用的查询语句 + commands: + - match (v:tag1) return "tag1" as name ,count(v) as cnt + - match (v:tag2) return "tag2" as name ,count(v) as cnt + timeout: ^_^timeout^_^ +``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-point.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-point.md new file mode 100644 index 00000000000..c951f1bc190 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-point.md @@ -0,0 +1,170 @@ +--- +id: extend-point +title: 自定义监控 +sidebar_label: 自定义监控 +--- +> HertzBeat拥有自定义监控能力,您只需配置监控模版YML就能适配一款自定义的监控类型。 +> 目前自定义监控支持[HTTP协议](extend-http),[JDBC协议](extend-jdbc),[SSH协议](extend-ssh),[JMX协议](extend-jmx),[SNMP协议](extend-snmp),后续会支持更多通用协议。 + +### 自定义流程 + +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) + +------- + +### 监控模版YML + +**HertzBeat的设计是一个监控模版对应一个监控类型,所有监控类型都是由监控模版来定义的**。 + +> 监控模版YML定义了 *监控类型的名称(国际化), 配置参数映射, 采集指标信息, 采集协议配置* 等。 + +下面使用样例详细介绍下这监控模版YML的配置用法。 + +样例:自定义一个 `app` 名称为 `example2` 的自定义监控类型,其使用HTTP协议采集指标数据。 + +[监控模版] -> [新增监控类型] -> [右边配置如下监控模版YML] -> [保存并应用] + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +# 监控类型所属类别: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... +app: example2 +# The monitoring i18n name +# 监控类型国际化名称 +name: + zh-CN: 模拟网站监测 + en-US: EXAMPLE WEBSITE +# 监控所需输入参数定义(根据定义渲染页面UI) +# Input params define for monitoring(render web ui by the definition) +params: + # field-param field key + # field-变量字段标识符 + - field: host + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 主机Host + en-US: Host + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: host + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # field-param field key + # field-变量字段标识符 + - field: port + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 端口 + en-US: Port + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: number + # when type is number, range is required + # 当type为number时,用range表示范围 + range: '[0,65535]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # default value + # 默认值 + defaultValue: 80 + # field-param field key + # field-变量字段标识符 + - field: uri + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 相对路径 + en-US: URI + # type-param field type(most mapping the html input tag) + # type-字段类型,样式(大部分映射input标签type属性) + type: text + # when type is text, use limit to limit string length + # 当type为text时,用limit表示字符串限制大小 + limit: 200 + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: false + # 参数输入框提示信息 + # param field input placeholder + placeholder: 'Website uri path(no ip port) EG:/console' + # field-param field key + # field-变量字段标识符 + - field: ssl + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 启用HTTPS + en-US: HTTPS + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: boolean + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # field-param field key + # field-变量字段标识符 + - field: timeout + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 超时时间(ms) + en-US: Timeout(ms) + # type-param field type(most mapping the html input tag) + # type-字段类型,样式(大部分映射input标签type属性) + type: number + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: false + # hide param-true or false + # 是否隐藏字段 true or false + hide: true + +metrics: + # metrics - summary, inner monitoring metrics (responseTime - response time, keyword - number of keywords) + # 监控指标 - summary, 内置监控指标有 (responseTime - 响应时间, keyword - 关键字数量) + - name: summary + # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 + # 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的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + priority: 0 + # collect metrics content + # 具体监控指标列表 + fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-if is metrics label + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + - field: responseTime + type: 0 + unit: ms + - field: keyword + type: 0 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: http + # the config content when protocol is http + http: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # http url + url: ^_^uri^_^ + timeout: ^_^timeout^_^ + # http method: GET POST PUT DELETE PATCH + method: GET + # if enabled https + ssl: ^_^ssl^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule + # http 响应数据解析方式: default-系统规则, jsonPath-jsonPath脚本, website-网站可用性指标监控, prometheus-Prometheus数据规则 + parseType: website + +``` + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-push.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-push.md new file mode 100644 index 00000000000..7245afe2a12 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-push.md @@ -0,0 +1,26 @@ +--- +id: extend-push +title: Push Style Custom Monitoring +sidebar_label: Push Style Custom Monitoring +--- + +> 推送方式监控是一种特殊的监控,允许用户配置数据格式并编写代码将指标推送到 Hertzbeat。 +> 下面我们将介绍如何使用这一功能。 + +### 推送方式监控的采集流程 + +【用户开始推送数据】->【HertzBeat推送模块暂存数据】->【HertzBeat采集模块定期采集数据】 + +### 数据解析方式 + +HertzBeat会使用用户添加新监控时配置的格式来解析数据。 + +### 创建监控步骤 + +HertzBeat页面 -> 应用服务监控 -> 推送方式监控 -> 新建推送方式监视器 -> 设置推送模块主机(Hertzbeat服务器ip,通常为127.0.0.1或localhost) -> 设置推送模块端口(hertzbeat服务器端口,通常为1157) -> 配置数据字段(单位:字符串表示,类型:0表示数字/1表示字符串)-> 结束 + +--- + +### 监控配置示例 + +![](/img/docs/advanced/extend-push-example-1.png) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-snmp.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-snmp.md new file mode 100644 index 00000000000..3ff65d60a17 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-snmp.md @@ -0,0 +1,209 @@ +--- +id: extend-snmp +title: SNMP协议自定义监控 +sidebar_label: SNMP协议自定义监控 +--- +> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用 SNMP 协议自定义指标监控。 +> SNMP 协议自定义监控可以让我们很方便的通过配置 Mib OID信息 就能监控采集到我们想监控的OID指标 + +### SNMP协议采集流程 +【**对端开启SNMP服务**】->【**HertzBeat直连对端SNMP服务**】->【**根据配置抓取对端OID指标信息**】->【**指标数据提取**】 + +由流程可见,我们自定义一个SNMP协议的监控类型,需要配置SNMP请求参数,配置获取哪些指标,配置查询OID信息。 + +### 数据解析方式 + +通过配置监控模版YML的指标`field`, `aliasFields`, `snmp` 协议下的 `oids`来抓取对端指定的数据并解析映射。 + + + +### 自定义步骤 + +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) + +------- +下面详细介绍下文件的配置用法,请注意看使用注释。 + +### 监控模版YML + +> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 +> 即我们通过自定义这个YML,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 + +样例:自定义一个名称为 example_windows 的自定义监控类型,其使用 SNMP 协议采集指标数据。 + + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring +# 监控类型所属类别: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... +app: windows +# The monitoring i18n name +# 监控类型国际化名称 +name: + zh-CN: Windows操作系统 + en-US: OS Windows +# 监控所需输入参数定义(根据定义渲染页面UI) +# Input params define for monitoring(render web ui by the definition) +params: + # field-param field key + # field-变量字段标识符 + - field: host + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 主机Host + en-US: Host + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: host + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # field-param field key + # field-变量字段标识符 + - field: port + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 端口 + en-US: Port + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: number + # when type is number, range is required + # 当type为number时,用range表示范围 + range: '[0,65535]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # default value + # 默认值 + defaultValue: 161 + # field-param field key + # field-变量字段标识符 + - field: version + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: SNMP 版本 + en-US: SNMP Version + # type-param field type(radio mapping the html radio tag) + # type-当type为radio时,前端用radio展示开关 + type: radio + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} + # 当type为radio单选框, checkbox复选框时, option表示可选项值列表 {name1:value1,name2:value2} + options: + - label: SNMPv1 + value: 0 + - label: SNMPv2c + value: 1 + # field-param field key + # field-变量字段标识符 + - field: community + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: SNMP 团体字 + en-US: SNMP Community + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: text + # when type is text, use limit to limit string length + # 当type为text时,用limit表示字符串限制大小 + limit: 100 + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: true + # 参数输入框提示信息 + # param field input placeholder + placeholder: 'Snmp community for v1 v2c' + # field-param field key + # field-变量字段标识符 + - field: timeout + # name-param field display i18n name + # name-参数字段显示名称 + name: + zh-CN: 超时时间(ms) + en-US: Timeout(ms) + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) + type: number + # when type is number, range is required + # 当type为number时,用range表示范围 + range: '[0,100000]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 + required: false + # hide-is hide this field and put it in advanced layout + # hide-是否隐藏此参数将其放入高级设置中 + hide: true + # default value + # 默认值 + defaultValue: 6000 +# collect metrics config list +# 采集指标配置列表 +metrics: + # metrics - system + # 监控指标 - system + - name: system + # 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的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 + priority: 0 + # collect metrics content + # 具体监控指标列表 + fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-if is metrics label + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), instance-是否是指标集合唯一标识符字段 + - field: name + type: 1 + - field: descr + type: 1 + - field: uptime + type: 1 + - field: numUsers + type: 0 + - field: services + type: 0 + - field: processes + type: 0 + - field: responseTime + type: 0 + unit: ms + - field: location + type: 1 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: snmp + # the config content when protocol is snmp + snmp: + # server host: ipv4 ipv6 domain + host: ^_^host^_^ + # server port + port: ^_^port^_^ + # snmp connect timeout + timeout: ^_^timeout^_^ + # snmp community + # snmp 团体字 + community: ^_^community^_^ + # snmp version + version: ^_^version^_^ + # snmp operation: get, walk + operation: get + # metrics oids: metric_name - oid_value + oids: + name: 1.3.6.1.2.1.1.5.0 + descr: 1.3.6.1.2.1.1.1.0 + uptime: 1.3.6.1.2.1.25.1.1.0 + numUsers: 1.3.6.1.2.1.25.1.5.0 + services: 1.3.6.1.2.1.1.7.0 + processes: 1.3.6.1.2.1.25.1.6.0 + location: 1.3.6.1.2.1.1.6.0 +``` diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-ssh.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-ssh.md similarity index 92% rename from home/versioned_docs/version-v1.1.x/advanced/extend-ssh.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-ssh.md index b9fdf892f7a..8284726e661 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-ssh.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-ssh.md @@ -3,7 +3,7 @@ id: extend-ssh title: SSH协议自定义监控 sidebar_label: SSH协议自定义监控 --- -> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用SSH协议自定义指标监控。 +> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用SSH协议自定义指标监控。 > SSH协议自定义监控可以让我们很方便的通过写sh命令脚本就能监控采集到我们想监控的Linux指标 ### SSH协议采集流程 @@ -57,20 +57,20 @@ total used free buff_cache available ### 自定义步骤 -配置自定义监控类型需新增配置YML文件 -1. 用监控类型命名的监控配置定义文件 - 例如:example_linux.yml 需位于安装目录 /hertzbeat/define/ 下 -2. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。 +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -> **点击保存应用** -> **使用新监控类型添加监控** + +![](/img/docs/advanced/extend-point-1.png) ------- 下面详细介绍下文件的配置用法,请注意看使用注释。 -### 监控配置定义文件 +### 监控模版YML > 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数结构定义(前端页面根据配置自动渲染UI), 采集指标信息, 采集协议配置* 等。 -> 即我们通过自定义这个YML文件,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 +> 即我们通过自定义这个YML,配置定义什么监控类型,前端页面需要输入什么参数,采集哪些性能指标,通过什么协议去采集。 样例:自定义一个名称为example_linux的自定义监控类型,其使用SSH协议采集指标数据。 -文件名称: example_linux.yml 位于 /define/example_linux.yml + ```yaml # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 @@ -103,7 +103,7 @@ params: zh-CN: 用户名 en-US: Username type: text - limit: 20 + limit: 50 required: true - field: password name: @@ -111,6 +111,7 @@ params: en-US: Password type: password required: true +# collect metrics config list # 采集指标配置列表 metrics: # 第一个监控指标 basic @@ -124,7 +125,7 @@ metrics: # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - field: hostname type: 1 - instance: true + label: true - field: version type: 1 - field: uptime diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-tutorial.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-tutorial.md similarity index 58% rename from home/versioned_docs/version-v1.1.x/advanced/extend-tutorial.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-tutorial.md index 335fa2cb56f..c536fabf6c4 100644 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-tutorial.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/advanced/extend-tutorial.md @@ -1,10 +1,10 @@ --- id: extend-tutorial -title: 快速教程:自定义适配一款基于HTTP协议的监控 -sidebar_label: 快速教程 +title: 自定义适配一款基于HTTP协议的新监控类型 +sidebar_label: 教程案例 --- -通过此教程我们一步一步描述如何在hertzbeat监控系统下自定义新增适配一款基于http协议的监控类型。 +通过此教程我们一步一步描述如何在 Apache HertzBeat (incubating) 系统下自定义新增适配一款基于 http 协议的监控类型。 阅读此教程前我们希望您已经从[自定义监控](extend-point)和[http协议自定义](extend-http)了解熟悉了怎么自定义类型,指标,协议等。 @@ -59,38 +59,62 @@ sidebar_label: 快速教程 **我们这次获取其app下的 `category`,`app`,`status`,`size`,`availableSize`等指标数据。** -### 新增对应的应用定义YML和参数定义YML +### 新增配置监控模版YML -1. 自定义监控类型需新增配置YML文件 +**HertzBeat页面** -> **监控模版菜单** -> **新增监控类型** -> **配置自定义监控模版YML** -用监控类型命名的监控配置定义文件 - 例如:app-hertzbeat.yml 需位于安装目录 /hertzbeat/define/ 下 +定义我们在页面上需要输入哪些参数,一般的HTTP协议参数主要有ip, port, headers, params, uri, 账户密码等,我们直接复用 `api`监控模版 里面的参数定义内容,删除其中的我们不需要输入的uri参数和keyword关键字等参数即可。 -定义我们在页面上需要输入哪些参数,一般的HTTP协议参数主要有ip, port, headers, params, uri, 账户密码等,我们直接复用 param-api.yml 里面的参数定义内容,删除其中的我们不需要输入的uri参数和keyword关键字等参数即可。 - -定义采集类型是啥,需要用哪种协议采集方式,采集的指标是啥,协议的配置参数等。我们直接复用 app-api.yml 里面的定义内容,修改为我们当前的监控类型`hertzbeat`配置参数即可,如下:注意⚠️我们这次获取接口响应数据中的`category`,`app`,`status`,`size`,`availableSize`等字段作为指标数据。 +定义采集类型是啥,需要用哪种协议采集方式,采集的指标是啥,协议的配置参数等。我们直接复用 `api`监控模版 里面的定义内容,修改为我们当前的监控类型`hertzbeat`配置参数即可,如下:注意⚠️我们这次获取接口响应数据中的`category`,`app`,`status`,`size`,`availableSize`等字段作为指标数据。 ```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: custom -# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... +# The monitoring type eg: linux windows tomcat mysql aws... +# 监控类型 eg: linux windows tomcat mysql aws... app: hertzbeat +# The monitoring i18n name +# 监控类型国际化名称 name: zh-CN: HertzBeat监控系统 en-US: HertzBeat Monitor +# Input params define for monitoring(render web ui by the definition) +# 监控所需输入参数定义(根据定义渲染页面UI) params: + # field-param field key + # field-字段名称标识符 - field: host + # name-param field display i18n name + # name-参数字段显示名称 name: zh-CN: 主机Host en-US: Host + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) type: host + # required-true or false + # 是否是必输项 true-必填 false-可选 required: true + # field-param field key + # field-变量字段标识符 - field: port + # name-param field display i18n name + # name-参数字段显示名称 name: zh-CN: 端口 en-US: Port + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) type: number + # when type is number, range is required + # 当type为number时,用range表示范围 range: '[0,65535]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 required: true + # default value + # 端口默认值 defaultValue: 1157 - field: ssl name: @@ -122,7 +146,7 @@ params: zh-CN: 用户名 en-US: Username type: text - limit: 20 + limit: 50 required: false hide: true - field: password @@ -132,23 +156,23 @@ params: type: password required: false hide: true -# 采集指标配置列表 metrics: - # 第一个监控指标 summary - # 注意:内置监控指标有 (responseTime - 响应时间) + # the first metrics summary + # attention: Built-in monitoring metrics contains (responseTime - Response time) - name: summary + # 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的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 priority: 0 + # collect metrics content # 具体监控指标列表 fields: + # metrics content contains field-metric name, type-metric type:0-number,1-string, label-if is metrics label, unit-metric unit('%','ms','MB') # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - - field: responseTime - type: 0 - unit: ms - field: app type: 1 - instance: true + label: true - field: category type: 1 - field: status @@ -156,43 +180,52 @@ metrics: - field: size type: 0 - field: availableSize - type: 0 -# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk, 我们这里使用HTTP协议 + type: 0 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here + # 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk, 我们这里使用HTTP协议 protocol: http -# 当protocol为http协议时具体的采集配置 + # the config content when protocol is http + # 当protocol为http协议时具体的采集配置 http: + # http host: ipv4 ipv6 domain # 主机host: ipv4 ipv6 域名 host: ^_^host^_^ + # http port # 端口 port: ^_^port^_^ + # http url, we don't need to enter a parameter here, just set the fixed value to /api/summary # url请求接口路径,我们这里不需要输入传参,写死为 /api/summary url: /api/summary timeout: ^_^timeout^_^ - # 请求方式 GET POST PUT DELETE PATCH,写死为 + # http method: GET POST PUT DELETE PATCH, default fixed value is GET + # 请求方式 GET POST PUT DELETE PATCH,写死为 GET method: GET + # if enabled https, default value is false # 是否启用ssl/tls,即是http还是https,默认false ssl: ^_^ssl^_^ + # http auth # 认证 authorization: + # http auth type: Basic Auth, Digest Auth, Bearer Token # 认证方式: Basic Auth, Digest Auth, Bearer Token type: ^_^authType^_^ basicAuthUsername: ^_^username^_^ basicAuthPassword: ^_^password^_^ digestAuthUsername: ^_^username^_^ digestAuthPassword: ^_^password^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, we use jsonpath to parse response data here # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控,我们这里使用jsonpath来解析响应数据 parseType: jsonPath - parseScript: '$.data.apps.*' - + parseScript: '$.data.apps.*' ``` -**新增完毕,现在我们重启hertzbeat系统。我们可以看到系统页面已经多了一个`hertzbeat`监控类型了。** +**点击保存并应用。我们可以看到系统页面的自定义监控菜单已经多了一个`hertzbeat`监控类型了。** ![](/img/docs/advanced/extend-http-example-1.png) -### 系统页面添加对`hertzbeat`监控类型的监控 +### 页面添加对`hertzbeat`监控类型的监控 > 我们点击新增 `HertzBeat监控系统`,配置监控IP,端口,采集周期,高级设置里的账户密码等, 点击确定添加监控。 @@ -218,10 +251,5 @@ metrics: #### 完! -HTTP协议的自定义监控的实践就到这里,HTTP协议还带其他参数headers,params等,我们可以像用postman一样去定义它,可玩性也非常高! - -如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯! - -**github: https://github.com/apache/hertzbeat** +HTTP协议的自定义监控的实践就到这里,HTTP协议还带其他参数 `headers,params` 等,我们可以像用postman一样去定义它,可玩性也非常高! -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/become_committer.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/become_committer.md new file mode 100644 index 00000000000..c91cdca7171 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/become_committer.md @@ -0,0 +1,60 @@ +--- +id: 'become_committer' +title: '成为Committer' +sidebar_position: 2 +--- + + + + +## 成为 Apache HertzBeat™ 的 Committer + +任何支持社区并在 CoPDoC 领域中工作的人都可以成为 Apache HertzBeat 的 Committer。CoPDoC 是 ASF 的缩写,用来描述我们如何不仅仅通过代码来认识到您的贡献。 + +- **Community** - 你可以通过我们的邮件列表、问题追踪器、讨论页面与社区成员互动,并分享愿景和知识。 +- **Project** - 需要明确的愿景和共识。 +- **Documentation** - 没有它,内容只会停留在作者的头脑中。 +- **Code** - 没有代码,讨论就毫无意义。 + +Apache HertzBeat 社区努力追求基于功绩的原则。因此,一旦有人在 CoPDoC 的任何领域有了足够的贡献,他们就可以成为 Committer 的候选人,最终被投票选为 HertzBeat 的 Committer。成为 Apache HertzBeat 的 Committer 并不一定意味着你必须使用你的提交权限向代码库提交代码;它意味着你致力于 HertzBeat 项目并为我们社区的成功做出了积极的贡献。 + +## Committer 的要求: + +没有成为 Committer 或 PPMC 成员的严格规则。新的 Committer 的候选人通常是积极的贡献者和社区成员。但是,如果能稍微明确一些规则,就可以在一定程度上消除贡献者的疑虑,使社区更加透明、合理和公平。 + +### 持续的贡献 + +Committer 的候选人应该持续参与并为 HertzBeat 做出大量的贡献(例如修复漏洞、添加新功能、编写文档、维护问题板、代码审查或回答社区问题),无论是向主网站的代码库还是 HertzBeat 的 GitHub 仓库贡献。 + +- +3 个月的轻度活动和参与。 +- +2 个月的中度活动和参与。 +- +1 个月的高度活动和参与。 + +### 贡献的质量 + +- 对项目有深入的理解。 +- 经过充分测试、良好设计、遵循 Apache HertzBeat 的编码标准,及简单的修复补丁。 +- 井井有条的面向用户的详细文档。 + +### 社区参与 + +- 在开发邮件列表上保持积极、礼貌与尊重,并帮助指导新的贡献者和用户。 +- 在项目维护的问题跟踪器上积极、有礼貌与尊重。 +- 对于拉取请求审查保持积极、有礼貌与尊重。 +- 即使存在分歧,也要以专业和外交的态度参与技术路线图的讨论。 +- 通过撰写文章或举办活动来推广项目。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/become_pmc_member.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/become_pmc_member.md new file mode 100644 index 00000000000..e64661b7595 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/become_pmc_member.md @@ -0,0 +1,58 @@ +--- +id: 'become_pmc_member' +title: '成为PMC member' +sidebar_position: 3 +--- + + + +## 成为 Apache HertzBeat™ 的 PMC 成员 + +任何支持社区并在 CoPDoC 领域中工作的人都可以成为 Apache HertzBeat 的PMC 成员。CoPDoC 是 ASF 的缩写,用来描述我们如何不仅仅通过代码来认识到您的贡献。 + +- **Community** - 您可以通过我们的邮件列表、问题追踪器、讨论页面与社区成员互动,并分享愿景和知识。 +- **Project** - 需要明确的愿景和共识。 +- **Documentation** - 没有它,内容只会停留在作者的头脑中。 +- **Code** - 没有代码,讨论就毫无意义。 + +Apache HertzBeat 社区努力追求基于功绩的原则。因此,一旦有人在 CoPDoC 的任何领域有了足够的贡献,他们就可以成为 PMC 成员资格的候选人,最终被投票选为 HertzBeat 的 PMC 成员。成为 Apache HertzBeat 的 PMC 成员并不一定意味着您必须使用您的提交权限向代码库提交代码;它意味着您致力于 HertzBeat 项目并为我们社区的成功做出了积极的贡献。 + +## PMC 成员的要求: + +没有成为 Committer 或 PPMC 成员的严格规则。新的 PMC 成员的候选人通常是积极的贡献者和社区成员。但是,如果能稍微明确一些规则,就可以在一定程度上消除贡献者的疑虑,使社区更加透明、合理和公平。 + +### 持续的贡献 + +PMC 成员的候选人应该持续参与并为 HertzBeat 做出大量的贡献(例如修复漏洞、添加新功能、编写文档、维护问题板、代码审查或回答社区问题),无论是向主网站的代码库还是 HertzBeat 的 GitHub 仓库贡献。 + +- +5 个月的轻度活动和参与。 +- +4 个月的中度活动和参与。 +- +3 个月的高度活动和参与。 + +### 贡献的质量 +- 对项目有深入的理解。 +- 经过充分测试、良好设计、遵循 Apache HertzBeat 的编码标准,及简单的修复补丁。 +- 井井有条的面向用户的详细文档。 + +### 社区参与 + +- 在开发邮件列表上保持积极、礼貌与尊重,并帮助指导新的贡献者和用户。 +- 在项目维护的问题跟踪器上积极、有礼貌与尊重。 +- 对于拉取请求审查保持积极、有礼貌与尊重。 +- 即使存在分歧,也要以专业和外交的态度参与技术路线图的讨论。 +- 通过撰写文章或举办活动来推广项目。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/code-style-and-quality-guide.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/code-style-and-quality-guide.md new file mode 100644 index 00000000000..a9a6f54d474 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/code-style-and-quality-guide.md @@ -0,0 +1,577 @@ +--- +id: 'code_style_and_quality_guide' +title: '代码风格和质量指南' +sidebar_position: 3 +--- + + + + +## 1 拉取请求与变更规则 + +1. `ISSUE`/`PR`(拉取请求) 的引导和命名 + + - 新建 `PR` 后需要在 `PR` 页面的 Github Development 按钮处关联已存在的对应 `ISSUE`(若无建议新建对应ISSUE) + + - 标题命名格式(英文,小写) + `[feature/bugfix/doc/improve/refactor/bug/cleanup] title` + +2. 添加描述信息 + + - 新建 `PR` 时请仔细描述此贡献,描述文档和代码同样重要。审阅者可以从描述中,而不仅仅是从代码中,了解问题和解决方案。 + - 勾选是否完成了对应的 Checklist。 + +3. 建议一次 `PR` 只包含一个功能/一种修复/一类改进/一种重构/一次清理/一类文档等 + +4. 提交消息(英文,小写,无特殊字符) + 消息的提交应遵循与 `PR` 类似的模式:`[feature/bugfix/doc/improve/refactor/bug/cleanup] title` + +## 2 代码检查样式 + +### 2.1 配置 Checkstyle + +1. 安装 Checkstyle-IDEA 插件. +2. 打开 Checkstyle 设置. 点击 **Settings** → **Tools** → **Checkstyle**。 +3. 设置 **Checkstyle version** 的版本为: **10.14.2**。 +4. 设置 **Scan scope** 为 **Only Java sources (including tests)**。 +5. 点击 **+** 按钮在 **Configuration** 部分打开一个对话框选择 checkstyle 配置文件。 + 1. 输入描述名称,比如:hertzbeat。 + 2. 选择 **Use a local checkstyle file**。 + 3. 设置 **File** 路径为: **script/checkstyle/checkstyle.xml**。 + 4. 选择 **Store relative to project location**。 + 5. 点击 **Next** → **Next** → **Finish**。 +6. 激活刚才的 **Checkstyle** 配置。 +7. 点击 **OK**。 + +- 后端代码规范 Maven 插件:`checkstyle` + 后端运行 `mvn checkstyle:checkstyle` + +- 前端代码格式化插件 `eslint` + 前端运行 `npm run lint:fix` + +## 3 编程规范 + +### 3.1 命名风格 + +1. 优先为变量命名选择名词,这样更容易区分`变量`或`方法`。 + ```java + Cache publicKeyCache; + ``` + +2. 变量的拼音缩写是禁止的(排除地名等名词),例如chengdu。 + +3. 推荐的变量名以 `类型` 结尾。 + 对于 `Collection/List` 类型的变量,取 `xxxx` (复数表示多个元素)或以 `xxxList` (特定类型)结束。 + 对于 `map` 类型的变量,清晰地描述 `key` 和 `value`: + ```java + Map idUserMap; + Map userIdNameMap; + ``` + +4. 通过其名称直观地知道变量的类型和含义。 + 方法名称应首先以动词开始,如下所示: + ```java + void computeVcores(Object parameter1); + ``` + > 注意:在 `Builder` 工具类中不必严格遵循这项规则。 + + + +### 3.2 常量变量定义 + +1. 多余的字符串应提取为常量 + >如果一个常量被硬编码两次或多次,请直接提取它为常量并更改相应的引用。 + 通常,`log` 中的常量可以忽略提取。 + + - 负面示例: + + ```java + public static RestResponse success(Object data) { + RestResponse resp = new RestResponse(); + resp.put("status", "success"); + resp.put("code", ResponseCode.CODE_SUCCESS); + resp.put("data", data); + return resp; + } + + public static RestResponse error() { + RestResponse resp = new RestResponse(); + resp.put("status", "error"); + resp.put("code", ResponseCode.CODE_FAIL); + resp.put("data", null); + return resp; + } + ``` + + - 正面示例: + + > 字符串提取为常量引用。 + + ```java + public static final String STATUS = "status"; + public static final String CODE = "code"; + public static final String DATA = "data"; + + public static RestResponse success(Object data) { + RestResponse resp = new RestResponse(); + resp.put(STATUS, "success"); + resp.put(CODE, ResponseCode.CODE_SUCCESS); + resp.put(DATA, data); + return resp; + } + + public static RestResponse error() { + RestResponse resp = new RestResponse(); + resp.put(STATUS, "error"); + resp.put(CODE, ResponseCode.CODE_FAIL); + resp.put(DATA, null); + return resp; + } + ``` + +2. 确保代码的可读性和直观性 + +- `annotation` 符号中的字符串不需要提取为常量。 + +- 被引用的 `package` 或 `resource` 名称不需要提取为常量。 + +3. 未被重新分配的变量也必须声明为 final 类型。 + +4. 关于 `constant/variable` 行的排序顺序 + + 按以下顺序对类中的变量行进行排序: + 1. `public static final V`, `static final V`,`protected static final V`, `private static final V` + 2. `public static v`, `static v`,`protected static v`, `private static v` + 3. `public v`, `v`, `protected v`, `private v` + +### 3.3 方法规则 + +1. 按照 `public`、`protected`、`private` 的顺序对类中的方法进行排序。 + + 类的静态方法可以放在非静态方法之后,并根据一致的方法可见性进行排序。 + +2. 当方法有限制时,方法的参数和返回值需要用 `@Nonnull` 或 `@Nullable` 注释和约束进行注释。 + + 例如,如果参数不能为 null,最好添加一个 `@Nonnull` 注释。如果返回值可以为 null,则应首先添加 `@Nullable` 注释。 + + 注意:包名为 javax.validation.requirements + +3. 如果方法中的代码行数太多,请尝试在适当的点上使用多个子方法来分段方法体。 + + 一般来说,需要坚持以下原则: + - 便于测试 + - 有好的语义 + - 易于阅读 + + 此外,还需要考虑在组件、逻辑、抽象和场景等方面的切割是否合理。 + + > 然而,目前还没有明确的演示定义。在演变过程中,我们将为开发者提供更多的示例,以便他们有更清晰的参考和理解。 + + +### 3.4 集合规则 + +1. 对于返回的 `collection` 值,除非有特殊的 `concurrent` (如线程安全),总是返回 `interface`,例如: + + - 如果使用 `ArrayList`,则返回 List + - 如果使用 `HashMap`,则返回 Map + - 如果使用 `HashSet`,则返回 Set + +2. 如果存在多线程,可以使用以下声明或返回类型: + + ```java + private CurrentHashMap map; + public CurrentHashMap funName(); + ``` + +3. 使用 `isEmpty()` 而不是 `length() == 0` 或者 `size() == 0` + + - 负面示例: + + ```java + if (pathPart.length() == 0) { + return; + } + ``` + + - 正面示例: + + ```java + if (pathPart.isEmpty()) { + return; + } + ``` + +### 3.5 并发处理 + +1. 需要管理 `线程池`,使用统一的入口点获取 `线程池`。 + + 注意:在演变过程中,我们将为开发者提供更多的示例,以便他们有更清晰的参考和理解。 + +2. `线程池` 需要进行资源约束,以防止因处理不当导致的资源泄露。 + +### 3.6 控制/条件语句 + +1. 避免因不合理的 `条件/控制` 分支顺序导致: + + - 多个代码行的 `深度` 为 `n+1` + - 多余的行 + +一般来说,如果一个方法的代码行深度由于连续嵌套的 `if... else..` 超过了 `2+ Tabs`,那么应该考虑试图 +- `合并分支`, +- `反转分支条件` +- `提取私有方法` + +以减少代码行深度并提高可读性,例如: +- 联合或将逻辑合并到下一级调用中 + - 负面示例: + ```java + if (isInsert) { + save(platform); + } else { + updateById(platform); + } + ``` + - 正面示例: + ```java + saveOrUpdate(platform); + ``` +- 合并条件 + - 负面示例: + ```java + if (expression1) { + if(expression2) { + ...... + } + } + ``` + - 正面示例: + ```java + if (expression1 && expression2) { + ...... + } + ``` +- 反转条件 + - 负面示例: + + ```java + public void doSomething() { + // 忽略更深的代码块行 + // ..... + if (condition1) { + ... + } else { + ... + } + } + ``` + + - 正面示例: + + ```java + public void doSomething() { + // 忽略更深的代码块行 + // ..... + if (!condition1) { + ... + return; + } + // ... + } + ``` +- 使用单一变量或方法减少复杂的条件表达式 + - 负面示例: + ```java + if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) { + ... + } + ``` + + - 正面示例: + ```java + if (containsSqlServer(dbType)) { + .... + } + //..... + // containsSqlServer的定义 + ``` + +> 在未来,使用 `sonarlint` 和 `better highlights` 检查代码深度看起来是个不错的选择。 + +### 3.7 代码注释规则 + +1. 方法缺少注释: + + - `When`:该方法何时可以被调用 + - `How`:如何使用此方法以及如何传递参数等 + - `What`:此方法实现了哪些功能 + - `Note`:在调用此方法时开发人员应注意什么 + +2. 缺少必要的类头部描述注释。 + + 添加 `What`,`Note` 等,如上述 `1` 中提到的。 + +3. 在接口中的方法声明必须被注释。 + + - 如果实现的语义和接口声明的注释内容不一致,则具体的实现方法也需要用注释重写。 + + - 如果方法实现的语义与接口声明的注释内容一致,则建议不写注释以避免重复的注释。 + +4. 在注释行中的第一个词需要大写,如 `param` 行,`return` 行。 + 如果特殊引用作为主题不需要大写,需要注意特殊符号,例如引号。 + +### 3.8 Java Lambda 表达式 + +1. 更倾向于使用 `non-capturing` lambda(不包含对外部范围的引用的lambda)。 + Capturing lambda 在每次调用时都需要创建一个新的对象实例。`Non-capturing` lambda 可以为每次调用使用相同的实例。 + + - 负面示例: + + ```java + map.computeIfAbsent(key, x -> key.toLowerCase()) + ``` + + - 正面示例: + + ```java + map.computeIfAbsent(key, k -> k.toLowerCase()); + ``` + +2. 考虑使用方法引用而不是内联lambda + + - 负面示例: + + ```java + map.computeIfAbsent(key, k-> Loader.load(k)); + ``` + + - 正面示例: + + ```java + map.computeIfAbsent(key, Loader::load); + ``` + +### 3.9 Java Streams + +- 在任何对性能敏感的代码中避免使用 Java Streams。 + +- 使用 Java Streams 的主要动机是为了提高代码的可读性。因此,它们可以在代码的某些部分中很好地匹配,这些部分不是数据密集型的,而是处理协调。 + +- 即使在后一种情况下,也试图限制范围到一个方法,或者一个内部类中的几个私有方法。 + +### 3.10 前置条件检查 + +1. 使用统一的 `Utils.requireXXX` 来完成前提的验证,如果可能的话,用新的前置条件检查替换 `AlertXXException.throwIfXXX`。 + +### 3.11 StringUtils + +1. 使用 `StringUtils.isBlank` 而不是 `StringUtils.isEmpty` + + - 负面示例: + + ```java + if (StringUtils.isEmpty(name)) { + return; + } + ``` + + - 正面示例: + + ```java + if (StringUtils.isBlank(name)) { + return; + } + ``` + +2. 使用 `StringUtils.isNotBlank` 而不是 `StringUtils.isNotEmpty` + + - 负面示例: + + ```java + if (StringUtils.isNotEmpty(name)) { + return; + } + ``` + + - 正面示例: + + ```java + if (StringUtils.isNotBlank(name)) { + return; + } + ``` + +3. 使用 `StringUtils.isAllBlank` 而不是 `StringUtils.isAllEmpty` + + - 负面示例: + + ```java + if (StringUtils.isAllEmpty(name, age)) { + return; + } + ``` + + - 正面示例: + + ```java + if (StringUtils.isAllBlank(name, age)) { + return; + } + ``` + +### 3.12 `Enum` 类 + +1. 枚举值比较 + + - 负面示例: + + ```java + if (status.equals(JobStatus.RUNNING)) { + return; + } + ``` + + - 正面示例: + + ```java + if (status == JobStatus.RUNNING) { + return; + } + ``` + +2. 枚举类不需要实现 Serializable + + - 负面示例: + + ```java + public enum JobStatus implements Serializable { + ... + } + ``` + + - 正面示例: + + ```java + public enum JobStatus { + ... + } + ``` + +3. 使用 `Enum.name()` 而不是 `Enum.toString()` + + - 负面示例: + + ```java + System.out.println(JobStatus.RUNNING.toString()); + ``` + + - 正面示例: + + ```java + System.out.println(JobStatus.RUNNING.name()); + ``` + +4. 枚举类名称统一使用 Enum 后缀 + + - 负面示例: + + ```java + public enum JobStatus { + ... + } + ``` + + - 正面示例: + + ```java + public enum JobStatusEnum { + ... + } + ``` + +### 3.13 `Deprecated` 注解 + + - 负面示例: + + ```java + @deprecated + public void process(String input) { + ... + } + ``` + + - 正面示例: + + ```java + @Deprecated + public void process(String input) { + ... + } + ``` + +## 4 日志 + +1. 使用 `占位符` 进行日志输出: + + - 负面示例 + ```java + log.info("Deploy cluster request " + deployRequest); + ``` + - 正面示例 + ```java + log.info("load plugin:{} to {}", file.getName(), appPlugins); + ``` + +2. 打印日志时,注意选择 `日志级别` + + 当打印日志内容时,如果传递了日志占位符的实际参数,必须避免过早评估,以避免由日志级别导致的不必要评估。 + + - 负面示例: + + 假设当前日志级别为 `INFO`: + + ```java + // 忽略声明行。 + List userList = getUsersByBatch(1000); + LOG.debug("All users: {}", getAllUserIds(userList)); + ``` + + - 正面示例: + + 在这种情况下,我们应该在进行实际的日志调用之前提前确定日志级别,如下所示: + + ```java + // 忽略声明行。 + List userList = getUsersByBatch(1000); + if (LOG.isDebugEnabled()) { + LOG.debug("All ids of users: {}", getAllIDsOfUsers(userList)); + } + ``` + +## 5 测试 + +1. 建议使用 `JUnit5` 进行测试用例的准备。 + +2. 实现的接口需在`e2e`模块下编写`e2e`测试用例脚本。 + + +## 参考资料 +- https://site.mockito.org/ +- https://alibaba.github.io/p3c/ +- https://rules.sonarsource.com/java/ +- https://junit.org/junit5/ +- https://streampark.apache.org/ diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contact.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contact.md new file mode 100644 index 00000000000..72f147b11c3 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contact.md @@ -0,0 +1,24 @@ +--- +id: contact +title: 交流联系 +sidebar_label: 交流联系 +--- +> 如果您在使用过程有任何需要帮助或者想交流建议,可以通过 群 ISSUE 讨论交流。 + +[订阅邮件列表](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) : 发送邮件至 `dev-subscribe@hertzbeat.apache.org` 来订阅邮件列表. + +[Chat On Discord](https://discord.gg/Fb6M73htGr) + +微信交流群 : 加 `tan-cloud` 好友邀请进群. + +微信公众号 : 搜索 ID `usthecom`. + +[QQ交流群](https://jq.qq.com/?_wv=1027&k=Bud9OzdI) : 群号 `630061200` + +[Github Discussion](https://github.com/apache/hertzbeat/discussions) + +[Reddit Community](https://www.reddit.com/r/hertzbeat/) + +[Follow Us Twitter](https://twitter.com/hertzbeat1024) + +[Subscribe YouTube](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) diff --git a/home/versioned_docs/version-v1.1.x/others/contributing.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contribution.md similarity index 71% rename from home/versioned_docs/version-v1.1.x/others/contributing.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contribution.md index 2515bb1cf0b..314571f8fc9 100644 --- a/home/versioned_docs/version-v1.1.x/others/contributing.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/contribution.md @@ -1,9 +1,26 @@ --- -id: contributing -title: 贡献者指南 -sidebar_label: 贡献者指南 +id: contribution +title: 贡献指南 +sidebar_position: 0 --- + + > 非常欢迎参与项目贡献,我们致力于维护一个互相帮助的快乐社区。 ### 贡献方式 @@ -33,20 +50,31 @@ sidebar_label: 贡献者指南 > 让 HertzBeat 的代码在您的开发工具上运行起来,并且能够断点调试。 > 此为前后端分离项目,本地代码启动需将后端 [manager](https://github.com/apache/hertzbeat/tree/master/manager) 和前端 [web-app](https://github.com/apache/hertzbeat/tree/master/web-app) 分别启动生效。 -- 后端启动 +#### 后端启动 + +1. 需要 `maven3+`, `java17` 和 `lombok` 环境 + +2. (可选)修改配置文件配置信息-`manager/src/main/resources/application.yml` + +3. 在项目根目录运行编译: `mvn clean install -DskipTests` + +4. 启动`springboot manager`服务 `manager/src/main/java/org/apache/hertzbeat/manager/Manager.java` -1. 需要`maven3+`, `java11+`和`lombok`环境 -2. 修改配置文件的依赖服务地址等信息-`manager/src/main/resources/application.yml` -3. 启动`springboot manager`服务 `manager/src/main/java/com/usthe/manager/Manager.java` +#### 前端启动 -- 前端启动 +1. 需要 `nodejs yarn` 环境, Make sure `Node.js >= 18` -1. 需要`nodejs npm angular-cli`环境 -2. 安装yarn `npm install -g yarn` -3. 在前端工程目录web-app下执行 `yarn install` -4. 全局安装angular-cli `npm install -g @angular/cli@14 --registry=https://registry.npm.taobao.org` -5. 待本地后端启动后,在web-app目录下启动本地前端 `ng serve --open` -6. 浏览器访问 localhost:4200 即可开始,默认账号密码 admin/hertzbeat +2. 进入 `web-app` 目录: `cd web-app` + +3. 安装yarn: `npm install -g yarn` + +4. 在前端工程目录 `web-app` 下执行: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app` + +5. 全局安装 `angular-cli`: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com` + +6. 待本地后端启动后,在web-app目录下启动本地前端 `ng serve --open` + +7. 浏览器访问 localhost:4200 即可开始,默认账号密码 admin/hertzbeat** ### 寻找任务 @@ -88,7 +116,7 @@ git push origin a-feature-branch 另外,我们的项目有比较规范和严格的 CI 检查流程,在提交 PR 之后会触发 CI,请注意是否通过 CI 检查。 -最后,Committer 可以将 PR 合并入DEV主分支。 +最后,Committer 可以将 PR 合并入 master 主分支。 ### 代码被合并后 @@ -113,7 +141,7 @@ git pull upstream master ### 加入讨论交流 -[Github Discussion](https://github.com/usthe/hertzbeat/discussions) +[Github Discussion](https://github.com/apache/hertzbeat/discussions) 加微信号 `tan-cloud` 拉您进微信交流群 @@ -129,3 +157,5 @@ git pull upstream master > 告警计算触发,任务状态联动,告警配置,告警通知。 - **[web-app](https://github.com/apache/hertzbeat/tree/master/web-app)** 提供可视化控制台页面 > 监控告警系统可视化控制台前端 + +![hertzBeat](/img/docs/hertzbeat-arch.png) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/development.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/development.md new file mode 100644 index 00000000000..2bfebd21d2f --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/development.md @@ -0,0 +1,74 @@ +--- +id: development +title: 如何将 HertzBeat 运行编译? +sidebar_label: 运行编译 +--- + +## 让 HertzBeat 运行起来 + +> 让 HertzBeat 的代码在您的开发工具上运行起来,并且能够断点调试。 +> 此为前后端分离项目,本地代码启动需将后端 [manager](https://github.com/apache/hertzbeat/tree/master/manager) 和前端 [web-app](https://github.com/apache/hertzbeat/tree/master/web-app) 分别启动生效。 + + +### 后端启动 + +1. 需要 `maven3+`, `java17` 和 `lombok` 环境 + +2. (可选)修改配置文件配置信息-`manager/src/main/resources/application.yml` + +3. 在项目根目录运行编译: `mvn clean install -DskipTests` + +4. 启动`springboot manager`服务 `manager/src/main/java/org/apache/hertzbeat/manager/Manager.java` + +### 前端启动 + +1. 需要 `nodejs yarn` 环境, 版本要求 `Node.js >= 18` + +2. 进入 `web-app` 目录: `cd web-app` + +3. 安装yarn: `npm install -g yarn` + +4. 在前端工程目录 `web-app` 下执行: `yarn install` 或者 `yarn install --registry=https://registry.npmmirror.com` + +5. 全局安装 `angular-cli`: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com` + +6. 待本地后端启动后,在web-app目录下启动本地前端 `ng serve --open` + +7. 浏览器访问 localhost:4200 即可开始,默认账号密码 admin/hertzbeat + +## 生成二进制包 + +> 需要 `maven3+`, `java17`, `node` 和 `yarn` 环境. + +### 前端打包 + +1. 需要 `Node Yarn` 环境, 版本要求 `Node.js >= 18` + +2. 切换到 `web-app` 目录: `cd web-app` + +3. 安装 yarn: `npm install -g yarn` + +4. 安装本项目依赖: `yarn install` 或 `yarn install --registry=https://registry.npmmirror.com` + +5. 打包: `yarn package` + + +### 后端打包 + +1. 需要 `maven3+`, `java17` 环境 + +2. 在项目根目录运行: `mvn clean package -Prelease` + +HertzBeat 包将生成为 `dist/hertzbeat-{version}.tar.gz` + +### 采样器打包 + +1. 需要 `maven3+`, `java17` 环境 + +2. 在项目根目录运行: `mvn clean install` + +3. 切换到 `collector` 目录: `cd collector` + +4. 在 `collector` 目录下执行: `mvn clean package -Pcluster` + +HertzBeat 采样器包将生成为 `dist/hertzbeat-collector-{version}.tar.gz` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/document.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/document.md new file mode 100644 index 00000000000..e696b3c35e4 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/document.md @@ -0,0 +1,95 @@ +--- +id: 'document' +title: '文档说明' +sidebar_position: 1 +--- + + + +对于任何类型的软件来说,良好的文档都是至关重要的。任何能够改进 HertzBeat 文档的贡献都是受欢迎的。 + +## 获取文档项目 + +HertzBeat 项目的文档在 [git 仓库 home 目录](https://github.com/apache/hertzbeat/tree/master/home) 中维护。 + +首先,您需要将文档项目 fork 到您自己的 github 仓库,然后将文`clone`到您的本地计算机。 + +```shell +git clone git@github.com:/hertzbeat.git +``` + +## 预览和生成静态文件 + +此网站使用 node 进行编译,使用 Docusaurus 框架组件。 + +1. 下载并安装 nodejs (版本 18.8.0) +2. 将代码克隆到本地 `git clone git@github.com:apache/hertzbeat.git` +3. 在`home`目录下运行 `npm install` 来安装所需的依赖库。 +4. 在`home`目录下运行 `npm run start`,您可以访问 http://localhost:3000 查看站点的英文模式预览 +5. 在`home`目录下运行 `npm run start-zh-cn`,您可以访问 http://localhost:3000 查看站点的中文模式预览 +6. 若要生成静态网站资源文件,请运行 `npm run build`。构建的静态资源位于 build 目录中。 + +## 目录结构 + +```html +|-- docs +|-- blog +|-- i18n +| `-- zh-CN // 中文国际化 +| |-- code.json +| |-- docusaurus-plugin-content-blog +| |-- docusaurus-plugin-content-docs +| `-- docusaurus-theme-classic +|-- resource // 静态资源文件 +|-- src +| |-- theme +| |-- css +| |-- js +| |-- pages +| | |-- components +| | |-- index.js +| |-- constants.js +|-- static // 图片静态资源 +| |-- img // +| | |-- blog // 博客图片 +| | |-- docs // 文档图片 +| | |-- home // 产品图片 +| | |-- icons // 图标 +|-- docusaurus.config.js +|-- sidebars.js // 文档侧边栏菜单配置 +``` + +## 规范 + +### 文件的命名规范 + +全部由小写,数字,下划线和破折号组成。 + +正例:`render-dom.js / signup.css / index.html / company-logo.png / hertz_beat.md` + +反例:`renderDom.js / UserManagement.html` + +### 资源路径 + +图片资源统一放在 `static/img/{模块名称}` 下 + +css 和其他样式文件放在 `src/css` 目录中。 + +### 页面内容修改 + +> 所有页面文档都可以通过底部的'编辑此页面'按钮直接跳转到相应的 github 资源修改页面。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-release.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-release.md new file mode 100644 index 00000000000..541444473d2 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-release.md @@ -0,0 +1,612 @@ +--- +id: 'how_to_release' +title: 如何进行版本发布 +sidebar_position: 4 +--- + +本教程详细描述了如何发布Apache HertzBeat,并以 v1.6.0 版本的发布为例。 + +## 1. 环境要求 + +此发布过程在 UbuntuOS(可在 Windows Mac) 中进行操作,并需要以下环境: + +- JDK 17 +- Node18 Yarn +- Apache Maven 3.x +- GnuPG 2.x +- Git +- SVN (Apache使用svn来托管项目发布) + +> 注意需要设置环境变量 `export GPG_TTY=$(tty)` + +## 2. 准备发布 + +> 首先整理帐户信息以更好地了解操作过程,稍后会多次使用。 +- apache id: `muchunjin (APACHE LDAP 用户名)` +- apache passphrase: `APACHE LDAP 密钥` +- apache email: `muchunjin@apache.org` +- gpg real name: `muchunjin (任何名称均可用, 在这里我将其设置为与apache id相同的名称)` +- gpg key passphrase: `创建gpg密钥时设置的密码,你需要记住此密码` + +### 2.1 生成密钥 + +```shell +$ gpg --full-gen-key +gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Please select what kind of key you want: +(1) RSA and RSA (default) +(2) DSA and Elgamal +(3) DSA (sign only) +(4) RSA (sign only) +(14) Existing key from card +Your selection? 1 # Please enter 1 +RSA keys may be between 1024 and 4096 bits long. +What keysize do you want? (3072) 4096 # Please enter 4096 here +Requested keysize is 4096 bits +Please specify how long the key should be valid. +0 = key does not expire + = key expires in n days +w = key expires in n weeks +m = key expires in n months +y = key expires in n years +Key is valid for? (0) 0 # Please enter 0 +Key does not expire at all +Is this correct? (y/N) y # Please enter y here + +GnuPG needs to construct a user ID to identify your key. + +Real name: muchunjin # Please enter 'gpg real name' +Email address: muchunjin@apache.org # Please enter your apache email address here +Comment: apache key # Please enter some comments here +You selected this USER-ID: + "muchunjin (apache key) " + +Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O # Please enter O here +We need to generate a lot of random bytes. It is a good idea to perform +some other action (type on the keyboard, move the mouse, utilize the +disks) during the prime generation; this gives the random number +generator a better chance to gain enough entropy. + +# At this time, a dialog box will pop up, asking you to enter the key for this gpg. +# you need to remember that it will be used in subsequent steps. +┌─────────────────────────────────────────────────────┐ +│ Please enter this passphrase to │ +│ protect your new key │ +│ │ +│ Passphrase: _______________________________________ │ +│ │ +│ │ +└─────────────────────────────────────────────────────┘ + +# Here you need to re-enter the password in the previous step. +┌─────────────────────────────────────────────────────┐ +│ Please re-enter this passphrase │ +│ │ +│ Passphrase: _______________________________________ │ +│ │ +│ │ +└─────────────────────────────────────────────────────┘ +gpg: key ACFB69E705016886 marked as ultimately trusted +gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/DC12398CCC33A5349EB9663DF9D970AB18C9EDF6.rev' +public and secret key created and signed. + +pub rsa4096 2023-05-01 [SC] + 85778A4CE4DD04B7E07813ABACFB69E705016886 +uid muchunjin (apache key) +sub rsa4096 2023-05-01 [E] +``` + +密钥可以通过`gpg --list-signatures`命令查看 + +### 2.2 将生成的密钥上传到公共服务器 + +```shell +$ gpg --keyid-format SHORT --list-keys +/root/.gnupg/pubring.kbx +------------------------ +pub rsa4096/05016886 2023-05-01 [SC] + 85778A4CE4DD04B7E07813ABACFB69E705016886 +uid [ultimate] muchunjin (apache key) +sub rsa4096/0C5A4E1C 2023-05-01 [E] + +# Send public key to keyserver via key id +$ gpg --keyserver keyserver.ubuntu.com --send-key 05016886 +# Among them, keyserver.ubuntu.com is the selected keyserver, it is recommended to use this, because the Apache Nexus verification uses this keyserver +``` + +#### 2.3 检查密钥是否创建成功 + +验证是否已经同步到公共网络,需要一分钟左右才能知道答案,如果不成功,您可以多次上传并重试。 + +```shell +$ gpg --keyserver keyserver.ubuntu.com --recv-keys 05016886 # If the following content appears, it means success +gpg: key ACFB69E705016886: "muchunjin (apache key) " not changed +gpg: Total number processed: 1 +gpg: unchanged: 1 +``` + +或者进入 https://keyserver.ubuntu.com/ 网址,输入密钥的名称,然后点击'Search key' 按钮,查看是否有对应名称的密钥。 + + +#### 2.4 将 gpg 公钥添加到 Apache SVN 项目仓库的 KEYS 文件中 + +- Apache HertzBeat Dev 分支 https://dist.apache.org/repos/dist/dev/incubator/hertzbeat +- Apache HertzBeat Release 分支 https://dist.apache.org/repos/dist/release/incubator/hertzbeat + +##### 2.4.1 将公钥添加到dev分支的KEYS + +```shell +$ mkdir -p svn/dev +$ cd svn/dev + +$ svn co https://dist.apache.org/repos/dist/dev/incubator/hertzbeat +$ cd svn/dev/hertzbeat + +# 将生成的KEY追加到KEYS文件中,检查是否添加正确 +$ (gpg --list-sigs muchunjin@apache.org && gpg --export --armor muchunjin@apache.org) >> KEYS + +$ svn ci -m "add gpg key for muchunjin" +``` + +##### 2.4.2 将公钥添加到release分支的KEYS + +```shell +$ mkdir -p svn/release +$ cd svn/release + +$ svn co https://dist.apache.org/repos/dist/release/incubator/hertzbeat +$ cd svn/release/hertzbeat + +# 将生成的KEY追加到KEYS文件中,检查是否添加正确 +$ (gpg --list-sigs muchunjin@apache.org && gpg --export --armor muchunjin@apache.org) >> KEYS + +$ svn ci -m "add gpg key for muchunjin" +``` + +## 3. 准备物料 & 发布 + +#### 3.1 基于 master 分支,创建一个名为 release-${release_version}-rcx 的分支,例如 release-1.6.0-rc1。并基于 release-1.6.0-rc1 分支创建一个名为 v1.6.0-rc1 的标签,并将此标签设置为预发布。 + +```shell +git checkout master +git checkout -b release-1.6.0-rc1 +``` + +#### 3.2 本地切换到待发布分支 + +```shell +git checkout release-1.6.0-rc1 +``` + +#### 3.3 编译二进制包 + +> HertzBeat 编译打包,在项目`web-app`目录下执行以下命令, + +```shell +yarn install + +yarn package +``` + +> 在项目根目录下执行以下命令 + +```shell +mvn clean package -Prelease +``` + +然后 + +```shell +mvn clean install +``` + +> HertzBeat-Collector 编译打包,在项目`collector`目录下执行以下命令 + +```shell +mvn clean package -Pcluster +``` + +生成的二进制包在: + +- `dist/apache-hertzbeat-{version}-incubating-bin.tar.gz` +- `dist/apache-hertzbeat-collector-{version}-incubating-bin.tar.gz` + +#### 3.4 打包项目源代码 + +> 打包项目源码 + +```shell +git archive \ +--format=tar.gz \ +--output="dist/apache-hertzbeat-1.6.0-incubating-src.tar.gz" \ +--prefix=apache-hertzbeat-1.6.0-incubating-src/ \ +release-1.6.0-rc1 +``` + +生成的代码归档文件在 `dist/apache-hertzbeat-1.6.0-incubating-src.tar.gz` + +#### 3.5 对二进制和源码包进行签名 + +将上步骤生成的三个文件包放到`dist`目录下(若无则新建目录),然后对文件包进行签名和SHA512校验和生成。 + +> 其中 `gpg -u 33545C76` 的 `33545C76` 是你的 GPG 密钥 ID,可以通过 `gpg --keyid-format SHORT --list-keys` 查看。 + +```shell +cd dist + +# sign +for i in *.tar.gz; do echo $i; gpg -u 33545C76 --armor --output $i.asc --detach-sig $i ; done + +# SHA512 +for i in *.tar.gz; do echo $i; sha512sum $i > $i.sha512 ; done + +# if macos sha512sum not found, you can install by brew install coreutils +``` + +> 最终文件列表如下 + +``` +apache-hertzbeat-1.6.0-incubating-src.tar.gz +apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc +apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512 +apache-hertzbeat-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc +apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512 +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512 +``` + +#### 3.6 验证签名 + +```shell +$ cd dist + +# 验证签名 +$ for i in *.tar.gz; do echo $i; gpg --verify $i.asc $i ; done + +apache-hertzbeat-1.6.0-incubating-src.tar.gz +gpg: Signature made Tue May 2 12:16:35 2023 CST +gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886 +gpg: Good signature from "muchunjin (apache key) " [ultimate] +apache-hertzbeat-1.6.0-incubating-bin.tar.gz +gpg: Signature made Tue May 2 12:16:36 2023 CST +gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886 +gpg: Good signature from "muchunjin (apache key) " [ultimate] +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz +gpg: Signature made Tue May 2 12:16:37 2023 CST +gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886 +gpg: BAD signature from "muchunjin (apache key) " [ultimate] + +# 验证 SHA512 +$ for i in *.tar.gz; do echo $i; sha512sum --check $i.sha512; done + +apache-hertzbeat-1.6.0-incubating-src.tar.gz +apache-hertzbeat-1.6.0-incubating-src.tar.gz: OK +apache-hertzbeat-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-1.6.0-incubating-bin.tar.gz: OK +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz: OK +``` + +#### 3.7 发布 Apache SVN 仓库中 dev 目录的物料包 + +- 检出仓库 + +```shell +# 检出 Apache SVN 仓库中的 dev/incubator/hertzbeat 目录到 Apache HertzBeat™ 项目根目录下的 svn/dev 目录下 +svn co https://dist.apache.org/repos/dist/dev/incubator/hertzbeat svn/dev + +svn co --depth empty https://dist.apache.org/repos/dist/dev/incubator/hertzbeat +``` + +- 复制物料包到 SVN 仓库 + +创建一个版本号目录,并以${release_version}-${RC_version}的形式命名。RC_version从1开始,即候选版本从RC1开始。在发布过程中,如果出现导致投票失败的问题,需要进行修正,那么RC版本需要迭代,RC版本号需要+1。例如:为版本1.6.0-RC1投票。如果投票顺利通过,那么RC1版本的资料将作为最终版本的资料发布。如果出现问题(当hertzbeat/incubator社区进行投票时,投票者会严格检查各种发布要求和合规问题)并需要纠正,那么修正后重新启动投票,下一次的候选版本为1.6.0-RC2。 + +```shell +mkdir -p svn/dev/1.6.0-RC1 +cp -f dist/* svn/dev/1.6.0-RC1 +``` + +- 提交到SVN + +```shell +cd svn/dev + +# 1. 检查svn状态 +svn status + +# 2. 添加到svn +svn add 1.6.0-RC1 + +svn status + +# 3. 提交到svn远端服务器 +svn commit -m "release for HertzBeat 1.6.0-RC1" +``` + +- 检查 Apache SVN 提交结果 + +> 在浏览器中访问 https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/ , 检查是否有新的版本内容 + +## 4. 进入社区投票阶段 + +#### 4.1 发送社区投票邮件 + +发送社区投票邮件需要至少三个`+1`,且无`-1`。 + +> `Send to`: dev@hertzbeat.apache.org
+> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0 rc1
+> `Body`: + +``` +Hello HertzBeat Community: + +This is a call for vote to release Apache HertzBeat (incubating) version release-1.6.0-RC1. + +Apache HertzBeat - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +Release notes: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0-rc1 + +The release candidates: +https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1/ + +Git tag for the release: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0-rc1 + +The artifacts signed with PGP key [33545C76], corresponding to [muchunjin@apache.org], that can be found in keys file: +https://downloads.apache.org/incubator/hertzbeat/KEYS + +The vote will be open for at least 72 hours or until the necessary number of votes are reached. + +Please vote accordingly: + +[ ] +1 approve +[ ] +0 no opinion +[ ] -1 disapprove with the reason + +*Valid check is a requirement for a vote. *Checklist for reference: + +[ ] Download HertzBeat are valid. +[ ] Checksums and PGP signatures are valid. +[ ] Source code distributions have correct names matching the current +release. +[ ] LICENSE and NOTICE files are correct for each HertzBeat repo. +[ ] All files have license headers if necessary. +[ ] No compiled archives bundled in source archive. +[ ] Can compile from source. + +More detail checklist please refer: +https://cwiki.apache.org/confluence/display/INCUBATOR/Incubator+Release+Checklist + +Steps to validate the release,Please refer to: +https://hertzbeat.apache.org/docs/community/how_to_verify_release + +How to Build: +https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package + +Thanks! +``` + +在72小时后,将统计投票结果,并发送投票结果邮件,如下所示。 + +> `Send to`: dev@hertzbeat.apache.org
+> `Title`: [RESULT][VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
+> `Body`: + +``` +Dear HertzBeat community, + +Thanks for your review and vote for "Release Apache HertzBeat (incubating) 1.6.0-rc1" +I'm happy to announce the vote has passed: + + +4 binding +1, from: + +- cc + +1 non-binding +1, from: + +- Roc Marshal + + +no 0 or -1 votes. + +Vote thread: +https://lists.apache.org/thread/t01b2lbtqzyt7j4dsbdp5qjc3gngjsdq + + +Thank you to everyone who helped us to verify and vote for this release. We will move to the ASF Incubator voting shortly. + + +Best, +ChunJin Mu +``` + +邮件内容中的一项是`Vote thread`,在 https://lists.apache.org/list.html?dev@hertzbeat.apache.org 查看获取 + + +#### 3.2 发送孵化社区投票邮件 + +发送孵化社区投票邮件需要至少三个`+1`,且无`-1`。 + +> `Send to`: general@incubator.apache.org
+> `cc`: dev@hertzbeat.apache.org、private@hertzbeat.apache.org
+> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
+> `Body`: + +``` +Hello Incubator Community: + +This is a call for a vote to release Apache HertzBeat (incubating) version 1.6.0-RC1. +The Apache HertzBeat community has voted on and approved a proposal to release Apache HertzBeat (incubating) version 1.6.0-RC1. +We now kindly request the Incubator PMC members review and vote on this incubator release. +Apache HertzBeat, a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +HertzBeat community vote thread: +https://lists.apache.org/thread/t01b2lbtqzyt7j4dsbdp5qjc3gngjsdq + +Vote result thread: +https://lists.apache.org/thread/t5z58mvrs1drgzfyc48c9lhmd8skswn7 + +The release candidate: +https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1/ + +Git tag for the release: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0-rc1 + +The artifacts signed with PGP key [33545C76], corresponding to [muchunjin@apache.org], that can be found in keys file: +https://downloads.apache.org/incubator/hertzbeat/KEYS + +The vote will be open for at least 72 hours or until the necessary number of votes are reached. + +Please vote accordingly: +[ ] +1 approve +[ ] +0 no opinion +[ ] -1 disapprove with the reason + +More detailed checklist please refer: +• https://cwiki.apache.org/confluence/display/INCUBATOR/Incubator+Release+Checklist + +Steps to validate the release, Please refer to: +• https://www.apache.org/info/verification.html +• https://hertzbeat.apache.org/docs/community/how_to_verify_release + + +How to Build: +https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package + + +Thanks, + +On behalf of Apache HertzBeat (incubating) community + + +Best, +ChunJin Mu +``` + +如果72小时后没有-1,回复邮件如下 + +> `Send to`: general@incubator.apache.org
+> `Body`: + +``` +Thanks everyone for review and vote, 72H passed. I'll announce the vote result soon. + +Best, +Chunjin Mu +``` + +然后将统计投票结果,并发送投票结果邮件,如下所示。 + +> `Send to`: general@incubator.apache.org
+> `Title`: [RESULT][VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
+> `Body`: + +``` +Hi Incubator Community, + +The vote to release Apache HertzBeat (incubating) 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes. + +3 binding votes, no +0 or -1 votes. + ++3 (binding) +1, from: +- xxx + +no 0 or -1 votes. + +Vote thread: + +https://lists.apache.org/thread/m1kyn4l30y55p6q39m0ys5djvdd73h0f + +Thanks everyone for your feedback and help with HertzBeat apache release. The HertzBeat team will take the steps to complete this release and will announce it soon. + +Best, +ChunJin Mu +``` + +邮件内容中的一项是`Vote thread`,在 https://lists.apache.org/list.html?general@incubator.apache.org 查看获取 + +等待一天,查看看导师是否有其他意见,如果没有,发送以下公告邮件 + +## 4. 完成最终发布步骤 + +#### 4.1 迁移源代码和二进制包 + +```shell +svn mv https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1 https://dist.apache.org/repos/dist/release/incubator/hertzbeat/1.6.0 -m "transfer packages for 1.6.0-RC1" +``` + +#### 4.2 添加新版本下载地址到官网 + +https://github.com/apache/hertzbeat/blob/master/home/docs/download.md +https://github.com/apache/hertzbeat/blob/master/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/download.md + +完成后打开官网地址 https://hertzbeat.apache.org/docs/download/ 查看是否有新版本的下载 + +> 需要注意的是,下载链接可能需要一个小时后才会生效,请注意。 + +#### 4.3 Github 生成 Release + +基于 release-1.6.0-rc1 分支修改创建一个名为 v1.6.0 的标签,并将此标签设置为 latest release。 + +:::tip +在原有的 Release 上面修改,无需重新创建 Release。 +::: + +然后输入发版标题和描述 + +- 发版标题: +``` +v1.6.0 +``` +- 描述: +``` +xxx +release note: xxx +``` + +然后点击`Publish release`按钮。 + +然后将 release-1.6.0-rc1 分支重命名 为 release-1.6.0。 + +#### 4.4 发送新版本公告邮件 + +> `Send to`: general@incubator.apache.org
+> `cc`: dev@hertzbeat.apache.org
+> `Title`: [ANNOUNCE] Release Apache HertzBeat (incubating) 1.6.0
+> `Body`: + +``` +Hi Incubator Community, + +We are glad to announce the release of Apache HertzBeat (incubating) 1.6.0. +Once again I would like to express my thanks to your help. + +Apache HertzBeat(https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +Download Links: https://hertzbeat.apache.org/download/ +Release Notes: https://github.com/apache/hertzbeat/releases/tag/v1.6.0 + +HertzBeat Resources: +- Issue: https://github.com/apache/hertzbeat/issues +- Mailing list: dev@hertzbeat.apache.org + + +Apache HertzBeat Team + +Best, +ChunJin Mu +``` + +该版本的发布顺利结束。 + +---- + +This doc refer from [Apache StreamPark](https://streampark.apache.org/) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-verify.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-verify.md new file mode 100644 index 00000000000..ee4f9563c83 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/how-to-verify.md @@ -0,0 +1,202 @@ +--- +id: how_to_verify_release +title: 版本物料的验证 +sidebar_position: 4 +--- +# 验证候选版本 + +详细检查列表请参考官方的[check list](https://cwiki.apache.org/confluence/display/INCUBATOR/Incubator+Release+Checklist) + +在浏览器中可访问版本内容 https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/ + +## 1. 下载候选版本到本地 + +> 需要依赖gpg工具,如果没有,建议安装gpg2 + +```shell +#如果本地有svn,可以clone到本地 +svn co https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/${release_version}-${rc_version}/ +#或者 直接下载物料文件 +wget https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/${release_version}-${rc_version}/xxx.xxx + +``` + + +## 2. 验证上传的版本是否合规 + +> 开始验证环节,验证包含但不局限于以下内容和形式 + + +### 2.1 查看发布包是否完整 + +> 上传到dist的包必须包含源码包,二进制包可选 + +1. 是否包含源码包 +2. 是否包含源码包的签名 +3. 是否包含源码包的sha512 +4. 如果上传了二进制包,则同样检查(2)-(4)所列的内容 + + +### 2.2 检查gpg签名 + +首先导入发布人公钥。从svn仓库导入KEYS到本地环境。(发布版本的人不需要再导入,帮助做验证的人需要导入,用户名填发版人的即可) + +#### 2.2.1 导入公钥 + +```shell +$ curl https://downloads.apache.org/incubator/hertzbeat/KEYS > KEYS # 下载KEYS +$ gpg --import KEYS # 导入KEYS到本地 +``` +#### 2.2.2 信任公钥 + +> 信任此次版本所使用的KEY + +```shell +$ gpg --edit-key xxxxxxxxxx #此次版本所使用的KEY用户 +gpg (GnuPG) 2.2.21; Copyright (C) 2020 Free Software Foundation, Inc. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Secret key is available. +gpg> trust #信任 +Please decide how far you trust this user to correctly verify other users' keys +(by looking at passports, checking fingerprints from different sources, etc.) + + 1 = I don't know or won't say + 2 = I do NOT trust + 3 = I trust marginally + 4 = I trust fully + 5 = I trust ultimately + m = back to the main menu + +Your decision? 5 #选择5 +Do you really want to set this key to ultimate trust? (y/N) y #选择y + +gpg> + +``` +#### 2.2.3 检查签名 + +```shell +for i in *.tar.gz; do echo $i; gpg --verify $i.asc $i ; done +``` + +检查结果 +> 出现类似以下内容则说明签名正确,关键字:**`Good signature`** + +```shell +apache-hertzbeat-xxx-incubating-src.tar.gz +gpg: Signature made XXXX +gpg: using RSA key XXXXX +gpg: Good signature from "xxx @apache.org>" +``` + +### 2.3 检查sha512哈希 + +> 本地计算sha512哈希后,验证是否与dist上的一致,如果上传二进制包,则同样需要检查二进制包的sha512哈希 + + +```shell +for i in *.tar.gz; do echo $i; sha512sum --check $i.sha512; done +``` + +### 2.4 检查二进制包 + +解压缩 `apache-hertzbeat-${release.version}-incubating-bin.tar.gz` + +```shell +tar -xzvf apache-hertzbeat-${release.version}-incubating-bin.tar.gz +``` + +进行如下检查: + +- [ ] 文件夹包含单词`incubating` +- [ ] 存在`LICENSE`和`NOTICE`文件 +- [ ] 存在`DISCLAIMER`或`DISCLAIMER-WIP`文件 +- [ ] `NOTICE`文件中的年份正确 +- [ ] 所有文本文件开头都有ASF许可证 +- [ ] 检查第三方依赖许可证: +- [ ] 第三方依赖的许可证兼容 +- [ ] 所有第三方依赖的许可证都在`LICENSE`文件中声名 +- [ ] 如果依赖的是Apache许可证并且存在`NOTICE`文件,那么这些`NOTICE`文件也需要加入到版本的`NOTICE`文件中 +- [ ] ..... + +参考: https://apache.org/legal/resolved.html + + +### 2.5. 源码编译验证 + +解压缩 `apache-hertzbeat-${release_version}-incubating-src.tar.gz` + +```shell +cd apache-hertzbeat-${release_version}-incubating-src +``` + +编译源码: https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package + +进行如下检查: + +- [ ] 检查源码包是否包含由于包含不必要文件,致使tar包过于庞大 +- [ ] 文件夹包含单词`incubating` +- [ ] 存在`LICENSE`和`NOTICE`文件 +- [ ] 存在`DISCLAIMER`或`DISCLAIMER-WIP`文件 +- [ ] `NOTICE`文件中的年份正确 +- [ ] 只存在文本文件,不存在二进制文件 +- [ ] 所有文件的开头都有ASF许可证 +- [ ] 能够正确编译 +- [ ] ..... + +参考: https://apache.org/legal/resolved.html + + +## 3. 邮件回复 + +如果发起了发布投票,验证后,可以参照此回复示例进行邮件回复 + +:::caution 注意 +回复的邮件一定要带上自己检查了那些项信息,仅仅回复`+1 approve`,是无效的。 + +PPMC 在 dev@hertzbeat.apache.org HertzBeat 的社区投票时,请带上 binding 后缀,表示对 HertzBeat 社区中的投票具有约束性投票,方便统计投票结果。 + +IPMC 在 general@incubator.apache.org incubator 社区投票,请带上 binding 后缀,表示对 incubator 社区中的投票具有约束性投票,方便统计投票结果。 +::: + +:::caution 注意 +如果在dev@hertzbeat.apache.org已经投过票,在incubator社区进行投票回复时,可以直接带过去,需要注意约束性 如: + +```html +//incubator社区 投票时,只有IPMC成员才具有约束性 binding,PPMC需要注意约束性的变化 +Forward my +1 from dev@hertzbeat (non-binding) +Copy my +1 from hertzbeat DEV ML (non-binding) +``` +::: + + + +非PPMC/IPMC成员 +```html ++1 (non-binding) +I checked: + 1. All download links are valid + 2. Checksum and signature are OK + 3. LICENSE and NOTICE are exist + 4. Build successfully on macOS(Big Sur) + 5. .... +``` + +PPMC/IPMC成员 +```html +//incubator社区 投票时,只有IPMC成员才具有约束性 binding ++1 (binding) +I checked: + 1. All download links are valid + 2. Checksum and signature are OK + 3. LICENSE and NOTICE are exist + 4. Build successfully on macOS(Big Sur) + 5. .... +``` + + +--- + +This doc refer from [Apache StreamPark](https://streampark.apache.org/) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/mailing_lists.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/mailing_lists.md new file mode 100644 index 00000000000..57de5409834 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/mailing_lists.md @@ -0,0 +1,63 @@ +--- +id: 'mailing_lists' +title: '邮件列表' +sidebar_position: 1 +--- + + + +[开发者邮件列表](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) 是社区推荐的沟通和获取最新信息的方式。 + +在您向邮件列表发送任何内容之前,请确保您已经**订阅**了它们。 + +## 用途 + +### 开发者列表 + +- 使用此列表提出您对 HertzBeat 的问题 +- 由 HertzBeat 贡献者用来讨论 HertzBeat 的开发 + + +| 列表名称 | 地址 | 订阅 | 退订 | 归档 | +|--------------|------------------------------|------------------------------------------------------|---------------------------------------------------------|------------------------------------------------------------------------| +| **开发者列表** | dev@hertzbeat.apache.org | [订阅](mailto:dev-subscribe@hertzbeat.apache.org) | [退订](mailto:dev-unsubscribe@hertzbeat.apache.org) | [归档](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) | + + +### 通知列表 + +- 关于 HertzBeat 代码库的更改的通知,频繁通知 + +| 列表名称 | 地址 | 订阅 | 退订 | 归档 | +|-----------|------------------------------|-------------------------------------------------------------|--------------------------------------------------------------|-----------------------------------------------------------------------------| +| **通知列表** | notifications@hertzbeat.apache.org | [订阅](mailto:notifications-subscribe@hertzbeat.apache.org) | [退订](mailto:notifications-unsubscribe@hertzbeat.apache.org) | [归档](https://lists.apache.org/list.html?notifications@hertzbeat.apache.org) | + +## 订阅步骤 + +发送订阅邮件即可订阅。步骤如下: + +- 1、**订阅**:点击上表中的 **订阅** 按钮,它将重定向到您的邮件客户端。主题和内容是任意的。 + 之后,您会从 dev-help@hertzbeat.apache.org 收到确认邮件(如果没有收到,请确认电子邮件是否被自动分类为垃圾邮件、推广邮件、订阅邮件等)。 +- 2、**确认**:直接回复确认邮件,或点击邮件中的链接快速回复。主题和内容是任意的。 +- 3、**欢迎**:在完成上述步骤后,您会收到一个主题为 WELCOME to dev@hertzbeat.apache.org 的欢迎邮件,您已成功订阅 Apache HertzBeat 邮件列表。 + +## 发送纯文本邮件 + +在发送邮件列表时,请使用纯文本邮件。 +**不要使用 HTML 邮件**。 +HTML 邮件更有可能被视为垃圾邮件并被拒绝。 +通过不同的邮件客户端,它可能会出现格式错误,并且其他人不容易阅读。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/new_committer_process.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/new_committer_process.md new file mode 100644 index 00000000000..188b68b3688 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/new_committer_process.md @@ -0,0 +1,245 @@ +--- +id: 'new_committer_process' +title: '提名新Committer流程' +sidebar_position: 4 +--- + + + +[官方指南](https://community.apache.org/newcommitter.html#new-committer-process) + +## 提名新Committer的流程 + +- 在邮件`private@hertzbeat.apache.org`中发起投票 + + 参见 **Committer投票模板** + +- 关闭投票 + + 参见 **关闭投票模板** + +- 如果结果是赞成,邀请新的Committer + + 参见 **Committer邀请模板** + +- 如果同意,那么:接受Committer + + 参见 **Committer接受模板** + +- 新Committer签署CLA,等待CLA的接收记录 + +- 请求创建Committer账户 + + 参见 **Committer账户创建模板** + + - 等待root告诉我们已经完成 + - PMC主席开启svn和其他访问权限 + - 在JIRA和CWiki中将Committer添加到适当的组中 + +- 通知Committer完成 + + 参见 **Committer完成模板** + +## 模板 + +请注意,模板中有三个占位符在使用之前应该替换: + +- NEW_COMMITTER_NAME +- NEW_COMMITTER_EMAIL +- NEW_COMMITTER_APACHE_NAME + +### Committer投票模板 + +```text +To: private@hertzbeat.apache.org +Subject: [VOTE] New committer: ${NEW_COMMITTER_NAME} +``` + +```text +Hi HertzBeat PPMC, + +This is a formal vote about inviting ${NEW_COMMITTER_NAME} as our new committer. + +${Work list}[1] + +[1] https://github.com/apache/hertzbeat/commits?author=${NEW_COMMITTER_NAME} +``` + +注意,投票将在今天一周后结束,即 +[midnight UTC on YYYY-MM-DD](https://www.timeanddate.com/counters/customcounter.html?year=YYYY&month=MM&day=DD) +[Apache投票指南](https://community.apache.org/newcommitter.html) + +### 关闭投票模板 + +```text +To: private@hertzbeat.apache.org +Subject: [RESULT] [VOTE] New committer: ${NEW_COMMITTER_NAME} +``` + +```text +Hi HertzBeat PPMC, + +The vote has now closed. The results are: + +Binding Votes: + ++1 [TOTAL BINDING +1 VOTES] + 0 [TOTAL BINDING +0/-0 VOTES] +-1 [TOTAL BINDING -1 VOTES] + +The vote is ***successful/not successful*** +``` + +### Committer邀请模板 + +```text +To: ${NEW_COMMITTER_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Invitation to become HertzBeat committer: ${NEW_COMMITTER_NAME} +``` + +```text +Hello ${NEW_COMMITTER_NAME}, + +The HertzBeat Project Management Committee (PMC) +hereby offers you committer privileges to the project. +These privileges are offered on the understanding that +you'll use them reasonably and with common sense. +We like to work on trust rather than unnecessary constraints. + +Being a committer enables you to more easily make +changes without needing to go through the patch +submission process. + +Being a committer does not require you to +participate any more than you already do. It does +tend to make one even more committed. You will +probably find that you spend more time here. + +Of course, you can decline and instead remain as a +contributor, participating as you do now. + +A. This personal invitation is a chance for you to +accept or decline in private. Either way, please +let us know in reply to the private@hertzbeat.apache.org +address only. + +B. If you accept, the next step is to register an iCLA: + 1. Details of the iCLA and the forms are found + through this link: https://www.apache.org/licenses/#clas + + 2. Instructions for its completion and return to + the Secretary of the ASF are found at + https://www.apache.org/licenses/#submitting + + 3. When you transmit the completed iCLA, request + to notify the Apache HertzBeat and choose a + unique Apache ID. Look to see if your preferred + ID is already taken at + https://people.apache.org/committer-index.html + This will allow the Secretary to notify the PMC + when your iCLA has been recorded. + +When recording of your iCLA is noted, you will +receive a follow-up message with the next steps for +establishing you as a committer. +``` + +### Committer接受模板 + +```text +To: ${NEW_COMMITTER_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Re: invitation to become HertzBeat committer +``` + +```text +Welcome. Here are the next steps in becoming a project committer. After that +we will make an announcement to the dev@hertzbeat.apache.org list. + +You need to send a Contributor License Agreement to the ASF. +Normally you would send an Individual CLA. If you also make +contributions done in work time or using work resources, +see the Corporate CLA. Ask us if you have any issues. +https://www.apache.org/licenses/#clas. + +You need to choose a preferred ASF user name and alternatives. +In order to ensure it is available you can view a list of taken IDs at +https://people.apache.org/committer-index.html + +Please notify us when you have submitted the CLA and by what means +you did so. This will enable us to monitor its progress. + +We will arrange for your Apache user account when the CLA has +been recorded. + +After that is done, please make followup replies to the dev@hertzbeat.apache.org list. +We generally discuss everything there and keep the +private@hertzbeat.apache.org list for occasional matters which must be private. + +The developer section of the website describes roles within the ASF and provides other +resources: + https://www.apache.org/foundation/how-it-works.html + https://www.apache.org/dev/ + +The incubator also has some useful information for new committers +in incubating projects: + https://incubator.apache.org/guides/committer.html + https://incubator.apache.org/guides/ppmc.html + +Just as before you became a committer, participation in any ASF community +requires adherence to the ASF Code of Conduct: + https://www.apache.org/foundation/policies/conduct.html + +Yours, +The Apache HertzBeat PPMC +``` + +### Committer完成模板 + +```text +To: private@hertzbeat.apache.org, ${NEW_COMMITTER_EMAIL} +Subject: account request: ${NEW_COMMITTER_NAME} +``` + +```text +${NEW_COMMITTER_NAME}, as you know, the ASF Infrastructure has set up your +committer account with the username '${NEW_COMMITTER_APACHE_NAME}'. + +Please follow the instructions to set up your SSH, +svn password, svn configuration, email forwarding, etc. +https://www.apache.org/dev/#committers + +You have commit access to specific sections of the +ASF repository, as follows: + +The general "committers" at: + https://svn.apache.org/repos/private/committers + +If you have any questions during this phase, then please +see the following resources: + +Apache developer's pages: https://www.apache.org/dev/ +Incubator committer guide: https://incubator.apache.org/guides/committer.html + +Naturally, if you don't understand anything be sure to ask us on the dev@hertzbeat.apache.org mailing list. +Documentation is maintained by volunteers and hence can be out-of-date and incomplete - of course +you can now help fix that. + +A PPMC member will announce your election to the dev list soon. +``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/new_pmc_member_process.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/new_pmc_member_process.md new file mode 100644 index 00000000000..4488f1fcfea --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/new_pmc_member_process.md @@ -0,0 +1,286 @@ +--- +id: 'new_pmc_ember_process' +title: '提名新PMC成员流程' +sidebar_position: 5 +--- + + + +这个指南是基于 [apache newcommitter](https://community.apache.org/newcommitter.html#new-committer-process) 的。 + +## 新PMC成员的流程 + +- 在邮件`private@hertzbeat.apache.org`中进行投票 + + 参见 **PMC成员投票模板** + +- 关闭投票 + + 参见 **关闭投票模板** + +- 董事会批准新的PMC成员 + + 参见 **董事会批准新PMC成员** + +- 如果结果是赞成,邀请新的PMC成员 + + 参见 **PMC成员邀请模板** + +- 如果同意,那么:接受PMC成员 + + 参见 **PMC成员接受模板** + +- 通知PMC成员完成 + + 参见 **PMC成员完成模板** + +- 宣布新的PMC成员 + + 参见 **PMC成员公告模板** + +## 模板 + +注意,在使用模板之前,有三个占位符需要被替换 + +- NEW_PMC_NAME +- NEW_PMC_EMAIL +- NEW_PMC_APACHE_NAME + +### PMC成员投票模板 + +```text +To: private@hertzbeat.apache.org +Subject: [VOTE] New PMC member candidate: ${NEW_PMC_NAME} +``` + +```text +Hi HertzBeat PPMC, + +This is a formal vote about inviting ${NEW_PMC_NAME} as our new PMC member. + +${Work list}[1] + +[1] https://github.com/apache/hertzbeat/commits?author=${NEW_PMC_NAME} +``` + +注意,投票将在今天一周后结束,即 +[midnight UTC on YYYY-MM-DD](https://www.timeanddate.com/counters/customcounter.html?year=YYYY&month=MM&day=DD) +[Apache 参考投票指南](https://community.apache.org/newcommitter.html) + + +### Close Vote Template + +```text +To: private@hertzbeat.apache.org +Subject: [RESULT] [VOTE] New PMC member: ${NEW_PMC_NAME} +``` + +```text +Hi HertzBeat PPMC, + +The vote has now closed. The results are: + +Binding Votes: + ++1 [TOTAL BINDING +1 VOTES] + 0 [TOTAL BINDING +0/-0 VOTES] +-1 [TOTAL BINDING -1 VOTES] + +The vote is ***successful/not successful*** +``` + +### Board Approval of new PMC member Template + +```text +To: board@apache.org +Cc: private@.apache.org +Subject: [NOTICE] ${NEW_PMC_NAME} for HertzBeat PMC member +``` + +```text +HertzBeat proposes to invite ${NEW_PMC_NAME} to join the PMC. + +The vote result is available here: https://lists.apache.org/... +``` + +[Apache New Pmc Guide](https://www.apache.org/dev/pmc.html#newpmc) + +### PMC成员邀请模板 + +```text +To: ${NEW_PMC_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Invitation to become HertzBeat PMC member: ${NEW_PMC_NAME} +``` + +```text +Hello ${NEW_PMC_NAME}, + +The HertzBeat Project Management Committee (PMC) +hereby offers you committer privileges to the project +as well as membership in the PMC. +These privileges are offered on the understanding that +you'll use them reasonably and with common sense. +We like to work on trust rather than unnecessary constraints. + +Being a PMC member enables you to guide the direction of the project. + +Being a PMC member does not require you to +participate any more than you already do. It does +tend to make one even more committed. You will +probably find that you spend more time here. + +Of course, you can decline and instead remain as a +contributor, participating as you do now. + +A. This personal invitation is a chance for you to +accept or decline in private. Either way, please +let us know in reply to the private@hertzbeat.apache.org +address only. + +B. If you accept, the next step is to register an iCLA: + 1. Details of the iCLA and the forms are found + through this link: https://www.apache.org/licenses/#clas + + 2. Instructions for its completion and return to + the Secretary of the ASF are found at + https://www.apache.org/licenses/#submitting + + 3. When you transmit the completed iCLA, request + to notify the Apache HertzBeat and choose a + unique Apache ID. Look to see if your preferred + ID is already taken at + https://people.apache.org/committer-index.html + This will allow the Secretary to notify the PMC + when your iCLA has been recorded. + +When recording of your iCLA is noted, you will +receive a follow-up message with the next steps for +establishing you as a PMC member. +``` + +### PMC成员接受模板 + +```text +To: ${NEW_PMC_EMAIL} +Cc: private@hertzbeatv.apache.org +Subject: Re: invitation to become HertzBeat PMC member +``` + +```text +Welcome. Here are the next steps in becoming a project PMC. After that +we will make an announcement to the dev@hertzbeat.apache.org list. + +You need to send a Contributor License Agreement to the ASF. +Normally you would send an Individual CLA. If you also make +contributions done in work time or using work resources, +see the Corporate CLA. Ask us if you have any issues. +https://www.apache.org/licenses/#clas. + +You need to choose a preferred ASF user name and alternatives. +In order to ensure it is available you can view a list of taken IDs at +https://people.apache.org/committer-index.html + +Please notify us when you have submitted the CLA and by what means +you did so. This will enable us to monitor its progress. + +We will arrange for your Apache user account when the CLA has +been recorded. + +After that is done, please make followup replies to the dev@hertzbeat.apache.org list. +We generally discuss everything there and keep the +private@hertzbeat.apache.org list for occasional matters which must be private. + +The developer section of the website describes roles within the ASF and provides other +resources: + https://www.apache.org/foundation/how-it-works.html + https://www.apache.org/dev/ + +The incubator also has some useful information for new PMC +in incubating projects: + https://incubator.apache.org/guides/committer.html + https://incubator.apache.org/guides/ppmc.html + +Just as before you became a PMC member, participation in any ASF community +requires adherence to the ASF Code of Conduct: + https://www.apache.org/foundation/policies/conduct.html + +Yours, +The Apache HertzBeat PPMC +``` + +### PMC成员完成模板 + +```text +To: private@hertzbeat.apache.org, ${NEW_PMC_EMAIL} +Subject: account request: ${NEW_PMC_NAME} +``` + +```text +${NEW_PMC_EMAIL}, as you know, the ASF Infrastructure has set up your +committer account with the username '${NEW_PMC_APACHE_NAME}'. + +Please follow the instructions to set up your SSH, +svn password, svn configuration, email forwarding, etc. +https://www.apache.org/dev/#committers + +You have commit access to specific sections of the +ASF repository, as follows: + +The general "committers" at: + https://svn.apache.org/repos/private/committers + +If you have any questions during this phase, then please +see the following resources: + +Apache developer's pages: https://www.apache.org/dev/ +Incubator committer guide: https://incubator.apache.org/guides/committer.html + +Naturally, if you don't understand anything be sure to ask us on the dev@hertzbeat.apache.org mailing list. +Documentation is maintained by volunteers and hence can be out-of-date and incomplete - of course +you can now help fix that. + +A PPMC member will announce your election to the dev list soon. +``` + +### PMC成员通知模板 + +```text +To: dev@hertzbeat.apache.org +[ANNONCE] New PMC member: ${NEW_PMC_NAME} +``` + +```text +Hi HertzBeat Community, + +The Podling Project Management Committee (PPMC) for Apache HertzBeat +has invited ${NEW_PMC_NAME} to become our PMC member and +we are pleased to announce that he has accepted. + +### add specific details here ### + +Please join me in congratulating ${NEW_PMC_NAME}! + +Being a committer enables easier contribution to the +project since there is no need to go via the patch +submission process. This should enable better productivity. +A PPMC member helps manage and guide the direction of the project. + +Thanks, +On behalf of the Apache HertzBeat (incubating) PPMC +``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/submit-code.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/submit-code.md new file mode 100644 index 00000000000..ee553bb6e1c --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/community/submit-code.md @@ -0,0 +1,76 @@ +--- +id: 'submit_code' +title: '提交代码' +sidebar_position: 2 +--- + + + +* 首先从远程仓库 将代码的一份副本 fork 到您自己的仓库 + +* 远程仓库开发合并分支:`master` + +* 将您fork仓库clone到您的本地设备 + + ```shell + git clone git@github.com:<您的账户名>/hertzbeat.git + ``` + +* 添加远程仓库地址,命名为 upstream + + ```shell + git remote add upstream git@github.com:apache/hertzbeat.git + ``` + +* 查看仓库 + + ```shell + git remote -v + ``` + + > 此时会有两个仓库:origin(您自己的仓库)和 upstream(远程仓库) + +* 获取/更新远程仓库代码 + + ```shell + git fetch upstream + ``` + +* 将远程仓库代码同步到本地仓库 + + ```shell + git checkout origin/master + git merge --no-ff upstream/master + ``` + +* **⚠️注意一定要新建分支开发特性 `git checkout -b feature-xxx`,不建议使用master分支直接开发** + +* 在本地修改代码后,提交到自己的仓库: + **注意提交信息为英文,不包含特殊字符** + ```shell + git commit -m '[docs]necessary instructions' + git push + ``` + +* 将更改提交到远程仓库后,您可以在您的仓库页面上看到一个绿色的按钮“Compare & pull request”,点击它。 + +* 这会弹出新建 Pull Request 页面,您需要这里仔细填写信息(英文),描述和代码同样重要,然后点击“Create pull request”按钮。 + +* 然后社区的 Committers 将进行 CodeReview,并与您讨论一些细节(包括设计、实现、性能等),之后您可以根据建议直接在这个分支更新代码(无需新建PR)。当社区 Committer approve之后,提交将被合并到 master 分支。 + +* 最后,恭喜您,您已经成为 HertzBeat 的官方贡献者,您会被加在贡献者墙上,您可以联系社区获取贡献者证书! diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/download.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/download.md new file mode 100644 index 00000000000..7ce72412d0b --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/download.md @@ -0,0 +1,36 @@ +--- +id: download +title: 下载 Apache HertzBeat (incubating) +sidebar_label: Download +--- + +> **这里是 Apache HertzBeat (incubating) 官方下载页面。** +> **请再下方表中选择版本下载,推荐使用最新版本。** + +:::tip +- 验证下载版本,请使用相应的哈希(sha512)、签名和[项目发布KEYS](https://downloads.apache.org/incubator/hertzbeat/KEYS)。 +- 检查哈希和签名的方法参考 [如何验证](https://www.apache.org/dyn/closer.cgi#verify)。 +::: + +## 最新版本 + +:::tip +以前版本的 HertzBeat 可能会受到安全问题的影响,请考虑使用最新版本。 +::: + + +| 版本 | 日期 | 下载 | Release Notes | +|---------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| +| v1.6.0 | 2024.06.10 | [apache-hertzbeat-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-1.6.0-incubating-src.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512) ) | [release note](https://github.com/apache/hertzbeat/releases/tag/v1.6.0) | + + +## 归档版本 + +在这里查看所有归档版本:[archive](https://archive.apache.org/dist/incubator/hertzbeat/). + +## Docker 镜像版本 + +> Apache HertzBeat 为每个版本制作了 Docker 镜像. 你可以从 [Docker Hub](https://hub.docker.com/r/apache/hertzbeat) 拉取使用. + +- HertzBeat https://hub.docker.com/r/apache/hertzbeat +- HertzBeat Collector https://hub.docker.com/r/apache/hertzbeat-collector diff --git a/home/versioned_docs/version-v1.1.x/help/activemq.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/activemq.md similarity index 99% rename from home/versioned_docs/version-v1.1.x/help/activemq.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/activemq.md index 49689137ec7..b2d8f1489f5 100644 --- a/home/versioned_docs/version-v1.1.x/help/activemq.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/activemq.md @@ -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 连接 | | 用户名 | 认证时使用的用户名 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/airflow.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/airflow.md new file mode 100644 index 00000000000..5323ede8110 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/airflow.md @@ -0,0 +1,41 @@ +--- +id: airflow +title: 监控:Apache Airflow监控 +sidebar_label: Apache Airflow +keywords: [开源监控系统, 开源数据库监控, Apache Airflow监控] +--- + +> 对Apache Airflow通用性能指标进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------ | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性 | +| 端口 | 数据库对外提供的端口,默认为8080 | +| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认3000毫秒 | +| HTTPS | 是否启用HTTPS | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:airflow_health + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------ | -------- | -------------------- | +| metadatabase | 无 | metadatabase健康情况 | +| scheduler | 无 | scheduler健康情况 | +| triggerer | 无 | triggerer健康情况 | + +#### 指标集合:airflow_version + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | -------- | --------------- | +| value | 无 | Airflow版本 | +| git_version | 无 | Airflow git版本 | + + + diff --git a/home/versioned_docs/version-v1.1.x/help/alert_console.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_console.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_console.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_console.md diff --git a/home/versioned_docs/version-v1.1.x/help/alert_dingtalk.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_dingtalk.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_dingtalk.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_dingtalk.md diff --git a/home/versioned_docs/version-v1.1.x/help/alert_discord.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_discord.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_discord.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_discord.md diff --git a/home/versioned_docs/version-v1.1.x/help/alert_email.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_email.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_email.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_email.md diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_enterprise_wechat_app.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_enterprise_wechat_app.md new file mode 100644 index 00000000000..3f1c5a2b9c1 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_enterprise_wechat_app.md @@ -0,0 +1,34 @@ +--- +id: alert_enterprise_wechat_app +title: 企业微信应用告警通知 +sidebar_label: 企业微信应用告警通知 +keywords: [开源告警系统, 开源监控告警系统, 企业微信应用告警通知] +--- + +> 阈值触发后发送告警信息,通过企业微信应用通知到接收人. + +### Operation steps + +1. **【企业微信后台管理】-> 【App管理】-> 【创建一个新的应用】-> 【设置应用信息】->【添加成功后复制应用的AgentId和Secret】** + +![email](/img/docs/help/alert-wechat-1.jpg) + +2. **【告警通知】->【新增接收人】 ->【选择企业微信应用通知方式】->【设置企业ID,企业应用id和应用的secret 】-> 【确定】** + +![email](/img/docs/help/alert-wechat-2.jpg) + +3. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】** + +> **注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人。** + +![email](/img/docs/help/alert-wechat-3.jpg) + + +### 企业微信应用通知常见问题 + +1. 企业微信应用未收到告警通知. +> 请检查用户是否具有应用程序权限. +> 请检查企业应用程序回调地址设置是否正常. +> 请检查服务器IP是否在企业应用程序白名单上. + +其它问题可以通过交流群ISSUE反馈哦! diff --git a/home/versioned_docs/version-v1.1.x/help/alert_feishu.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_feishu.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_feishu.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_feishu.md diff --git a/home/versioned_docs/version-v1.1.x/help/alert_slack.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_slack.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_slack.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_slack.md diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_smn.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_smn.md new file mode 100644 index 00000000000..73f434a8e8a --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_smn.md @@ -0,0 +1,43 @@ +--- +id: alert_smn +title: 华为云SMN通知 +sidebar_label: 告警华为云SMN通知 +keywords: [ 告警华为云SMN通知, 开源告警系统, 开源监控告警系统 ] +--- + +> 阈值触发后发送告警信息,通过华为云SMN通知到接收人。 + +### 操作步骤 + +1. **按照[华为云SMN官方文档](https://support.huaweicloud.com/qs-smn/smn_json.html)开通SMN服务并配置SMN** + +![alert-notice-10](/img/docs/help/alert-notice-10.png) + +2. **保存SMN的主题URN** + +![alert-notice-11](/img/docs/help/alert-notice-11.png) + +3. **按照[华为云签名文档](https://support.huaweicloud.com/devg-apisign/api-sign-provide.html)获取AK、SK和项目ID** + +![alert-notice-12](/img/docs/help/alert-notice-12.png) + +![alert-notice-13](/img/docs/help/alert-notice-13.png) + +4. **【告警通知】->【新增接收人】 ->【选择华为云SMN通知方式】->【设置华为云SMN AK、SK等配置】-> 【确定】** + +![alert-notice-14](/img/docs/help/alert-notice-14.png) + +5. **配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】** + +> ** 注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人 **。 + +![email](/img/docs/help/alert-notice-4.png) + +### 华为云SMN通知常见问题 + +1. 华为云SMN群未收到告警通知 + +> 请排查在告警中心是否已有触发的告警信息 +> 请排查是否正确配置华为云SMN AK、SK等配置,是否已配置告警策略关联 + +其它问题可以通过交流群ISSUE反馈哦! diff --git a/home/versioned_docs/version-v1.1.x/help/alert_telegram.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_telegram.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_telegram.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_telegram.md diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_threshold.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_threshold.md new file mode 100644 index 00000000000..401a3d04d45 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_threshold.md @@ -0,0 +1,54 @@ +--- +id: alert_threshold +title: 阈值告警配置 +sidebar_label: 阈值告警配置 +--- +> 对监控指标配置告警阈值(警告告警,严重告警,紧急告警),系统根据阈值配置和采集指标数据计算触发告警。 + +## 操作步骤 + +### 1. 监控服务设置标签(可选) + +如果您需要对告警进行分类,可以对监控的目标设置标签。如:您有多个Linux系统需要监控,并且每个系统监控指标不同,比如:A服务器可用内存大于1G,B服务器可用内存大于2G,那么您可以为A服务器和B服务器分别设置标签,然后针对标签进行告警配置。 + +#### 创建标签 + +依次点击 **标签管理 -> 新增标签** + +![threshold](/img/docs/help/alert-threshold-2.png) + +如上图所示,新增标签,这里我们设置标签为: linux:dev (开发环境使用Linux) + +#### 配置标签 +TODO 图片名称更新 +![threshold](/img/docs/help/alert-threshold-3.png) + +如上图所示,我们点击`新增标签` + +![threshold](/img/docs/help/alert-threshold-4.png) + +选择我们的标签,这里演示选择`linux:dev`标签 + +### 创建阈值规则 + +依次点击 **【阈值规则】->【新增阈值规则】-> 【配置后确定】** + +![threshold](/img/docs/help/alert-threshold-1.png) + +上图配置具体说明: + +- **指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> summary指标集合下的 -> responseTime响应时间指标 +- **阈值规则**:根据此表达式来计算判断是否触发阈值,表达式环境变量和操作符见页面提示,例如:设置响应时间大于50触发告警,表达式为 `responseTime > 50`。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr) +- **告警级别**:触发阈值的告警级别,从低到高依次为:警告-warning,严重-critical,紧急-emergency +- **触发次数**:设置触发阈值多少次之后才会真正的触发告警 +- **通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${app}.${metrics}.${metric}指标的值为${responseTime},大于50触发告警` +- **绑定标签**:选择我们需要应用的标签,如果不选择标签则会应用到设置指标对象对应的所有服务上。 +- **应用全局**:设置此阈值是否对全局的此类指标都应用有效,默认否。新增阈值后还需将阈值与监控对象关联,这样阈值才会对此监控生效。 +- **恢复通知**:告警触发后是否发送恢复通知,默认不发送。 +- **启用告警**:此告警阈值配置开启生效或关闭 + + +**阈值告警配置完毕,已经被成功触发的告警信息可以在【告警中心】看到。** +**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【告警通知】配置。** + +其它问题可以通过交流群ISSUE反馈哦! diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_threshold_expr.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_threshold_expr.md new file mode 100644 index 00000000000..5924d8965f8 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_threshold_expr.md @@ -0,0 +1,68 @@ +--- +id: alert_threshold_expr +title: 阈值触发表达式 +sidebar_label: 阈值触发表达式 +--- +> 在我们配置阈值告警时,需要配置阈值触发表达式,系统根据表达式和监控指标值计算触发是否告警,这里详细介绍下表达式使用。 + +#### 表达式支持的操作符 + + +| 运算符(可视化配置) | 运算符(表达式配置) | 支持类型 | 说明 | | +| ------------------ | -------------------- | ----------------------- | ------------------------ | - | +| 等于 | equals(str1,str2) | 字符型 | 判断字符串是否相等 | | +| 不等于 | !equals(str1,str2) | 字符型 | 判断字符串是否不相等 | | +| 包含 | contains(str1,str2) | 字符型 | 判断字符串是否包含 | | +| 不包含 | !contains(str1,str2) | 字符型 | 判断字符串是否不包含 | | +| 匹配 | matches(str1,str2) | 字符型 | 判断字符串正则是否匹配 | | +| 不匹配 | !matches(str1,str2) | 字符型 | 判断字符串正则是否不匹配 | | +| 存在值 | exists(obj) | 字符型、数值型、时间型 | 判断字符是否有值存在 | | +| 不存在值 | !exists(obj) | 字符型 、数值型、时间型 | 判断字符是否有值存在 | | +| > | obj1 > obj2 | 数值型、时间型 | 判断数值是否大于 | | +| < | obj1 < obj2 | 数值型、时间型 | 判断数值是否小于 | | +| >= | obj1 >= obj2 | 数值型、时间型 | 判断数值是否大于等于 | | +| <= | obj1 <= obj2 | 数值型、时间型 | 判断数值是否小于等于 | | +| != | obj1 != obj2 | 数值型、时间型 | 判断数值是否不相等 | | +| == | obj1 == obj2 | 数值型、时间型 | 判断数值是否相等 | | + +#### 表达式函数库列表 + + +| 支持函数库 | 说明 | +| -------------------------------------------- | ------------------------------------------------------------------ | +| condition ? trueExpression : falseExpression | 三元运算符 | +| toDouble(str) | 将字符串转换为Double类型 | +| toBoolean(str) | 将字符串转换为Boolean类型 | +| toInteger(str) | 将字符串转换为Integer类型 | +| array[n] | 取数组第n个元素 | +| * | 算法乘 | +| / | 算法除 | +| % | 求余 | +| ( 和 ) | 括号用于控制运算的优先级,确保在逻辑或数学表达式中某些部分先被计算 | +| + | 加号用于表示数学中的加法运算、字符串拼接 | +| - | 减号用于表示数学中的减法运算 | +| && | 逻辑AND操作符 | +| \|\| | 逻辑OR操作符 | + +#### 支持的环境变量 + +> 环境变量即指标值等支持的变量,用于在表达式中,阈值计算判断时会将变量替换成实际值进行计算 + +非固定环境变量:这些变量会根据我们选择的监控指标对象而动态变化,例如我们选择了**网站监控的响应时间指标**,则环境变量就有 `responseTime - 此为响应时间变量` +如果我们想设置**网站监控的响应时间大于400时**触发告警,则表达式为 `responseTime>400` + +固定环境变量(不常用):`instance : 所属行实例值` +此变量主要用于计算多实例时,比如采集到c盘d盘的`usage`(`usage为非固定环境变量`),我们只想设置**c盘的usage大于80**时告警,则表达式为 `equals(instance,"c")&&usage>80` + +#### 表达式设置案例 + +1. 网站监控->响应时间大于等于400ms时触发告警 + `responseTime>=400` +2. API监控->响应时间大于3000ms时触发告警 + `responseTime>3000` +3. 全站监控->URL(instance)路径为 `https://baidu.com/book/3` 的响应时间大于200ms时触发告警 + `equals(instance,"https://baidu.com/book/3")&&responseTime>200` +4. MYSQL监控->status指标->threads_running(运行线程数)指标大于7时触发告警 + `threads_running>7` + +若遇到问题可以通过交流群ISSUE交流反馈哦! diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_webhook.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_webhook.md new file mode 100644 index 00000000000..61ed1dc99b5 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_webhook.md @@ -0,0 +1,64 @@ +--- +id: alert_webhook +title: 告警 Webhook 回调通知 +sidebar_label: 告警 Webhook 回调通知 +keywords: [告警 Webhook 回调通知, 开源告警系统, 开源监控告警系统] +--- + +> 阈值触发后发送告警信息,通过post请求方式调用WebHook接口通知到接收人。 + +## 操作步骤 + +1. **【告警通知】->【新增接收人】 ->【选择WebHook通知方式】-> 【设置WebHook回调地址】 -> 【确定】** + +![email](/img/docs/help/alert-notice-5.png) + +2. ** 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】** + +> ** 注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人 **。 + +![email](/img/docs/help/alert-notice-4.png) + +### WebHook回调POST请求体BODY内容 + +内容格式:JSON +```json +{ + "alarmId": 76456, + "target": "${target}", + "thresholdId": 33455, + "priority": 0, + "content": "udp_port monitoring availability alert, code is FAIL", + "status": 0, + "times": 1, + "triggerTime": "2022-02-25T13:32:13", + "tags": { + "app": "windows", + "monitorId": "180427708350720", + "metrics": "availability", + "code": "UN_CONNECTABLE", + "thresholdId": "112", + "monitorName": "WINDOWS_192.168.124.12" + } +} +``` + +| | | +|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| alarmId | integer($int64) title: Alarm record entity primary key index ID 告警记录实体主键索引ID | +| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field 告警目标对象: 监控可用性-available 指标-app.metrics.field | +| thresholdId | integer($int64) title: Alarm definition ID associated with the alarm 告警关联的告警定义ID | +| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色 | +| content | string title: The actual content of the alarm notification 告警通知实际内容 | +| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed 告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理 | +| times | integer($int32) title: Alarm threshold trigger times 告警阈值触发次数 | +| triggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 首次告警触发时间(毫秒时间戳) | +| tags | example: {key1:value1} | + +### webhook通知常见问题 + +1. WebHook回调未生效 +> 请查看告警中心是否已经产生此条告警信息 +> 请排查配置的WebHook回调地址是否正确 + +其它问题可以通过交流群ISSUE反馈哦! diff --git a/home/versioned_docs/version-v1.1.x/help/alert_wework.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_wework.md similarity index 100% rename from home/versioned_docs/version-v1.1.x/help/alert_wework.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/alert_wework.md diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/almalinux.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/almalinux.md new file mode 100644 index 00000000000..64f15c3777d --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/almalinux.md @@ -0,0 +1,117 @@ +--- +id: almalinux +title: 监控:AlmaLinux操作系统监控 +sidebar_label: AlmaLinux操作系统 +keywords: [开源监控系统, 开源操作系统监控, AlmaLinux操作系统监控] +--- +> 对AlmaLinux操作系统的通用性能指标进行采集监控。 + +### 配置参数 + + +| 参数名称 | 参数帮助描述 | +| -------- | ------------------------------------------------------------------------- | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux SSH对外提供的端口,默认为22。 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次回去信息都会创建一个连接 | +| 用户名 | SSH连接用户名,可选 | +| 密码 | SSH连接密码,可选 | +| 采集器 | 配置此监控使用哪台采集器调度采集 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | +| 密钥 | 连接服务器所需密钥 | + +### 采集指标 + +#### 指标集合:系统基本信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | ------------ | +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | --------------------------- | +| info | 无 | CPU型号 | +| cores | 核数 | CPU内核数量 | +| interrupt | 个数 | CPU中断数量 | +| load | 无 | CPU最近1/5/15分钟的平均负载 | +| context_switch | 个数 | 当前上下文切换数量 | +| usage | % | CPU使用率 | + +#### 指标集合:内存信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------- | -------- | ---------------- | +| total | Mb | 总内存容量 | +| used | Mb | 用户程序内存量 | +| free | Mb | 空闲内存容量 | +| buff_cache | Mb | 缓存占用内存 | +| available | Mb | 剩余可用内存容量 | +| usage | % | 内存使用率 | + +#### 指标集合:磁盘信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------- | -------- | ------------------ | +| disk_num | 块数 | 磁盘总数 | +| partition_num | 分区数 | 分区总数 | +| block_write | 块数 | 写入磁盘的总块数 | +| block_read | 块数 | 从磁盘读出的块数 | +| write_rate | iops | 每秒写磁盘块的速率 | + +#### 指标集合:网卡信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | ------------------- | +| interface_name | 无 | 网卡名称 | +| receive_bytes | byte | 入站数据流量(bytes) | +| transmit_bytes | byte | 出站数据流量(bytes) | + +#### 指标集合:文件系统 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------- | -------- | -------------- | +| filesystem | 无 | 文件系统的名称 | +| used | Mb | 已使用磁盘大小 | +| available | Mb | 可用磁盘大小 | +| usage | % | 使用率 | +| mounted | 无 | 挂载点目录 | + + + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------- | -------- | ------------ | +| pid | 无 | 进程ID | +| cpu_usage | % | CPU占用率 | +| mem_usage | % | 内存占用率 | +| command | 无 | 执行命令 | + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------- | -------- | ------------ | +| pid | 无 | 进程ID | +| mem_usage | % | 内存占用率 | +| cpu_usage | % | CPU占用率 | +| command | 无 | 执行命令 | diff --git a/home/versioned_docs/version-v1.1.x/help/api.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/api.md similarity index 90% rename from home/versioned_docs/version-v1.1.x/help/api.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/api.md index 2f78ce4947d..6a39ef5977b 100644 --- a/home/versioned_docs/version-v1.1.x/help/api.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/api.md @@ -12,13 +12,15 @@ keywords: [开源监控系统, 开源网站监控, HTTP API监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 | | 相对路径 | 网站地址除IP端口外的后缀路径,例如 `www.tancloud.cn/console` 网站的相对路径为 `/console`。 | | 请求方式 | 设置接口调用的请求方式:GET,POST,PUT,DELETE。 | | 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 | | 用户名 | 接口Basic认证或Digest认证时使用的用户名 | | 密码 | 接口Basic认证或Digest认证时使用的密码 | +| 请求Headers | HTTP 请求头 | +| 查询Params | HTTP查询参数,支持[时间表达式](time_expression) | | Content-Type | 设置携带BODY请求体数据请求时的资源类型 | | 请求BODY | 设置携带BODY请求体数据,PUT POST请求方式时有效 | | 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | diff --git a/home/versioned_docs/version-v1.1.x/help/centos.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/centos.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/centos.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/centos.md index 41d462feb89..03c514bc7b8 100644 --- a/home/versioned_docs/version-v1.1.x/help/centos.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/centos.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源操作系统监控, CentOS操作系统监 | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | Linux SSH对外提供的端口,默认为22。 | | 用户名 | SSH连接用户名,可选 | | 密码 | SSH连接密码,可选 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/clickhouse.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/clickhouse.md new file mode 100644 index 00000000000..1c5adeeccc2 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/clickhouse.md @@ -0,0 +1,99 @@ +--- +id: clickhouse +title: 监控:Clickhouse数据库监控 +sidebar_label: Clickhouse数据库 +keywords: [开源监控系统, 开源数据库监控, Clickhouse数据库监控] +--- +> 对Clickhouse数据库的通用性能指标进行采集监控。 + +### 配置参数 + + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------------------- | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 数据库对外提供的端口,默认为8123。 | +| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认6000毫秒。 | +| 数据库名称 | 数据库实例名称,可选。 | +| 用户名 | 数据库连接用户名,可选 | +| 密码 | 数据库连接密码,可选 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:ping 可用性 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------ | -------- | ------------ | +| responseTime | 无 | 响应时间 | + +#### 指标集合:system.metrics表的数据 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- | -------- | -------------------------------------- | +| Query | 无 | 正在执行的查询的数量 | +| Merge | 无 | 正在执行的后台合并的数量 | +| Move | 无 | 正在执行的后台移动的数量 | +| PartMutation | 无 | 表变更的次数 | +| ReplicatedFetch | 无 | 从副本收集的数据块数量 | +| ReplicatedSend | 无 | 发送到副本的数量块数量 | +| ReplicatedChecks | 无 | 检查一致性的数据块数量 | +| QueryPreempted | 无 | 停止或等待的查询数量 | +| TCPConnection | 无 | TCP连接数量 | +| HTTPConnection | 无 | HTTP连接数量 | +| OpenFileForRead | 无 | 打开的可读文件的数量 | +| OpenFileForWrite | 无 | 打开的可写文件的数量 | +| QueryThread | 无 | 查询处理的线程数量 | +| ReadonlyReplica | 无 | 处于只读状态的 Replicated table 的数量 | +| EphemeralNode | 无 | ZooKeeper 中保存的临时节点数 | +| ZooKeeperWatch | 无 | ZooKeeper事件订阅数 | +| StorageBufferBytes | Bytes | Buffer tables 中的字节数 | +| VersionInteger | 无 | ClickHouse 版本号 | +| RWLockWaitingReaders | 无 | 等待读表的读写锁的线程数量 | +| RWLockWaitingWriters | 无 | 等待写表的读写锁的线程数量 | +| RWLockActiveReaders | 无 | 在一个表的读写锁中持有读锁的线程数 | +| RWLockActiveWriters | 无 | 在一个表的读写锁中持有写锁的线程数 | +| GlobalThread | 无 | 全局线程池中的线程数 | +| GlobalThreadActive | 无 | 全局线程池中活跃的线程数 | +| LocalThread | 无 | 本地线程池中的线程数 | +| LocalThreadActive | 无 | 本地线程池中活跃的线程数 | + +#### 指标集合:system.events表的数据 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------------------------------- |-------| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Query | 无 | 要解释和可能执行的查询数量。 不包括由于 AST 大小限制、配额限制或同时运行的查询数量限制而无法解析或被拒绝的查询。 可能包括 ClickHouse 本身发起的内部查询。 不计算子查询。 | +| SelectQuery | 无 | 可能执行的 Select 查询数 | +| InsertQuery | 无 | 可能执行的 Insert 查询数 | +| InsertedRows | 无 | 被插入到所有表中的行数 | +| InsertedBytes | Bytes | 被插入到所有表中的字节数 | +| FailedQuery | 无 | 执行失败的查询数量 | +| FailedSelectQuery | 无 | 执行失败的 Select 查询数量 | +| FileOpen | 无 | 文件打开数 | +| MergeTreeDataWriterRows | 无 | 写入 MergeTree 表的数据行数 | +| MergeTreeDataWriterCompressedBytes | Bytes | 压缩写入 MergeTree 表的数据字节数 | + +#### 指标集合:system.asynchronous_metrics表的数据 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------------------------------------- | ------ | ----------------------------------------- | +| AsynchronousMetricsCalculationTimeSpent | 无 | 异步指标计算花费的时间(秒) | +| jemalloc.arenas.all.muzzy_purged | 无 | 被清除的模糊(muzzy)页的数量 | +| jemalloc.arenas.all.dirty_purged | 无 | 被清除的脏 (dirty)页的数量 | +| BlockReadBytes_ram1 | 无 | ram1 块读取的字节数 | +| jemalloc.background_thread.run_intervals | 无 | jemalloc 后台线程的运行间隔数 | +| BlockQueueTime_nbd13 | 无 | nbd13 块队列等待时间 | +| jemalloc.background_thread.num_threads | 无 | jemalloc 后台线程的数量 | +| jemalloc.resident | 无 | jemalloc 分配器占用的物理内存大小(字节) | +| InterserverThreads | 无 | Interserver 线程数 | +| BlockWriteMerges_nbd7 | 无 | nbd7 块写合并数量 | +| MarkCacheBytes | 无 | StorageMergeTree 的 marks 的缓存大小 | +| MarkCacheFiles | 无 | StorageMergeTree 的 marks 的缓存文件数量 | +| MaxPartCountForPartition | 无 | partitions 中最大的活跃数据块的数量 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/debian.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/debian.md new file mode 100644 index 00000000000..dcda89ee2b6 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/debian.md @@ -0,0 +1,105 @@ +--- +id: debian +title: 监控:debian 系统监控 +sidebar_label: Debian +keywords: [开源监控系统, 操作系统监控, Debian监控] +--- +> 对Debian系统的通用性能指标进行采集监控 + +## 配置参数 + + +| 参数名称 | 参数帮助描述 | +| -------- | ------------------------------------------------------------------------- | +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Debian系统的ssh端口,默认: 22 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次回去信息都会创建一个连接 | +| 用户名 | 服务器用户名 | +| 密码 | 服务器密码 | +| 采集器 | 配置此监控使用哪台采集器调度采集 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | +| 密钥 | 连接服务器所需密钥 | + +### 采集指标 + +#### 指标集合:系统基本信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | ------------ | +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | ------------ | +| Info | 无 | 型号 | +| Cores | 无 | 核数 | +| Interrupt | 无 | 中断数 | +| Load | 无 | 负载 | +| Context Switch | 无 | 上下文切换 | +| Usage | % | 使用率 | + +#### 指标集合:内存信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------- | -------- | -------------- | +| Total Memory | Mb | 总内存容量 | +| User Program Memory | Mb | 用户程序内存量 | +| Free Memory | Mb | 空闲内存容量 | +| Buff Cache Memory | Mb | 缓存占用内存 | +| Available Memory | Mb | 剩余可用内存 | +| Memory Usage | % | 内存使用率 | + +#### 指标集合:磁盘信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------- | -------- | ------------ | +| Disk Num | 无 | 磁盘总数 | +| Partition Num | 无 | 分区总数 | +| Block Write | 无 | 写磁盘块数 | +| Block Read | 无 | 读磁盘块数 | +| Write Rate | iops | 磁盘写速率 | + +#### 指标集合:网卡信息 + +统计所有网卡的网卡名称、入站数据流量、出站数据流量。 + +单位:Mb + +#### 指标集合:文件系统 + +统计所有挂载的文件系统的使用情况。统计信息包括:文件系统、已使用量、可用量、使用率、挂载点。 + +单位: + +- 已使用量:Mb +- 可用量:Mb +- 使用率:% + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + +单位: + +- CPU占用率:% +- 内存占用率:% + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + +单位: + +- 内存占用率:% +- CPU占用率:% diff --git a/home/versioned_docs/version-v1.1.x/help/dm.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dm.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/dm.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dm.md index 4f17b97f81a..cdd9f6f6ee5 100644 --- a/home/versioned_docs/version-v1.1.x/help/dm.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dm.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, 达梦数据库监控] | 参数名称 | 参数帮助描述 | | ------------ | ------------------------------------------------------------ | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为5236。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dns.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dns.md new file mode 100644 index 00000000000..67ea72c177e --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dns.md @@ -0,0 +1,69 @@ +--- +id: dns +title: 监控 DNS 服务器 +sidebar_label: DNS服务器 +keywords: [ 开源监控系统, 开源DNS监控工具, 监控DNS指标 ] +--- + +# 监控:DNS服务器 + +> 收集和监控DNS的常规性能指标。 + +**协议使用:DNS** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|-----------|------------------------------------------------| +| DNS服务器IP | 被监控的IPv4、IPv6。注意⚠️不包含协议头(例如:https://,http://)。 | +| 监控名称 | 标识此监控的名称,名称需要是唯一的。 | +| 端口 | DNS服务对外提供的端口,默认为53。 | +| 域名解析的地址 | 域名解析的地址。 | +| 连接超时时间 | 设置连接DNS服务器的超时时间,单位ms毫秒,默认6000毫秒。 | +| 查询类别 | DNS查询的类别. 可选的值包括 `IN`, `CHAOS`, `HESIOD`, `NONE`, 和 `ANY`。默认值:IN | +| 是否使用tcp协议 | 设置DNS查询是否使用tcp协议。 | +| 采集间隔 | 监控周期性数据采集的时间间隔,单位:秒,最小可设置为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 用于更多关于标识和描述此监控的信息,用户可以在此处添加备注信息。 | + +### 采集指标 + +#### 指标集:Header + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------|------|-----------------| +| 响应时间 | 毫秒 | DNS服务器响应请求所需的时间 | +| 操作码 | 无 | 当前消息的类型 | +| 响应状态 | 无 | 响应的状态码 | +| 响应标志 | 无 | 响应标志 | +| 请求记录数 | 无 | 请求记录的数量 | +| 响应记录数 | 无 | 响应记录的数量 | +| 授权记录数 | 无 | 表示权威资源记录的数量 | +| 附加记录数 | 无 | 表示附加资源记录的数量 | + +### 指标集: Question + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------|------|-----------------------------------| +| Section | 无 | 请求记录信息,其中包含查询的域名,资源类型,资源记录类,附加信息。 | + +### 指标集: Answer + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|----------------------------------------| +| Section0 | 无 | 请求响应信息,其中包含查询的域名,TTL,资源记录类,资源类型,查询的结果。 | +> Answer 指标集最多会采集10条响应记录,指标名称从 Section0 到 Section9。 + +### 指标集: Authority + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|------------------------------------------------------------------| +| Section0 | 无 | 域名的SOA(Start of Authority,权威区域起始)记录,其中包含查询的域名,TTL,资源类型,资源记录类等信息。 | +> Authority 指标集最多会采集10条响应记录,指标名称从 Section0 到 Section9。 + +### 指标集: Additional + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|-------------| +| Section0 | 无 | DNS查询的附加信息。 | +> Additional 指标集最多会采集10条响应记录,指标名称从 Section0 到 Section9。 diff --git a/home/versioned_docs/version-v1.1.x/help/docker.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/docker.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/docker.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/docker.md index acad6a51a16..221776b2426 100644 --- a/home/versioned_docs/version-v1.1.x/help/docker.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/docker.md @@ -33,7 +33,7 @@ systemctl daemon-reload systemctl restart docker ``` -**注意:记得在服务器中台打开 `2375` 端口号。** +**注意:记得在服务器中打开 `2375` 端口号。** **3、如果上述方法不行则:** @@ -53,7 +53,7 @@ firewall-cmd --reload | 参数名称 | 参数帮助描述 | | ------------ | ------------------------------------------------------------ | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为2375。 | | 查询超时时间 | 设置获取Docker服务器API接口时的超时时间,单位ms毫秒,默认3000毫秒。 | | 器名称 | 一般是监控所有运行中的容器信息。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/doris_fe.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/doris_fe.md new file mode 100644 index 00000000000..0e4803826be --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/doris_fe.md @@ -0,0 +1,132 @@ +--- +id: doris_fe +title: 监控:DORIS数据库FE监控 +sidebar_label: DORIS数据库FE +keywords: [开源监控系统, 开源数据库监控, DORIS数据库FE监控] +--- + +> 对DORIS数据库FE的通用性能指标进行采集监控。支持DORIS2.0.0。 + +**使用协议:HTTP** + +### 监控前操作 + +查看 `fe/conf/fe.conf` 文件,获取 `http_port` 配置项的值,该值用作监控使用。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ------------ |-----------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性 | +| 端口 | 数据库对外提供的端口,默认为8030 , 取值自 `http_port` 配置项的值 | +| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认6000毫秒 | +| 采集器 | 配置此监控使用哪台采集器调度采集 | +| 绑定标签 | 您可以使用标签进行监控资源的分类管理, 例如给资源分别绑定生产环境、测试环境的标签。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:doris_fe_connection_total + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ----------------------- | +| value | 无 | 当前FE的MySQL端口连接数 | + +#### 指标集合:doris_fe_edit_log_clean + +不应失败,如失败,需人工介入 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------------- | +| success | 无 | 清理历史元数据日志成功的次数 | +| failed | 无 | 清理历史元数据日志失败的次数 | + + +#### 指标集合:doris_fe_edit_log + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------------- | -------- | ------------------------ | +| write | 无 | 元数据日志写入次数的计数 | +| read | 无 | 元数据日志读取次数的计数 | +| current | 无 | 元数据日志当前数量 | +| accumulated_bytes | 字节 | 元数据日志写入量的累计值 | +| current_bytes | 字节 | 元数据日志当前值 | + +#### 指标集合:doris_fe_image_clean + +不应失败,如失败,需人工介入 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | -------------------------------- | +| success | 无 | 清理历史元数据镜像文件成功的次数 | +| failed | 无 | 清理历史元数据镜像文件失败的次数 | + +#### 指标集合:doris_fe_image_write + +不应失败,如失败,需人工介入 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------------- | +| success | 无 | 生成元数据镜像文件成功的次数 | +| failed | 无 | 生成元数据镜像文件失败的次数 | + +#### 指标集合:doris_fe_query_err + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------- | +| value | 无 | 错误查询的累积值 | + +#### 指标集合:doris_fe_max_journal_id + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------------ | +| value | 无 | 当前FE节点最大元数据日志ID。如果是Master FE,则是当前写入的最大ID,如果是非Master FE,则代表当前回放的元数据日志最大ID。用于观察多个FE之间的 id 是否差距过大。过大则表示元数据同步出现问题 | + +#### 指标集合:doris_fe_max_tablet_compaction_score + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------------ | +| value | 无 | 所有BE节点中最大的 compaction score 值。该值可以观测当前集群最大的 compaction score,以判断是否过高。如过高则可能出现查询或写入延迟 | + +#### 指标集合:doris_fe_qps + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------ | +| value | 无 | 当前FE每秒查询数量(仅统计查询请求) | + +#### 指标集合:doris_fe_query_err_rate + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | -------------- | +| value | 无 | 每秒错误查询数 | + +#### 指标集合:doris_fe_report_queue_size + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------------ | +| value | 无 | BE的各种定期汇报任务在FE端的队列长度,该值反映了汇报任务在 Master FE 节点上的阻塞程度,数值越大,表示FE处理能力不足 | + +#### 指标集合:doris_fe_rps + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------------------------------- | +| value | 无 | 当前FE每秒请求数量(包含查询以及其他各类语句) | + +#### 指标集合:doris_fe_scheduled_tablet_num + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------------ | +| value | 无 | Master FE节点正在调度的 tablet 数量。包括正在修复的副本和正在均衡的副本,该数值可以反映当前集群,正在迁移的 tablet 数量。如果长时间有值,说明集群不稳定 | + +#### 指标集合:doris_fe_txn_status + +可以观测各个状态下导入事务的数量,来判断是否有堆积 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------- | -------- | ------------- | +| unknown | 无 | 未知 | +| prepare | 无 | 准备中 | +| committed | 无 | 已提交 | +| visible | 无 | 可见 | +| aborted | 无 | 已中止/已撤销 | diff --git a/home/versioned_docs/version-v1.1.x/help/dynamic_tp.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dynamic_tp.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/dynamic_tp.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dynamic_tp.md index aaa5a6f86cd..e3e143c17ed 100644 --- a/home/versioned_docs/version-v1.1.x/help/dynamic_tp.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/dynamic_tp.md @@ -66,7 +66,7 @@ management: | 参数名称 | 参数帮助描述 | | ------------ |------------------------------------------------------| | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 应用服务对外提供的端口,默认为8080。 | | 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 | | Base Path | 暴露接口路径前缀,默认 /actuator | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/elasticsearch.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/elasticsearch.md new file mode 100644 index 00000000000..e64d956bc77 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/elasticsearch.md @@ -0,0 +1,63 @@ +--- +id: elasticsearch +title: 监控:ElasticSearch +sidebar_label: ElasticSearch +keywords: [ 开源监控系统, 监控ElasticSearch ] +--- + +> 对ElasticSearch的通用性能指标进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|---------|------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | ElasticSearch开放的HTTP API端口,默认值:9200。 | +| 启用HTTPS | 是否启用HTTPS。 | +| 认证方式 | 连接ElasticSearch使用的认证方式,可选。 | +| 用户名 | 连接ElasticSearch的用户名,可选。 | +| 密码 | 连接ElasticSearch的密码,可选 | +| 查询超时时间 | 设置查询未响应数据时的超时时间,单位ms毫秒,默认6000毫秒。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:health + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------------------|------|----------| +| cluster_name | 无 | 集群名称 | +| status | 无 | 集群状态 | +| nodes | 无 | 集群节点数 | +| data_nodes | 无 | 数据节点数 | +| active_primary_shards | 无 | 主节点活跃分片数 | +| active_shards | 无 | 活跃分片数 | +| active_percentage | % | 分片健康度 | +| initializing_shards | 无 | 初始化分片数 | +| unassigned_shards | 无 | 未分配分片数 | + +#### 指标集合:nodes + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|--------| +| total | 无 | 节点数 | +| successful | 无 | 在线节点数 | +| failed | 无 | 离线节点数 | + +#### 指标集合:nodes_detail + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------------------|------|---------| +| node_name | 无 | 节点名称 | +| ip | 无 | IP地址 | +| cpu_load_average | 无 | CPU平均负载 | +| cpu_percent | % | CPU占用率 | +| heap_used | MB | 内存使用量 | +| heap_used_percent | % | 内存使用率 | +| heap_total | MB | 总内存 | +| disk_free | GB | 磁盘剩余容量 | +| disk_total | GB | 磁盘总容量 | +| disk_used_percent | % | 磁盘使用率 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/euleros.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/euleros.md new file mode 100644 index 00000000000..258f7bb36dd --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/euleros.md @@ -0,0 +1,107 @@ +--- +id: euleros +title: 监控:EulerOS操作系统监控 +sidebar_label: EulerOS操作系统 +keywords: [ 开源监控系统, 开源操作系统监控, EulerOS操作系统监控 ] +--- + +> 对EulerOS操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux SSH对外提供的端口,默认为22。 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次获取信息都会创建一个连接。 | +| 用户名 | SSH连接用户名,可选。 | +| 密码 | SSH连接密码,可选。 | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | +| 密钥 | 连接服务器所需密钥。 | + +### 采集指标 + +#### 指标集合:系统基本信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------------------| +| info | 无 | CPU型号 | +| cores | 无 | CPU内核数量 | +| interrupt | 无 | CPU中断数量 | +| load | 无 | CPU最近1/5/15分钟的平均负载 | +| context_switch | 无 | 当前上下文切换数量 | +| usage | % | CPU使用率 | + +#### 指标集合:内存信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|----------| +| total | Mb | 总内存容量 | +| used | Mb | 用户程序内存量 | +| free | Mb | 空闲内存容量 | +| buff_cache | Mb | 缓存占用内存 | +| available | Mb | 剩余可用内存容量 | +| usage | % | 内存使用率 | + +#### 指标集合:磁盘信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------|------|-----------| +| disk_num | 无 | 磁盘总数 | +| partition_num | 无 | 分区总数 | +| block_write | 无 | 写入磁盘的总块数 | +| block_read | 无 | 从磁盘读出的块数 | +| write_rate | iops | 每秒写磁盘块的速率 | + +#### 指标集合:网卡信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| interface_name | 无 | 网卡名称 | +| receive_bytes | Mb | 入站数据流量 | +| transmit_bytes | Mb | 出站数据流量 | + +#### 指标集合:文件系统 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|---------| +| filesystem | 无 | 文件系统的名称 | +| used | Mb | 已使用磁盘大小 | +| available | Mb | 可用磁盘大小 | +| usage | % | 使用率 | +| mounted | 无 | 挂载点目录 | + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| cpu_usage | % | CPU占用率 | +| mem_usage | % | 内存占用率 | +| command | 无 | 执行命令 | + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| mem_usage | % | 内存占用率 | +| cpu_usage | % | CPU占用率 | +| command | 无 | 执行命令 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/flink.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/flink.md new file mode 100644 index 00000000000..ef260f4dc2c --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/flink.md @@ -0,0 +1,38 @@ +--- +id: flink +title: 监控:Flink +sidebar_label: Flink Monitor +keywords: [开源监控系统, 开源 Flink 监控] +--- + +> 对 Flink 流引擎的通用指标进行测量监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 监控的端口 | +| 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 | +| SSL | 是否开启SSL(默认关闭) | +| 用户名 | 连接用户名 | +| 密码 | 连接密码 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:overview + +| 指标名称 | 指标单位 | 指标帮助描述 | +|--------------|------|----------| +| slots_total | 个 | 插槽总数 | +| slots_used | 个 | 已用插槽数 | +| task_total | 个 | 任务总数 | +| jobs_running | 个 | 正在运行的任务数 | +| jobs_failed | 个 | 已经失败的任务数 | + + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/freebsd.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/freebsd.md new file mode 100644 index 00000000000..53f7eceb7c3 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/freebsd.md @@ -0,0 +1,89 @@ +--- +id: freebsd +title: 监控:FreeBSD操作系统监控 +sidebar_label: FreeBSD操作系统 +keywords: [ 开源监控系统, 开源操作系统监控, FreeBSD操作系统监控 ] +--- + +> 对FreeBSD操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。 + + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux SSH对外提供的端口,默认为22。 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次获取信息都会创建一个连接。 | +| 用户名 | SSH连接用户名,可选。 | +| 密码 | SSH连接密码,可选。 | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | +| 密钥 | 连接服务器所需密钥。 | + +### 采集指标 + +#### 指标集合:系统基本信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------------------| +| info | 无 | CPU型号 | +| cores | 核数 | CPU内核数量 | +| interrupt | 个数 | CPU中断数量 | +| load | 无 | CPU最近1/5/15分钟的平均负载 | +| context_switch | 个数 | 当前上下文切换数量 | +| usage | % | CPU使用率 | + +#### 指标集合:内存信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|---------| +| physmem | Mb | 物理内存 | +| usermem | Mb | 用户程序内存量 | +| realmem | Mb | 实际内存 | +| availmem | Mb | 可用内存 | + +#### 指标集合:文件系统 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|---------| +| filesystem | 无 | 文件系统的名称 | +| used | Mb | 已使用磁盘大小 | +| available | Mb | 可用磁盘大小 | +| usage | % | 使用率 | +| mounted | 无 | 挂载点目录 | + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| cpu_usage | % | CPU占用率 | +| mem_usage | % | 内存占用率 | +| command | 无 | 执行命令 | + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| mem_usage | % | 内存占用率 | +| cpu_usage | % | CPU占用率 | +| command | 无 | 执行命令 | + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ftp.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ftp.md new file mode 100644 index 00000000000..c86dfb14a7b --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ftp.md @@ -0,0 +1,34 @@ +--- +id: ftp +title: 监控:FTP服务器 +sidebar_label: FTP服务器 +keywords: [ 开源监控系统, 开源FTP服务器监控工具, 监控FTP指标 ] +--- + +> 采集和监控FTP服务的通用指标 + +**协议使用:FTP** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|--------------------------------------| +| 目标Host | 被监控的IPv4、IPv6。注意⚠️不包含协议头(例如:ftp://)。 | +| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | FTP服务端口,默认值:21。 | +| 目录 | FTP服务托管的目录。 | +| 超时时间 | 连接FTP服务器超时时间,默认值:1000毫秒。 | +| 用户名 | 连接FTP服务的用户名, 可选。 | +| 密码 | 连接FTP服务的密码,可选。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:概要 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------|------|------------------| +| 活动状态 | 无 | 检查目录是否存在,且具有访问权限 | +| 响应时间 | ms | 连接FTP响应时间 | diff --git a/home/versioned_docs/version-v1.1.x/help/fullsite.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/fullsite.md similarity index 96% rename from home/versioned_docs/version-v1.1.x/help/fullsite.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/fullsite.md index 0fd3c7fda9e..f7fc4c150b7 100644 --- a/home/versioned_docs/version-v1.1.x/help/fullsite.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/fullsite.md @@ -14,7 +14,7 @@ keywords: [开源监控系统, 开源网站监控, SiteMap监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 | | 网站地图 | 网站SiteMap地图地址的相对路径,例如:/sitemap.xml。 | | 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 | diff --git a/home/versioned_docs/version-v1.1.x/help/guide.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/guide.md similarity index 71% rename from home/versioned_docs/version-v1.1.x/help/guide.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/guide.md index e9bd66e9af6..40ad5765ca8 100644 --- a/home/versioned_docs/version-v1.1.x/help/guide.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/guide.md @@ -22,6 +22,18 @@ sidebar_label: 帮助入门  👉 [SSL证书有效期](ssl_cert)
 👉 [JVM虚拟机](jvm)
 👉 [SpringBoot2.0](springboot2)
+  👉 [DNS服务器](dns)
+  👉 [FTP服务器](ftp)
+  👉 [Websocket](websocket)
+ +### 应用程序监控 + + 👉 [Linux进程](process)
+ 👉 [JVM虚拟机](jvm)
+ 👉 [SpringBoot2.0](springboot2)
+ 👉 [SpringBoot3.0](springboot3)
+ 👉 [DynamicTp线程池](dynamic_tp)
+ ### 数据库监控 @@ -33,6 +45,14 @@ sidebar_label: 帮助入门  👉 [达梦数据库监控](dm)
 👉 [OpenGauss数据库监控](opengauss)
 👉 [IoTDB数据库监控](iotdb)
+  👉 [TiDB数据库监控](tidb)
+  👉 [MongoDB数据库监控](mongodb)
+  👉 [NebulaGraph集群监控](nebulagraph_cluster)
+ +### 缓存监控 + + 👉 [Redis](redis)
+ 👉 [Memcached](memcached)
### 操作系统监控 @@ -40,6 +60,10 @@ sidebar_label: 帮助入门  👉 [Windows操作系统监控](windows)
 👉 [Ubuntu操作系统监控](ubuntu)
 👉 [Centos操作系统监控](centos)
+  👉 [FreeBSD操作系统监控](freebsd)
+  👉 [RedHat操作系统监控](redhat)
+  👉 [RockyLinux操作系统监控](rockylinux)
+  👉 [EulerOS操作系统监控](euleros)
### 中间件监控 @@ -51,12 +75,29 @@ sidebar_label: 帮助入门  👉 [RabbitMQ](rabbitmq)
 👉 [ActiveMQ](activemq)
 👉 [Jetty](jetty)
+  👉 [Nacos](nacos)
### 云原生监控  👉 [Docker](docker)
 👉 [Kubernetes](kubernetes)
+### 大数据监控 + +  👉 [Clickhouse](clickhouse)
+  👉 [ElasticSearch](elasticsearch)
+  👉 [Flink](flink)
+ +### Ai大模型监控 + + 👉 [OpenAi](openai)
+ +### 网络监控 + +  👉 [华为通用交换机](huawei_switch)
+ +### 服务器监控 + ## 💡 告警服务 > 更自由化的阈值告警配置,支持邮箱,短信,webhook,钉钉,企业微信,飞书机器人等告警通知。 @@ -87,4 +128,9 @@ sidebar_label: 帮助入门  👉 [配置 Slack 通知](alert_slack)
 👉 [配置企业微信机器人通知](alert_wework)
 👉 [配置钉钉机器人通知](alert_dingtalk)
- 👉 [配置飞书机器人通知](alert_feishu)
+ 👉 [配置飞书机器人通知](alert_feishu)
+ 👉 [配置华为云SMN通知](alert_smn)
+ +### 插件 + + 👉 [插件](plugin)
diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hadoop.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hadoop.md new file mode 100644 index 00000000000..fec361e2366 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hadoop.md @@ -0,0 +1,93 @@ +--- +id: hadoop +title: 监控:Hadoop +sidebar_label: Hadoop +keywords: [开源监控系统, 开源JAVA监控, Hadoop的JVM虚拟机监控] +--- + +> 对Hadoop的JVM虚拟机的通用性能指标进行采集监控 + +**使用协议:JMX** + +### 监控前操作 + +> 您需要在 Hadoop 应用开启 `JMX` 服务,HertzBeat 使用 JMX 协议对Hadoop中的 JVM 进行指标采集。 + +#### Hadoop应用开启JMX协议步骤 + +应用启动时添加JVM参数 ⚠️注意可自定义暴露端口,对外IP + +- 1.进入hadoop-env.sh配置文件,在命令行终端输入以下命令: + +```shell +vi $HADOOP_HOME/etc/hadoop/hadoop-env.sh +``` + +- 2.添加如下参数,`` 为自定义暴露端口号。 + +```shell +export HADOOP_OPTS= "$HADOOP_OPTS +-Djava.rmi.server.hostname=对外ip地址 +-Dcom.sun.management.jmxremote.port=9999 +-Dcom.sun.management.jmxremote.ssl=false +-Dcom.sun.management.jmxremote.authenticate=false " +``` + +- 3.保存并退出,并在 $HADOOP_HOME/sbin 目录下执行 `start-all.sh` 重启服务。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ----------- | ----------- | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 | +| 用户名 | JMX连接用户名 | +| 密码 | JMX连接密码 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + + +#### 指标集合:memory_pool + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------| ----------- | ----------- | +| name | 无 | 指标名称 | +| committed | kb | 总量 | +| init | kb | 初始化大小 | +| max | kb | 最大 | +| used | kb | 已使用 | + +#### 指标集合:code_cache (限JDK8及以下) + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------| ----------- | ----------- | +| committed | kb | 总量 | +| init | kb | 初始化大小 | +| max | kb | 最大 | +| used | kb | 已使用 | + +#### 指标集合:class_loading + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------------------| ----------- | ----------- | +| LoadedClassCount | 个 | 已加载类数量 | +| TotalLoadedClassCount | 个 | 历史已加载类总量 | +| UnloadedClassCount | 个 | 未加载类数量 | + + +#### 指标集合:thread + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------------------------| ----------- | ----------- | +| TotalStartedThreadCount | 个 | 已经开始的线程数量 | +| ThreadCount | 个 | 线程数 | +| PeakThreadCount | 个 | 未加载类数量 | +| DaemonThreadCount | 个 | 守护进程数 | +| CurrentThreadUserTime | ms | 使用时间 | +| CurrentThreadCpuTime | ms | 使用CPU时间 | + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hbase_master.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hbase_master.md new file mode 100644 index 00000000000..f75d5cc8e98 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hbase_master.md @@ -0,0 +1,62 @@ +--- +id: hbase_master +title: 监控:Hbase Master监控 +sidebar_label: Apache Hbase Master +keywords: [开源监控系统, 开源数据库监控, HbaseMaster监控] +--- +> 对Hbase Master的通用性能指标进行采集监控 + +**使用协议:HTTP** + +## 监控前操作 + +查看 `hbase-site.xml` 文件,获取 `hbase.master.info.port` 配置项的值,该值用作监控使用。 + +## 配置参数 + + +| 参数名称 | 参数帮助描述 | +| ------------ | -------------------------------------------------------------------- | +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 端口 | hbase master的端口号,默认为16010。即:`hbase.master.info.port`参数值 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 查询超时时间 | 设置连接的超时时间,单位ms毫秒,默认3000毫秒。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:server + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- |----| ---------------------------- | +| numRegionServers | 无 | 当前存活的 RegionServer 个数 | +| numDeadRegionServers | 无 | 当前Dead的 RegionServer 个数 | +| averageLoad | 无 | 集群平均负载 | +| clusterRequests | 无 | 集群请求数量 | + +#### 指标集合:Rit + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------- | ------ | ------------------- | +| ritCount | 无 | 当前的 RIT 数量 | +| ritCountOverThreshold | 无 | 超过阈值的 RIT 数量 | +| ritOldestAge | ms | 最老的RIT的持续时间 | + +#### 指标集合:basic + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------------------- | ----- | ------------------------ | +| liveRegionServers | 无 | 当前活跃RegionServer列表 | +| deadRegionServers | 无 | 当前离线RegionServer列表 | +| zookeeperQuorum | 无 | Zookeeper列表 | +| masterHostName | 无 | Master节点 | +| BalancerCluster_num_ops | 无 | 集群负载均衡次数 | +| numActiveHandler | 无 | RPC句柄数 | +| receivedBytes | MB | 集群接收数据量 | +| sentBytes | MB | 集群发送数据量(MB) | +| clusterRequests | 无 | 集群总请求数量 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hbase_regionserver.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hbase_regionserver.md new file mode 100644 index 00000000000..44d5b533932 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hbase_regionserver.md @@ -0,0 +1,97 @@ +--- +id: hbase_regionserver +title: 监控 Hbase RegionServer监控 +sidebar_label: Apache Hbase RegionServer +keywords: [开源监控系统, 开源数据库监控, RegionServer监控] +--- +> 对Hbase RegionServer的通用性能指标进行采集监控 + +**使用协议:HTTP** + +## 监控前操作 + +查看 `hbase-site.xml` 文件,获取 `hbase.regionserver.info.port` 配置项的值,该值用作监控使用。 + +## 配置参数 + + +| 参数名称 | 参数帮助描述 | +| ------------ |----------------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 端口 | hbase regionserver的端口号,默认为16030。即:`hbase.regionserver.info.port`参数值 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 查询超时时间 | 设置连接的超时时间,单位ms毫秒,默认3000毫秒。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +> 所有指标名称均直接引用官方的字段,所以存在命名不规范。 + +#### 指标集合:server + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- |-------|------------------------------------------| +| regionCount | 无 | Region数量 | +| readRequestCount | 无 | 重启集群后的读请求数量 | +| writeRequestCount | 无 | 重启集群后的写请求数量 | +| averageRegionSize | MB | 平均Region大小 | +| totalRequestCount | 无 | 全部请求数量 | +| ScanTime_num_ops | 无 | Scan 请求总量 | +| Append_num_ops | 无 | Append 请求量 | +| Increment_num_ops | 无 | Increment请求量 | +| Get_num_ops | 无 | Get 请求量 | +| Delete_num_ops | 无 | Delete 请求量 | +| Put_num_ops | 无 | Put 请求量 | +| ScanTime_mean | 无 | 平均 Scan 请求时间 | +| ScanTime_min | 无 | 最小 Scan 请求时间 | +| ScanTime_max | 无 | 最大 Scan 请求时间 | +| ScanSize_mean | bytes | 平均 Scan 请求大小 | +| ScanSize_min | 无 | 最小 Scan 请求大小 | +| ScanSize_max | 无 | 最大 Scan 请求大小 | +| slowPutCount | 无 | 慢操作次数/Put | +| slowGetCount | 无 | 慢操作次数/Get | +| slowAppendCount | 无 | 慢操作次数/Append | +| slowIncrementCount | 无 | 慢操作次数/Increment | +| slowDeleteCount | 无 | 慢操作次数/Delete | +| blockCacheSize | 无 | 缓存块内存占用大小 | +| blockCacheCount | 无 | 缓存块数量_Block Cache 中的 Block 数量 | +| blockCacheExpressHitPercent | 无 | 读缓存命中率 | +| memStoreSize | 无 | Memstore 大小 | +| FlushTime_num_ops | 无 | RS写磁盘次数/Memstore flush 写磁盘次数 | +| flushQueueLength | 无 | Region Flush 队列长度 | +| flushedCellsSize | 无 | flush到磁盘大小 | +| storeFileCount | 无 | Storefile 个数 | +| storeCount | 无 | Store 个数 | +| storeFileSize | 无 | Storefile 大小 | +| compactionQueueLength | 无 | Compaction 队列长度 | +| percentFilesLocal | 无 | Region 的 HFile 位于本地 HDFS Data Node的比例 | +| percentFilesLocalSecondaryRegions | 无 | Region 副本的 HFile 位于本地 HDFS Data Node的比例 | +| hlogFileCount | 无 | WAL 文件数量 | +| hlogFileSize | 无 | WAL 文件大小 | + +#### 指标集合:IPC + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------- | ------ | ------------------- | +| numActiveHandler | 无 | 当前的 RIT 数量 | +| NotServingRegionException | 无 | 超过阈值的 RIT 数量 | +| RegionMovedException | ms | 最老的RIT的持续时间 | +| RegionTooBusyException | ms | 最老的RIT的持续时间 | + +#### 指标集合:JVM + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------------------- | ----- | ------------------------ | +| MemNonHeapUsedM | 无 | 当前活跃RegionServer列表 | +| MemNonHeapCommittedM | 无 | 当前离线RegionServer列表 | +| MemHeapUsedM | 无 | Zookeeper列表 | +| MemHeapCommittedM | 无 | Master节点 | +| MemHeapMaxM | 无 | 集群负载均衡次数 | +| MemMaxM | 无 | RPC句柄数 | +| GcCount | MB | 集群接收数据量 | + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hdfs_datanode.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hdfs_datanode.md new file mode 100644 index 00000000000..efb05494290 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hdfs_datanode.md @@ -0,0 +1,56 @@ +--- +id: hdfs_datanode +title: 监控:Apache HDFS DataNode监控 +sidebar_label: Apache HDFS DataNode +keywords: [大数据监控系统, 分布式文件系统监控, Apache HDFS DataNode监控] +--- + +> Hertzbeat 对 Apache HDFS DataNode 节点监控指标进行监控。 + +**使用协议:HTTP** + +## 监控前操作 + +获取 Apache HDFS DataNode 的 HTTP 监控端口。 取值:`dfs.datanode.http.address` + +## 配置参数 + +| 参数名称 | 参数帮助描述 | +| ---------------- |---------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。不带协议头。 | +| 端口 | Apache HDFS DataNode 的监控端口号,默认为50075。 | +| 查询超时时间 | 查询 Apache HDFS DataNode 的超时时间,单位毫秒,默认6000毫秒。 | +| 指标采集间隔 | 监控数据采集的时间间隔,单位秒,最小间隔为30秒。 | +| 是否探测 | 新增监控前是否先探测检查监控可用性。 | +| 描述备注 | 此监控的更多描述和备注信息。 | + +### 采集指标 + +#### 指标集合:FSDatasetState + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------------- | -------- | ------------------------------------ | +| DfsUsed | GB | DataNode HDFS使用量 | +| Remaining | GB | DataNode HDFS剩余空间 | +| Capacity | GB | DataNode HDFS空间总量 | + +#### 指标集合:JvmMetrics + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------ | -------- | ------------------------------------ | +| MemNonHeapUsedM | MB | JVM 当前已经使用的 NonHeapMemory 的大小 | +| MemNonHeapCommittedM | MB | JVM 配置的 NonHeapCommittedM 的大小 | +| MemHeapUsedM | MB | JVM 当前已经使用的 HeapMemory 的大小 | +| MemHeapCommittedM | MB | JVM HeapMemory 提交大小 | +| MemHeapMaxM | MB | JVM 配置的 HeapMemory 的大小 | +| MemMaxM | MB | JVM 运行时可以使用的最大内存大小 | +| ThreadsRunnable | 个 | 处于 RUNNABLE 状态的线程数量 | +| ThreadsBlocked | 个 | 处于 BLOCKED 状态的线程数量 | +| ThreadsWaiting | 个 | 处于 WAITING 状态的线程数量 | +| ThreadsTimedWaiting | 个 | 处于 TIMED WAITING 状态的线程数量 | + +#### 指标集合:runtime + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------| -------- | ----------------- | +| StartTime | | 启动时间 | \ No newline at end of file diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hdfs_namenode.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hdfs_namenode.md new file mode 100644 index 00000000000..26fd5e985af --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hdfs_namenode.md @@ -0,0 +1,93 @@ +--- +id: hdfs_namenode +title: 监控:Apache HDFS NameNode监控 +sidebar_label: Apache HDFS NameNode +keywords: [大数据监控系统, 分布式文件系统监控, Apache HDFS NameNode监控] +--- + +> Hertzbeat 对 Apache HDFS NameNode 节点监控指标进行监控。 + +**使用协议:HTTP** + +## 监控前操作 + +获取 Apache HDFS NameNode 的 HTTP 监控端口。取值:`dfs.namenode.http-address` + +## 配置参数 + +| 参数名称 | 参数帮助描述 | +| ---------------- |---------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。不带协议头。 | +| 端口 | HDFS NameNode 的监控端口号,默认为50070。 | +| 查询超时时间 | 查询 HDFS NameNode 的超时时间,单位毫秒,默认6000毫秒。 | +| 指标采集间隔 | 监控数据采集的时间间隔,单位秒,最小间隔为30秒。 | +| 是否探测 | 新增监控前是否先探测检查监控可用性。 | +| 描述备注 | 此监控的更多描述和备注信息。 | + +### 采集指标 + +#### 指标集合:FSNamesystem + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------------- | -------- | ------------------------------------ | +| CapacityTotal | | 集群存储总容量 | +| CapacityTotalGB | GB | 集群存储总容量 | +| CapacityUsed | | 集群存储已使用容量 | +| CapacityUsedGB | GB | 集群存储已使用容量 | +| CapacityRemaining | | 集群存储剩余容量 | +| CapacityRemainingGB | GB | 集群存储剩余容量 | +| CapacityUsedNonDFS | | 集群非 HDFS 使用容量 | +| TotalLoad | | 整个集群的客户端连接数 | +| FilesTotal | | 集群文件总数量 | +| BlocksTotal | | 总 BLOCK 数量 | +| PendingReplicationBlocks | | 等待被备份的块数量 | +| UnderReplicatedBlocks | | 副本数不够的块数量 | +| CorruptBlocks | | 坏块数量 | +| ScheduledReplicationBlocks | | 安排要备份的块数量 | +| PendingDeletionBlocks | | 等待被删除的块数量 | +| ExcessBlocks | | 多余的块数量 | +| PostponedMisreplicatedBlocks | | 被推迟处理的异常块数量 | +| NumLiveDataNodes | | 活的数据节点数量 | +| NumDeadDataNodes | | 已经标记为 Dead 状态的数据节点数量 | +| NumDecomLiveDataNodes | | 下线且 Live 的节点数量 | +| NumDecomDeadDataNodes | | 下线且 Dead 的节点数量 | +| NumDecommissioningDataNodes | | 正在下线的节点数量 | +| TransactionsSinceLastCheckpoint | | 从上次Checkpoint之后的事务数量 | +| LastCheckpointTime | | 上一次Checkpoint时间 | +| PendingDataNodeMessageCount | | DATANODE 的请求被 QUEUE 在 standby namenode 中的个数 | + +#### 指标集合:RPC + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------- | -------- | ---------------------- | +| ReceivedBytes | | 接收数据速率 | +| SentBytes | | 发送数据速率 | +| RpcQueueTimeNumOps | | RPC 调用速率 | + +#### 指标集合:runtime + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------| -------- | ----------------- | +| StartTime | | 启动时间 | + +#### 指标集合:JvmMetrics + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------ | -------- | ---------------- | +| MemNonHeapUsedM | MB | JVM 当前已经使用的 NonHeapMemory 的大小 | +| MemNonHeapCommittedM | MB | JVM 配置的 NonHeapCommittedM 的大小 | +| MemHeapUsedM | MB | JVM 当前已经使用的 HeapMemory 的大小 | +| MemHeapCommittedM | MB | JVM HeapMemory 提交大小 | +| MemHeapMaxM | MB | JVM 配置的 HeapMemory 的大小 | +| MemMaxM | MB | JVM 运行时可以使用的最大内存大小 | +| GcCountParNew | 次 | 新生代GC消耗时间 | +| GcTimeMillisParNew | 毫秒 | 新生代GC消耗时间 | +| GcCountConcurrentMarkSweep | 毫秒 | 老年代GC次数 | +| GcTimeMillisConcurrentMarkSweep | 个 | 老年代GC消耗时间 | +| GcCount | 个 | GC次数 | +| GcTimeMillis | 个 | GC消耗时间 | +| ThreadsRunnable | 个 | 处于 BLOCKED 状态的线程数量 | +| ThreadsBlocked | 个 | 处于 BLOCKED 状态的线程数量 | +| ThreadsWaiting | 个 | 处于 WAITING 状态的线程数量 | +| ThreadsTimedWaiting | 个 | 处于 TIMED WAITING 状态的线程数量 | + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hive.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hive.md new file mode 100644 index 00000000000..2c2136f91cf --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hive.md @@ -0,0 +1,77 @@ +--- +id: hive +Title: 监控 Apache Hive +sidebar_label: Apache Hive +keywords: [开源监控工具, 开源 Apache Hive 监控工具, 监控 Apache Hive 指标] +--- + +> 收集和监控由 SpringBoot Actuator 提供的常规性能指标。 + +## 监控前操作 + +如果您想使用此监控类型监控 Apache Hive 的信息,您需要以远程模式启动您的 Hive Server2。 + +**1、启用元数据存储:** + +```shell +hive --service metastore & +``` +**2. 启用 Hive Server2:** + +```shell +hive --service hiveserver2 & +``` + +### 配置参数 + +| 参数名称 | 参数描述 | +| ---------- |--------------------------------------------------------| +| 监控主机 | 被监控的目标 IPV4、IPV6 或域名。注意⚠️不要包含协议头(例如:https://,http://)。 | +| 监控名称 | 用于标识此监控的名称,需要保证唯一性。 | +| 端口 | 数据库提供的默认端口为 10002。 | +| 启用 HTTPS | 是否通过 HTTPS 访问网站,请注意⚠️当启用 HTTPS 时,需要将默认端口更改为 443 | +| 采集间隔 | 监控周期性采集数据的时间间隔,单位为秒,最小间隔为 30 秒。 | +| 是否探测 | 在新增监控前是否先进行可用性探测,只有探测成功才会继续新增或修改操作。 | +| 描述备注 | 用于添加关于监控的额外标识和描述信息。 | + +### 采集指标 + +#### 指标收集: 基本信息 + +| 指标名称 | 指标单位 | 指标描述 | +|--------|-------|-----------------------------| +| 虚拟机名称 | 无 | 运行 HiveServer2 的虚拟机(VM)的名称。 | +| 虚拟机供应商 | 无 | 虚拟机的供应商或提供者。 | +| 虚拟机版本 | 无 | 虚拟机的版本。 | +| 允许持续时间 | 无 | HiveServer2 运行的持续时间。 | + +#### 指标收集: 环境信息 + +| 指标名称 | 指标单位 | 指标描述 | +|------------|-------|--------------------------------| +| HTTPS代理端口号 | 无 | 用于 HTTPS 代理通信的端口号。 | +| 操作系统 | 无 | 运行 HiveServer2 的操作系统的名称。 | +| 操作系统版本 | 无 | 操作系统的版本。 | +| 操作系统架构 | 无 | 操作系统的架构。 | +| java运行环境 | 无 | HiveServer2 使用的 Java 运行时环境的名称。 | +| java运行环境版本 | 无 | Java 运行时环境的版本。 | + +#### 指标收集: 线程信息 + +| 指标名称 | 指标单位 | 指标描述 | +|--------|------|------------------------------| +| 线程数量 | None | HiveServer2 当前正在使用的线程数。 | +| 总启动线程数 | None | HiveServer2 启动以来启动的线程总数。 | +| 最高线程数 | None | HiveServer2 在任何给定时间使用的最高线程数。 | +| 守护线程数 | None | HiveServer2 当前活动的守护线程数。 | + +#### 指标收集: 代码缓存 + +| 指标名称 | 指标单位 | 指标描述 | +|------------|-------------|---------------| +| 内存池当前内存 | MB | 当前为内存池分配的内存量。 | +| 内存池初始内存 | MB | 内存池请求的初始内存量。 | +| 内存池可分配最大内存 | MB | 内存池可分配的最大内存量。 | +| 内存池内存使用量 | MB | 内存池已使用内存量 | + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/huawei_switch.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/huawei_switch.md new file mode 100644 index 00000000000..9a4d4400c6c --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/huawei_switch.md @@ -0,0 +1,53 @@ +--- +id: huawei_switch +title: 监控:华为通用交换机 +sidebar_label: 华为通用交换机 +keywords: [ 开源监控系统, 网络监控, 华为通用交换机监控 ] +--- + +> 对 华为交换机 的通用指标(可用性,系统信息,端口流量等)进行采集监控。 + +**使用协议:SNMP** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|---------------------|-------------------------------------------------------------------------------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | SNMP端口号,默认为161 | +| SNMP 版本 | 所使用的SNMP版本 | +| SNMP 团体字 | 用于SNMP v1 和 SNMP v2c,用于在SNMP Agent完成认证,字符串形式。团体名包括“read”和“write”两种,执行SNMP查询操作时,采用“read”团体名进行认证;执行SNMP设置操作时,则采用“write”团体名进行认证。 | +| SNMP username | 用于SNMP v3,MSG 用户名 | +| SNMP contextName | 用于SNMP v3,用于确定Context EngineID对被管理设备的MIB视图。 | +| SNMP authPassword | 用于SNMP v3,SNMP 认证密码 | +| authPassword 加密方式 | 用于SNMP v3,SNMP 认证算法 | +| SNMP privPassphrase | 用于SNMP v3,SNMP 加密密码 | +| privPassword 加密方式 | 用于SNMP v3,SNMP 加密算法 | +| 查询超时时间 | 设置查询未响应数据时的超时时间,单位ms毫秒,默认6000毫秒。 | +| 采集间隔 | 监控周期性采集数据的时间间隔,单位为秒,最小间隔为 30 秒。 | +| 描述备注 | 用于添加关于监控的额外标识和描述信息。 | + +### 采集指标 + +由于华为通用交换机可查询的指标过多,详细的指标可于[华为MIB查询平台](https://info.support.huawei.com/info-finder/tool/zh/enterprise/mib) +进行查询。 + +此文档仅介绍监控模板中查询的监控指标。 + +#### 指标集合:huawei_core + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------|--------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| ifIndex | 无 | 接口索引 该值大于零且全局唯一。 | +| ifDescr | 无 | 描述接口的字符串,应该包含制造商、产品名和接口软硬件的版本。 | +| ifMtu | octets | 最大传输单元。接口上可以传送的最大报文的大小。对于传输网络数据报的接口,这是接口可以传输的最大数据报的大小。 | +| ifSpeed | 比特/秒 | 估计的接口当前带宽。对于带宽无法改变或者无法准确估计的接口,该项为额定带宽值。 如果接口的带宽比该表项的值大,则该表项的值是其最大值(4,294,967,295),并且ifHighSpeed的值是接口的速率。对于没有速率概念的子层接口,该表项的值为零。 | +| ifInOctets | octets | 该接口入方向通过的总字节数,包括分桢的数据。在管理系统的重新初始化和ifCounterDiscontinuityTime项指定的时间内,该节点的值将出现不连续的情况。 | +| ifInDiscards | 无 | 入方向的被丢弃的报文个数,即使没有错误发生。也将阻止这些报文送往上层协议。 一个可能的原因是释放buffer的空间。在管理系统的重新初始化和ifCounterDiscontinuityTime项指定的时间内,该节点的值将出现不连续的情况。 | +| ifInErrors | 无 | 出错而不会被送往上层协议的报文/传输单元个数。在管理系统的重新初始化和ifCounterDiscontinuityTime项指定的时间内,该节点的值将出现不连续的情况。 | +| ifOutOctets | octets | 该接口出方向通过的总字节数,包括分桢的数据。在管理系统的重新初始化和ifCounterDiscontinuityTime项指定的时间内,该节点的值将出现不连续的情况。 | +| ifOutDiscards | 无 | 出方向的被丢弃的报文个数,即使没有错误发生。也将阻止这些报文发送。丢弃此类报文的一个可能原因是为了释放缓冲区空间。 在管理系统的重新初始化和ifCounterDiscontinuityTime项指定的时间内,该节点的值将出现不连续的情况。 | +| ifOutErrors | 无 | 对于面向数据包的接口,该节点表示由于错误而无法发送的数据包数量。对于面向字符或固定长度接口,该节点表示由于错误而无法传输的传输单元的数量。这种计数器的值可能在管理系统的重新初始化时会不连续,其他时间如ifCounterDiscontinuityTime的值。 | +| ifAdminStatus | 无 | 接口的理想状态。 testing(3)状态表示没有可操作的数据包通过。 当受管系统初始化时,全部接口开始于ifAdminStatus在down(2)状态。由于明确的管理动作或被管理的系统保留的每个配置信息,ifAdminStatus然后被更改为Up(1)或testing(3)状态(或保留在down(2)状态)。 | +| ifOperStatus | 无 | 当前接口的操作状态。testing(3)状态表示没有可操作的数据包可以通过。如果ifAdminStatus是down(2),则ifOperStatus应该是down(2)。 如果ifAdminStatus是改为up(1),则ifOperStatus应该更改为up(1)。如果接口准备好传输,接收网络流量; 它应该改为dormant(5)。如果接口正在等待外部动作(如串行线路等待传入连接); 它应该保持在down(2)状态,并且只有当有故障阻止它变成up(1)状态。 它应该留在notPresent(6)状态如果接口缺少(通常为硬件)组件。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hugegraph.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hugegraph.md new file mode 100644 index 00000000000..8770ababdcd --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/hugegraph.md @@ -0,0 +1,146 @@ +--- +id: hugegraph +title: 监控:HugeGraph监控 +sidebar_label: Apache HugeGraph +keywords: [开源监控系统, 开源数据库监控, HugeGraph监控] +--- +> 对HugeGraph的通用性能指标进行采集监控 + +**使用协议:HTTP** + +## 监控前操作 + +查看 `rest-server.properties` 文件,获取 `restserver_port` 配置项的值,该值用作监控使用。 + +## 配置参数 + + +| 参数名称 | 参数帮助描述 | +|-----------|---------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 端口 | HugeGraph restserver的端口号,默认为8080。即:`restserver_port`参数值 | +| 启动SSL | 使用使用SSL | +| Base Path | 基础路径,默认为: /metrics ,通常情况下不需要修改 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:gauges + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------------------ | -------- | --------------------------------- | +| edge-hugegraph-capacity | 无 | 表示当前图中边的容量上限 | +| edge-hugegraph-expire | 无 | 表示边数据的过期时间 | +| edge-hugegraph-hits | 无 | 表示边数据缓存的命中次数 | +| edge-hugegraph-miss | 无 | 表示边数据缓存的未命中次数 | +| edge-hugegraph-size | 无 | 表示当前图中边的数量 | +| instances | 无 | 表示当前运行的HugeGraph实例数量| +| schema-id-hugegraph-capacity | 无 | 表示图中schema ID的容量上限 | +| schema-id-hugegraph-expire | 无 | 表示schema ID数据的过期时间 | +| schema-id-hugegraph-hits | 无 | 表示schema ID数据缓存的命中次数| +| schema-id-hugegraph-miss | 无 | 表示schema ID数据缓存的未命中次数| +| schema-id-hugegraph-size | 无 | 表示当前图中schema ID的数量 | +| schema-name-hugegraph-capacity | 无 | 表示图中schema名称的容量上限 | +| schema-name-hugegraph-expire | 无 | 表示schema名称数据的过期时间 | +| schema-name-hugegraph-hits | 无 | 表示schema名称数据缓存的命中次数| +| schema-name-hugegraph-miss | 无 | 表示schema名称数据缓存的未命中次数| +| schema-name-hugegraph-size | 无 | 表示当前图中schema名称的数量 | +| token-hugegraph-capacity | 无 | 表示图中token的容量上限 | +| token-hugegraph-expire | 无 | 表示token数据的过期时间 | +| token-hugegraph-hits | 无 | 表示token数据缓存的命中次数 | +| token-hugegraph-miss | 无 | 表示token数据缓存的未命中次数 | +| token-hugegraph-size | 无 | 表示当前图中token的数量 | +| users-hugegraph-capacity | 无 | 表示图中用户的容量上限 | +| users-hugegraph-expire | 无 | 表示用户数据的过期时间 | +| users-hugegraph-hits | 无 | 表示用户数据缓存的命中次数 | +| users-hugegraph-miss | 无 | 表示用户数据缓存的未命中次数 | +| users-hugegraph-size | 无 | 表示当前图中用户的数量 | +| users_pwd-hugegraph-capacity | 无 | 表示users_pwd的容量上限 | +| users_pwd-hugegraph-expire | 无 | 表示users_pwd数据的过期时间 | +| users_pwd-hugegraph-hits | 无 | 表示users_pwd数据缓存的命中次数 | +| users_pwd-hugegraph-miss | 无 | 表示users_pwd数据缓存的未命中次数| +| users_pwd-hugegraph-size | 无 | 表示当前图中users_pwd的数量 | +| vertex-hugegraph-capacity | 无 | 表示图中顶点的容量上限 | +| vertex-hugegraph-expire | 无 | 表示顶点数据的过期时间 | +| vertex-hugegraph-hits | 无 | 表示顶点数据缓存的命中次数 | +| vertex-hugegraph-miss | 无 | 表示顶点数据缓存的未命中次数 | +| vertex-hugegraph-size | 无 | 表示当前图中顶点的数量 | +| batch-write-threads | 无 | 表示批量写入操作时的线程数 | +| max-write-threads | 无 | 表示最大写入操作的线程数 | +| pending-tasks | 无 | 表示待处理的任务数 | +| workers | 无 | 表示当前工作线程的数量 | +| average-load-penalty | 无 | 表示平均加载延迟 | +| estimated-size | 无 | 表示估计的数据大小 | +| eviction-count | 无 | 表示被驱逐的数据条数 | +| eviction-weight | 无 | 表示被驱逐数据的权重 | +| hit-count | 无 | 表示缓存命中总数 | +| hit-rate | 无 | 表示缓存命中率 | +| load-count | 无 | 表示数据加载次数 | +| load-failure-count | 无 | 表示数据加载失败次数 | +| load-failure-rate | 无 | 表示数据加载失败率 | +| load-success-count | 无 | 表示数据加载成功次数 | +| long-run-compilation-count | 无 | 表示长时间运行的编译次数 | +| miss-count | 无 | 表示缓存未命中总数 | +| miss-rate | 无 | 表示缓存未命中率 | +| request-count | 无 | 表示总的请求次数 | +| total-load-time | 无 | 表示总的数据加载时间 | +| sessions | 无 | 表示当前的活动会话数量 | + + + +#### 指标集合:counters + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------------------------------- | -------- | ---------------------------------------- | +| GET-SUCCESS_COUNTER | 无 | 记录GET请求成功的次数 | +| GET-TOTAL_COUNTER | 无 | 记录GET请求的总次数 | +| favicon-ico-GET-FAILED_COUNTER | 无 | 记录获取favicon.ico失败的GET请求次数 | +| favicon-ico-GET-TOTAL_COUNTER | 无 | 记录获取favicon.ico的GET请求总次数 | +| graphs-HEAD-FAILED_COUNTER | 无 | 记录graphs资源的HEAD请求失败的次数 | +| graphs-HEAD-SUCCESS_COUNTER | 无 | 记录graphs资源的HEAD请求成功的次数 | +| graphs-HEAD-TOTAL_COUNTER | 无 | 记录graphs资源的HEAD请求的总次数 | +| graphs-hugegraph-graph-vertices-GET-SUCCESS_COUNTER | 无 | 记录获取HugeGraph图中顶点的GET请求成功的次数 | +| graphs-hugegraph-graph-vertices-GET-TOTAL_COUNTER | 无 | 记录获取HugeGraph图中顶点的GET请求的总次数 | +| metircs-GET-FAILED_COUNTER | 无 | 记录获取metrics失败的GET请求次数 | +| metircs-GET-TOTAL_COUNTER | 无 | 记录获取metrics的GET请求总次数 | +| metrics-GET-SUCCESS_COUNTER | 无 | 记录获取metrics成功的GET请求次数 | +| metrics-GET-TOTAL_COUNTER | 无 | 记录获取metrics的GET请求总次数 | +| metrics-gauges-GET-SUCCESS_COUNTER | 无 | 记录获取metrics gauges成功的GET请求次数 | +| metrics-gauges-GET-TOTAL_COUNTER | 无 | 记录获取metrics gauges的GET请求总次数 | + + + +#### 指标集合:system + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------------------------------- | -------- | -------------------------------------------------- | +| mem | 无 | 表示系统的总内存量 | +| mem_total | 无 | 表示系统的总内存量(与mem相同) | +| mem_used | 无 | 表示系统当前使用的内存量 | +| mem_free | 无 | 表示系统空闲的内存量 | +| mem_unit | 无 | 表示内存量的单位(如字节、千字节、兆字节等) | +| processors | 无 | 表示系统的处理器数量 | +| uptime | 无 | 表示系统运行时间,即从启动到现在的时间 | +| systemload_average | 无 | 表示系统的平均负载,反映了系统的繁忙程度 | +| heap_committed | 无 | 表示JVM堆内存的承诺大小,即保证可供JVM使用的堆内存大小 | +| heap_init | 无 | 表示JVM堆内存的初始大小 | +| heap_used | 无 | 表示JVM当前使用的堆内存大小 | +| heap_max | 无 | 表示JVM堆内存的最大可使用大小 | +| nonheap_committed | 无 | 表示JVM非堆内存的承诺大小 | +| nonheap_init | 无 | 表示JVM非堆内存的初始大小 | +| nonheap_used | 无 | 表示JVM当前使用的非堆内存大小 | +| nonheap_max | 无 | 表示JVM非堆内存的最大可使用大小 | +| thread_peak | 无 | 表示自JVM启动以来峰值线程数 | +| thread_daemon | 无 | 表示当前活跃的守护线程数 | +| thread_total_started | 无 | 表示自JVM启动以来总共启动过的线程数 | +| thread_count | 无 | 表示当前活跃的线程数 | +| garbage_collector_g1_young_generation_count | 无 | 表示G1垃圾收集器年轻代垃圾收集的次数 | +| garbage_collector_g1_young_generation_time | 无 | 表示G1垃圾收集器年轻代垃圾收集的总时间 | +| garbage_collector_g1_old_generation_count | 无 | 表示G1垃圾收集器老年代垃圾收集的次数 | +| garbage_collector_g1_old_generation_time | 无 | 表示G1垃圾收集器老年代垃圾收集的总时间 | +| garbage_collector_time_unit | 无 | 表示垃圾收集时间的单位(如毫秒、秒等) | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/influxdb.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/influxdb.md new file mode 100644 index 00000000000..1881d79f4ee --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/influxdb.md @@ -0,0 +1,68 @@ +--- +id: influxdb +title: 监控:InfluxDB 数据库监控 +sidebar_label: InfluxDB 数据库 +keywords: [开源监控系统, 开源数据库监控, InfluxDB 数据库监控] +--- + + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ----------- |------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 数据库对外提供的端口,默认为8086。 | +| URL | 数据库连接URL,一般是由host拼接,不需要添加 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:influxdb 基本信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------| ----------- |--------| +| build_date | 无 | 创建日期 | +| os | 无 | 操作系统 | +| cpus | 无 | cpus | +| version | 无 | 版本号 | + +#### 指标集合:http 响应时间 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------|------|---------| +| handler | 无 | handler | +| path | 无 | 路径 | +| response_code | 无 | 返回code | +| method | 无 | 请求方法 | +| user_agent | 无 | 用户代理 | +| status | 无 | 状态 | + +#### 指标集合:正在排队的 TSM 数 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------------------------|------|------------| +| bucket | 无 | 存储桶 | +| engine | 无 | 引擎类型 | +| id | 无 | 标识符 | +| level | 无 | 级别 | +| path | 无 | 数据文件路径 | + + +#### 指标集合:HTTP写入请求的字节数量 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- |------|--------| +| endpoint | 无 | 终点 | +| org_id | 无 | 组织标识符 | +| status | 无 | 状态 | + +#### 指标集合:质量控制请求总数 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- |------|--------| +| result | 无 | 结果 | +| org | 无 | 组织标识符 | + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/influxdb_promql.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/influxdb_promql.md new file mode 100644 index 00000000000..ac56245fee4 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/influxdb_promql.md @@ -0,0 +1,63 @@ +--- +id: influxdb_promql +title: 监控:InfluxDB-PromQL +sidebar_label: InfluxDB-PromQL +keywords: [ 开源监控系统, InfluxDB监控,InfluxDB-PromQL监控 ] +--- + +> 使用 Prometheus PromQL 从 Prometheus 服务器中查询到 InfluxDB 的通用指标数据来进行监控。此方案适用于 Prometheus 已监控 InfluxDB,需要从 Prometheus 服务器抓取 InfluxDB 的监控数据。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Prometheus api 端口,默认值:9090。 | +| 相对路径 | Prometheus查询PromQL的URL,默认值:/api/v1/query。 | +| 请求方式 | 设置接口调用的请求方式:GET,POST,PUT,DELETE,默认值:GET。 | +| 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443。 | +| 用户名 | 接口Basic认证或Digest认证时使用的用户名。 | +| 密码 | 接口Basic认证或Digest认证时使用的密码。 | +| Content-Type | 设置携带BODY请求体数据请求时的资源类型。 | +| 请求BODY | 设置携带BODY请求体数据,PUT POST请求方式时有效。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:basic_influxdb_memstats_alloc + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|---------| +| instance | 无 | 指标所属实例 | +| timestamp | 无 | 采集指标时间戳 | +| value | 无 | 指标值 | + +#### 指标集合: influxdb_database_numMeasurements + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|---------| +| job | 无 | 指标名称 | +| instance | 无 | 指标所属实例 | +| database | 无 | 数据库名称 | +| timestamp | 无 | 采集指标时间戳 | +| value | 无 | 指标值 | + +#### 指标集合: influxdb_query_rate_seconds + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|---------| +| instance | 无 | 指标所属实例 | +| timestamp | 无 | 采集指标时间戳 | +| value | 无 | 指标值 | + +#### 指标集合: influxdb_queryExecutor_queriesFinished_10s + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|---------| +| instance | 无 | 指标所属实例 | +| timestamp | 无 | 采集指标时间戳 | +| value | 无 | 指标值 | + + diff --git a/home/versioned_docs/version-v1.1.x/help/iotdb.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/iotdb.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/iotdb.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/iotdb.md index fe1c33ffd0b..0f0dc0e0ecb 100644 --- a/home/versioned_docs/version-v1.1.x/help/iotdb.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/iotdb.md @@ -50,7 +50,7 @@ predefinedMetrics: | 参数名称 | 参数帮助描述 | |--------|------------------------------------------------------| | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | IoTDB指标接口对外提供的端口,默认为9091。 | | 超时时间 | HTTP请求查询超时时间 | | 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | diff --git a/home/versioned_docs/version-v1.1.x/help/issue.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/issue.md similarity index 82% rename from home/versioned_docs/version-v1.1.x/help/issue.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/issue.md index 49577b2a1b7..b7414f878b1 100644 --- a/home/versioned_docs/version-v1.1.x/help/issue.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/issue.md @@ -16,17 +16,15 @@ sidebar_label: 常见问题 安装包安装部署的hertzbeat,对ping连通性监控不可用,但本地直接ping是可用的。 > 安装包部署需要配置java虚拟机root权限启动hertzbeat从而使用ICMP,若未启用root权限则是判断telnet对端7号端口是否开通 > docker安装默认启用无此问题 +> 详见 https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address -4. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖服务TDengine时序数据库] -> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - TDengine数据库 -> 安装初始化此数据库参考 [TDengine安装初始化](../start/tdengine-init) - -5. 配置了k8s监控,但是实际监控时间并未按照正确间隔时间执行 +4. 配置了k8s监控,但是实际监控时间并未按照正确间隔时间执行 请参考下面几点排查问题: > 一:首先查看hertzbeat的错误日志,如果出现了'desc: SQL statement too long, check maxSQLLength config',信息 > 二:需要调整tdengine配置文件,可在服务器创建taos.cfg文件,调整# max length of an SQL : maxSQLLength 654800,然后重启tdengine,需要加入配置文件的挂载 > 三:如果遇到了重启tdengine失败,需要调整挂载数据文件中的配置,见 .../taosdata/dnode/dnodeEps.json,中dnodeFqdn调整为启动失败的dockerId即可,然后docker restart tdengine -6.配置http api监控,用于进行业务接口探测,确保业务可以用,另外接口有进行token鉴权校验,"Authorization:Bearer eyJhbGciOiJIUzI1....",配置后测试,提示“StatusCode 401”。服务端应用收到的token为"Authorization:Bearer%20eyJhbGciOiJIUzI1....",hertzbeat对空格进行转义为“%20”,服务器没有转义导致鉴权失败,建议转义功能作为可选项。 + +5. 配置http api监控,用于进行业务接口探测,确保业务可以用,另外接口有进行token鉴权校验,"Authorization:Bearer eyJhbGciOiJIUzI1....",配置后测试,提示“StatusCode 401”。服务端应用收到的token为"Authorization:Bearer%20eyJhbGciOiJIUzI1....",hertzbeat对空格进行转义为“%20”,服务器没有转义导致鉴权失败,建议转义功能作为可选项。 ### Docker部署常见问题 diff --git a/home/versioned_docs/version-v1.1.x/help/jetty.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/jetty.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/jetty.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/jetty.md index 6c7a6692434..04a15823529 100644 --- a/home/versioned_docs/version-v1.1.x/help/jetty.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/jetty.md @@ -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连接密码 | diff --git a/home/versioned_docs/version-v1.1.x/help/jvm.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/jvm.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/jvm.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/jvm.md index 7d28f7db71e..c97cc73b003 100644 --- a/home/versioned_docs/version-v1.1.x/help/jvm.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/jvm.md @@ -31,7 +31,7 @@ keywords: [开源监控系统, 开源JAVA监控, JVM虚拟机监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 查询超时时间 | 设置JVM连接的超时时间,单位ms毫秒,默认3000毫秒。 | | 用户名 | JMX连接用户名 | | 密码 | JMX连接密码 | diff --git a/home/versioned_docs/version-v1.1.x/help/kafka.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kafka.md similarity index 94% rename from home/versioned_docs/version-v1.1.x/help/kafka.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kafka.md index c13c47617fd..2b4ed0514b7 100644 --- a/home/versioned_docs/version-v1.1.x/help/kafka.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kafka.md @@ -18,7 +18,7 @@ keywords: [开源监控系统, 开源消息中间件监控, Kafka监控] 2. 修改 Kafka 启动脚本 修改 Kafka 安装目录下的启动脚本 `/bin/kafka-server-start.sh` -在倒数第二行添加如下内容, ⚠️注意替换您自己的端口和对外 IP 地址 +在脚本正文(即非注释行)的第一行前添加如下内容, ⚠️注意替换您自己的端口和对外 IP 地址 ```shell export JMX_PORT=9999; @@ -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连接密码 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kafka_promql.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kafka_promql.md new file mode 100644 index 00000000000..a0b0b625485 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kafka_promql.md @@ -0,0 +1,56 @@ +--- +id: kafka_promql +title: 监控:Kafka-PromQL +sidebar_label: Kafka-PromQL +keywords: [ 开源监控系统,开源中间件监控, Kafka监控,Kafka-PromQL监控 ] +--- + +> 使用 Prometheus PromQL 从 Prometheus 服务器中查询到 Kafka 的通用指标数据来进行监控。此方案适用于 Prometheus 已监控 Kafka,需要从 Prometheus 服务器抓取 Kafka 的监控数据。 + +### 前置条件 + +1. 部署 kafka; +2. 部署 kafka_exporter; +3. 通过 prometheus 采集 kafka_exporter暴露的监控指标; + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Prometheus api 端口,默认值:9090。 | +| 相对路径 | Prometheus查询PromQL的URL,默认值:/api/v1/query。 | +| 请求方式 | 设置接口调用的请求方式:GET,POST,PUT,DELETE,默认值:GET。 | +| 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443。 | +| 用户名 | 接口Basic认证或Digest认证时使用的用户名。 | +| 密码 | 接口Basic认证或Digest认证时使用的密码。 | +| Content-Type | 设置携带BODY请求体数据请求时的资源类型。 | +| 请求BODY | 设置携带BODY请求体数据,PUT POST请求方式时有效。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:kafka_brokers + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|---------| +| \_\_name__ | 无 | 指标名称 | +| instance | 无 | 指标所属实例 | +| timestamp | 无 | 采集指标时间戳 | +| value | 无 | 指标值 | + +#### 指标集合: kafka_topic_partitions + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|---------| +| \_\_name__ | 无 | 指标名称 | +| instance | 无 | 指标所属实例 | +| timestamp | 无 | 采集指标时间戳 | +| value | 无 | 指标值 | + +### HertzBeat支持的其他Kafka监控方式 + +1. kafka启用了JMX监控,可以使用 [Kafka](kafka) 监控; +2. kafka集群部署kafka_exporter暴露的监控指标,可以参考 [Prometheus任务](prometheus) 配置Prometheus采集任务监控kafka。 diff --git a/home/versioned_docs/version-v1.1.x/help/kubernetes.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kubernetes.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/kubernetes.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kubernetes.md index 9700168e620..f45da8d9b27 100644 --- a/home/versioned_docs/version-v1.1.x/help/kubernetes.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/kubernetes.md @@ -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里面的数据库名称,用户名密码等参数会覆盖上面配置的参数 | diff --git a/home/versioned_docs/version-v1.1.x/help/linux.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/linux.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/linux.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/linux.md index 83bb93ee276..853be6610b4 100644 --- a/home/versioned_docs/version-v1.1.x/help/linux.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/linux.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源操作系统监控, Linux操作系统监控 | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | Linux SSH对外提供的端口,默认为22。 | | 用户名 | SSH连接用户名,可选 | | 密码 | SSH连接密码,可选 | diff --git a/home/versioned_docs/version-v1.1.x/help/mariadb.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mariadb.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/mariadb.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mariadb.md index bee07e51493..5fd59466717 100644 --- a/home/versioned_docs/version-v1.1.x/help/mariadb.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mariadb.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, MariaDB数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为3306。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/memcached.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/memcached.md new file mode 100644 index 00000000000..0debad01ce9 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/memcached.md @@ -0,0 +1,67 @@ +--- +id: memcached +title: 监控 Memcached +sidebar_label: Memcached +keywords: [ 开源监控工具, 开源 Memcached 监控工具, 监控 memcached 指标 ] +--- + +> 收集并监控 Memcached 的一般性能指标。 + +**协议使用:Memcached** + +```text +默认的 YML 配置适用于 Memcached 的版本为 1.4.15。 +您需要使用 stats 命令查看您的 Memcached 可以监控的参数。 +``` + +**1、通过 stats、stats setting、stats settings 等命令获取可用的参数指标。** + +```shell +# telnet ip port +[root@server ~]# telnet localhost 11211 +Trying ::1... +Connected to localhost. +Escape character is '^]'. +stats +STAT pid 15168 +STAT uptime 11691 +STAT time 1702569246 +STAT version 1.4.15 +... +``` + +**帮助文档: https://www.runoob.com/memcached/memcached-stats.html** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|------|---------------------------------------------------| +| 监控主机 | 被监控的 IPV4、IPV6 或域名。注意⚠️不带协议头(例如:https://,http://) | +| 监控名称 | 标识此监控的名称。名称需要唯一 | +| 端口 | Memcached 提供的端口 | +| 采集间隔 | 监控周期性数据采集的间隔时间,单位:秒,最小可设置间隔为 30 秒 | +| 是否检测 | 添加监控前是否检测并检查可用性。仅在检测成功后才会继续添加和修改操作 | +| 描述备注 | 有关标识和描述此监控的更多信息,用户可以在此备注信息 | + +### 采集指标 + +#### 指标集:server_info + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------------|------|-------------------| +| pid | 无 | Memcache 服务器进程 ID | +| uptime | s | 服务器已运行的秒数 | +| version | 无 | Memcache 版本 | +| curr_connections | 无 | 当前连接数 | +| auth_errors | 无 | 认证失败次数 | +| threads | 无 | 当前线程数 | +| item_size | byte | 条目大小 | +| item_count | 无 | 条目数量 | +| curr_items | 无 | 当前存储的数据总数 | +| total_items | 无 | 自启动以来存储的数据总数 | +| bytes | byte | 当前存储占用的字节数 | +| cmd_get | 无 | Get 命令请求数 | +| cmd_set | 无 | Set 命令请求数 | +| cmd_flush | 无 | Flush 命令请求数 | +| get_misses | 无 | Get 命令未命中次数 | +| delete_misses | 无 | Delete 命令未命中次数 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mongodb.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mongodb.md new file mode 100644 index 00000000000..23c4a866809 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mongodb.md @@ -0,0 +1,96 @@ +--- +id: mongodb +title: 监控:MongoDB数据库 +sidebar_label: MongoDB数据库 +keywords: [ 开源监控系统, 开源数据库监控, MongoDB数据库监控 ] +--- + +> 对MongoDB数据库的通用性能指标进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 数据库对外提供的端口,默认为27017。 | +| 用户名 | MongoDB用户名,可选。 | +| 密码 | MongoDB密码,可选。 | +| 数据库 | 数据库名称 | +| 认证数据库 | 存储用户凭据的数据库名称。 | +| 连接超时时间 | 设置连接MongoDB未响应数据时的超时时间,单位ms毫秒,默认6000毫秒。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:构建信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------------|------|-------------------------| +| version | 无 | MongoDB版本信息 | +| gitVersion | 无 | 源代码git版本 | +| sysInfo | 无 | 系统信息 | +| loaderFlags | 无 | 加载器标志 | +| compilerFlags | 无 | 编译器标志 | +| allocator | 无 | MongoDB所使用的内存分配器 | +| javascriptEngine | 无 | MongoDB所使用的JavaScript引擎 | + +#### 指标集合:服务器文档 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|--------| +| deleted | 无 | 已删除数 | +| inserted | 无 | 已插入数 | +| returned | 无 | 已返回数 | +| updated | 无 | 已更新数 | + +#### 指标集合:服务器操作 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|-------------------| +| scanAndOrder | 无 | 执行查询时需要扫描并进行排序的次数 | +| writeConflicts | 无 | 写冲突的次数 | + +#### 指标集合: 服务器_ttl + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------------|------|-------------------------------| +| deletedDocuments | 无 | 删除的过期文档数量 | +| passes | 无 | TTL清理过程的总传递次数,每次传递会检查并删除过期的文档 | + +#### 指标集合:系统信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------------|------|-----------------------| +| currentTime | 无 | 当前时间 | +| hostname | 无 | 主机名 | +| cpuAddrSize | MB | CPU的地址位数 | +| memSizeMB | MB | 内存大小(MB) | +| memLimitMB | MB | MongoDB进程的内存限制(MB) | +| numCores | 无 | CPU 核数 | +| cpuArch | 无 | CPU 架构 | +| numaEnabled | 无 | 是否启用了NUMA(非一致性内存访问)架构 | + +#### 指标集合:操作系统信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------|------|--------| +| type | 无 | 操作系统类型 | +| name | 无 | 操作系统名称 | +| version | 无 | 版本号 | + +#### 指标集合:额外信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------------|------|----------------------| +| versionString | 无 | 版本 | +| libcVersion | 无 | 标准库版本 | +| kernelVersion | 无 | 内核版本 | +| cpuFrequencyMHz | 无 | CPU 频率(兆赫兹) | +| cpuFeatures | 无 | CPU的特性列表,包括支持的指令集和特性 | +| pageSize | 无 | 内存页大小 | +| numPages | 无 | 内存页数量 | +| maxOpenFiles | 无 | 系统中允许打开的最大文件数 | + diff --git a/home/versioned_docs/version-v1.1.x/help/mysql.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mysql.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/mysql.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mysql.md index 6fa70d36f8f..dc23f3d6fa5 100644 --- a/home/versioned_docs/version-v1.1.x/help/mysql.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/mysql.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Mysql数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为3306。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nacos.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nacos.md new file mode 100644 index 00000000000..8b5313c2dc1 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nacos.md @@ -0,0 +1,93 @@ +--- +id: nacos +title: 监控:Nacos分布式监控 +sidebar_label: Nacos分布式 +keywords: [开源监控系统, 中间件监控, Nacos分布式监控] +--- + +> 通过调用 Nacos Metrics 接口对 Nacos 注册配置中心服务的通用指标进行采集监控。 + +### 监控前操作 + +#### 搭建Nacos集群暴露metrics数据 + +1. 按照[部署文档](https://nacos.io/zh-cn/docs/deployment.html)搭建好Nacos集群。 +2. 配置application.properties文件,暴露metrics数据。 +``` +management.endpoints.web.exposure.include=* +``` +3. 访问```{ip}:8848/nacos/actuator/prometheus```,查看是否能访问到metrics数据。 + +更多信息请参考[Nacos 监控手册](https://nacos.io/zh-cn/docs/monitor-guide.html)。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ----------- | ----------- | +| 服务器Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| Nacos服务端口 | Nacos服务对外提供的端口,默认为8848。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:jvm + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| system_cpu_usage | 无 | CPU使用率 | +| system_load_average_1m | 无 | load | +| jvm_memory_used_bytes | 字节 | 内存使用字节,包含各种内存区 | +| jvm_memory_max_bytes | 字节 | 内存最大字节,包含各种内存区 | +| jvm_gc_pause_seconds_count | 无 | gc次数,包含各种gc | +| jvm_gc_pause_seconds_sum | 秒 | gc耗时,包含各种gc | +| jvm_threads_daemon | 无 | 线程数 | + +#### 指标集合:Nacos + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| http_server_requests_seconds_count | 秒 | http请求次数,包括多种(url,方法,code) | +| http_server_requests_seconds_sum | 秒 | http请求总耗时,包括多种(url,方法,code) | +| nacos_timer_seconds_sum | 秒 | Nacos config水平通知耗时 | +| nacos_timer_seconds_count | 无 | Nacos config水平通知次数 | +| nacos_monitor{name='longPolling'} | 无 | Nacos config长连接数 | +| nacos_monitor{name='configCount'} | 无 | Nacos config配置个数 | +| nacos_monitor{name='dumpTask'} | 无 | Nacos config配置落盘任务堆积数 | +| nacos_monitor{name='notifyTask'} | 无 | Nacos config配置水平通知任务堆积数 | +| nacos_monitor{name='getConfig'} | 无 | Nacos config读配置统计数 | +| nacos_monitor{name='publish'} | 无 | Nacos config写配置统计数 | +| nacos_monitor{name='ipCount'} | 无 | Nacos naming ip个数 | +| nacos_monitor{name='domCount'} | 无 | Nacos naming域名个数(1.x 版本) | +| nacos_monitor{name='serviceCount'} | 无 | Nacos naming域名个数(2.x 版本) | +| nacos_monitor{name='failedPush'} | 无 | Nacos naming推送失败数 | +| nacos_monitor{name='avgPushCost'} | 秒 | Nacos naming平均推送耗时 | +| nacos_monitor{name='leaderStatus'} | 无 | Nacos naming角色状态 | +| nacos_monitor{name='maxPushCost'} | 秒 | Nacos naming最大推送耗时 | +| nacos_monitor{name='mysqlhealthCheck'} | 无 | Nacos naming mysql健康检查次数 | +| nacos_monitor{name='httpHealthCheck'} | 无 | Nacos naming http健康检查次数 | +| nacos_monitor{name='tcpHealthCheck'} | 无 | Nacos naming tcp健康检查次数 | + +#### 指标集合:Nacos 异常 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| nacos_exception_total{name='db'} | 无 | 数据库异常 | +| nacos_exception_total{name='configNotify'} | 无 | Nacos config水平通知失败 | +| nacos_exception_total{name='unhealth'} | 无 | Nacos config server之间健康检查异常 | +| nacos_exception_total{name='disk'} | 无 | Nacos naming写磁盘异常 | +| nacos_exception_total{name='leaderSendBeatFailed'} | 无 | Nacos naming leader发送心跳异常 | +| nacos_exception_total{name='illegalArgument'} | 无 | 请求参数不合法 | +| nacos_exception_total{name='nacos'} | 无 | Nacos请求响应内部错误异常(读写失败,没权限,参数错误) | + +#### 指标集合:client + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| nacos_monitor{name='subServiceCount'} | 无 | 订阅的服务数 | +| nacos_monitor{name='pubServiceCount'} | 无 | 发布的服务数 | +| nacos_monitor{name='configListenSize'} | 无 | 监听的配置数 | +| nacos_client_request_seconds_count | 无 | 请求的次数,包括多种(url,方法,code) | +| nacos_client_request_seconds_sum | 秒 | 请求的总耗时,包括多种(url,方法,code) | + \ No newline at end of file diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nebulagraph.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nebulagraph.md new file mode 100644 index 00000000000..d070101da8f --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nebulagraph.md @@ -0,0 +1,123 @@ +--- +id: nebulaGraph +title: 监控 NebulaGraph 数据库 +sidebar_label: NebulaGraph 数据库 +keywords: [ 开源监控工具, 开源 NebulaGraph 监控工具, 监控 NebulaGraph 指标 ] +--- + +> 收集和监控 NebulaGraph 的常规性能指标。 + +**使用协议:nebulaGraph** + +```text +监控分为两个部分,nebulaGraph_stats 和 rocksdb_stats。 +nebulaGraph_stats 是 NebulaGraph 的统计信息,rocksdb_stats 是 RocksDB 的统计信息。 +``` + +### + +**1、通过 stats 和 rocksdb stats 接口获取可用参数。** + +1.1、如果只需要获取 nebulaGraph_stats,需要确保可以访问 stats,否则会出现错误。 + +默认端口是 19669,访问地址为 http://ip:19669/stats + +1.2、如果需要获取 rocksdb stats 的附加参数,需要确保可以访问 rocksdb stats,否则会报错。 + +首次连接 NebulaGraph 时,必须先注册 Storage 服务,以便正确查询数据。 + +**有帮助文档:https://docs.nebula-graph.com.cn/3.4.3/4.deployment-and-installation/connect-to-nebula-graph/** + +**https://docs.nebula-graph.com.cn/3.4.3/2.quick-start/3.quick-start-on-premise/3.1add-storage-hosts/** + +默认端口是 19779,访问地址为:http://ip:19779/rocksdb_stats + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|-------------|--------------------------------------------------------------------| +| 监控主机 | 被监控的 IPV4、IPV6 或域名。注意⚠️没有协议头(例如:https://、http://) | +| 监控名称 | 识别此监控的名称。名称需要唯一 | +| graphPort | Nebula Graph 提供的 Graph 服务的端口 | +| timePeriod | 可以是 5 秒、60 秒、600 秒或 3600 秒,分别表示最近 5 秒、最近 1 分钟、最近 10 分钟和最近 1 小时的时间段 | +| storagePort | Nebula Graph 提供的 Storage 服务的端口 | +| 超时 | 允许收集响应时间 | +| 收集间隔 | 监控周期性数据收集的间隔时间,单位:秒,最小可设置的间隔为 30 秒 | +| 是否检测 | 是否检测和验证添加监控之前的可用性。只有检测成功后,添加和修改操作才会继续进行 | +| 描述备注 | 用于识别和描述此监控的更多信息,用户可以在此处记录信息 | + +### 收集指标 + +#### 指标集:nebulaGraph_stats + +指标太多,相关链接如下 +**https://docs.nebula-graph.com.cn/3.4.3/6.monitor-and-metrics/1.query-performance-metrics/** + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------------------------------------------------------|------|--------| +| 达到内存水位线的语句的数量(rate) | | | +| 达到内存水位线的语句的数量(sum) | | | +| 服务端主动回收的过期的会话数量(rate) | | | +| 服务端主动回收的过期的会话数量(sum) | | | +| 慢查询延迟时间(avg) | | | +| 慢查询延迟时间(p75) | | | +| 慢查询延迟时间(p95) | | | +| 慢查询延迟时间(p99) | | | +| 慢查询延迟时间(p999) | | | +| 查询延迟时间(avg) | | | +| 查询延迟时间(p75) | | | +| 查询延迟时间(p95) | | | +| 查询延迟时间(p99) | | | +| 查询延迟时间(p999) | | | +| 因用户名密码错误导验证失败的会话数量(rate) | | | +| 因用户名密码错误导验证失败的会话数量(sum) | | | +| 查询次数(rate) | | | +| 查询次数(sum) | | | +| 排序(Sort)算子执行时间(rate) | | | +| 排序(Sort)算子执行时间(sum) | | | +| Graphd 服务发给 Storaged 服务的 RPC 请求失败的数量(rate) | | | +| Graphd 服务发给 Storaged 服务的 RPC 请求失败的数量(sum) | | | +| 登录验证失败的会话数量(rate) | | | +| 登录验证失败的会话数量(sum) | | | +| 查询报错语句数量(rate) | | | +| 查询报错语句数量(sum) | | | +| 被终止的查询数量(rate) | | | +| 被终止的查询数量(sum) | | | +| 因查询错误而导致的 Leader 变更的次数(rate) | | | +| 因查询错误而导致的 Leader 变更的次数(sum) | | | +| Graphd 服务发给 Metad 服务的 RPC 请求数量(rate) | | | +| Graphd 服务发给 Metad 服务的 RPC 请求数量(sum) | | | +| 慢查询次数(rate) | | | +| 慢查询次数(sum) | | | +| 活跃的会话数的变化数(sum) | | | +| 活跃的查询语句数的变化数(sum) | | | +| Graphd 服务接收的语句数(rate) | | | +| Graphd 服务接收的语句数(sum) | | | +| 聚合(Aggregate)算子执行时间(rate) | | | +| 聚合(Aggregate)算子执行时间(sum) | | | +| 优化器阶段延迟时间(avg) | | | +| 优化器阶段延迟时间(p75) | | | +| 优化器阶段延迟时间(p95) | | | +| 优化器阶段延迟时间(p99) | | | +| 优化器阶段延迟时间(p999) | | | +| Graphd 服务发给 Metad 的 RPC 请求失败的数量(rate) | | | +| Graphd 服务发给 Metad 的 RPC 请求失败的数量(sum) | | | +| 索引扫描(IndexScan)算子执行时间(rate) | | | +| 索引扫描(IndexScan)算子执行时间(sum) | | | +| 服务端建立过的会话数量(rate) | | | +| 服务端建立过的会话数量(sum) | | | +| 因为超过FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONS参数导致的验证登录的失败的会话数量(rate) | | | +| 因为超过FLAG_OUT_OF_MAX_ALLOWED_CONNECTIONS参数导致的验证登录的失败的会话数量(sum) | | | +| Graphd 服务发给 Storaged 服务的 RPC 请求数量(rate) | | | +| Graphd 服务发给 Storaged 服务的 RPC 请求数量(sum) | | | + +#### 指标集:rocksdb_stats + +指标太多,相关链接如下 +**https://docs.nebula-graph.com.cn/3.4.3/6.monitor-and-metrics/2.rocksdb-statistics/** + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------------------|------|------------------------| +| rocksdb.backup.read.bytes | | 备份 RocksDB 数据库期间读取的字节数 | +| rocksdb.backup.write.bytes | | 指标名称 | +| ... | | ... | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nebulagraph_cluster.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nebulagraph_cluster.md new file mode 100644 index 00000000000..851f6dd7946 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nebulagraph_cluster.md @@ -0,0 +1,91 @@ +--- +id: nebulagraph_cluster +title: 监控:NebulaGraph集群监控 +sidebar_label: NebulaGraph集群 +keywords: [ 开源监控系统, 开源数据库监控, 开源图数据库监控, NebulaGraph集群监控 ] +--- + +> 对NebulaGraph集群的基础信息、节点,任务等进行监控。 + +**协议使用:ngql** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|---------|------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| graph端口 | graph服务开放的端口,默认为9669。 | +| 连接超时时间 | 连接graph服务超时时间,单位ms毫秒,默认6000毫秒。 | +| 用户名 | 数据库连接用户名。 | +| 密码 | 数据库连接密码。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:基础信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|--------------|------|---------| +| responseTime | 无 | 响应时间 | +| charset | 无 | 字符集 | +| collation | 无 | 字符集排序规则 | + +#### 指标集合:Session + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------------|------|------------| +| session | 无 | session的数量 | +| running_query_count | 无 | 正在执行的查询的数量 | + +#### 指标集合:后台任务 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|--------------|------|--------------| +| queue_jobs | 无 | 等待中的后台任务 | +| running_jobs | 无 | 正在执行的后台任务的数量 | + +#### 指标集合:节点信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------------|------|-----------------| +| total_storage_node | 无 | storage节点的数量 | +| offline_storage_node | 无 | 离线的storage节点的数量 | +| total_meta_node | 无 | meta节点的数量 | +| offline_meta_node | 无 | 离线的meta节点的数量 | +| total_graph_node | 无 | graph节点数量 | +| offline_graph_node | 无 | 离线graph节点数量 | + +#### 指标集合:Storage节点 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------------------|------|---------------------| +| host | 无 | 节点地址 | +| port | 无 | 端口 | +| status | 无 | 状态 (ONLINE/OFFLINE) | +| leaderCount | 无 | 当前节点leader分片的数量 | +| leaderDistribution | 无 | 当前节点leader分片分布 | +| partitionDistribution | 无 | 当前节点上分片分布 | +| version | 无 | 版本 | + +#### 指标集合:Meta节点 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------|------|---------------------| +| host | 无 | 节点地址 | +| port | 无 | 端口 | +| status | 无 | 状态 (ONLINE/OFFLINE) | +| version | 无 | 版本 | + +#### 指标集合:Graph节点 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------|------|---------------------| +| host | 无 | 节点地址 | +| port | 无 | 端口 | +| status | 无 | 状态 (ONLINE/OFFLINE) | +| version | 无 | 版本 | + +> 如果需要自定义监控模板采集NebulaGraph集群的数据,请参考: [NGQL自定义监控](../advanced/extend-ngql.md) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nginx.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nginx.md new file mode 100644 index 00000000000..a509ff7da2a --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/nginx.md @@ -0,0 +1,155 @@ +--- +id: nginx +title: 监控 Nginx +sidebar_label: Nginx 监控 +keywords: [开源监控工具, 开源Java监控工具, 监控Nginx指标] +--- + +> 收集和监控 Nginx 的常规性能指标。 + +**使用的协议:Nginx** + +### 需要启用 Nginx 的 `ngx_http_stub_status_module` 和 `ngx_http_reqstat_module` 监控模块 + +如果你想使用这种监控方式监控 'Nginx' 的信息,你需要修改你的 Nginx 配置文件以启用监控模块。 + +### 启用 ngx_http_stub_status_module + +1. 检查是否已添加 `ngx_http_stub_status_module` + +```shell +nginx -V +``` +查看是否包含 `--with-http_stub_status_module`,如果没有则需要重新编译安装 Nginx。 + +2. 编译安装 Nginx, 添加 `ngx_http_stub_status_module` 模块 + +下载 Nginx 并解压,在目录下执行 + +```shell +./configure --prefix=/usr/local/nginx --with-http_stub_status_module + +make && make install +``` + +3. 修改 Nginx 配置文件 + +修改 `nginx.conf` 文件,添加监控模块暴露端点,如下配置: + +```shell +# modify nginx.conf +server { + listen 80; # port + server_name localhost; + location /nginx-status { + stub_status on; + access_log on; + #allow 127.0.0.1; #only allow requests from localhost + #deny all; #deny all other hosts + } +} +``` + +4. 重新加载 Nginx + +```shell +nginx -s reload +``` + +5. 在浏览器访问 `http://localhost/nginx-status` 即可查看 Nginx 监控状态信息。 + +### 启用 `ngx_http_reqstat_module` + +1. 安装 `ngx_http_reqstat_module` 模块 + +```shell +# install `ngx_http_reqstat_module` +wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip + +unzip ngx_req_status.zip + +patch -p1 < ../ngx_req_status-master/write_filter.patch + +./configure --prefix=/usr/local/nginx --add-module=/path/to/ngx_req_status-master + +make -j2 + +make install +``` + +2. 修改 Nginx 配置文件 + +修改 `nginx.conf` 文件,添加状态模块暴露端点,如下配置: + +```shell +# modify nginx.conf +http { + req_status_zone server_name $server_name 256k; + req_status_zone server_addr $server_addr 256k; + + req_status server_name server_addr; + + server { + location /req-status { + req_status_show on; + #allow 127.0.0.1; #only allow requests from localhost + #deny all; #deny all other hosts + } + } +} +``` + +3. 重新加载 Nginx + +```shell +nginx -s reload +``` + +4. 在浏览器访问 `http://localhost/req-status` 即可查看 Nginx 监控状态信息。 + + +**参考文档: https://blog.csdn.net/weixin_55985097/article/details/116722309** + +**⚠️注意监控模块的端点路径为 `/nginx-status` `/req-status`** + +### 配置参数 + +| 参数名 | 参数描述 | +|-------------------|-----------------------------------------------------| +| 监控主机 | 被监控的 IPV4、IPV6 或域名。注意⚠️不需要协议头部(例如:https://,http://) | +| 监控名称 | 标识此监控的名称。名称需要唯一 | +| 端口 | Nginx 提供的端口 | +| 超时时间 | 允许收集响应时间 | +| 收集间隔时间 | 监控周期性数据收集的间隔时间,单位为秒,最小可设置的间隔时间为30秒 | +| 是否检测 | 是否在添加监控之前检测和确认监控的可用性。只有在检测成功后,添加和修改操作才会继续进行 | +| 描述备注 | 用户可以在此处注明有关标识和描述此监控的更多信息 | + +### 收集指标 + +#### 指标收集:nginx_status + +| 指标名称 | 指标单位 | 指标描述 | +|-------|-------------|------------| +| 接收连接数 | | 已接受的连接 | +| 处理连接数 | | 成功处理的连接 | +| 活动连接数 | | 当前活动连接 | +| 丢弃连接数 | | 丢弃的连接 | +| 请求连接数 | | 客户端请求 | +| 读连接数 | | 正在执行读操作的连接 | +| 写连接数 | | 正在执行写操作的连接 | +| 等待连接数 | | 等待连接 | + +#### 指标集:req_status + +| 指标名称 | 指标单位 | 指标描述 | +|---------|-------|---------| +| 分组类别 | | 分组类别 | +| 分组名称 | | 分组名称 | +| 最大并发连接数 | | 最大并发连接数 | +| 最大带宽 | kb | 最大带宽 | +| 总流量 | kb | 总流量 | +| 总请求数 | | 总请求数 | +| 当前并发连接数 | | 当前并发连接数 | +| 当前带宽 | kb | 当前带宽 | + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ntp.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ntp.md new file mode 100644 index 00000000000..5760321922f --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ntp.md @@ -0,0 +1,41 @@ +--- +id: ntp +title: 监控 NTP 服务器 +sidebar_label: NTP 服务器 +keywords: [ open source monitoring tool, open source NTP monitoring tool, monitoring NTP metrics ] +--- + +NTP监控的中文文档如下: + +# NTP监控 + +> 收集和监控NTP的常规性能指标。 + +**协议使用:NTP** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|------|--------------------------------------------------| +| 监控主机 | 被监控的IPv4、IPv6或域名。注意⚠️不包含协议头(例如:https://,http://) | +| 监控名称 | 标识此监控的名称。名称需要是唯一的 | +| 采集间隔 | 监控周期性数据采集的时间间隔,单位:秒,最小可设置为30秒 | +| 是否检测 | 是否在添加监控之前检测和检查监控的可用性。只有在检测成功后,添加和修改操作才会继续进行 | +| 描述备注 | 用于更多关于标识和描述此监控的信息,用户可以在此处添加备注信息 | + +### 采集指标 + +#### 指标集:概要 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------|------|--------------------------| +| 响应时间 | 毫秒 | NTP服务器响应请求所需的时间。 | +| 时间 | 毫秒 | NTP服务器报告的当前时间。 | +| 日期 | | 与NTP服务器报告的当前时间对应的日期。 | +| 偏移量 | 毫秒 | NTP服务器的时钟与客户端时钟之间的时间差。 | +| 延迟 | 毫秒 | 请求到达NTP服务器并返回响应所需的时间。 | +| 版本号 | | 服务器使用的NTP协议的版本号。 | +| 模式 | | NTP服务器的操作模式,如客户端、服务器或广播。 | +| 层级 | | NTP服务器的层级,表示其与参考时钟的距离。 | +| 参考ID | | 指示NTP服务器使用的参考时钟或时间源的标识符。 | +| 精度 | | NTP服务器时钟的精度,表示其准确性。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/openai.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/openai.md new file mode 100644 index 00000000000..d22b1238855 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/openai.md @@ -0,0 +1,82 @@ +--- +id: openai +title: 监控:OpenAI 账户情况 +sidebar_label: OpenAI 账户情况 +keywords: [开源监控系统, 开源网络监控, OpenAI账户监控] +--- + +### 准备工作 + +#### 获取会话密钥 +> 1. 打开 Chrome 浏览器的网络请求界面 +> `Mac: cmd + option + i` +> `Windows: ctrl + shift + i` +> 2. 访问 https://platform.openai.com/usage +> 3. 找到 https://api.openai.com/dashboard/billing/usage 请求 +> 4. 找到请求头中 Authorization 字段,并复制 `Bearer ` 之后的内容。例如: `sess-123456` + +### 注意事项 + +> 1. 请确保 HertzBeat 可以具备外网访问能力。若不确定可以通过在 HertzBeat 中创建对 openai.com 的 HTTP API 监控进行探测尝试。 +> 2. 监控周期应至少大于 120 秒,避免发送的请求过于频繁,导致返回状态码 429 (太多请求)。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|:-------|---------------------------------| +| 监控Host | 此处填写 api.openai.com 。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | +| 会话密钥 | 即准备工作中获取的会话密钥。 | | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 对监控资源的分类管理标签。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:信用额度授予 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------|--------|---------| +| 总授予额度 | 美元 ($) | 总授予额度 | +| 总使用额度 | 美元 ($) | 总使用额度 | +| 总可用额度 | 美元 ($) | 总可用额度 | +| 总付费可用额度 | 美元 ($) | 总付费可用额度 | + +#### 指标集合:模型花费 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------|--------|---------| +| 模型名称 | 无 | 模型名称 | +| 花费 | 美元 ($) | 花费 | + +#### 指标集合:订阅计费 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|--------------|--------|--------------| +| 是否有支付方式 | 无 | 是否有支付方式 | +| 订阅是否已取消 | 无 | 订阅是否已取消 | +| 订阅取消时间 | 无 | 订阅取消时间 | +| 订阅是否拖欠 | 无 | 订阅是否拖欠 | +| 一定时间内最大使用量限制 | 次 | 一定时间内最大使用量限制 | +| 最大使用量限制 | 次 | 最大使用量限制 | +| 系统硬限制使用量 | 次 | 系统硬限制使用量 | +| 软限制费用 | 美元 ($) | 软限制费用 | +| 硬限制费用 | 美元 ($) | 硬限制费用 | +| 系统硬限制费用 | 美元 ($) | 系统硬限制费用 | +| 订阅计划 | 无 | 订阅计划 | +| 是否是主要订阅 | 无 | 是否是主要订阅 | +| 结算机制 | 无 | 结算机制 | +| 是否符合拖欠资格 | 无 | 是否符合拖欠资格 | +| 最大余额 | 美元 ($) | 最大余额 | +| 是否符合自动充值资格 | 无 | 是否符合自动充值资格 | +| 是否启用自动充值 | 无 | 是否启用自动充值 | +| 自动充值阈值 | 美元 ($) | 自动充值阈值 | +| 自动充值金额 | 美元 ($) | 自动充值金额 | +| 信用等级 | 无 | 信用等级 | +| 账户名称 | 无 | 账户名称 | +| 采购号 | 无 | 采购号 | +| 账单邮箱 | 无 | 账单邮箱 | +| 税务ID | 无 | 税务ID | +| 结算地址 | 无 | 结算地址 | +| 业务地址 | 无 | 业务地址 | diff --git a/home/versioned_docs/version-v1.1.x/help/opengauss.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/opengauss.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/opengauss.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/opengauss.md index 6fc1a2819f3..632a7f41b2d 100644 --- a/home/versioned_docs/version-v1.1.x/help/opengauss.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/opengauss.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, OpenGauss数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为5432。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/opensuse.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/opensuse.md new file mode 100644 index 00000000000..6c3b2e9ac7e --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/opensuse.md @@ -0,0 +1,117 @@ +--- +id: opensuse +title: 监控:OpenSUSE操作系统监控 +sidebar_label: OpenSUSE操作系统 +keywords: [开源监控系统, 开源操作系统监控, OpenSUSE操作系统监控] +--- +> 对OpenSUSE操作系统的通用性能指标进行采集监控。 + +### 配置参数 + + +| 参数名称 | 参数帮助描述 | +| -------- |------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux SSH对外提供的端口,默认为22。 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次获取信息都会创建一个连接 | +| 用户名 | SSH连接用户名,可选 | +| 密码 | SSH连接密码,可选 | +| 采集器 | 配置此监控使用哪台采集器调度采集 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | +| 密钥 | 连接服务器所需密钥 | + +### 采集指标 + +#### 指标集合:系统基本信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | ------------ | +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- | -------- | --------------------------- | +| info | 无 | CPU型号 | +| cores | 核数 | CPU内核数量 | +| interrupt | 个数 | CPU中断数量 | +| load | 无 | CPU最近1/5/15分钟的平均负载 | +| context_switch | 个数 | 当前上下文切换数量 | +| usage | % | CPU使用率 | + +#### 指标集合:内存信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------- | -------- | ---------------- | +| total | Mb | 总内存容量 | +| used | Mb | 用户程序内存量 | +| free | Mb | 空闲内存容量 | +| buff_cache | Mb | 缓存占用内存 | +| available | Mb | 剩余可用内存容量 | +| usage | % | 内存使用率 | + +#### 指标集合:磁盘信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------- | -------- | ------------------ | +| disk_num | 块数 | 磁盘总数 | +| partition_num | 分区数 | 分区总数 | +| block_write | 块数 | 写入磁盘的总块数 | +| block_read | 块数 | 从磁盘读出的块数 | +| write_rate | iops | 每秒写磁盘块的速率 | + +#### 指标集合:网卡信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------- |------|-------------| +| interface_name | 无 | 网卡名称 | +| receive_bytes | Mb | 入站数据流量 | +| transmit_bytes | Mb | 出站数据流量 | + +#### 指标集合:文件系统 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------- | -------- | -------------- | +| filesystem | 无 | 文件系统的名称 | +| used | Mb | 已使用磁盘大小 | +| available | Mb | 可用磁盘大小 | +| usage | % | 使用率 | +| mounted | 无 | 挂载点目录 | + + + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------- | -------- | ------------ | +| pid | 无 | 进程ID | +| cpu_usage | % | CPU占用率 | +| mem_usage | % | 内存占用率 | +| command | 无 | 执行命令 | + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------- | -------- | ------------ | +| pid | 无 | 进程ID | +| mem_usage | % | 内存占用率 | +| cpu_usage | % | CPU占用率 | +| command | 无 | 执行命令 | diff --git a/home/versioned_docs/version-v1.1.x/help/oracle.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/oracle.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/oracle.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/oracle.md index 0d91256a137..49136e51c48 100644 --- a/home/versioned_docs/version-v1.1.x/help/oracle.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/oracle.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Oracle数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为1521。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/versioned_docs/version-v1.1.x/help/ping.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ping.md similarity index 67% rename from home/versioned_docs/version-v1.1.x/help/ping.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ping.md index 09f640153ba..7b6613f25bd 100644 --- a/home/versioned_docs/version-v1.1.x/help/ping.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ping.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网络监控, 网络PING监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | Ping超时时间 | 设置PING未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | | 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | @@ -26,3 +26,11 @@ keywords: [开源监控系统, 开源网络监控, 网络PING监控] | ----------- | ----------- | ----------- | | responseTime | ms毫秒 | 网站响应时间 | + +### 常见问题 + +1. 安装包部署的hertzbeat下ping连通性监控异常 + 安装包安装部署的hertzbeat,对ping连通性监控不可用,但本地直接ping是可用的。 +> 安装包部署需要配置java虚拟机root权限启动hertzbeat从而使用ICMP,若未启用root权限则是判断telnet对端7号端口是否开通 +> docker安装默认启用无此问题 +> 详见 https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/plugin.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/plugin.md new file mode 100644 index 00000000000..e89f669886f --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/plugin.md @@ -0,0 +1,25 @@ +--- +id: plugin +title: 自定义插件 +sidebar_label: 自定义插件 +--- + +## 自定义插件 +### 简介 + +当前`Hertzbeat`在使用时,主要依赖`alert`模块对用户进行通知,然后用户采取一些措施如发送请求、执行`sql`、执行`shell`脚本等。 +但目前只能通过手动或者`webhook`接收告警信息进行自动化处理。基于此,`HertzBeat`新增了`plugin`模块,该模块有一个通用接口`Plugin`,用户可以自己实现这个接口的`alert`方法,接收`Alert`类作为参数进行自定义操作。 +用户添加自定义代码后,只需要对`plugin`模块进行打包,拷贝到安装目录下`/ext-lib`文件夹中,重启`HertzBeat`主程序,即可实现告警后执行自定义功能,无需自己重新打包部署整个程序。 +目前,`HertzBeat`只在告警后设置了触发`alert`方法,如需在采集、启动程序等时机设置触发方法,请在`https://github.com/apache/hertzbeat/issues/new/choose` 提`Task`。 + +### 具体使用 +1. 拉取主分支代码 `git clone https://github.com/apache/hertzbeat.git` ,定位到`plugin`模块的 + `Plugin`接口。 + ![plugin-1.png](/img/docs/help/plugin-1.png) +2. 在`org.apache.hertzbeat.plugin.impl`目录下, 新建一个接口实现类,如`org.apache.hertzbeat.plugin.impl.DemoPluginImpl`,在实现类中接收`Alert`类作为参数,实现`alert`方法,逻辑由用户自定义,这里我们简单打印一下对象。 + ![plugin-2.png](/img/docs/help/plugin-2.png) +3. 打包`hertzbeat-plugin`模块。 + ![plugin-3.png](/img/docs/help/plugin-3.png) +4. 将打包后的`jar`包,拷贝到安装目录下的`ext-lib`目录下(若为`docker`安装则先将`ext-lib`目录挂载出来,再拷贝到该目录下) + ![plugin-4.png](/img/docs/help/plugin-4.png) +5. 然后重启`HertzBeat`,即可实现自定义告警后处理策略。 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/pop3.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/pop3.md new file mode 100644 index 00000000000..8d6c2eb5548 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/pop3.md @@ -0,0 +1,49 @@ +--- +id: pop3 +title: 监控POP3 +sidebar_label: POP3监控 +keywords: [开源监控工具,开源Java监控工具,监控POP3指标] +--- + +> 收集和监控POP3的常规性能指标。 + +**使用的协议:POP3** + +### 启用POP3服务 + +如果您想使用此监控类型来监控"POP3"的信息,请在您的邮件服务器上开启POP3服务。 + +**1、开启POP3服务:** + +```text +以qq邮箱为例【其它邮箱类似】: + 1. 点击`设置`选项 + 2. 选择`账号` + 3. 找到开启SMTP/POP3/IMAP选项,并开启 + 4. 得到POP3服务器域名,端口号,以及授权码【开启SMTP/POP3/IMAP服务后,qq邮箱提供】 + 5. 通过POP3服务器域名,端口号,qq邮箱账号以及授权码连接POP3服务器,采集监控指标 +``` + + +### 配置参数 + +| 参数名 | 参数描述 | +|-------------------|-----------------------------------------------------| +| 监控主机 | 被监控的 IPV4、IPV6 或域名。注意⚠️不需要协议头部(例如:https://,http://) | +| 监控名称 | 标识此监控的名称。名称需要唯一 | +| 端口 | POP3 提供的端口 | +| 超时时间 | 允许收集响应时间 | +| 收集间隔时间 | 监控周期性数据收集的间隔时间,单位为秒,最小可设置的间隔时间为30秒 | +| 是否检测 | 是否在添加监控之前检测和确认监控的可用性。只有在检测成功后,添加和修改操作才会继续进行 | +| 描述备注 | 用户可以在此处注明有关标识和描述此监控的更多信息 | + +### 采集指标 + +#### 指标集:email_status + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------|------|------------| +| 邮件数量 | | 邮件数量 | +| 邮箱总大小 | kb | 邮箱中邮件的总大小 | + + diff --git a/home/versioned_docs/version-v1.1.x/help/port.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/port.md similarity index 86% rename from home/versioned_docs/version-v1.1.x/help/port.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/port.md index 628c8912319..f27314e8e40 100644 --- a/home/versioned_docs/version-v1.1.x/help/port.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/port.md @@ -1,8 +1,8 @@ --- id: port title: 监控:端口可用性 -sidebar_label: 端口可用性 -keywords: [开源监控系统, 开源网络监控, 端口可用性监控] +sidebar_label: TCP 端口可用性 +keywords: [开源监控系统, 开源网络监控, TCP 端口可用性监控] --- > 判断对端服务暴露端口是否可用,进而判断对端服务是否可用,采集响应时间等指标进行监测 @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网络监控, 端口可用性监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 | | 连接超时时间 | 端口连接的等待超时时间,单位毫秒,默认3000毫秒。 | | 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | diff --git a/home/versioned_docs/version-v1.1.x/help/postgresql.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/postgresql.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/postgresql.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/postgresql.md index 5a95c3415ef..4716d0e2e64 100644 --- a/home/versioned_docs/version-v1.1.x/help/postgresql.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/postgresql.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, PostgreSQL数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为5432。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/process.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/process.md new file mode 100644 index 00000000000..91d7718e419 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/process.md @@ -0,0 +1,91 @@ +--- +id: process +title: 监控:Linux 进程监控 +sidebar_label: Process +keywords: [开源监控系统, 操作系统进程监控, 进程监控] +--- +> 对Linux系统进程基础信息进行采集监控,包括进程的 CPU使用率、内存使用率、物理内存、IO 等监控 + +## 配置参数 + + +| 参数名称 | 参数帮助描述 | +| -------- | ------------------------------------------------------------------------- | +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux系统的ssh端口,默认: 22 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次回去信息都会创建一个连接 | +| 用户名 | 服务器用户名 | +| 密码 | 服务器密码 | +| 进程名称 | 需要监控的进程名称或进程部分名称 | +| 采集器 | 配置此监控使用哪台采集器调度采集 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | +| 私钥 | 连接服务器所需私钥 | + +### 采集指标 + +#### 指标集合:进程基本信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------ | +| PID | 无 | 进程ID | +| User | 无 | 用户 | +| CPU | 无 | CPU使用率 | +| MEM | 无 | 内存使用率 | +| rss | 无 | 物理内存 | +| cmd | 无 | 运行命令 | + +#### 指标集合:内存使用信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------ | +| PID | 无 | 进程ID | +| detail | 无 | 详细监控指标 | + +包含的指标: + +- 虚拟内存峰值 +- 当前虚拟内存使用 +- 锁定内存 +- 固定内存 +- 物理内存峰值 +- 当前物理内存使用 +- 数据段大小 +- 堆栈大小 +- 代码大小 +- 共享库大小 +- 页表项大小 + +#### 指标集合:其他监控信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------ | +| PID | 无 | 进程ID | +| path | 无 | 执行路径 | +| date | 无 | 启动时间 | +| fd_count | 无 | 打开文件描述符数量 | + +#### 指标集合:IO + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------ | +| PID | 无 | 进程ID | +| metric | 无 | 监控指标名称 | +| value | 无 | 监控指标值 | + +包含的指标: + +- rchar(进程从磁盘或其他文件读取的总字节数) +- wchar(进程写入到磁盘或其他文件的总字节数) +- syscr(进程发起的读取操作的次数) +- syscw(进程发起的写入操作的次数) +- read_bytes(进程从磁盘实际读取的字节数) +- write_bytes(进程写入到磁盘的实际字节数) +- cancelled_write_bytes(进程写入到磁盘的实际字节数) diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/prometheus.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/prometheus.md new file mode 100755 index 00000000000..50d148f72a9 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/prometheus.md @@ -0,0 +1,44 @@ +--- +id: prometheus +title: 监控:Prometheus任务监控 +sidebar_label: Prometheus任务监控 +keywords: [ 开源监控系统, Prometheus协议监控 ] +--- + +> 采集支持Prometheus协议的应用的指标数据。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------------|------------------------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(例如: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 监控HTTP端口。 | +| 端点路径 | 监控HTTP接口的路径,注意⚠️需要从 `/` 开始。 | +| 查询超时时间 | 设置采集数据超时时间,单位ms毫秒,默认6000毫秒。 | +| 启用HTTPS | 采集数据是否启用HTTPS,可选,默认值:否 | +| 请求Headers | 访问监控HTTP接口请求头信息,可选。 | +| 查询Params | 访问监控HTTP接口查询参数信息,可选。 | +| Content-Type | HTTP请求的ContentType,可选。 | +| 请求BODY | 请求体,可选。 | +| 认证方式 | 认证方式,可选值包括:`Basic Auth`,`Digest Auth`,可选。 | +| 用户名 | 用户名,可选。 | +| 密码 | 密码,可选。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 使用示例 + +应用暴露的监控地址为:`http://127.0.0.1:8080/actuator/prometheus` + +可以使用如下配置: + +- 目标Host:`127.0.0.1` +- 端口:`8080` +- 端点路径:`/actuator/prometheus` + +其余设置保持默认。 + + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/pulsar.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/pulsar.md new file mode 100644 index 00000000000..a59178686b3 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/pulsar.md @@ -0,0 +1,77 @@ +--- +id: pulsar +title: 监控:Pulsar监控 +sidebar_label: Apache Pulsar +keywords: [开源监控系统, 开源数据库监控, HbaseMaster监控] +--- +> 对Pulsar的通用性能指标进行采集监控 + +**使用协议:HTTP** + +## 配置参数 + + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------------------- | +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 端口 | Pulsar的webServiceProt值,默认为8080。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 查询超时时间 | 设置连接的超时时间,单位ms毫秒,默认3000毫秒。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 绑定标签 | 用于对监控资源进行分类管理 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:版本信息 + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------ | -------- | ------------ | +| Version Info | 无 | 版本信息 | + +#### 指标集合:process_start_time_seconds + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------ | -------- | ------------ | +| Process Start Time | 无 | 进程启动时间 | + +#### 指标集合:process_open_fds + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| --------------------- | -------- | ---------------- | +| Open File Descriptors | 无 | 打开的文件描述符 | + +#### 指标集合:process_max_fds + + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- | -------- | -------------- | +| Max File Descriptors | 无 | 最大文件描述符 | + +#### 指标集合: jvm_memory_pool_allocated_bytes + +Java虚拟机(JVM)中特定内存池已分配的内存字节数。在Pulsar中,这通常指的是用于各种目的的JVM内存(如堆内存、非堆内存等)中已经分配出去的内存量。 + +#### 指标集合:jvm_memory_pool_used_bytes + +与allocated_bytes不同,这个指标会显示实际使用的内存,而不仅仅是分配的内存。 + +#### 指标集合:jvm_memory_pool_committed_bytes + +JVM中特定内存池已承诺的内存字节数。在JVM中,承诺的内存是指虚拟机保证可供应用程序使用的内存量,通常这部分内存会被操作系统锁定,以减少交换或垃圾回收的可能性。 + +#### 指标集合:jvm_memory_pool_max_bytes + +JVM中特定内存池可分配的最大内存字节数。这是该内存池允许的最大内存限制,有助于设置内存使用的上限。 + +#### 指标集合:pulsar_broker_publish_latency + +Broker端消息发布延迟 + +#### 指标集合:pulsar_metadata_store_ops_latency_ms + +Broker端元数据存储操作延迟 + diff --git a/home/versioned_docs/version-v1.1.x/help/rabbitmq.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rabbitmq.md similarity index 99% rename from home/versioned_docs/version-v1.1.x/help/rabbitmq.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rabbitmq.md index 603b12a3d9e..8cb91eeb3e6 100644 --- a/home/versioned_docs/version-v1.1.x/help/rabbitmq.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rabbitmq.md @@ -27,7 +27,7 @@ rabbitmq-plugins enable rabbitmq_management | 参数名称 | 参数帮助描述 | |----------|---------------------------------------------| | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | RabbitMQ Management 对外提供的HTTP端口,默认为15672。 | | 用户名 | 接口Basic认证时使用的用户名 | | 密码 | 接口Basic认证时使用的密码 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/redhat.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/redhat.md new file mode 100644 index 00000000000..5ceb911c8d3 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/redhat.md @@ -0,0 +1,107 @@ +--- +id: redhat +title: 监控:RedHat操作系统监控 +sidebar_label: RedHat操作系统 +keywords: [ 开源监控系统, 开源操作系统监控, RedHat操作系统监控 ] +--- + +> 对RedHat操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux SSH对外提供的端口,默认为22。 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次获取信息都会创建一个连接。 | +| 用户名 | SSH连接用户名,可选。 | +| 密码 | SSH连接密码,可选。 | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | +| 密钥 | 连接服务器所需密钥。 | + +### 采集指标 + +#### 指标集合:系统基本信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------------------| +| info | 无 | CPU型号 | +| cores | 无 | CPU内核数量 | +| interrupt | 无 | CPU中断数量 | +| load | 无 | CPU最近1/5/15分钟的平均负载 | +| context_switch | 无 | 当前上下文切换数量 | +| usage | % | CPU使用率 | + +#### 指标集合:内存信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|----------| +| total | Mb | 总内存容量 | +| used | Mb | 用户程序内存量 | +| free | Mb | 空闲内存容量 | +| buff_cache | Mb | 缓存占用内存 | +| available | Mb | 剩余可用内存容量 | +| usage | % | 内存使用率 | + +#### 指标集合:磁盘信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------|------|-----------| +| disk_num | 无 | 磁盘总数 | +| partition_num | 无 | 分区总数 | +| block_write | 无 | 写入磁盘的总块数 | +| block_read | 无 | 从磁盘读出的块数 | +| write_rate | iops | 每秒写磁盘块的速率 | + +#### 指标集合:网卡信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| interface_name | 无 | 网卡名称 | +| receive_bytes | Mb | 入站数据流量 | +| transmit_bytes | Mb | 出站数据流量 | + +#### 指标集合:文件系统 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|---------| +| filesystem | 无 | 文件系统的名称 | +| used | Mb | 已使用磁盘大小 | +| available | Mb | 可用磁盘大小 | +| usage | % | 使用率 | +| mounted | 无 | 挂载点目录 | + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| cpu_usage | % | CPU占用率 | +| mem_usage | % | 内存占用率 | +| command | 无 | 执行命令 | + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| mem_usage | % | 内存占用率 | +| cpu_usage | % | CPU占用率 | +| command | 无 | 执行命令 | diff --git a/home/versioned_docs/version-v1.1.x/help/redis.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/redis.md similarity index 99% rename from home/versioned_docs/version-v1.1.x/help/redis.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/redis.md index ca36748e255..dd9b304e1ce 100644 --- a/home/versioned_docs/version-v1.1.x/help/redis.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/redis.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, Redis数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | redis对外提供的端口,默认为6379,sentinel节点默认26379 | | 超时时间 | 设置redis info 查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rocketmq.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rocketmq.md new file mode 100644 index 00000000000..f12a43628ac --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rocketmq.md @@ -0,0 +1,48 @@ +--- +id: rocketmq +title: 监控 Apache RocketMQ 消息中间件 +sidebar_label: RocketMQ消息中间件 +keywords: [ 开源监控系统, 开源中间件监控, RocketMQ消息中间件监控 ] +--- + +> 对 RocketMQ 消息中间件的broker,消费者等相关指标进行监测。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|-----------|------------------------------------------------| +| 注册中心Host | RocketMQ注册中心的IPV4,IPV6(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 注册中心端口。 | +| accessKey | accessKey。 | +| secretKey | secretKey。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:集群 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------------------------|------|------------| +| BrokerId | 无 | Broker唯一ID | +| Address | 无 | Broker地址 | +| Version | 无 | 版本 | +| Producer_Message_TPS | 无 | 生产消息TPS | +| Consumer_Message_TPS | 无 | 消费消息TPS | +| Yesterday_Produce_Count | 无 | 昨天生产消息数 | +| Yesterday_Consume_Count | 无 | 昨天消费消息数 | +| Today_Produce_Count | 无 | 今天生产消息数 | +| Today_Consume_Count | 无 | 今天消费消息数 | + +#### 指标集合:消费者 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------------|------|--------| +| Consumer_group | 无 | 消费者组 | +| Client_quantity | 无 | 客户端数量 | +| Message_model | 无 | 消息模式 | +| Consume_type | 无 | 消费类型 | +| Consume_tps | 无 | 消费TPS | +| Delay | 无 | 延迟 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rockylinux.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rockylinux.md new file mode 100644 index 00000000000..0cf541702bc --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/rockylinux.md @@ -0,0 +1,107 @@ +--- +id: rockylinux +title: 监控:Rocky Linux操作系统监控 +sidebar_label: Rocky Linux操作系统 +keywords: [ 开源监控系统, 开源操作系统监控, Rocky Linux操作系统监控 ] +--- + +> 对Rocky Linux操作系统的通用性能指标 (系统信息、CPU、内存、磁盘、网卡、文件系统、TOP资源进程等) 进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Linux SSH对外提供的端口,默认为22。 | +| 超时时间 | 设置连接的超时时间,单位ms毫秒,默认6000毫秒。 | +| 复用连接 | 设置SSH连接是否复用,默认为:false。为false每次获取信息都会创建一个连接。 | +| 用户名 | SSH连接用户名,可选。 | +| 密码 | SSH连接密码,可选。 | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | +| 密钥 | 连接服务器所需密钥。 | + +### 采集指标 + +#### 指标集合:系统基本信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| Host Name | 无 | 主机名称 | +| System Version | 无 | 操作系统版本 | +| Uptime | 无 | 启动时间 | + +#### 指标集合:CPU 信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------------------| +| info | 无 | CPU型号 | +| cores | 无 | CPU内核数量 | +| interrupt | 无 | CPU中断数量 | +| load | 无 | CPU最近1/5/15分钟的平均负载 | +| context_switch | 无 | 当前上下文切换数量 | +| usage | % | CPU使用率 | + +#### 指标集合:内存信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|----------| +| total | Mb | 总内存容量 | +| used | Mb | 用户程序内存量 | +| free | Mb | 空闲内存容量 | +| buff_cache | Mb | 缓存占用内存 | +| available | Mb | 剩余可用内存容量 | +| usage | % | 内存使用率 | + +#### 指标集合:磁盘信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------|------|-----------| +| disk_num | 无 | 磁盘总数 | +| partition_num | 无 | 分区总数 | +| block_write | 无 | 写入磁盘的总块数 | +| block_read | 无 | 从磁盘读出的块数 | +| write_rate | iops | 每秒写磁盘块的速率 | + +#### 指标集合:网卡信息 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------------|------|--------| +| interface_name | 无 | 网卡名称 | +| receive_bytes | Mb | 入站数据流量 | +| transmit_bytes | Mb | 出站数据流量 | + +#### 指标集合:文件系统 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------------|------|---------| +| filesystem | 无 | 文件系统的名称 | +| used | Mb | 已使用磁盘大小 | +| available | Mb | 可用磁盘大小 | +| usage | % | 使用率 | +| mounted | 无 | 挂载点目录 | + +#### 指标集合:Top10 CPU进程 + +统计进程使用CPU的Top10进程。统计信息包括:进程ID、CPU占用率、内存占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| cpu_usage | % | CPU占用率 | +| mem_usage | % | 内存占用率 | +| command | 无 | 执行命令 | + +#### 指标集合:Top10 内存进程 + +统计进程使用内存的Top10进程。统计信息包括:进程ID、内存占用率、CPU占用率、执行命令。 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-----------|------|--------| +| pid | 无 | 进程ID | +| mem_usage | % | 内存占用率 | +| cpu_usage | % | CPU占用率 | +| command | 无 | 执行命令 | diff --git a/home/versioned_docs/version-v1.1.x/help/shenyu.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/shenyu.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/shenyu.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/shenyu.md index 71ffa94819e..08788efeaae 100644 --- a/home/versioned_docs/version-v1.1.x/help/shenyu.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/shenyu.md @@ -46,7 +46,7 @@ shenyu: | 参数名称 | 参数帮助描述 | |--------|------------------------------------------------------| | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 网关指标接口对外提供的端口,默认为8090。 | | 超时时间 | HTTP请求响应超时时间 | | 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/smtp.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/smtp.md new file mode 100644 index 00000000000..21dcd9a88f3 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/smtp.md @@ -0,0 +1,41 @@ +--- +id: smtp +title: SMTP 邮件服务器监控 +sidebar_label: SMTP 监控 +keywords: [ open source monitoring tool, open source SMTP monitoring tool, monitoring SMTP metrics ] +--- + +> 收集和监控 SMTP 邮件服务器的常规性能指标。 + +```text +通过 SMTP 的 hello 命令确定服务器是否可用 +``` + +> 详见 https://datatracker.ietf.org/doc/html/rfc821#page-13 + + +**协议使用:SMTP** + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|---------|---------------------------------------------------| +| 监控主机 | 被监控的 IPV4、IPV6 或域名。注意⚠️无需协议头(例如:https://、http://) | +| 监控名称 | 标识此监控的名称。名称需要保持唯一 | +| 端口 | SMTP 提供的端口号 | +| 电子邮件 | 您的电子邮件名称,用于 hello 命令的参数 | +| 超时时间 | 允许的收集响应时间 | +| 收集间隔 | 监视定期数据收集的间隔时间,单位:秒,最小可设置的间隔为 30 秒 | +| 是否检测可用性 | 是否在添加监控之前检测和验证监控的可用性。只有在检测成功后,才会继续进行添加和修改操作 | +| 描述备注 | 用于标识和描述此监控的更多信息,用户可以在此处添加备注信息 | + +### 收集的指标 + +#### 指标集:概要 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------------|------|-------------------| +| 响应时间 | 毫秒 | SMTP 服务器响应请求所需的时间 | +| 响应状态 | | 响应状态 | +| SMTP 服务器标语 | | SMTP 服务器的标语 | +| helo 命令返回信息 | | helo 命令返回的响应信息 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/spring_gateway.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/spring_gateway.md new file mode 100644 index 00000000000..086e0a63ac8 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/spring_gateway.md @@ -0,0 +1,90 @@ +--- +id: spring_gateway +Title: 监控 Spring Gateway +sidebar_label: Spring Gateway +keywords: [开源监控工具, 开源 Spring Gateway 监控工具, 监控 Spring Gateway 指标] +--- + +> 收集和监控 SpringBoot Actuator 提供的常规性能指标。 + +## 监控前操作 + +如果您想使用此监控类型监控 'Spring Gateway' 的信息,您需要集成您的 SpringBoot 应用程序并启用 SpringBoot Actuator。 + +**1、添加 POM .XML 依赖:** + +```xml + + org.springframework.boot + spring-boot-starter-actuator + +``` +**2. 修改 YML 配置以暴露度量接口:** + +```yaml +management: + endpoint: + gateway: + enabled: true # default value + endpoints: + web: + exposure: + include: '*' + enabled-by-default: on +``` + +### 配置参数 + +| 参数名称 | 参数描述 | +| ----------- |--------------------------------------------------------| +| 监控主机 | 被监控的目标 IPV4、IPV6 或域名。注意⚠️不要包含协议头(例如:https://,http://)。 | +| 监控名称 | 用于标识此监控的名称,需要保证唯一性。 | +| 端口 | 数据库提供的默认端口为 8080。 | +| 启用 HTTPS | 是否通过 HTTPS 访问网站,请注意⚠️当启用 HTTPS 时,需要将默认端口更改为 443 | +| 采集间隔 | 监控周期性采集数据的时间间隔,单位为秒,最小间隔为 30 秒。 | +| 是否探测 | 在新增监控前是否先进行可用性探测,只有探测成功才会继续新增或修改操作。 | will continue only if the probe is successful +| 描述备注 | 用于添加关于监控的额外标识和描述信息。 | + +### 采集指标 + +#### 指标收集: 健康状态 + +| 指标名称 | 指标单位 | 指标描述 | +|-------|-------|--------------------------| +| 服务状态 | 无 | 服务健康状态: UP(正常),Down(异常) | + +#### 指标收集: 环境信息 + +| 指标名称 | 指标单位 | 指标描述 | +|---------|-------|----------------------------------------------| +| profile | 无 | 应用程序运行的配置环境: prod(生产环境),dev(开发环境),test(测试环境) | +| 端口号 | 无 | 应用程序暴露的端口 | +| 操作系统 | 无 | 运行操作系统 | +| 操作系统架构 | 无 | 运行操作系统的架构 | +| JDK供应商 | 无 | JDK 供应商 | +| JVM版本 | 无 | JVM 版本 | + +#### 指标收集: 线程信息 + +| 指标名称 | 指标单位 | 指标描述 | +|-------------|------------|-------------| +| 状态 | 无 | 线程状态 | +| 数量 | 无 | 线程状态对应的线程数量 | + +#### 指标收集: 内存使用情况 + +| 指标名称 | 指标单位 | 指标描述 | +|-------|-------|-------------| +| 内存空间 | 无 | 内存空间名称 | +| 内存占用 | MB | 此空间占用的内存大小 | + +#### 指标收集: 路由信息 + +| 指标名称 | 指标单位 | 指标描述 | +|-------|-------|----------| +| 路由id | 无 | 路由 ID | +| 匹配规则 | 无 | 路由匹配规则 | +| 资源标识符 | 无 | 服务资源标识符 | +| 优先级 | 无 | 此路由的优先级 | + + diff --git a/home/versioned_docs/version-v1.1.x/help/springboot2.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/springboot2.md similarity index 75% rename from home/versioned_docs/version-v1.1.x/help/springboot2.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/springboot2.md index dc269c2e593..280c6cb6b06 100644 --- a/home/versioned_docs/version-v1.1.x/help/springboot2.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/springboot2.md @@ -30,13 +30,28 @@ management: include: '*' enabled-by-default: on ``` - +*注意:如果你的项目里还引入了认证相关的依赖,比如springboot-security,那么SpringBoot Actuator暴露出的接口可能会被拦截,此时需要你手动放开这些接口,以springboot-security为例,需要在SecurityConfig配置类中加入以下代码:* +```java +public class SecurityConfig extends WebSecurityConfigurerAdapter{ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception{ + httpSecurity + // 配置要放开的接口 ----------------------------------- + .antMatchers("/actuator/**").permitAll() + .antMatchers("/metrics/**").permitAll() + .antMatchers("/trace").permitAll() + .antMatchers("/heapdump").permitAll() + // 。。。 + // 其他接口请参考:https://blog.csdn.net/JHIII/article/details/126601858 ----------------------------------- + } +} +``` ### 配置参数 | 参数名称 | 参数帮助描述 | | ------------ |------------------------------------------------------| | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 应用服务对外提供的端口,默认为8080。 | | 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 | | Base Path | 暴露接口路径前缀,默认 /actuator | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/springboot3.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/springboot3.md new file mode 100644 index 00000000000..384f9249d16 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/springboot3.md @@ -0,0 +1,87 @@ +--- +id: springboot3 +title: 监控:SpringBoot3.0 监控 +sidebar_label: SpringBoot3.0 监控 +keywords: [开源监控系统, 开源消息中间件监控, SpringBoot3.0 监控] +--- + +> 对SpringBoot3.0 actuator 暴露的通用性能指标进行采集监控。 + +## 监控前操作 + +如果想要通过此监控类型监控 `SpringBoot` 中的信息,则需要您的SpringBoot应用集成并开启SpringBoot Actuator。 + +**1、添加POM.XML依赖:** + +```xml + + org.springframework.boot + spring-boot-starter-actuator + +``` + +**2、修改YML配置暴露指标接口:** + +```yaml +management: + endpoints: + web: + exposure: + include: '*' + enabled-by-default: on +``` + +*注意:如果你的项目里还引入了认证相关的依赖,比如springboot-security,那么SpringBoot Actuator暴露出的接口可能会被拦截,此时需要你手动放开这些接口,以springboot-security为例,需要在SecurityConfig配置类中加入以下代码:* + +```java +public class SecurityConfig extends WebSecurityConfigurerAdapter{ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception{ + httpSecurity + // 配置要放开的接口 ----------------------------------- + .antMatchers("/actuator/**").permitAll() + .antMatchers("/metrics/**").permitAll() + .antMatchers("/trace").permitAll() + .antMatchers("/heapdump").permitAll() + // ... + // 其他接口请参考:https://blog.csdn.net/JHIII/article/details/126601858 ----------------------------------- + } +} +``` + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|--------|------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 应用服务对外提供的端口,默认为8080。 | +| 启动SSL | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443。 | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 对监控资源的分类管理标签。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:可用性 +| 指标名称 | 指标单位 | 指标帮助描述 | +|--------------|------|--------| +| responseTime | ms | 响应时间 | + +#### 指标集合:线程 +| 指标名称 | 指标单位 | 指标帮助描述 | +|-------|------|--------------------| +| state | 无 | 线程状态 | +| size | 无 | 此线程状态对应的线程数量 | + +#### 指标集合:内存使用 +| 指标名称 | 指标单位 | 指标帮助描述 | +|----------|------|-----------| +| space | 无 | 内存空间名称 | +| mem_used | MB | 此空间占用内存大小 | + +#### 指标集合:健康状态 +| 指标名称 | 指标单位 | 指标帮助描述 | +|--------|------|-----------------| +| status | 无 | 服务健康状态: UP,Down | \ No newline at end of file diff --git a/home/versioned_docs/version-v1.1.x/help/sqlserver.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/sqlserver.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/sqlserver.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/sqlserver.md index 925123e4a6c..5dc66e27cfc 100644 --- a/home/versioned_docs/version-v1.1.x/help/sqlserver.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/sqlserver.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源数据库监控, SqlServer数据库监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 数据库对外提供的端口,默认为1433。 | | 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | | 数据库名称 | 数据库实例名称,可选。 | diff --git a/home/versioned_docs/version-v1.1.x/help/ssl_cert.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ssl_cert.md similarity index 95% rename from home/versioned_docs/version-v1.1.x/help/ssl_cert.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ssl_cert.md index 8b6c352b7ed..d5f23f56ff6 100644 --- a/home/versioned_docs/version-v1.1.x/help/ssl_cert.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ssl_cert.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网站监控, SSL证书监控监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 网站对外提供的端口,https一般默认为443。 | | 相对路径 | 网站地址除IP端口外的后缀路径,例如 `www.tancloud.cn/console` 网站的相对路径为 `/console`。 | | 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/tidb.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/tidb.md new file mode 100644 index 00000000000..bc5db826027 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/tidb.md @@ -0,0 +1,49 @@ +--- +id: tidb +title: 监控:TiDB数据库监控 +sidebar_label: TiDB数据库 +keywords: [开源监控系统, 开源数据库监控, TiDB数据库监控] +--- + +> 使用 HTTP 和 JDBC 协议对 TiDB 的通用性能指标进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ----------- | ----------- | +| 目标Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| Service端口 | TiDB数据库对外提供用于状态报告的端口,默认为10080。 | +| PD端口 | TiDB数据库的PD端口,默认为2379。 | +| 查询超时时间 | 设置SQL查询未响应数据时的超时时间,单位ms毫秒,默认6000毫秒。 | +| JDBC端口 | TiDB数据库对外提供用于客户端请求的端口,默认为4000。 | +| 数据库名称 | 数据库实例名称,可选。 | +| 用户名 | 数据库连接用户名,可选 | +| 密码 | 数据库连接密码,可选 | +| JDBC URL | 数据库使用[JDBC驱动的](https://docs.pingcap.com/zh/tidb/stable/dev-guide-connect-to-tidb#jdbc)连接URL,可选,若配置,则URL里面的数据库名称,用户名密码等参数会覆盖上面配置的参数 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +监控模板将从TiDB系统变量表中检索监控指标,用户可以自行检索[TiDB系统变量表](https://docs.pingcap.com/zh/tidb/stable/system-variables)以查询所需信息或其他系统变量。 + +除此之外,TiDB也提供默认监控指标表,见[Metrics Schema](https://docs.pingcap.com/zh/tidb/stable/metrics-schema)与[METRICS_SUMMARY](https://docs.pingcap.com/zh/tidb/stable/information-schema-metrics-summary),用户可以根据需求自行添加检索式。 + +由于可以被监控的指标过多,下文仅介绍监控模板中所查询的指标。 + +#### 指标集合:系统变量 + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| version | 无 | MySQL 的版本和 TiDB 的版本,例如 '8.0.11-TiDB-v7.5.1' | +| version_comment | 无 | TiDB 版本号的其他信息,例如 'TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible' | +| version_compile_machine | 无 | 运行 TiDB 的 CPU 架构的名称 | +| version_compile_os | 无 | TiDB 所在操作系统的名称 | +| max_connections | 无 | 该变量表示 TiDB 中同时允许的最大客户端连接数,用于资源控制。默认情况下,该变量值为 0 表示不限制客户端连接数。当本变量的值大于 0 且客户端连接数到达此值时,TiDB 服务端将会拒绝新的客户端连接。 | +| datadir | 无 | 数据存储的位置,位置可以是本地路径 /tmp/tidb。如果数据存储在 TiKV 上,则可以是指向 PD 服务器的路径。变量值的格式为 ${pd-ip}:${pd-port},表示 TiDB 在启动时连接到的 PD 服务器。 | +| port | 无 | 使用 MySQL 协议时 tidb-server 监听的端口。 | + + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/time_expression.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/time_expression.md new file mode 100644 index 00000000000..f03ebfab25e --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/time_expression.md @@ -0,0 +1,66 @@ +--- +id: time_expression +title: 时间表达式 +sidebar_label: 时间表达式 +keywords: [ 动态时间,时间表达式 ] +--- + +### 简介 + +HertzBeat支持使用表达式计算监控采集时的相对时间,支持更加灵活的在监控模板中定义时间。 + +### 语法 + +``` +${FORMATTER [{ + | - } ]} +``` + +- `FORMATTER` : 决定表达式计算的结果的格式 +- `DURATION` : 时间段大小,正整数 +- `TIME_UNIT` : 时间段单位 + +### 支持的格式化类型 + +> 示例输出以当前时间为 `2022-04-24 02:40:00.123` + +| 名称 | 描述 | 示例 | +|--------------|----------------------------|---------------------| +| @now | 格式化为 `yyyy-MM-dd HH:mm:ss` | 2022-04-24 02:40:00 | +| @date | 格式化为 `yyyy-MM-dd` | 2022-04-24 | +| @timestamp10 | 返回10位时间戳 | 1650768000 | +| @timestamp | 返回13位时间戳 | 1650768000000 | +| @time | 格式化为 `HH:mm:ss` | 02:40:00 | +| @year | 格式化为 `yyyy` | 2022 | +| @month | 格式化为 `MM` | 04 | +| @day | 格式化为 `dd` | 24 | +| @hour | 格式化为 `HH` | 02 | +| @minute | 格式化为 `mm` | 40 | +| @millisecond | 格式化为 `SSS` | 123 | +| @second | 格式化为 `ss` | 00 | + +### 支持的时间单位 + +| 名称 | 描述 | +|----|----| +| y | 年 | +| M | 月 | +| d | 日 | +| H | 小时 | +| m | 分钟 | +| s | 秒 | +| w | 周 | + +#### 在哪里可以使用 + +- HTTP协议监控类型的请求参数 + +#### 使用示例 + +1. 简单表达式 + - `${now}` 获取当前时间,并格式化为 `yyyy-MM-dd HH:mm:ss` + - `${time+1h}` 计算当前时间一小时之后的时间,并格式化为 `HH:mm:ss` + - `${time+1h+15s+30s}` 计算当前时间一小时15分钟30秒之后的时间,并格式化为 `HH:mm:ss` +2. 复杂表达式模板(如果内置的格式化器无法满足需要,可以组合使用多个表达式) + - `${@year}年${@month}月${@day}日`,获取当前日期并按照 yyyy年MM月dd日格式返回 + + diff --git a/home/versioned_docs/version-v1.1.x/help/tomcat.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/tomcat.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/tomcat.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/tomcat.md index 1c0554ff57f..c306bebc550 100644 --- a/home/versioned_docs/version-v1.1.x/help/tomcat.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/tomcat.md @@ -14,7 +14,7 @@ keywords: [开源监控系统, 开源网站监控, Tomcat监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 查询超时时间 | 设置Tomcat连接的超时时间,单位ms毫秒,默认3000毫秒。 | | 用户名 | JMX连接用户名 | | 密码 | JMX连接密码 | diff --git a/home/versioned_docs/version-v1.1.x/help/ubuntu.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ubuntu.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/ubuntu.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ubuntu.md index 7d096154a2a..e5d1be3a140 100644 --- a/home/versioned_docs/version-v1.1.x/help/ubuntu.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/ubuntu.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源操作系统监控, Ubuntu监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | Linux SSH对外提供的端口,默认为22。 | | 用户名 | SSH连接用户名,可选 | | 密码 | SSH连接密码,可选 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/udp_port.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/udp_port.md new file mode 100644 index 00000000000..06c11717b25 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/udp_port.md @@ -0,0 +1,31 @@ +--- +id: udp_port +title: 监控:UDP 端口可用性监控 +sidebar_label: UDP 端口可用性 +keywords: [开源监控系统, 开源网络监控, UDP 端口可用性监控] +--- + +> UDP 是面向无连接的传输层协议,其端口可用性状态我们通过在应用层发送请求报文获得响应来判断,配置信息我们需要填充能使对端响应的应用层16进制报文内容。建议使用wireshark抓包来获取发送报文内容。 +> 您可以点击`新建 UDP端口可用性`并进行配置,或者选择`更多操作`,导入已有配置。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|:-------|--------------------------------------------------------| +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头 (例如: https://, http://) 。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | 网站对外提供的端口。 | +| 连接超时时间 | 端口连接的等待超时时间,单位毫秒,默认6000毫秒。 | +| 发送报文内容 | 能使对端响应的应用层16进制报文内容。 | +| 采集器 | 配置此监控使用哪台采集器调度采集。 | +| 监控周期 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 对监控资源的分类管理标签。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:概要 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|------|---------|--------| +| 响应时间 | 毫秒 (ms) | 网站响应时间 | diff --git a/home/versioned_docs/version-v1.1.x/help/website.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/website.md similarity index 95% rename from home/versioned_docs/version-v1.1.x/help/website.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/website.md index 4ec9eba4ab5..ee8921e316b 100644 --- a/home/versioned_docs/version-v1.1.x/help/website.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/website.md @@ -12,7 +12,7 @@ keywords: [开源监控系统, 开源网站监控] | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | 网站对外提供的端口,http一般默认为80,https一般默认为443。 | | 相对路径 | 网站地址除IP端口外的后缀路径,例如 `www.tancloud.cn/console` 网站的相对路径为 `/console`。 | | 启用HTTPS | 是否通过HTTPS访问网站,注意⚠️开启HTTPS一般默认对应端口需要改为443 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/websocket.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/websocket.md new file mode 100644 index 00000000000..ad8baa7d71b --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/websocket.md @@ -0,0 +1,33 @@ +--- +id: websocket +title: 监控:Websocket +sidebar_label: Websocket +keywords: [ 开源监控系统, Websocket监控 ] +--- + +> WebSocket 服务的首次握手的响应等相关指标进行监测。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +|------------------|--------------------------------------------------------------| +| WebSocket服务的Host | 被监控的Websocket的IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | Websocket服务的端口。 | +| WebSocket服务的路径 | Websocket端点的路径。 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒。 | +| 绑定标签 | 用于对监控资源进行分类管理。 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息。 | + +### 采集指标 + +#### 指标集合:概要 + +| 指标名称 | 指标单位 | 指标帮助描述 | +|---------------|------|---------| +| responseTime | ms | 响应时间 | +| httpVersion | 无 | HTTP 版本 | +| responseCode | 无 | 响应状态码 | +| statusMessage | 无 | 状态消息 | +| connection | 无 | 表示连接方式 | +| upgrade | 无 | 升级后的协议 | diff --git a/home/versioned_docs/version-v1.1.x/help/windows.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/windows.md similarity index 97% rename from home/versioned_docs/version-v1.1.x/help/windows.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/windows.md index f67bc6e868f..6a1c79b9ede 100644 --- a/home/versioned_docs/version-v1.1.x/help/windows.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/windows.md @@ -19,7 +19,7 @@ keywords: [开源监控系统, 开源操作系统监控, Windows操作系统监 | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | Windows SNMP服务对外提供的端口,默认为 161。 | | SNMP 版本 | SNMP协议版本 V1 V2c V3 | | SNMP 团体字 | SNMP 协议团体名(Community Name),用于实现SNMP网络管理员访问SNMP管理代理时的身份验证。类似于密码,默认值为 public | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/yarn.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/yarn.md new file mode 100644 index 00000000000..2c88fe1e5a9 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/yarn.md @@ -0,0 +1,83 @@ +--- +id: yarn +title: 监控:Apache Yarn监控 +sidebar_label: Apache Yarn +keywords: [大数据监控系统, Apache Yarn监控, 资源管理器监控] +--- + +> Hertzbeat 对 Apache Yarn 节点监控指标进行监控。 + +**使用协议:HTTP** + +## 监控前操作 + +获取 Apache Yarn 的 HTTP 监控端口。 取值:`yarn.resourcemanager.webapp.address` + +## 配置参数 + +| 参数名称 | 参数帮助描述 | +| ---------------- |---------------------------------------| +| 目标Host | 被监控的对端IPV4,IPV6或域名。不带协议头。 | +| 端口 | Apache Yarn 的监控端口号,默认为8088。 | +| 查询超时时间 | 查询 Apache Yarn 的超时时间,单位毫秒,默认6000毫秒。 | +| 指标采集间隔 | 监控数据采集的时间间隔,单位秒,最小间隔为30秒。 | + +### 采集指标 + +#### 指标集合:ClusterMetrics + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- | -------- | ---------------------------------- | +| NumActiveNMs | | 当前存活的 NodeManager 个数 | +| NumDecommissionedNMs | | 当前 Decommissioned 的 NodeManager 个数 | +| NumDecommissioningNMs| | 集群正在下线的节点数 | +| NumLostNMs | | 集群丢失的节点数 | +| NumUnhealthyNMs | | 集群不健康的节点数 | + +#### 指标集合:JvmMetrics + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- | -------- | ------------------------------------ | +| MemNonHeapCommittedM | MB | JVM当前非堆内存大小已提交大小 | +| MemNonHeapMaxM | MB | JVM非堆最大可用内存 | +| MemNonHeapUsedM | MB | JVM当前已使用的非堆内存大小 | +| MemHeapCommittedM | MB | JVM当前已使用堆内存大小 | +| MemHeapMaxM | MB | JVM堆内存最大可用内存 | +| MemHeapUsedM | MB | JVM当前已使用堆内存大小 | +| GcTimeMillis | | JVM GC时间 | +| GcCount | | JVM GC次数 | + +#### 指标集合:QueueMetrics + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------------------ | -------- | ------------------------------------ | +| queue | | 队列名称 | +| AllocatedVCores | | 分配的虚拟核数(已分配) | +| ReservedVCores | | 预留核数 | +| AvailableVCores | | 可用核数(尚未分配) | +| PendingVCores | | 阻塞调度核数 | +| AllocatedMB | MB | 已分配(已用)的内存大小 | +| AvailableMB | MB | 可用内存(尚未分配) | +| PendingMB | MB | 阻塞调度内存 | +| ReservedMB | MB | 预留内存 | +| AllocatedContainers | | 已分配(已用)的container数 | +| PendingContainers | | 阻塞调度container个数 | +| ReservedContainers | | 预留container数 | +| AggregateContainersAllocated | | 累积的container分配总数 | +| AggregateContainersReleased | | 累积的container释放总数 | +| AppsCompleted | | 完成的任务数 | +| AppsKilled | | 被杀掉的任务数 | +| AppsFailed | | 失败的任务数 | +| AppsPending | | 阻塞的任务数 | +| AppsRunning | | 提正在运行的任务数 | +| AppsSubmitted | | 提交过的任务数 | +| running_0 | | 运行时间小于60分钟的作业个数 | +| running_60 | | 运行时间介于60~300分钟的作业个数 | +| running_300 | | 运行时间介于300~1440分钟的作业个数 | +| running_1440 | | 运行时间大于1440分钟的作业个数 | + +#### 指标集合:runtime + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------------------- | -------- | ---------------------------- | +| StartTime | | 启动时间戳 | diff --git a/home/versioned_docs/version-v1.1.x/help/zookeeper.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/zookeeper.md similarity index 98% rename from home/versioned_docs/version-v1.1.x/help/zookeeper.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/zookeeper.md index 775331568df..0783ceaf3fb 100644 --- a/home/versioned_docs/version-v1.1.x/help/zookeeper.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/help/zookeeper.md @@ -51,7 +51,7 @@ Complete! | 参数名称 | 参数帮助描述 | | ----------- | ----------- | | 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | -| 监控名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | | 端口 | Zookeeper的Linux服务器SSH端口。 | | 查询超时时间 | 设置Zookeeper连接的超时时间,单位ms毫秒,默认3000毫秒。 | | 用户名 | Zookeeper所在Linux连接用户名 | diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/introduce.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/introduce.md new file mode 100644 index 00000000000..cd0274a5f98 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/introduce.md @@ -0,0 +1,311 @@ +--- +id: introduce +title: Apache HertzBeat (incubating) +sidebar_label: 介绍 +slug: / +--- + +> 实时监控系统,无需Agent,性能集群,兼容Prometheus,自定义监控和状态页构建能力。 + +[![Discord](https://img.shields.io/badge/Chat-Discord-7289DA?logo=discord)](https://discord.gg/Fb6M73htGr) +[![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) +[![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) +[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) +[![QQ](https://img.shields.io/badge/QQ-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) +[![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) + + +## 🎡 介绍 + +[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) 是一个易用友好的开源实时监控告警系统,无需 Agent,高性能集群,兼容 Prometheus,提供强大的自定义监控和状态页构建能力。 + +### 特点 + +- 集 **监控+告警+通知** 为一体,支持对应用服务,应用程序,数据库,缓存,操作系统,大数据,中间件,Web服务器,云原生,网络,自定义等监控阈值告警通知一步到位。 +- 易用友好,无需 `Agent`,全 `WEB` 页面操作,鼠标点一点就能监控告警,零上手学习成本。 +- 将 `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s` 或 `Docker` 等新的监控类型吗? +- 兼容 `Prometheus` 的系统生态并且更多,只需页面操作就可以监控 `Prometheus` 所能监控的。 +- 高性能,支持多采集器集群横向扩展,支持多隔离网络监控,云边协同。 +- 自由的告警阈值规则,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱` 等方式消息及时送达。 +- 提供强大的状态页构建能力,轻松向用户传达您产品服务的实时状态。 + +> `HertzBeat`的强大自定义,多类型支持,高性能,易扩展,低耦合,希望能帮助开发者和团队快速搭建自有监控系统。 + +---- + +### 强大的监控模版 + +> 开始我们就说 HertzBeat 的特点是自定义监控能力,无需 Agent。在讨论这两点之前,我们先介绍下 HertzBeat 的不一样的监控模版。而正是因为这样的监控模版设计,才会有了后面的高级特性。 + +HertzBeat 自身并没有去创造一种采集数据协议让监控对端来适配它。而是充分使用了现有的生态,`SNMP协议`采集网络交换机路由器信息,`JMX规范`采集JAVA应用信息,`JDBC规范`采集数据集信息,`SSH`直连执行脚本获取回显信息,`HTTP+(JsonPath | prometheus等)`解析API接口信息,`IPMI协议`采集服务器信息等等。 +HertzBeat 使用这些已有的标准协议或规范,将他们抽象规范可配置化,最后使其都可以通过编写YML格式监控模版的形式,来制定模版使用这些协议来采集任何想要的指标数据。 + +![hertzbeat](/img/blog/multi-protocol.png) + +你相信用户只需在UI页面编写一个监控模版,点击保存后,就能立刻适配一款`K8s`或`Docker`等新的监控类型吗? + +![hertzbeat](/img/home/9.png) + + +### 内置监控类型 + +**官方内置了大量的监控模版类型,方便用户直接在页面添加使用,一款监控类型对应一个YML监控模版** + +- [Website](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-website.yml), [Port Telnet](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-port.yml), + [Http Api](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api.yml), [Ping Connect](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ping.yml), + [Jvm](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml), + [Ssl Certificate](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot2](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml), + [FTP Server](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml), [SpringBoot3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml), + [Udp Port](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-udp.yml), [Dns](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dns.yml), + [Pop3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-pop3.yml), [Ntp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ntp.yml), + [Api Code](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api_code.yml), [Smtp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-smtp.yml), + [Nginx](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nginx.yml) +- [Mysql](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml), + [MariaDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis.yml), + [ElasticSearch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml), + [Oracle](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml), + [DM](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml), + [ClickHouse](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml), + [Redis Cluster](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml), [Redis Sentinel](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml) + [Doris BE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_be.yml), [Doris FE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_fe.yml), + [Memcached](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-memcached.yml), [NebulaGraph](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-nebulaGraph.yml) +- [Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml), + [CentOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-windows.yml), + [EulerOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml), [Fedora CoreOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml), + [OpenSUSE](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml), [Rocky Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml), + [Red Hat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml), [FreeBSD](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml), + [AlmaLinux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml), [Debian Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-debian.yml) +- [Tomcat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml), + [Zookeeper](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml), + [Flink](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml), + [ShenYu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml), + [Jetty](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml), + [Spring Gateway](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spring_gateway.yml), [EMQX MQTT](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-emqx.yml), + [AirFlow](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-airflow.yml), [Hive](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hive.yml), + [Spark](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spark.yml), [Hadoop](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hadoop.yml) +- [Kubernetes](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-docker.yml) +- [CiscoSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml), [HpeSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml), + [HuaweiSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml), [TpLinkSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml), + [H3cSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml) +- 和更多自定义监控模版。 +- 通知支持 `Discord` `Slack` `Telegram` `邮件` `钉钉` `微信` `飞书` `短信` `Webhook` `Server酱`。 + +### 强大自定义功能 + +> 由前面的**监控模版**介绍,大概清楚了 `HertzBeat` 拥有的强大自定义功能。 +> 我们将每个监控类型都视为一个监控模版,不管是官方内置的还是后期用户自定义新增的。用户都可以方便的通过修改监控模版来新增修改删除监控指标。 +> 模版里面包含各个协议的使用配置,环境变量,指标转换,指标计算,单位转换,指标采集等一系列功能,帮助用户能采集到自己想要的监控指标。 + +![hertzbeat](/img/docs/custom-arch.png) + +### 无需 Agent + +> 对于使用过各种系统的用户来说,可能最麻烦头大的不过就是各种 `agent` 的安装部署调试升级了。 +> 每台主机得装个 `agent`,为了监控不同应用中间件可能还得装几个对应的 `agent`,监控数量上来了轻轻松松上千个,写个批量脚本可能会减轻点负担。 +> `agent` 的版本是否与主应用兼容, `agent` 与主应用的通讯调试, `agent` 的同步升级等等等等,这些全是头大的点。 + +`HertzBeat` 的原理就是使用不同的协议去直连对端系统,采用 `PULL` 的形式去拉取采集数据,无需用户在对端主机上部署安装 `Agent` | `Exporter` 等。 +- 比如监控 `linux操作系统`, 在 `HertzBeat` 端输入IP端口账户密码或密钥即可。 +- 比如监控 `mysql数据库`, 在 `HertzBeat` 端输入IP端口账户密码即可。 +**密码等敏感信息全链路加密** + +### 高性能集群 + +> 当监控数量指数级上升,采集性能下降或者环境不稳定容易造成采集器单点故障时,这时我们的采集器集群就出场了。 + +- `HertzBeat` 支持部署采集器集群,多采集器集群横向扩展,指数级提高可监控数量与采集性能。 +- 监控任务在采集器集群中自调度,单采集器挂掉无感知故障迁移采集任务,新加入采集器节点自动调度分担采集压力。 +- 单机模式与集群模式相互切换部署非常方便,无需额外组件部署。 + +![hertzbeat](/img/docs/cluster-arch.png) + +### 云边协同 + +> 两地三中心,多云环境,多隔离网络,这些场景名词可能大家略有耳闻。当需要用一套监控系统统一监控不同隔离网络的IT资源时,这时我们的云边协同就来啦。 + +- `HertzBeat` 支持部署边缘采集器集群,与主 `HertzBeat` 服务云边协同提升采集能力。 + +在多个网络不相通的隔离网络中,在以往方案中我们需要在每个网络都部署一套监控系统,这导致数据不互通,管理部署维护都不方便。 +`HertzBeat` 提供的云边协同能力,可以在多个隔离网络部署边缘采集器,采集器在隔离网络内部进行监控任务采集,采集数据上报,由主服务统一调度管理展示。 + +![hertzbeat](/img/docs/cluster-arch.png) + +### 易用友好 + +- 集 **监控+告警+通知** All in one, 无需单独部署多个组件服务。 +- 全UI界面操作,不管是新增监控,修改监控模版,还是告警阈值通知,都可在WEB界面操作完成,无需要修改文件或脚本或重启。 +- 无需 Agent, 监控对端我们只需在WEB界面填写所需IP端口账户密码等参数即可。 +- 自定义友好,只需一个监控模版YML,自动生成对应监控类型的监控管理页面,数据图表页面,阈值配置等。 +- 阈值告警通知友好,基于表达式阈值配置,多种告警通知渠道,支持告警静默,时段标签告警级别过滤等。 + +### 完全开源 + +- Apache 基金会孵化器下开源项目,Gitee GVP,使用`Apache2`协议,由自由开放的开源社区主导维护的开源协作产品。 +- 无监控数量`License`,监控类型等伪开源限制。 +- 基于`Java+SpringBoot+TypeScript+Angular`主流技术栈构建,方便的二次开发。 +- 开源不等同于免费,基于HertzBeat二次开发需保留页面脚注,版权等。 + +**HertzBeat 已被 [CNCF云原生全景图](https://landscape.cncf.io/card-mode?category=monitoring&grouping=category) 收录** + +![cncf](/img/home/cncf-landscape-left-logo.svg) + +----- + +**`HertzBeat`的强大自定义,多类型支持,高性能,易扩展,低耦合,希望能帮助开发者和团队快速搭建自有监控系统。** + +----- + +## 即刻体验一波 + +Docker 环境下运行一条命令即可:`docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat` +浏览器访问 `http://localhost:1157` 默认账户密码 `admin/hertzbeat` + +### 登陆页面 + +- HertzBeat 的用户管理统一由配置文件 `sureness.yml` 维护,用户可以通过修改此文件来新增删除修改用户信息,用户角色权限等。默认账户密码 admin/hertzbeat + +![hertzbeat](/img/home/0.png) + +### 概览页面 + +- 全局概览页面,分类展示了当前监控大类别数量分布,用户可直观查看当前的监控类型与数量并点击跳转至对应监控类型进行维护管理。 +- 展示当前注册的采集器集群状态,包括采集器的上线状态,监控任务,启动时间,IP地址,名称等。 +- 下发展示了最近告警信息列表,告警级别分布情况,告警处理率情况。 + +![hertzbeat](/img/home/1.png) + +### 监控中心 + +- 监控入口,支持对应用服务,数据库,操作系统,中间件,网络,自定义等监控的管理。 +- 以列表的形式展示当前已添加的监控,支持对监控的新增,修改,删除,取消监控,导入导出,批量管理等。 +- 支持标签分组,查询过滤,查看监控详情入口等。 + +内置支持的监控类型包括: + +- [Website](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-website.yml), [Port Telnet](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-port.yml), + [Http Api](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api.yml), [Ping Connect](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ping.yml), + [Jvm](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml), + [Ssl Certificate](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot2](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml), + [FTP Server](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml), [SpringBoot3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml), + [Udp Port](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-udp.yml), [Dns](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dns.yml), + [Pop3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-pop3.yml), [Ntp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ntp.yml), + [Api Code](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api_code.yml), [Smtp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-smtp.yml), + [Nginx](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nginx.yml) +- [Mysql](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml), + [MariaDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis.yml), + [ElasticSearch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml), + [Oracle](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml), + [DM](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml), + [ClickHouse](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml), + [Redis Cluster](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml), [Redis Sentinel](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml) + [Doris BE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_be.yml), [Doris FE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_fe.yml), + [Memcached](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-memcached.yml), [NebulaGraph](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-nebulaGraph.yml) +- [Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml), + [CentOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-windows.yml), + [EulerOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml), [Fedora CoreOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml), + [OpenSUSE](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml), [Rocky Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml), + [Red Hat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml), [FreeBSD](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml), + [AlmaLinux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml), [Debian Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-debian.yml) +- [Tomcat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml), + [Zookeeper](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml), + [Flink](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml), + [ShenYu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml), + [Jetty](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml), + [Spring Gateway](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spring_gateway.yml), [EMQX MQTT](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-emqx.yml), + [AirFlow](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-airflow.yml), [Hive](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hive.yml), + [Spark](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spark.yml), [Hadoop](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hadoop.yml) +- [Kubernetes](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-docker.yml) +- [CiscoSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml), [HpeSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml), + [HuaweiSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml), [TpLinkSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml), + [H3cSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml) + +![hertzbeat](/img/home/2.png) + +### 新增修改监控 + +- 新增或修改指定监控类型的监控实例,配置对端监控的IP,端口等参数,设置采集周期,采集任务调度方式,支持提前探测可用性等。 +- 页面上配置的监控参数由对应监控类型的监控模版所定义,用户可以通过修改监控模版来修改页面配置参数。 +- 支持关联标签,用标签来管理监控分组,告警匹配等。 + +![hertzbeat](/img/home/10.png) + +### 监控详情 + +- 监控的数据详情页面,展示了当前监控的基本参数信息,监控指标数据信息。 +- 监控实时数据报告,以小卡片列表的形式展示了当前监控的所有指标实时值,用户可根据实时值参考配置告警阈值规则。 +- 监控历史数据报告,以趋势图表的形式展示了当前监控数值类型的指标的历史值,支持查询小时,天,月的历史数据,支持配置页面刷新时间。 +- ⚠️注意监控历史图表需配置外置时序数据库才能获取完整功能,时序数据库支持: IOTDB, TDengine, InfluxDB, GreptimeDB + +![hertzbeat](/img/home/3.png) + +![hertzbeat](/img/home/4.png) + +### 告警中心 + +- 已触发告警消息的管理展示页面,使用户有直观的展示当前告警情况。 +- 支持告警处理,告警标记未处理,告警删除清空等批量操作。 + +![hertzbeat](/img/home/7.png) + +### 阈值规则 + +- 对于监控的可用性状态设置阈值规则,特定指标的值超过我们预期范围时发出告警,这些都可以在阈值规则这里配置。 +- 告警级别分为三级:通知告警,严重告警,紧急告警。 +- 阈值规则支持可视化页面配置或表达式规则配置,灵活性更高。 +- 支持配置触发次数,告警级别,通知模版,关联指定监控等。 + +![hertzbeat](/img/home/6.png) + +![hertzbeat](/img/home/11.png) + +### 告警收敛 + +- 当通过阈值规则判断触发告警后,会进入到告警收敛,告警收敛会根据规则对特定时间段的重复告警消息去重收敛,已避免大量重复性告警导致接收人告警麻木。 +- 告警收敛规则支持重复告警生效时间段,标签匹配和告警级别匹配过滤。 + +![hertzbeat](/img/home/12.png) + +![hertzbeat](/img/home/13.png) + + +### 告警静默 + +- 当通过阈值规则判断触发告警后,会进入到告警静默,告警静默会根据规则对特定一次性时间段或周期性时候段的告警消息屏蔽静默,此时间段不发送告警消息。 +- 此应用场景如用户在系统维护中,无需发已知告警。用户在工作日时间才会接收告警消息,用户在晚上需避免打扰等。 +- 告警静默规则支持一次性时间段或周期性时间段,支持标签匹配和告警级别匹配。 + +![hertzbeat](/img/home/14.png) + +![hertzbeat](/img/home/15.png) + +### 消息通知 + +- 消息通知功能是把告警消息通过不同媒体渠道通知给指定的接收人,告警消息及时触达。 +- 功能包含接收人信息管理和通知策略管理,接收人管理维护接收人信息以其通知方式信息,通知策略管理维护把哪些告警信息通知给哪些接收人的策略规则。 +- 通知方式支持 `邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等方式。 +- 通知策略支持标签匹配和告警级别匹配,方便的使不同标签的告警和告警级别分派给不同的接收处理人。 +- 支持通知模版,用户可以自定义通过模版内容格式来满足自己的个性化通知展示需求。 + +![hertzbeat](/img/home/16.png) + +![hertzbeat](/img/home/17.png) + +![hertzbeat](/img/home/8.png) + +### 监控模版 + +- HertzBeat 将 `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 等协议规范可配置化,只需在浏览器配置监控模版 `YML` 就能使用这些协议去自定义采集想要的指标。您相信只需配置下就能立刻适配一款 `K8s` 或 `Docker` 等新的监控类型吗? +- 同理我们内置的所有监控类型(mysql,website,jvm,k8s)也一一映射为对应的监控模版,用户可以新增修改监控模版来自定义监控功能。 + +![hertzbeat](/img/home/9.png) + + +----- + +**还有更多强大的功能快去探索呀。Have Fun!** + +----- + +**Github: https://github.com/apache/hertzbeat** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/others/design.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/others/design.md new file mode 100644 index 00000000000..7799d12fe52 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/others/design.md @@ -0,0 +1,9 @@ +--- +id: design +title: 设计文档 +sidebar_label: 设计文档 +--- + +### HertzBeat 架构 + +![architecture](/img/docs/hertzbeat-arch.svg) diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/resource.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/others/resource.md similarity index 61% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/resource.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/others/resource.md index c4aa2f0ee17..46699d69a23 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/resource.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/others/resource.md @@ -1,19 +1,20 @@ --- id: resource -title: Related resources -sidebar_label: Related resources +title: 相关资源 +sidebar_label: 相关资源 --- -## Icon Resources +## 图标资源 -### HertzBeat Logo +### HertzBeat LOGO ![logo](/img/hertzbeat-logo.svg) Download: [SVG](/img/hertzbeat-logo.svg) [PNG](/img/hertzbeat-logo.png) -### HertzBeat Brand Logo +### HertzBeat Brand LOGO ![logo](/img/hertzbeat-brand.svg) -Download: [SVG](/img/hertzbeat-brand.svg) [PNG](/img/hertzbeat-brand.png) +Download: [SVG](/img/hertzbeat-brand.svg) [PNG](/img/hertzbeat-brand.png) + diff --git a/home/versioned_docs/version-v1.1.x/start/account-modify.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/account-modify.md similarity index 88% rename from home/versioned_docs/version-v1.1.x/start/account-modify.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/account-modify.md index ff2dcc30270..710ae8cbee5 100644 --- a/home/versioned_docs/version-v1.1.x/start/account-modify.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/account-modify.md @@ -1,10 +1,12 @@ --- id: account-modify -title: 配置修改账户密码 -sidebar_label: 配置修改账户密码 +title: 配置修改账户密码和加密密钥 +sidebar_label: 更新账户和密钥 --- -HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat +## 更新账户 + +Apache HertzBeat (incubating) 默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat 若需要新增删除修改账户或密码,可以通过配置 `sureness.yml` 实现,若无此需求可忽略此步骤 修改位于安装目录下的 `/hertzbeat/config/sureness.yml` 的配置文件,docker环境目录为`opt/hertzbeat/config/sureness.yml`,建议提前挂载映射 配置文件内容参考 项目仓库[/script/sureness.yml](https://github.com/apache/hertzbeat/blob/master/script/sureness.yml) @@ -110,12 +112,11 @@ account: role: [guest] ``` -## Update Security Secret - -> This secret is the key for account security encryption management and needs to be updated to your custom key string of the same length. +## 更新安全密钥 +> 此密钥为账户安全加密管理的密钥,需要更新为相同长度的你自定义密钥串。 -Update the `application.yml` file in the `config` directory, modify the `sureness.jwt.secret` parameter to your custom key string of the same length. +更新 `config` 目录下的 `application.yml` 文件,修改 `sureness.jwt.secret` 参数为你自定义的相同长度的密钥串。 ```yaml sureness: diff --git a/home/versioned_docs/version-v1.1.x/start/custom-config.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/custom-config.md similarity index 70% rename from home/versioned_docs/version-v1.1.x/start/custom-config.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/custom-config.md index 34013a37f89..27ebbf49520 100644 --- a/home/versioned_docs/version-v1.1.x/start/custom-config.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/custom-config.md @@ -28,21 +28,29 @@ common: sign-name: 赫兹跳动 template-id: 1343434 ``` +1.1 腾讯云短信创建签名(sign-name) +![image](https://github.com/apache/hertzbeat/assets/40455946/3a4c287d-b23d-4398-8562-4894296af485) + +1.2 腾讯云短信创建正文模板(template-id) +``` +监控:{1},告警级别:{2}。内容:{3} +``` +![image](https://github.com/apache/hertzbeat/assets/40455946/face71a6-46d5-452c-bed3-59d2a975afeb) -2. 配置告警自定义参数 -> 如果您收到频繁的内置可用性告警,或在您所在网络抖动厉害,建议调整以下参数 +1.3 腾讯云短信创建应用(app-id) +![image](https://github.com/apache/hertzbeat/assets/40455946/2732d710-37fa-4455-af64-48bba273c2f8) + +1.4 腾讯云访问管理(secret-id、secret-key) +![image](https://github.com/apache/hertzbeat/assets/40455946/36f056f0-94e7-43db-8f07-82893c98024e) + + +2. 配置告警自定义参数 ```yaml alerter: # 自定义控制台地址 console-url: https://console.tancloud.cn - # 告警触发评估间隔基础时间,相同重复告警在2倍此时间内不会被重复连续触发 单位毫秒 - alert-eval-interval-base: 600000 - # 告警触发评估间隔最大时间,相同重复告警最多在此时间段被抑制 单位毫秒 - max-alert-eval-interval: 86400000 - # 内置可用性告警连续触发几次才会真正发送告警 默认1次,当网络环境不好,不想频繁收到可用性告警时,可将此值调大(3) - system-alert-trigger-times: 1 ``` 3. 使用外置redis代替内存存储实时指标数据 diff --git a/home/versioned_docs/version-v1.1.x/start/docker-deploy.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/docker-deploy.md similarity index 57% rename from home/versioned_docs/version-v1.1.x/start/docker-deploy.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/docker-deploy.md index 8d42c10d07f..89cb46ef951 100644 --- a/home/versioned_docs/version-v1.1.x/start/docker-deploy.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/docker-deploy.md @@ -4,7 +4,7 @@ title: 通过 Docker 方式安装 HertzBeat sidebar_label: Docker方式部署 --- -> 推荐使用Docker部署HertzBeat +> 推荐使用 Docker 部署 Apache HertzBeat (incubating) 1. 下载安装Docker环境 Docker 工具自身的下载请参考以下资料: @@ -18,10 +18,17 @@ sidebar_label: Docker方式部署 ``` 2. 拉取HertzBeat Docker镜像 - 镜像版本TAG可查看[官方镜像仓库](https://hub.docker.com/r/apache/hertzbeat/tags) + 镜像版本TAG可查看 [dockerhub 官方镜像仓库](https://hub.docker.com/r/apache/hertzbeat/tags) + 或者使用 [quay.io 镜像仓库](https://quay.io/repository/apache/hertzbeat) - ``` shell + ```shell $ docker pull apache/hertzbeat + $ docker pull apache/hertzbeat-collector + ``` + 若网络超时或者使用 + ```shell + $ docker pull quay.io/tancloud/hertzbeat + $ docker pull quay.io/tancloud/hertzbeat-collector ``` 3. 部署HertzBeat您可能需要掌握的几条命令 @@ -40,51 +47,44 @@ sidebar_label: Docker方式部署 $ exit ``` -4. 配置挂载的HertzBeat的配置文件(可选) - 在主机目录下创建application.yml,eg:/opt/application.yml - 配置文件完整内容见项目仓库[/script/application.yml](https://gitee.com/hertzbeat/hertzbeat/raw/master/script/application.yml) 您可以根据需求修改配置文件 - - 若需使用邮件发送告警,需替换`application.yml`里面的邮件服务器参数 +4. 挂载并配置HertzBeat的配置文件(可选) + 下载 `application.yml` 文件到主机目录下,例如: $(pwd)/application.yml + 下载源 [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + - 若需使用邮件发送告警,需替换 `application.yml` 里面的邮件服务器参数 - **推荐**若需使用外置Mysql数据库替换内置H2数据库,需替换`application.yml`里面的`spring.datasource`参数 具体步骤参见 [H2数据库切换为MYSQL](mysql-change)) - **推荐**若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.td-engine`参数 具体步骤参见 [使用TDengine存储指标数据](tdengine-init) - **推荐**若需使用时序数据库IotDB来存储指标数据库,需替换`application.yml`里面的`warehouse.storeiot-db`参数 具体步骤参见 [使用IotDB存储指标数据](iotdb-init) -5. 配置挂载的HertzBeat用户配置文件,自定义用户密码(可选) +5. 挂载并配置HertzBeat用户配置文件,自定义用户密码(可选) HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat 若需要新增删除修改账户或密码,可以通过配置 `sureness.yml` 实现,若无此需求可忽略此步骤 - 在主机目录下创建sureness.yml,eg:/opt/sureness.yml - 配置文件完整内容见项目仓库[/script/sureness.yml](https://github.com/apache/hertzbeat/blob/master/script/sureness.yml) + 下载 `sureness.yml` 文件到主机目录下,例如: $(pwd)/sureness.yml + 下载源 [github/script/sureness.yml](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml) 具体修改步骤参考 [配置修改账户密码](account-modify) 6. 启动HertzBeat Docker容器 ```shell -$ docker run -d -p 1157:1157 \ +$ docker run -d -p 1157:1157 -p 1158:1158 \ -e LANG=zh_CN.UTF-8 \ -e TZ=Asia/Shanghai \ - -v /opt/data:/opt/hertzbeat/data \ - -v /opt/logs:/opt/hertzbeat/logs \ - -v /opt/application.yml:/opt/hertzbeat/config/application.yml \ - -v /opt/sureness.yml:/opt/hertzbeat/config/sureness.yml \ + -v $(pwd)/data:/opt/hertzbeat/data \ + -v $(pwd)/logs:/opt/hertzbeat/logs \ + -v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml \ + -v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml \ --restart=always \ --name hertzbeat apache/hertzbeat ``` 这条命令启动一个运行HertzBeat的Docker容器,并且将容器的1157端口映射到宿主机的1157端口上。若宿主机已有进程占用该端口,则需要修改主机映射端口。 - `docker run -d` : 通过Docker运行一个容器,使其在后台运行 - - - `-p 1157:1157` : 映射容器端口到主机端口,请注意,前面是宿主机的端口号,后面是容器的端口号。 - - - `-e LANG=zh_CN.UTF-8` : (可选) 设置语言 - - - `-e TZ=Asia/Shanghai` : (可选) 设置时区 - - - `-v /opt/data:/opt/hertzbeat/data` : (可选,数据持久化)重要⚠️ 挂载H2数据库文件到本地主机,保证数据不会因为容器的创建删除而丢失 - - - `-v /opt/logs:/opt/hertzbeat/logs` : (可选,不需要可删除)挂载日志文件到本地主机,保证日志不会因为容器的创建删除而丢失,方便查看 - - - `-v /opt/application.yml:/opt/hertzbeat/config/application.yml` : (可选,不需要可删除)挂载上上一步修改的本地配置文件到容器中,即使用本地配置文件覆盖容器配置文件。我们需要修改此配置文件的MYSQL,TDengine配置信息来连接外部服务。 - - - `-v /opt/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (可选,不需要可删除)挂载上一步修改的账户配置文件到容器中,若无修改账户需求可删除此命令参数。 + - `-e LANG=zh_CN.UTF-8` : 设置系统语言 + - `-e TZ=Asia/Shanghai` : 设置系统时区 + - `-p 1157:1157 -p 1158:1158` : 映射容器端口到主机端口,请注意,前面是宿主机的端口号,后面是容器的端口号。1157是WEB端口,1158是集群端口。 + - `-v $(pwd)/data:/opt/hertzbeat/data` : (可选,数据持久化)重要⚠️ 挂载H2数据库文件到本地主机,保证数据不会因为容器的创建删除而丢失 + - `-v $(pwd)/logs:/opt/hertzbeat/logs` : (可选,不需要可删除)挂载日志文件到本地主机,保证日志不会因为容器的创建删除而丢失,方便查看 + - `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (可选,不需要可删除)挂载上上一步修改的本地配置文件到容器中,即使用本地配置文件覆盖容器配置文件。我们需要修改此配置文件的MYSQL,TDengine配置信息来连接外部服务。 + - `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (可选,不需要可删除)挂载上一步修改的账户配置文件到容器中,若无修改账户需求可删除此命令参数。 - 注意⚠️ 挂载文件时,前面参数为你自定义本地文件地址,后面参数为docker容器内文件地址(固定) @@ -96,11 +96,34 @@ $ docker run -d -p 1157:1157 \ $ docker update --restart=always hertzbeat ``` - - `apache/hertzbeat` : 使用拉取最新的的HertzBeat官方发布的应用镜像来启动容器,版本可查看[官方镜像仓库](https://hub.docker.com/r/apache/hertzbeat/tags) + - `apache/hertzbeat` : 使用拉取最新的的HertzBeat官方发布的应用镜像来启动容器,**若使用`quay.io`镜像需用参数`quay.io/tancloud/hertzbeat`代替。** 7. 开始探索HertzBeat 浏览器访问 http://ip:1157/ 即可开始探索使用HertzBeat,默认账户密码 admin/hertzbeat。 +8. 部署采集器集群(可选) + +```shell +$ docker run -d \ + -e IDENTITY=custom-collector-name \ + -e MODE=public \ + -e MANAGER_HOST=127.0.0.1 \ + -e MANAGER_PORT=1158 \ + --name hertzbeat-collector apache/hertzbeat-collector +``` + + 这条命令启动一个运行HertzBeat采集器的Docker容器,并直连上了HertzBeat主服务节点。 + - `docker run -d` : 通过Docker运行一个容器,使其在后台运行 + - `-e IDENTITY=custom-collector-name` : (可选) 设置采集器的唯一标识名称。⚠️注意多采集器时采集器名称需保证唯一性。 + - `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。 + - `-e MANAGER_HOST=127.0.0.1` : 重要⚠️ 设置连接的主HertzBeat服务地址IP。 + - `-e MANAGER_PORT=1158` : (可选) 设置连接的主HertzBeat服务地址端口,默认 1158. + - `-v $(pwd)/logs:/opt/hertzbeat-collector/logs` : (可选,不需要可删除)挂载日志文件到本地主机,保证日志不会因为容器的创建删除而丢失,方便查看 + - `--name hertzbeat-collector` : 命名容器名称 hertzbeat-collector + - `apache/hertzbeat-collector` : 使用拉取最新的的HertzBeat采集器官方发布的应用镜像来启动容器,**若使用`quay.io`镜像需用参数`quay.io/tancloud/hertzbeat-collector`代替。** + +8. 浏览器访问主HertzBeat服务 `http://localhost:1157` 查看概览页面即可看到注册上来的新采集器 + **HAVE FUN** ### Docker部署常见问题 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/greptime-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/greptime-init.md new file mode 100644 index 00000000000..c83f0638605 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/greptime-init.md @@ -0,0 +1,64 @@ +--- +id: greptime-init +title: 依赖时序数据库服务GreptimeDB安装初始化 +sidebar_label: 使用GreptimeDB存储指标数据(可选) +--- + +Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) + +> 我们推荐使用并长期支持 VictoriaMetrics 作为存储。 + +GreptimeDB is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency. +It's designed to work on infrastructure of the cloud era, and users benefit from its elasticity and commodity storage. + +**⚠️ 若不配置时序数据库,则只会留最近一小时历史数据** + +### 通过Docker方式安装GreptimeDB +> 可参考官方网站[安装教程](https://docs.greptime.com/getting-started/overview) +1. 下载安装Docker环境 + Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 + 安装完毕后终端查看Docker版本是否正常输出。 + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Docker安装GreptimeDB + +```shell +$ docker run -p 4000-4004:4000-4004 \ + -p 4242:4242 -v /opt/greptimedb:/tmp/greptimedb \ + --name greptime \ + greptime/greptimedb standalone start \ + --http-addr 0.0.0.0:4000 \ + --rpc-addr 0.0.0.0:4001 +``` + + `-v /opt/greptimedb:/tmp/greptimedb` 为greptimedb数据目录本地持久化挂载,需将`/opt/greptimedb`替换为实际本地存在的目录 + 使用```$ docker ps```查看数据库是否启动成功 + +### 在hertzbeat的`application.yml`配置文件配置此数据库连接 + +1. 配置HertzBeat的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 + +**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.greptime`数据源参数,URL账户密码,并启用`enabled`为`true`** + +```yaml +warehouse: + store: + # 关闭默认JPA + jpa: + enabled: false + greptime: + enabled: true + endpoint: localhost:4001 +``` + +2. 重启 HertzBeat + +### 常见问题 + +1. 时序数据库 GreptimeDB 或者 IoTDB 或者 TDengine 是否都需要配置,能不能都用 +> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。 + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/influxdb-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/influxdb-init.md new file mode 100644 index 00000000000..427f07af423 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/influxdb-init.md @@ -0,0 +1,76 @@ +--- +id: influxdb-init +title: 依赖时序数据库服务InfluxDB安装初始化 +sidebar_label: 使用InfluxDB存储指标数据(可选) +--- + +Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) + +> 我们推荐使用并长期支持 VictoriaMetrics 作为存储。 + +InfluxDB是一个由InfluxData开发的开源时序型数据库,专注于海量时序数据的高性能读、高性能写、高效存储与实时分析等。 注意支持⚠️ 1.x版本。 + +**注意⚠️ 时序数据库安装配置为可选项,但强烈建议生产环境配置,以提供更完善的历史图表功能,高性能和稳定性** +**⚠️ 若不配置时序数据库,则只会留最近一小时历史数据** + +### 1. 直接使用华为云服务 GaussDB For Influx + +> 开通使用[华为云云数据库 GaussDB For Influx](https://www.huaweicloud.com/product/gaussdbforinflux.html) + +> 获取云数据库对外暴露连接地址,账户密码即可 + +⚠️注意云数据库默认开启了SSL,云数据库地址应使用 `https:` + +### 2. 通过Docker方式安装InfluxDB +> 可参考官方网站[安装教程](https://hub.docker.com/_/influxdb) +1. 下载安装Docker环境 + Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 + 安装完毕后终端查看Docker版本是否正常输出。 + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Docker安装InfluxDB 1.x + +```shell +$ docker run -p 8086:8086 \ + -v /opt/influxdb:/var/lib/influxdb \ + influxdb:1.8 +``` + + `-v /opt/influxdb:/var/lib/influxdb` 为influxdb数据目录本地持久化挂载,需将`/opt/influxdb`替换为实际本地存在的目录 + 使用```$ docker ps```查看数据库是否启动成功 + + +### 在hertzbeat的`application.yml`配置文件配置此数据库连接 + +1. 配置HertzBeat的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 + +**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.influxdb`数据源参数,URL账户密码,并启用`enabled`为`true`** + +```yaml +warehouse: + store: + # 关闭默认JPA + jpa: + enabled: false + influxdb: + enabled: true + server-url: http://localhost:8086 + username: root + password: root + expire-time: '30d' + replication: 1 +``` + +2. 重启 HertzBeat + +### 常见问题 + +1. 时序数据库InfluxDb, IoTDB和TDengine是否都需要配置,能不能都用 + +> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。 + + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/iotdb-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/iotdb-init.md new file mode 100644 index 00000000000..b4888e2af03 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/iotdb-init.md @@ -0,0 +1,124 @@ +--- +id: iotdb-init +title: 依赖时序数据库服务IoTDB安装初始化 +sidebar_label: 使用IoTDB存储指标数据(可选) +--- +Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) + +> 我们推荐使用并长期支持 VictoriaMetrics 作为存储。 + +Apache IoTDB是一体化收集、存储、管理与分析物联网时序数据的软件系统,我们使用其存储分析采集到的监控指标历史数据。支持V1.*版本,废弃V0.*版本的支持。 + +**注意⚠️ 时序数据库安装配置为可选项,但强烈建议生产环境配置,以提供更完善的历史图表功能,高性能和稳定性** + +**⚠️ 若不配置时序数据库,则只会留最近一小时历史数据** + +> 如果您已有IoTDB环境,可直接跳到YML配置那一步。 + +### 通过Docker方式安装IoTDB + +> 可参考官方网站[安装教程](https://iotdb.apache.org/zh/UserGuide/V0.13.x/QuickStart/WayToGetIoTDB.html) + +1. 下载安装Docker环境 + Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 + 安装完毕后终端查看Docker版本是否正常输出。 + + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Docker安装IoTDB + +```shell +$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ + -v /opt/iotdb/data:/iotdb/data \ + --name iotdb \ + apache/iotdb:1.2.2-standalone +``` + +`-v /opt/iotdb/data:/iotdb/data` 为IoTDB数据目录本地持久化挂载,需将`/iotdb/data`替换为实际本地存在的目录 +使用```$ docker ps```查看数据库是否启动成功 + +3. 在hertzbeat的`application.yml`配置文件配置IoTDB数据库连接 + + 配置HertzBeat的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 + 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 + +**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.iot-db`数据源参数,HOST账户密码等,并启用`enabled`为`true`** + +```yaml +warehouse: + store: + # 关闭默认JPA + jpa: + enabled: false + # 启用IotDB + iot-db: + enabled: true + host: 127.0.0.1 + rpc-port: 6667 + username: root + password: root + # use default queryTimeoutInMs = -1 + query-timeout-in-ms: -1 + # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) + expire-time: '7776000000' +``` + +**IoTDB集群版配置** +如果您使用IoTDB为集群请参考下面配置 + +```yaml +warehouse: + store: + # 关闭默认JPA + jpa: + enabled: false + # 启用IotDB + iot-db: + enabled: true + node-urls: ['127.0.0.1:6667','127.0.0.2:6667','127.0.0.3:6667''] + username: root + password: root + # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0 + query-timeout-in-ms: -1 + # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) + expire-time: '7776000000' +``` + +参数说明: + + +| 参数名称 | 参数说明 | +| ------------------- |-------------------------------------------| +| enabled | 是否启用 | +| host | IoTDB数据库地址 | +| rpc-port | IoTDB数据库端口 | +| node-urls | IoTDB集群地址 | +| username | IoTDB数据库账户 | +| password | IoTDB数据库密码 | +| version | IoTDB数据库版本,已废弃,仅支持V1.* | +| query-timeout-in-ms | 查询超时时间 | +| expire-time | 数据存储时间,默认'7776000000'(90天,单位为毫秒,-1代表永不过期) | + +> 如果集群配置`node-urls`和单机配置同时设置,以集群`node-urls`配置稳准 + +4. 重启 HertzBeat + +### 常见问题 + +1. 时序数据库IoTDB和TDengine是否都需要配置,能不能都用 + +> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。 + +2. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库] + +> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库 + +3. 安装配置了IotDB数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库] + +> 请检查配置参数是否正确 +> iot-db enable是否设置为true +> 注意⚠️若hertzbeat和IotDB都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP +> 可根据logs目录下启动日志排查 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/mysql-change.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/mysql-change.md new file mode 100644 index 00000000000..b25a8408387 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/mysql-change.md @@ -0,0 +1,89 @@ +--- +id: mysql-change +title: 关系型数据库使用 Mysql 替换依赖的 H2 存储系统元数据 +sidebar_label: 元数据使用Mysql存储(可选) +--- +MYSQL是一款值得信赖的关系型数据库,Apache HertzBeat (incubating) 除了支持使用默认内置的H2数据库外,还可以切换为使用MYSQL存储监控信息,告警信息,配置信息等结构化关系数据。 + +注意⚠️ 使用外置Mysql数据库替换内置H2数据库为可选项,但建议生产环境配置,以提供更好的性能 + +> 如果您已有MYSQL环境,可直接跳到数据库创建那一步。 + +### 通过Docker方式安装MYSQL +1. 下载安装Docker环境 + Docker 的安装请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 + 安装完毕后请于终端检查Docker版本输出是否正常。 + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Docker安装MYSQl + ``` + $ docker run -d --name mysql \ + -p 3306:3306 \ + -v /opt/data:/var/lib/mysql \ + -e MYSQL_ROOT_PASSWORD=123456 \ + --restart=always \ + mysql:5.7 + ``` + `-v /opt/data:/var/lib/mysql` 为mysql数据目录本地持久化挂载,需将`/opt/data`替换为实际本地存在的目录 + 使用```$ docker ps```查看数据库是否启动成功 + +### 数据库创建 +1. 进入MYSQL或使用客户端连接MYSQL服务 + `mysql -uroot -p123456` +2. 创建名称为hertzbeat的数据库 + `create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;` +3. 查看hertzbeat数据库是否创建成功 + `show databases;` + +### 修改hertzbeat的配置文件application.yml切换数据源 + +- 配置HertzBeat的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 + 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 + 替换里面的`spring.database`数据源参数,IP端口账户密码驱动 + ⚠️注意`application.yml`文件内容需完整,除下方修改内容外其他参数需保留,完整内容见[/script/application.yml](https://github.com/hertzbeat/hertzbeat/raw/master/script/application.yml) + + 需修改部分原参数: + ```yaml + spring: + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + ``` + 具体替换参数如下,需根据mysql环境配置账户密码IP: + ```yaml + spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: 123456 + url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false + platform: mysql + jpa: + database: mysql + ``` + +- 通过docker启动时,建议修改host为宿主机的外网IP地址,包括mysql连接字符串和redis。 + +**启动 HertzBeat 浏览器访问 http://ip:1157/ 开始使用HertzBeat进行监控告警,默认账户密码 admin/hertzbeat** + +### 常见问题 + +1. 缺少hibernate的mysql方言,导致启动异常 Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set + +如果上述配置启动系统,出现` Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set`异常, +需要在`application.yml`文件中增加以下配置: + +```yaml +spring: + jpa: + hibernate: + ddl-auto: update + properties: + hibernate: + dialect: org.hibernate.dialect.MySQL5InnoDBDialect +``` diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/package-deploy.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/package-deploy.md new file mode 100644 index 00000000000..b5f9d7e0456 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/package-deploy.md @@ -0,0 +1,91 @@ +--- +id: package-deploy +title: 通过安装包安装 HertzBeat +sidebar_label: 安装包方式部署 +--- +> Apache HertzBeat (incubating) 支持在Linux Windows Mac系统安装运行,CPU支持X86/ARM64。 + +1. 下载HertzBeat安装包 + 下载您系统环境对应的安装包 `hertzbeat-xx.tar.gz` `hertzbeat-collector-xx.tar.gz` + - [下载页面](/docs/download) + +2. 配置HertzBeat的配置文件(可选) + 解压安装包到主机 eg: /opt/hertzbeat + ``` + $ tar zxvf hertzbeat-xx.tar.gz + or + $ unzip -o hertzbeat-xx.zip + ``` + 修改位于 `hertzbeat/config/application.yml` 的配置文件(可选),您可以根据需求修改配置文件 + - 若需使用邮件发送告警,需替换`application.yml`里面的邮件服务器参数 + - **推荐**若需使用外置Mysql数据库替换内置H2数据库,需替换`application.yml`里面的`spring.datasource`参数 具体步骤参见 [H2数据库切换为MYSQL](mysql-change)) + - **强烈推荐** 以后我们将主要支持VictoriaMetrics作为时序数据库,若需使用时序数据库VictoriaMetrics来存储指标数据,需替换`application.yml`里面的`warehouse.store.victoria-metrics`参数 具体步骤参见 [使用VictoriaMetrics存储指标数据](victoria-metrics-init) + - **推荐**若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.td-engine`参数 具体步骤参见 [使用TDengine存储指标数据](tdengine-init) + - **推荐**若需使用时序数据库IotDB来存储指标数据库,需替换`application.yml`里面的`warehouse.storeiot-db`参数 具体步骤参见 [使用IotDB存储指标数据](iotdb-init) + +3. 配置用户配置文件(可选,自定义配置用户密码) + HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat + 若需要新增删除修改账户或密码,可以通过修改位于 `hertzbeat/config/sureness.yml` 的配置文件实现,若无此需求可忽略此步骤 + 具体参考 [配置修改账户密码](account-modify) + +4. 部署启动 + 执行位于安装目录hertzbeat/bin/下的启动脚本 startup.sh, windows环境下为 startup.bat + ``` + $ ./startup.sh + ``` + +5. 开始探索HertzBeat + 浏览器访问 http://ip:1157/ 即刻开始探索使用HertzBeat,默认账户密码 admin/hertzbeat。 + +6. 部署采集器集群(可选) + - 下载解压您系统环境对应采集器安装包`hertzbeat-collector-xx.tar.gz`到规划的另一台部署主机上 [下载页面](/docs/download) + - 配置采集器的配置文件 `hertzbeat-collector/config/application.yml` 里面的连接主HertzBeat服务的对外IP,端口,当前采集器名称(需保证唯一性)等参数 `identity` `mode` (public or private) `manager-host` `manager-port` + ```yaml + collector: + dispatch: + entrance: + netty: + enabled: true + identity: ${IDENTITY:} + mode: ${MODE:public} + manager-host: ${MANAGER_HOST:127.0.0.1} + manager-port: ${MANAGER_PORT:1158} + ``` + - 启动 `$ ./bin/startup.sh ` 或 `bin/startup.bat` + - 浏览器访问主HertzBeat服务 `http://localhost:1157` 查看概览页面即可看到注册上来的新采集器 + +**HAVE FUN** + + +### 安装包部署常见问题 + +**最多的问题就是网络环境问题,请先提前排查** + +1. **若您使用的是不含JDK的安装包,需您提前准备JAVA运行环境** + +安装JAVA运行环境-可参考[官方网站](http://www.oracle.com/technetwork/java/javase/downloads/index.html) +要求:JAVA17环境 +下载JAVA安装包: [镜像站](https://repo.huaweicloud.com/java/jdk/) +安装后命令行检查是否成功安装 + ``` + $ java -version + java version "17.0.9" + Java(TM) SE Runtime Environment 17.0.9 (build 17.0.9+8-LTS-237) + Java HotSpot(TM) 64-Bit Server VM 17.0.9 (build 17.0.9+8-LTS-237, mixed mode) + + ``` + +2. **按照流程部署,访问 http://ip:1157/ 无界面** + 请参考下面几点排查问题: +> 一:若切换了依赖服务MYSQL数据库,排查数据库是否成功创建,是否启动成功 +> 二:HertzBeat的配置文件 `hertzbeat/config/application.yml` 里面的依赖服务IP账户密码等配置是否正确 +> 三:若都无问题可以查看 `hertzbeat/logs/` 目录下面的运行日志是否有明显错误,提issue或交流群或社区反馈 + +3. **日志报错TDengine连接或插入SQL失败** +> 一:排查配置的数据库账户密码是否正确,数据库是否创建 +> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter + +4. **监控历史图表长时间都一直无数据** +> 一:时序数据库是否配置,未配置则无历史图表数据 +> 二:若使用了Tdengine,排查Tdengine的数据库`hertzbeat`是否创建 +> 三: HertzBeat的配置文件 `application.yml` 里面的依赖服务 时序数据库 IP账户密码等配置是否正确 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/postgresql-change.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/postgresql-change.md new file mode 100644 index 00000000000..3d554d84f0a --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/postgresql-change.md @@ -0,0 +1,84 @@ +--- +id: postgresql-change +title: 关系型数据库使用 PostgreSQL 替换依赖的 H2 存储系统元数据 +sidebar_label: 元数据使用PostgreSQL存储(可选) +--- +PostgreSQL是一个功能强大,开源的关系型数据库管理系统(RDBMS)。Apache HertzBeat (incubating) 除了支持使用默认内置的H2数据库外,还可以切换为使用PostgreSQL存储监控信息,告警信息,配置信息等结构化关系数据。 + +注意⚠️ 使用外置PostgreSQL数据库替换内置H2数据库为可选项,但建议生产环境配置,以提供更好的性能 + +> 如果您已有PostgreSQL环境,可直接跳到数据库创建那一步。 + + +### 通过Docker方式安装PostgreSQL + +1. Download and install the Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/)。 + After the installation you can check if the Docker version normally output at the terminal. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` + +2. Docker安装 PostgreSQL + ``` + $ docker run -d --name postgresql -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=123456 -e TZ=Asia/Shanghai postgresql:15 + ``` + 使用```$ docker ps```查看数据库是否启动成功 + +3. Create database in container manually or with [script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sql/schema.sql). + +### 数据库创建 + +1. 进入 PostgreSQL 或使用客户端连接 PostgreSQL 服务 + ``` + su - postgres + psql + ``` + +2. 创建名称为hertzbeat的数据库 + `CREATE DATABASE hertzbeat;` + +3. 查看hertzbeat数据库是否创建成功 + `\l` + +### 修改hertzbeat的配置文件application.yml切换数据源 + +1. 配置HertzBeat的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 + 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 + 替换里面的`spring.database`数据源参数,IP端口账户密码驱动 + ⚠️注意`application.yml`文件内容需完整,除下方修改内容外其他参数需保留,完整内容见[/script/application.yml](https://github.com/hertzbeat/hertzbeat/raw/master/script/application.yml) + +```yaml +spring: + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL +``` +具体替换参数如下,需根据 PostgreSQL 环境配置账户密码IP: +```yaml +spring: + config: + activate: + on-profile: prod + datasource: + driver-class-name: org.postgresql.Driver + username: root + password: 123456 + url: jdbc:postgresql://127.0.0.1:5432/hertzbeat + hikari: + max-lifetime: 120000 + + jpa: + database: postgresql + hibernate: + ddl-auto: update + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect +``` + +**启动 HertzBeat 浏览器访问 http://ip:1157/ 开始使用HertzBeat进行监控告警,默认账户密码 admin/hertzbeat** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/quickstart.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/quickstart.md new file mode 100644 index 00000000000..8bee9dd1041 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/quickstart.md @@ -0,0 +1,124 @@ +--- +id: quickstart +title: 快速开始 +sidebar_label: 快速开始 +--- + +### 🐕 开始使用 + +- 如果您是想将 Apache HertzBeat (incubating) 部署到本地搭建监控系统,请参考下面的部署文档进行操作。 + + +### 🍞 HertzBeat安装 +> HertzBeat支持通过源码安装启动,Docker容器运行和安装包方式安装部署,CPU架构支持X86/ARM64。 + +#### 方式一:Docker方式快速安装 + +1. `docker` 环境仅需一条命令即可开始 + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat``` + +```或者使用 quay.io (若 dockerhub 网络链接超时)``` + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat``` + +2. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` + +3. 部署采集器集群(可选) + +``` +docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MANAGER_PORT=1158 --name hertzbeat-collector apache/hertzbeat-collector +``` +- `-e IDENTITY=custom-collector-name` : 配置此采集器的唯一性标识符名称,多个采集器名称不能相同,建议自定义英文名称。 +- `-e MODE=public` : 配置运行模式(public or private), 公共集群模式或私有云边模式。 +- `-e MANAGER_HOST=127.0.0.1` : 配置连接主HertzBeat服务的对外IP。 +- `-e MANAGER_PORT=1158` : 配置连接主HertzBeat服务的对外端口,默认1158。 + +更多配置详细步骤参考 [通过Docker方式安装HertzBeat](docker-deploy) + +#### 方式二:通过安装包安装 + +1. 下载您系统环境对应的安装包`hertzbeat-xx.tar.gz` [GITHUB Release](https://github.com/apache/hertzbeat/releases) +2. 配置 HertzBeat 的配置文件 `hertzbeat/config/application.yml`(可选) +3. 部署启动 `$ ./bin/startup.sh ` 或 `bin/startup.bat` +4. 浏览器访问 `http://localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` +5. 部署采集器集群(可选) + - 下载您系统环境对应采集器安装包`hertzbeat-collector-xx.tar.gz`到规划的另一台部署主机上 [GITHUB Release](https://github.com/apache/hertzbeat/releases) + - 配置采集器的配置文件 `hertzbeat-collector/config/application.yml` 里面的连接主HertzBeat服务的对外IP,端口,当前采集器名称(需保证唯一性)等参数 `identity` `mode` (public or private) `manager-host` `manager-port` + ```yaml + collector: + dispatch: + entrance: + netty: + enabled: true + identity: ${IDENTITY:} + mode: ${MODE:public} + manager-host: ${MANAGER_HOST:127.0.0.1} + manager-port: ${MANAGER_PORT:1158} + ``` + - 启动 `$ ./bin/startup.sh ` 或 `bin/startup.bat` + - 浏览器访问主HertzBeat服务 `http://localhost:1157` 查看概览页面即可看到注册上来的新采集器 + +更多配置详细步骤参考 [通过安装包安装HertzBeat](package-deploy) + +#### 方式三:本地代码启动 + +1. 此为前后端分离项目,本地代码调试需要分别启动后端工程`manager`和前端工程`web-app` +2. 后端:需要`maven3+`, `java17`和`lombok`环境,修改`YML`配置信息并启动`manager`服务 +3. 前端:需要`nodejs npm angular-cli`环境,待本地后端启动后,在`web-app`目录下启动 `ng serve --open` +4. 浏览器访问 `http://localhost:4200` 即可开始,默认账号密码 `admin/hertzbeat` + +详细步骤参考 [参与贡献之本地代码启动](../community/contribution) + +##### 方式四:Docker-Compose 统一安装 hertzbeat+mysql+iotdb/tdengine + +通过 [docker-compose部署脚本](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) 一次性把 mysql 数据库, iotdb/tdengine 时序数据库和 hertzbeat 安装部署。 + +详细步骤参考 [docker-compose部署方案](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/README.md) + +##### 方式五:Kubernetes Helm Charts 部署 hertzbeat+collector+mysql+iotdb + +通过 Helm Chart 一次性将 HertzBeat 集群组件部署到 Kubernetes 集群中。 + +详细步骤参考 [Artifact Hub](https://artifacthub.io/packages/helm/hertzbeat/hertzbeat) + +**HAVE FUN** + +### 🐵 依赖服务部署(可选) + +> HertzBeat依赖于 **关系型数据库** H2(默认已内置无需安装) 或 [Mysql](mysql-change) 和 **时序性数据库** [TDengine2+](tdengine-init) 或 [IOTDB](iotdb-init) (可选) + +**注意⚠️ 若需要部署时序数据库,IotDB 和 TDengine 任选其一即可!** + +##### 安装Mysql(可选) + +1. docker安装Mysql + ` $ docker run -d --name mysql -p 3306:3306 -v /opt/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7` + `-v /opt/data:/var/lib/mysql` - 为mysql数据目录本地持久化挂载,需将`/opt/data`替换为实际本地存在的目录 +2. 创建名称为hertzbeat的数据库 + `create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;` +3. 在hertzbeat的配置文件`application.yml`配置Mysql数据库替换H2内置数据库连接参数 + +详细步骤参考 [使用Mysql替换内置H2数据库](mysql-change) + +##### 安装TDengine(可选) + +1. docker安装TDengine + `docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp --name tdengine tdengine/tdengine:3.0.4.0` +2. 创建名称为hertzbeat的数据库 +3. 在hertzbeat的配置文件`application.yml`配置tdengine连接 + +详细步骤参考 [使用时序数据库TDengine存储指标数据(可选)](tdengine-init) + +##### 安装IotDB(可选) + +1. Docker安装IoTDB + +```shell +$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ + -v /opt/iotdb/data:/iotdb/data \ + --name iotdb \ + apache/iotdb:0.13.3-node +``` + +详细步骤参考 [使用时序数据库IoTDB存储指标数据(可选)](iotdb-init) diff --git a/home/versioned_docs/version-v1.1.x/start/rainbond-deploy.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/rainbond-deploy.md similarity index 80% rename from home/versioned_docs/version-v1.1.x/start/rainbond-deploy.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/rainbond-deploy.md index 0a55beb17a7..5da0679d327 100644 --- a/home/versioned_docs/version-v1.1.x/start/rainbond-deploy.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/rainbond-deploy.md @@ -4,7 +4,7 @@ title: 使用 Rainbond 部署 HertzBeat sidebar_label: Rainbond方式部署 --- -如果你不熟悉 Kubernetes,想在 Kubernetes 中安装 HertzBeat,可以使用 Rainbond 来部署。Rainbond 是一个基于 Kubernetes 构建的云原生应用管理平台,可以很简单的将你的应用部署到 Kubernetes中。 +如果你不熟悉 Kubernetes,想在 Kubernetes 中安装 Apache HertzBeat (incubating),可以使用 Rainbond 来部署。Rainbond 是一个基于 Kubernetes 构建的云原生应用管理平台,可以很简单的将你的应用部署到 Kubernetes中。 ## 前提 diff --git a/home/versioned_docs/version-v1.1.x/start/sslcert-practice.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/sslcert-practice.md similarity index 56% rename from home/versioned_docs/version-v1.1.x/start/sslcert-practice.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/sslcert-practice.md index 5b9fc3fce41..62cd3e157a3 100644 --- a/home/versioned_docs/version-v1.1.x/start/sslcert-practice.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/sslcert-practice.md @@ -9,24 +9,20 @@ sidebar_label: 使用案例 这篇文章介绍如果使用 hertzbeat 监控系统来检测我们网站的SSL证书有效期,当证书过期时或证书快过期前几天,给我们发告警消息。 -#### HertzBeat是什么 +#### HertzBeat 是什么 -HertzBeat 一个拥有强大自定义监控能力,无需Agent的实时监控工具。网站监测,PING连通性,端口可用性,数据库,操作系统,中间件,API监控,阈值告警,告警通知(邮件微信钉钉飞书)。 +Apache HertzBeat (incubating) 一个拥有强大自定义监控能力,无需Agent的实时监控工具。网站监测,PING连通性,端口可用性,数据库,操作系统,中间件,API监控,阈值告警,告警通知(邮件微信钉钉飞书)。 -**官网: https://hertzbeat.com | https://tancloud.cn** -github: https://github.com/apache/hertzbeat -gitee: https://gitee.com/hertzbeat/hertzbeat +github: https://github.com/apache/hertzbeat #### 安装 HertzBeat -1.如果不想安装可以直接使用云服务 [TanCloud探云 console.tancloud.cn](https://console.tancloud.cn) - -2. `docker` 环境仅需一条命令即可安装 +1. `docker` 环境仅需一条命令即可安装 `docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat` -3. 安装成功浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` +2. 安装成功浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` #### 监控SSL证书 @@ -35,76 +31,62 @@ gitee: https://gitee.com/hertzbeat/hertzbeat > 系统页面 -> 监控菜单 -> SSL证书 -> 新增SSL证书 -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_1.png) + 2. 配置监控网站 > 我们这里举例监控百度网站, 配置监控host域名,名称,采集间隔等。 > 点击确定 注意⚠️新增前默认会先去测试网站连接性,连接成功才会新增,当然也可以把**是否测试**按钮置灰。 -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_2.png) 3. 查看检测指标数据 > 在监控列表可以查看任务状态,进监控详情可以查看指标数据图表等。 +![](/img/docs/start/ssl_3.png) -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image) - - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image) - - +![](/img/docs/start/ssl_11.png) 4. 设置阈值(证书过期时触发) > 系统页面 -> 告警 -> 告警阈值 -> 新增阈值 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_4.png) > 配置阈值,选择SSL证书指标对象,配置告警表达式-当指标`expired`为`true`触发,即`equals(expired,"true")` , 设置告警级别通知模版信息等。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_5.png) > 关联阈值与监控, 在阈值列表设置此阈值应用于哪些监控。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image) - - - +![](/img/docs/start/ssl_6.png) 5. 设置阈值(证书过期前一周触发) > 同理如上,新增配置阈值,配置告警表达式-当指标有效期时间戳 `end_timestamp`,`now()`函数为当前时间戳,若配置提前一周触发告警即:`end_timestamp <= (now() + 604800000)` , 其中 `604800000` 为7天总时间差毫秒值。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_7.png) > 最终可以在告警中心看到已触发的告警。 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image) - +![](/img/docs/start/ssl_8.png) 6. 告警通知(通过钉钉微信飞书等及时通知) > 监控系统 -> 告警通知 -> 新增接收人 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_9.png) 钉钉微信飞书等token配置可以参考帮助文档 -https://hertzbeat.com/docs/help/alert_dingtalk +https://hertzbeat.apache.org/docs/help/alert_dingtalk https://tancloud.cn/docs/help/alert_dingtalk > 告警通知 -> 新增告警通知策略 -> 将刚才配置的接收人启用通知 - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_10.png) 7. OK 当阈值触发后我们就可以收到对应告警消息啦,如果没有配通知,也可以在告警中心查看告警信息。 @@ -115,5 +97,3 @@ https://tancloud.cn/docs/help/alert_dingtalk 监控SSL证书的实践就到这里,当然对hertzbeat来说这个功能只是冰山一角,如果您觉得hertzbeat这个开源项目不错的话欢迎给我们在GitHub Gitee star哦,灰常感谢。感谢老铁们的支持。笔芯! **github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/versioned_docs/version-v1.1.x/start/tdengine-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/tdengine-init.md similarity index 77% rename from home/versioned_docs/version-v1.1.x/start/tdengine-init.md rename to home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/tdengine-init.md index b2020c713b3..7fcd8fd460e 100644 --- a/home/versioned_docs/version-v1.1.x/start/tdengine-init.md +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/tdengine-init.md @@ -4,17 +4,20 @@ title: 依赖时序数据库服务TDengine安装初始化 sidebar_label: 使用TDengine存储指标数据(可选) --- -HertzBeat的历史数据存储依赖时序数据库 TDengine 或 IoTDB,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) +Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) -TDengine是一款开源物联网时序型数据库,我们用其存储采集到的监控指标历史数据。 注意支持⚠️ 2.4.x版本。 +> 我们推荐使用并长期支持 VictoriaMetrics 作为存储。 -**注意⚠️ 时序数据库安装配置为可选项,但强烈建议生产环境配置,以提供更完善的历史图表功能和高性能** +TDengine是一款开源物联网时序型数据库,我们用其存储采集到的监控指标历史数据。 注意支持⚠️ 3.x版本。 + +**注意⚠️ 时序数据库安装配置为可选项,但强烈建议生产环境配置,以提供更完善的历史图表功能,高性能和稳定性** +**⚠️ 若不配置时序数据库,则只会留最近一小时历史数据** > 如果您已有TDengine环境,可直接跳到创建数据库实例那一步。 ### 通过Docker方式安装TDengine -> 可参考官方网站[安装教程](https://www.taosdata.com/docs/cn/v2.0/getting-started/docker) +> 可参考官方网站[安装教程](https://docs.taosdata.com/get-started/docker/) 1. 下载安装Docker环境 Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 安装完毕后终端查看Docker版本是否正常输出。 @@ -28,7 +31,7 @@ TDengine是一款开源物联网时序型数据库,我们用其存储采集到 $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ -v /opt/taosdata:/var/lib/taos \ --name tdengine -e TZ=Asia/Shanghai \ - tdengine/tdengine:2.4.0.12 + tdengine/tdengine:3.0.4.0 ``` `-v /opt/taosdata:/var/lib/taos` 为tdengine数据目录本地持久化挂载,需将`/opt/taosdata`替换为实际本地存在的目录 @@ -37,7 +40,7 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ ### 创建数据库实例 -> [TDengine CLI 小技巧](https://docs.taosdata.com/2.4/reference/taos-shell/#tdengine-cli-%E5%B0%8F%E6%8A%80%E5%B7%A7) +> [TDengine CLI 小技巧](https://docs.taosdata.com/develop/model/) 1. 进入数据库Docker容器 ``` @@ -46,12 +49,12 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ 2. 修改账户密码 - > 我们强烈建议您修改密码。TDengine默认的账户密码是 root/taosdata + > 建议您修改密码。TDengine默认的账户密码是 root/taosdata > 进入容器后,执行 `taos` 命令进入TDengine CLI , 如下: ``` - root@tdengine-server:~/TDengine-server-2.4.0.4# taos - Welcome to the TDengine shell from Linux, Client Version:2.4.0.4 + root@tdengine-server:~/TDengine-server# taos + Welcome to the TDengine shell from Linux, Client Version Copyright (c) 2020 by TAOS Data, Inc. All rights reserved. taos> ``` @@ -63,10 +66,10 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ ``` taos> show databases; - taos> CREATE DATABASE hertzbeat KEEP 90 DAYS 10 BLOCKS 6 UPDATE 1; + taos> CREATE DATABASE hertzbeat KEEP 90 DURATION 10 BUFFER 16; ``` - 上述语句将创建一个名为 hertzbeat 的库,这个库的数据将保留90天(超过90天将被自动删除),每 10 天一个数据文件,内存块数为 6,允许更新数据 + 上述语句将创建一个名为 hertzbeat 的库,这个库的数据将保留90天(超过90天将被自动删除),每 10 天一个数据文件,每个 VNode 的写入内存池的大小为 16 MB 4. 查看hertzbeat数据库是否成功创建 @@ -81,14 +84,14 @@ $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ 输入 q 或 quit 或 exit 回车 ``` -**注意⚠️若是安装包安装的TDengine2.3+版本** +**注意⚠️若是安装包安装的TDengine** > 除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter ### 在hertzbeat的`application.yml`配置文件配置此数据库连接 1. 配置HertzBeat的配置文件 - 修改位于 `hertzbeat/config/application.yml` 的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 **修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置里面的`warehouse.store.td-engine`数据源参数,URL账户密码,并启用`enabled`为`true`** @@ -107,6 +110,8 @@ warehouse: password: taosdata ``` +2. 重启 HertzBeat + ### 常见问题 1. 时序数据库IoTDB和TDengine是否都需要配置,能不能都用 @@ -116,7 +121,7 @@ warehouse: > 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库 3. 监控详情历史图片不展示或无数据,已经配置了TDengine -> 请确认是否安装的TDengine版本为2.4.0.12附近,版本3.0和2.2不支持兼容 +> 请确认是否安装的TDengine版本为3.0以上,版本2.x不支持兼容 4. 安装配置了TDengine数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库] > 请检查配置参数是否正确 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/upgrade.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/upgrade.md new file mode 100644 index 00000000000..0effd531384 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/upgrade.md @@ -0,0 +1,54 @@ +--- +id: upgrade +title: HertzBeat 新版本更新指引 +sidebar_label: 版本更新指引 +--- + +**Apache HertzBeat (incubating) 的发布版本列表** + +- [下载页面](/docs/download) +- [Github Release](https://github.com/apache/hertzbeat/releases) +- [DockerHub Release](https://hub.docker.com/r/apache/hertzbeat/tags) + +HertzBeat 的元数据信息保存在 H2 或 Mysql, PostgreSQL 关系型数据库内, 采集指标数据存储在 TDengine, IotDB 等时序数据库内。 + +**升级前您需要保存备份好数据库的数据文件和监控模版文件** + + + +### Docker部署方式的升级 + +1. 若使用了自定义监控模版 + - 需要备份 `docker cp hertzbeat:/opt/hertzbeat/define ./define` 当前运行 docker 容器里面的 `/opt/hertzbeat/define` 目录到当前主机下 + - `docker cp hertzbeat:/opt/hertzbeat/define ./define` + - 然后在后续升级启动 docker 容器的时候需要挂载上这个 define 目录,`-v $(pwd)/define:/opt/hertzbeat/define` + - `-v $(pwd)/define:/opt/hertzbeat/define` + +2. 若使用内置默认 H2 数据库 + - 需挂载或备份 `-v $(pwd)/data:/opt/hertzbeat/data` 容器内的数据库文件目录 `/opt/hertzbeat/data` + - 停止并删除容器,删除本地 HertzBeat docker 镜像,拉取新版本镜像 + - 参考 [Docker安装HertzBeat](docker-deploy) 使用新镜像创建新的容器,注意需要将数据库文件目录挂载 `-v $(pwd)/data:/opt/hertzbeat/data` + +3. 若使用外置关系型数据库 Mysql, PostgreSQL + - 无需挂载备份容器内的数据库文件目录 + - 停止并删除容器,删除本地 HertzBeat docker 镜像,拉取新版本镜像 + - 参考 [Docker安装HertzBeat](docker-deploy) 使用新镜像创建新的容器,`application.yml`配置数据库连接即可 + + +### 安装包部署方式的升级 + +1. 若使用内置默认 H2 数据库 + - 备份安装包下的数据库文件目录 `/opt/hertzbeat/data` + - 若有自定义监控模版,需备份 `/opt/hertzbeat/define` 下的模版YML + - `bin/shutdown.sh` 停止 HertzBeat 进程,下载新安装包 + - 参考 [安装包安装HertzBeat](package-deploy) 使用新安装包启动 + +2. 若使用外置关系型数据库 Mysql, PostgreSQL + - 无需备份安装包下的数据库文件目录 + - 若有自定义监控模版,需备份 `/opt/hertzbeat/define` 下的模版YML + - `bin/shutdown.sh` 停止 HertzBeat 进程,下载新安装包 + - 参考 [安装包安装HertzBeat](package-deploy) 使用新安装包启动,`application.yml`配置数据库连接即可 + + + +**HAVE FUN** diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/victoria-metrics-init.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/victoria-metrics-init.md new file mode 100644 index 00000000000..7668cefcaf3 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/start/victoria-metrics-init.md @@ -0,0 +1,68 @@ +--- +id: victoria-metrics-init +title: 依赖时序数据库服务VictoriaMetrics安装初始化 +sidebar_label: 使用VictoriaMetrics存储指标数据(推荐) +--- + +Apache HertzBeat (incubating) 的历史数据存储依赖时序数据库,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) + +> 我们推荐使用并长期支持 VictoriaMetrics 作为存储。 + +VictoriaMetrics,是一个快速高效、经济并且可扩展的监控解决方案和时序数据库,兼容 Prometheus 生态。推荐版本(VictoriaMetrics:v1.95.1+, HertzBeat:v1.4.3+) + +**注意⚠️ 时序数据库安装配置为可选项,但强烈建议生产环境配置,以提供更完善的历史图表功能,高性能和稳定性** +**⚠️ 若不配置时序数据库,则只会留最近一小时历史数据** + +> 如果您已有VictoriaMetrics环境,可直接跳到YML配置那一步。 + + +### 通过Docker方式安装VictoriaMetrics +> 可参考官方网站[安装教程](https://docs.victoriametrics.com/Quick-Start.html#how-to-install) +1. 下载安装Docker环境 + Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 + 安装完毕后终端查看Docker版本是否正常输出。 + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Docker安装VictoriaMetrics + +```shell +$ docker run -d -p 8428:8428 \ + -v $(pwd)/victoria-metrics-data:/victoria-metrics-data \ + --name victoria-metrics \ + victoriametrics/victoria-metrics:v1.95.1 +``` + + `-v $(pwd)/victoria-metrics-data:/victoria-metrics-data` 为VictoriaMetrics数据目录本地持久化挂载 + 使用```$ docker ps```查看数据库是否启动成功 + +3. 在hertzbeat的`application.yml`配置文件配置VictoriaMetrics数据库连接 + + 配置HertzBeat的配置文件 + 修改位于 `hertzbeat/config/application.yml` 的配置文件 + 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 + +**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.victoria-metrics`数据源参数,HOST账户密码等,并启用`enabled`为`true`** + +```yaml +warehouse: + store: + # 关闭默认JPA + jpa: + enabled: false + # 启用 victoria-metrics + victoria-metrics: + enabled: true + url: http://localhost:8428 + username: root + password: root +``` + +4. 重启 HertzBeat + +### 常见问题 + +1. 时序数据库是否都需要配置,能不能都用 +> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,但会影响历史图表数据和存储时长等。 + diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/template.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/template.md new file mode 100644 index 00000000000..55d89c73cba --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.5.x/template.md @@ -0,0 +1,97 @@ +--- +id: template +title: 监控模版中心 +sidebar_label: 监控模版 +--- + +> Apache HertzBeat (incubating) 是一个拥有强大自定义监控能力,无需 Agent 的开源实时监控告警工具。 + +> 我们将`Http, Jmx, Ssh, Snmp, Jdbc, Prometheus`等协议规范可配置化,您只需在浏览器配置`YML`就能使用这些协议去自定义采集任何您想要的指标。 +> 您相信只需配置下就能立刻适配一款`K8s`或`Docker`等新的监控类型吗? + +这是它的架构原理: + +![hertzBeat](/img/docs/hertzbeat-arch.png) + +**我们将所有监控采集类型(mysql,website,jvm,k8s)都定义为yml模版,用户可以导入这些模版到hertzbeat系统中,使其支持对应类型的监控,非常方便!** + +![](/img/docs/advanced/extend-point-1.png) + +**欢迎大家一起贡献你使用过程中自定义的通用监控类型YML模版,可用的模板如下:** + +### 应用服务监控模版 + + 👉 [Website monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-website.yml)
+ 👉 [HTTP API](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api.yml)
+ 👉 [PING Connectivity](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ping.yml)
+ 👉 [Port Telnet](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-port.yml)
+ 👉 [Full site monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml)
+ 👉 [SSL Cert monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml)
+ 👉 [JVM monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml)
+ 👉 [SpringBoot2.0](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml)
+ 👉 [SpringBoot3.0](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml)
+ 👉 [FTP Server](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml)
+ +### 数据库监控模版 + + 👉 [MYSQL database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml)
+ 👉 [MariaDB database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml)
+ 👉 [PostgreSQL database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml)
+ 👉 [SqlServer database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml)
+ 👉 [Oracle database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml)
+ 👉 [DM database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dm.yml)
+ 👉 [OpenGauss database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml)
+ 👉 [IoTDB database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml)
+ 👉 [ElasticSearch database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml)
+ 👉 [MongoDB database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml)
+ 👉 [ClickHouse database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml)
+ 👉 [Redis database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis.yml)
+ 👉 [Redis Sentinel database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml)
+ 👉 [Redis Cluster database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml)
+ +### 操作系统监控模版 + + 👉 [Linux operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-linux.yml)
+ 👉 [Windows operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-windows.yml)
+ 👉 [Ubuntu operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml)
+ 👉 [Centos operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-centos.yml)
+ 👉 [EulerOS operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml)
+ 👉 [Fedora CoreOS operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml)
+ 👉 [OpenSUSE operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml)
+ 👉 [Rocky Linux operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml)
+ 👉 [Red Hat operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml)
+ 👉 [FreeBSD operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml)
+ 👉 [AlmaLinux operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml)
+ 👉 [Debian operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-debian.yml)
+ + +### 中间件监控模版 + + 👉 [Zookeeper](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml)
+ 👉 [Kafka](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml)
+ 👉 [Tomcat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml)
+ 👉 [ShenYu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml)
+ 👉 [DynamicTp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml)
+ 👉 [RabbitMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml)
+ 👉 [ActiveMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml)
+ 👉 [Jetty](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml)
+ 👉 [Flink](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-flink.yml)
+ 👉 [Nacos](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml)
+ + +### 云原生监控模版 + + 👉 [Docker](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-docker.yml)
+ 👉 [Kubernetes](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml)
+ +### 网络监控模版 + + 👉 [CiscoSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml)
+ 👉 [HpeSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml)
+ 👉 [HuaweiSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml)
+ 👉 [TpLinkSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml)
+ 👉 [H3CSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml)
+ +--- + +**Have Fun!** diff --git a/home/sidebars.json b/home/sidebars.json index f79a6d5c439..ea2e285f869 100755 --- a/home/sidebars.json +++ b/home/sidebars.json @@ -19,10 +19,9 @@ "start/victoria-metrics-init", "start/iotdb-init", "start/tdengine-init", - "start/greptime-init", "start/influxdb-init", - "start/mysql-change", "start/postgresql-change", + "start/mysql-change", "start/custom-config", "start/ssl-cert-practice" ] @@ -79,13 +78,6 @@ "advanced/extend-snmp" ] }, - { - "type": "category", - "label": "push", - "items": [ - "advanced/extend-push" - ] - }, { "type": "category", "label": "NGQL", @@ -154,6 +146,7 @@ "help/fullsite", "help/ssl_cert", "help/nginx", + "help/imap", "help/pop3", "help/smtp", "help/ntp", @@ -187,7 +180,8 @@ "help/nebulaGraph", "help/nebulagraph_cluster", "help/tidb", - "help/mongodb" + "help/mongodb", + "help/mongodb_atlas" ] }, { @@ -236,6 +230,7 @@ "items": [ "help/spark", "help/flink", + "help/flink_on_yarn", "help/doris_be", "help/doris_fe", "help/hadoop", @@ -276,6 +271,13 @@ "help/openai" ] }, + { + "type": "category", + "label": "aiConfig", + "items": [ + "help/aiConfig" + ] + }, { "type": "category", "label": "custom", diff --git a/home/src/pages/team/index.jsx b/home/src/pages/team/index.jsx index e1dfbeb1ca3..c41eaeff6f3 100644 --- a/home/src/pages/team/index.jsx +++ b/home/src/pages/team/index.jsx @@ -1065,6 +1065,28 @@ export default function () { src="https://avatars.githubusercontent.com/u/17960863?v=4?s=100" width="100px;" alt="xfl12345"/>
xfl12345
📖 + Limbo
Limbo

💻 + 哈哈哈哈哈哈哈哈哈
哈哈哈哈哈哈哈哈哈

💻 + + + Leon Li
Leon + Li

💻 + dennis zhuang
dennis zhuang

💻 + Kerwin Bryant
Kerwin + Bryant

💻 diff --git a/home/src/pages/team/member.json b/home/src/pages/team/member.json index 06089a42ad2..45206e0f1a6 100644 --- a/home/src/pages/team/member.json +++ b/home/src/pages/team/member.json @@ -79,5 +79,15 @@ } ], "committer" : [ + { + "githubId": "29418975", + "gitUrl": "https://github.com/zhangshenghang", + "name": "Shenghang Zhang" + }, + { + "githubId": "15684156", + "gitUrl": "https://github.com/crossoverJie", + "name": "crossoverJie" + } ] } diff --git a/home/static/img/docs/cluster-arch.png b/home/static/img/docs/cluster-arch.png index 98a5489ae77..57fff7258a3 100644 Binary files a/home/static/img/docs/cluster-arch.png and b/home/static/img/docs/cluster-arch.png differ diff --git a/home/static/img/docs/community/account-1.png b/home/static/img/docs/community/account-1.png new file mode 100644 index 00000000000..d83dae96d7f Binary files /dev/null and b/home/static/img/docs/community/account-1.png differ diff --git a/home/static/img/docs/community/account-10.png b/home/static/img/docs/community/account-10.png new file mode 100644 index 00000000000..e91a49f7847 Binary files /dev/null and b/home/static/img/docs/community/account-10.png differ diff --git a/home/static/img/docs/community/account-11.png b/home/static/img/docs/community/account-11.png new file mode 100644 index 00000000000..e88804fd939 Binary files /dev/null and b/home/static/img/docs/community/account-11.png differ diff --git a/home/static/img/docs/community/account-2.png b/home/static/img/docs/community/account-2.png new file mode 100644 index 00000000000..bbb53015af0 Binary files /dev/null and b/home/static/img/docs/community/account-2.png differ diff --git a/home/static/img/docs/community/account-3.png b/home/static/img/docs/community/account-3.png new file mode 100644 index 00000000000..3282c87fe12 Binary files /dev/null and b/home/static/img/docs/community/account-3.png differ diff --git a/home/static/img/docs/community/account-4.png b/home/static/img/docs/community/account-4.png new file mode 100644 index 00000000000..e5edecc0b0b Binary files /dev/null and b/home/static/img/docs/community/account-4.png differ diff --git a/home/static/img/docs/community/account-5.png b/home/static/img/docs/community/account-5.png new file mode 100644 index 00000000000..481c270ce2b Binary files /dev/null and b/home/static/img/docs/community/account-5.png differ diff --git a/home/static/img/docs/community/account-6.png b/home/static/img/docs/community/account-6.png new file mode 100644 index 00000000000..29e14684f61 Binary files /dev/null and b/home/static/img/docs/community/account-6.png differ diff --git a/home/static/img/docs/community/account-7.png b/home/static/img/docs/community/account-7.png new file mode 100644 index 00000000000..0efb7e1d990 Binary files /dev/null and b/home/static/img/docs/community/account-7.png differ diff --git a/home/static/img/docs/community/account-8.png b/home/static/img/docs/community/account-8.png new file mode 100644 index 00000000000..973b657ba39 Binary files /dev/null and b/home/static/img/docs/community/account-8.png differ diff --git a/home/static/img/docs/community/account-9.png b/home/static/img/docs/community/account-9.png new file mode 100644 index 00000000000..ab9acc26860 Binary files /dev/null and b/home/static/img/docs/community/account-9.png differ diff --git a/home/static/img/docs/community/clas-web.png b/home/static/img/docs/community/clas-web.png new file mode 100644 index 00000000000..94a579b9d18 Binary files /dev/null and b/home/static/img/docs/community/clas-web.png differ diff --git a/home/static/img/docs/community/email-1.png b/home/static/img/docs/community/email-1.png new file mode 100644 index 00000000000..b06060a95e6 Binary files /dev/null and b/home/static/img/docs/community/email-1.png differ diff --git a/home/static/img/docs/community/email-2.png b/home/static/img/docs/community/email-2.png new file mode 100644 index 00000000000..669faa124e9 Binary files /dev/null and b/home/static/img/docs/community/email-2.png differ diff --git a/home/static/img/docs/community/email-3.png b/home/static/img/docs/community/email-3.png new file mode 100644 index 00000000000..1a4c9c38e46 Binary files /dev/null and b/home/static/img/docs/community/email-3.png differ diff --git a/home/static/img/docs/community/email-4.png b/home/static/img/docs/community/email-4.png new file mode 100644 index 00000000000..f82b626dfff Binary files /dev/null and b/home/static/img/docs/community/email-4.png differ diff --git a/home/static/img/docs/community/email-5.png b/home/static/img/docs/community/email-5.png new file mode 100644 index 00000000000..23dd2e01895 Binary files /dev/null and b/home/static/img/docs/community/email-5.png differ diff --git a/home/static/img/docs/community/icla-content-1.png b/home/static/img/docs/community/icla-content-1.png new file mode 100644 index 00000000000..2423fef5e12 Binary files /dev/null and b/home/static/img/docs/community/icla-content-1.png differ diff --git a/home/static/img/docs/community/icla-content-2.png b/home/static/img/docs/community/icla-content-2.png new file mode 100644 index 00000000000..81f208ee86d Binary files /dev/null and b/home/static/img/docs/community/icla-content-2.png differ diff --git a/home/static/img/docs/community/icla-content-3.png b/home/static/img/docs/community/icla-content-3.png new file mode 100644 index 00000000000..2147566f90e Binary files /dev/null and b/home/static/img/docs/community/icla-content-3.png differ diff --git a/home/static/img/docs/community/icla-content-4.png b/home/static/img/docs/community/icla-content-4.png new file mode 100644 index 00000000000..daf93016e63 Binary files /dev/null and b/home/static/img/docs/community/icla-content-4.png differ diff --git a/home/static/img/docs/community/icla-content-5.png b/home/static/img/docs/community/icla-content-5.png new file mode 100644 index 00000000000..f1c6daf9d21 Binary files /dev/null and b/home/static/img/docs/community/icla-content-5.png differ diff --git a/home/static/img/docs/community/icla-pdf.png b/home/static/img/docs/community/icla-pdf.png new file mode 100644 index 00000000000..7c06492faad Binary files /dev/null and b/home/static/img/docs/community/icla-pdf.png differ diff --git a/home/static/img/docs/community/icla-web.png b/home/static/img/docs/community/icla-web.png new file mode 100644 index 00000000000..83967eeee0e Binary files /dev/null and b/home/static/img/docs/community/icla-web.png differ diff --git a/home/static/img/docs/custom-arch.png b/home/static/img/docs/custom-arch.png index 7e051de9a34..127af075899 100644 Binary files a/home/static/img/docs/custom-arch.png and b/home/static/img/docs/custom-arch.png differ diff --git a/home/static/img/docs/help/status-1.png b/home/static/img/docs/help/status-1.png new file mode 100644 index 00000000000..49b922ce3e3 Binary files /dev/null and b/home/static/img/docs/help/status-1.png differ diff --git a/home/static/img/docs/help/status-2.png b/home/static/img/docs/help/status-2.png new file mode 100644 index 00000000000..25ec13fa821 Binary files /dev/null and b/home/static/img/docs/help/status-2.png differ diff --git a/home/static/img/docs/help/status-3.png b/home/static/img/docs/help/status-3.png new file mode 100644 index 00000000000..4caf444ce18 Binary files /dev/null and b/home/static/img/docs/help/status-3.png differ diff --git a/home/static/img/docs/help/status-4.png b/home/static/img/docs/help/status-4.png new file mode 100644 index 00000000000..e8a419cd9f3 Binary files /dev/null and b/home/static/img/docs/help/status-4.png differ diff --git a/home/static/img/docs/hertzbeat-arch.png b/home/static/img/docs/hertzbeat-arch.png index 913eb1eb22d..18970afdaef 100644 Binary files a/home/static/img/docs/hertzbeat-arch.png and b/home/static/img/docs/hertzbeat-arch.png differ diff --git a/home/static/img/docs/hertzbeat-arch.svg b/home/static/img/docs/hertzbeat-arch.svg index 2e05b10e2cd..c8c8c747665 100644 --- a/home/static/img/docs/hertzbeat-arch.svg +++ b/home/static/img/docs/hertzbeat-arch.svg @@ -11,7 +11,11 @@ font-family: "Cascadia"; src: url("https://excalidraw.com/Cascadia.woff2"); } + @font-face { + font-family: "Assistant"; + src: url("https://excalidraw.com/Assistant-Regular.woff2"); + } - queuealerternotifywarehouseh2/mysqlservercollectordispatchmanage datamemory/redislatest metric dataiotdb/tdenginehistory metric dataWEB UIHTTP/HTTPSdefault,jsonpath,prometheusparseJDBCmysql,oracle,sqlserver,postgreSQL,mariadbSSH SHELLlinux, zookeeper,ubuntu,centosSNMPwindows, network...JMXtomcat,jvm,kafka...Ping,Port,Site-map,Ssl-cert,Api,Website...OS,Database,Middleware,Service,Cloud-Native...HertzBeatmonitoring templateHertzBeatisolated network regionAisolated network regionBisolated network regionCcollectorCloud<->EdgecollectorcollectorcollectorClustermonitoringresourcemonitoring resourcecollectormonitoring resourcecollectormonitoring resource \ No newline at end of file + queuealerternotifywarehouseh2/pgservercollectordispatchmanage datamemory/redislatest metric datavm/tsdbhistory metric dataWEB UIHTTP/HTTPSdefault,jsonpath,prometheusparseJDBCmysql,oracle,sqlserver,postgreSQL,mariadbSSH SHELLlinux,zookeeper,ubuntu,centosSNMPwindows,network,switch...JMXtomcat,jvm,kafka,hadoop...Ping,Port,Site-map,Ssl-cert,Api,Website...OS,Database,Middleware,Service,Cloud-Native...Apache HertzBeat (incubating)template ymlHertzBeatisolated network regionAisolated network regionBisolated network regionCcollectorCloud<->EdgecollectorcollectorcollectorClustermonitoringresourcemonitoring resourcecollectormonitoring resourcecollectormonitoring resource \ No newline at end of file diff --git a/home/versioned_docs/version-v1.1.x/advanced/extend-point.md b/home/versioned_docs/version-v1.1.x/advanced/extend-point.md deleted file mode 100644 index 452c0b74f36..00000000000 --- a/home/versioned_docs/version-v1.1.x/advanced/extend-point.md +++ /dev/null @@ -1,195 +0,0 @@ ---- -id: extend-point -title: 自定义监控 -sidebar_label: 自定义监控 ---- -> HertzBeat拥有自定义监控能力,您只需配置YML文件就能适配一款自定义的监控类型。 -> 目前自定义监控支持[HTTP协议](extend-http),[JDBC协议](extend-jdbc)(mysql,mariadb,postgresql..),[SSH协议](extend-ssh),JMX协议,SNMP协议,后续会支持更多通用协议。 - -### 自定义步骤 - -配置自定义监控类型需新增配置一个YML文件 -1. 用监控类型命名的监控配置定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/ 下 -2. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。 - -------- -下面详细介绍下这文件的配置用法。 - -### 监控配置定义文件 - -> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数映射, 指标信息, 采集协议配置信息*等。 - -样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。 -文件名称: example.yml 位于 /define/example.yml - -```yaml -# 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 -category: custom -# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws... -app: example -name: - zh-CN: 模拟应用类型 - en-US: EXAMPLE APP -# 监控参数定义. field 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换 -# 强制固定必须参数 - host -params: - # field-字段名称标识符 - - field: host - # name-参数字段显示名称 - name: - zh-CN: 主机Host - en-US: Host - # type-字段类型,样式(大部分映射input标签type属性) - type: host - # 是否是必输项 true-必填 false-可选 - required: true - - field: port - name: - zh-CN: 端口 - en-US: Port - type: number - # 当type为number时,用range表示范围 - range: '[0,65535]' - required: true - # 端口默认值 - defaultValue: 80 - # 参数输入框提示信息 - placeholder: '请输入端口' - - field: username - name: - zh-CN: 用户名 - en-US: Username - type: text - # 当type为text时,用limit表示字符串限制大小 - limit: 20 - required: false - - field: password - name: - zh-CN: 密码 - en-US: Password - type: password - required: false - - field: ssl - name: - zh-CN: 启动SSL - en-US: Enable SSL - # 当type为boolean时,前端用switch展示开关 - type: boolean - required: false - - field: method - name: - zh-CN: 请求方式 - en-US: Method - type: radio - required: true - # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2} - options: - - label: GET请求 - value: GET - - label: POST请求 - value: POST - - label: PUT请求 - value: PUT - - label: DELETE请求 - value: DELETE -# 采集指标配置列表 -metrics: -# 第一个监控指标 cpu -# 注意:内置监控指标有 (responseTime - 响应时间) - - name: cpu - # 指标调度优先级(0-127)越小优先级越高,优先级低的指标会等优先级高的指标采集完成后才会被调度,相同优先级的指标会并行调度采集 - # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 - priority: 0 - # 具体监控指标列表 - fields: - # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 label是否为标签 unit:指标单位 - - field: hostname - type: 1 - instance: true - - field: usage - type: 0 - unit: '%' - - field: cores - type: 0 - - field: waitTime - type: 0 - unit: s -# (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换 - aliasFields: - - hostname - - core1 - - core2 - - usage - - allTime - - runningTime -# (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值 -# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime - calculates: - - hostname=hostname - - cores=core1+core2 - - usage=usage - - waitTime=allTime-runningTime -# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk - protocol: http -# 当protocol为http协议时具体的采集配置 - http: - # 主机host: ipv4 ipv6 域名 - host: ^_^host^_^ - # 端口 - port: ^_^port^_^ - # url请求接口路径 - url: /metrics/cpu - # 请求方式 GET POST PUT DELETE PATCH - method: GET - # 是否启用ssl/tls,即是http还是https,默认false - ssl: false - # 请求头内容 - headers: - apiVersion: v1 - # 请求参数内容 - params: - param1: param1 - param2: param2 - # 认证 - authorization: - # 认证方式: Basic Auth, Digest Auth, Bearer Token - type: Basic Auth - basicAuthUsername: ^_^username^_^ - basicAuthPassword: ^_^password^_^ - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控 - # todo xmlPath-xmlPath脚本,prometheus-Prometheus数据规则 - parseType: jsonPath - parseScript: '$' - - - name: memory - priority: 1 - fields: - - field: hostname - type: 1 - instance: true - - field: total - type: 0 - unit: kb - - field: usage - type: 0 - unit: '%' - - field: speed - type: 0 - protocol: http - http: - host: ^_^host^_^ - port: ^_^port^_^ - url: /metrics/memory - method: GET - headers: - apiVersion: v1 - params: - param1: param1 - param2: param2 - authorization: - type: Basic Auth - basicAuthUsername: ^_^username^_^ - basicAuthPassword: ^_^password^_^ - parseType: default -``` - diff --git a/home/versioned_docs/version-v1.1.x/help/alert_threshold.md b/home/versioned_docs/version-v1.1.x/help/alert_threshold.md deleted file mode 100644 index 42a711c5916..00000000000 --- a/home/versioned_docs/version-v1.1.x/help/alert_threshold.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: alert_threshold -title: 阈值告警配置 -sidebar_label: 阈值告警配置 ---- - -> 对监控指标配置告警阈值(警告告警,严重告警,紧急告警),系统根据阈值配置和采集指标数据计算触发告警。 - -### 操作步骤 - -1. **【告警配置】->【新增阈值】-> 【配置后确定】** - -![threshold](/img/docs/help/alert-threshold-1.png) - -如上图: - -**指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> summary指标集合下的 -> responseTime响应时间指标 -**阈值触发表达式**:根据此表达式来计算判断是否触发阈值,表达式环境变量和操作符见页面提示,例如:设置响应时间大于50触发告警,表达式为 `responseTime > 50`。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr) -**告警级别**:触发阈值的告警级别,从低到高依次为:警告-warning,严重-critical,紧急-emergency -**触发次数**:设置触发阈值多少次之后才会真正的触发告警 -**通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${app}.${metrics}.${metric}指标的值为${responseTime},大于50触发告警` -**全局默认**: 设置此阈值是否对全局的此类指标都应用有效,默认否。新增阈值后还需将阈值与监控对象关联,这样阈值才会对此监控生效。 -**启用告警**:此告警阈值配置开启生效或关闭 - -2. ** 阈值关联监控⚠️ 【告警配置】-> 【将刚设置的阈值】-> 【配置关联监控】-> 【配置后确定】** - -> ** 注意⚠️ 新增阈值后还需将阈值与监控对象关联(即设置此阈值对哪些监控有效),这样阈值才会对此监控生效 **。 - -![threshold](/img/docs/help/alert-threshold-2.png) - -![threshold](/img/docs/help/alert-threshold-3.png) - -**阈值告警配置完毕,已经被成功触发的告警信息可以在【告警中心】看到。** -**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【告警通知】配置。** - -其它问题可以通过交流群ISSUE反馈哦! diff --git a/home/versioned_docs/version-v1.1.x/help/alert_threshold_expr.md b/home/versioned_docs/version-v1.1.x/help/alert_threshold_expr.md deleted file mode 100644 index 14fbcdb13dc..00000000000 --- a/home/versioned_docs/version-v1.1.x/help/alert_threshold_expr.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -id: alert_threshold_expr -title: 阈值触发表达式 -sidebar_label: 阈值触发表达式 ---- - -> 在我们配置阈值告警时,需要配置阈值触发表达式,系统根据表达式和监控指标值计算触发是否告警,这里详细介绍下表达式使用。 - -#### 表达式支持的操作符 - -``` -equals(str1,str2) -== -< -<= -> ->= -!= -( ) -+ -- -&& -|| -``` - -丰富的操作符让我们可以很自由的定义表达式。 -注意⚠️ 字符串的相等请用 `equals(str1,str2)` 数字类型的相等判断请用== 或 != - -#### 表达式函数库列表 - -参考: https://www.yuque.com/boyan-avfmj/aviatorscript/ashevw - -#### 支持的环境变量 -> 环境变量即指标值等支持的变量,用于在表达式中,阈值计算判断时会将变量替换成实际值进行计算 - -非固定环境变量:这些变量会根据我们选择的监控指标对象而动态变化,例如我们选择了**网站监控的响应时间指标**,则环境变量就有 `responseTime - 此为响应时间变量` -如果我们想设置**网站监控的响应时间大于400时**触发告警,则表达式为 `responseTime>400` - -固定环境变量(不常用):`instance : 所属行实例值` -此变量主要用于计算多实例时,比如采集到c盘d盘的`usage`(`usage为非固定环境变量`),我们只想设置**c盘的usage大于80**时告警,则表达式为 `equals(instance,"c")&&usage>80` - -#### 表达式设置案例 - -1. 网站监控->响应时间大于等于400ms时触发告警 -`responseTime>=400` -2. API监控->响应时间大于3000ms时触发告警 -`responseTime>3000` -3. 全站监控->URL(instance)路径为 `https://baidu.com/book/3` 的响应时间大于200ms时触发告警 -`equals(instance,"https://baidu.com/book/3")&&responseTime>200` -4. MYSQL监控->status指标->threads_running(运行线程数)指标大于7时触发告警 -`threads_running>7` - -若遇到问题可以通过交流群ISSUE交流反馈哦! diff --git a/home/versioned_docs/version-v1.1.x/help/alert_webhook.md b/home/versioned_docs/version-v1.1.x/help/alert_webhook.md deleted file mode 100644 index 2f1b5ff36ac..00000000000 --- a/home/versioned_docs/version-v1.1.x/help/alert_webhook.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -id: alert_webhook -title: 告警 Webhook 回调通知 -sidebar_label: 告警 Webhook 回调通知 -keywords: [告警 Webhook 回调通知, 开源告警系统, 开源监控告警系统] ---- - -> 阈值触发后发送告警信息,通过post请求方式调用WebHook接口通知到接收人。 - -## 操作步骤 - -1. **【告警通知】->【新增接收人】 ->【选择WebHook通知方式】-> 【设置WebHook回调地址】 -> 【确定】** - -![email](/img/docs/help/alert-notice-5.png) - -2. ** 配置关联的告警通知策略⚠️ 【新增通知策略】-> 【将刚设置的接收人关联】-> 【确定】** - -> ** 注意⚠️ 新增了接收人并不代表已经生效可以接收告警信息,还需配置关联的告警通知策略,即指定哪些消息发给哪些接收人 **。 - -![email](/img/docs/help/alert-notice-4.png) - -### WebHook回调POST请求体BODY内容 - -内容格式:JSON -```json -{ - "id":76456, - "target":"available", - "alertDefineId":232, - "priority":0, - "content":"监控紧急可用性告警: UN_CONNECTABLE", - "tag": { - "monitorId": 3543534545, - "monitorName":"API_poetry.didi.top" - }, - "status":0, - "times":1, - "gmtCreate":"2022-02-25T13:32:13", - "gmtUpdate":"2022-02-25T13:32:13" -} -``` - -| | | -|-----|-----| -| id | integer($int64) title: Alarm record entity primary key index ID 告警记录实体主键索引ID | -| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field 告警目标对象: 监控可用性-available 指标-app.metrics.field | -| alertDefineId integer($int64) title: Alarm definition ID associated with the alarm 告警关联的告警定义ID | -| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色 | -| content | string title: The actual content of the alarm notification 告警通知实际内容 | -| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed 告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理 | -| times | integer($int32) title: Alarm threshold trigger times 告警阈值触发次数 | -| firstTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 首次告警触发时间(毫秒时间戳) | -| lastTriggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 最近告警触发时间(毫秒时间戳) | -| nextEvalInterval | integer($int64) title: Alarm evaluation interval (milliseconds) 告警评估时间间隔(单位毫秒) | -| tags | example: {key1:value1} | -| gmtCreate | string($date-time) title: Record the latest creation time (timestamp in milliseconds) 记录最新创建时间(毫秒时间戳) | -| gmtUpdate |string($date-time) title: Record modify time(毫秒时间戳) | - -### webhook通知常见问题 - -1. WebHook回调未生效 -> 请查看告警中心是否已经产生此条告警信息 -> 请排查配置的WebHook回调地址是否正确 - -其它问题可以通过交流群ISSUE反馈哦! diff --git a/home/versioned_docs/version-v1.1.x/introduce.md b/home/versioned_docs/version-v1.1.x/introduce.md deleted file mode 100644 index 5341acbb417..00000000000 --- a/home/versioned_docs/version-v1.1.x/introduce.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -id: introduce -title: HertzBeat赫兹跳动 -sidebar_label: 介绍 -slug: / ---- - -> 易用友好的开源实时监控告警工具,无需Agent,强大自定义监控能力。 - -[![discord](https://img.shields.io/badge/chat-on%20discord-brightgreen)](https://discord.gg/Fb6M73htGr) -[![QQ](https://img.shields.io/badge/qq-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/web-monitor.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/ping-connect.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/port-available.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/database-monitor.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/os-monitor.svg) -![hertzbeat](https://img.shields.io/badge/monitor-cloud%20native-brightgreen) -![hertzbeat](https://img.shields.io/badge/monitor-middleware-blueviolet) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/custom-monitor.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/threshold.svg) -![hertzbeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat@gh-pages/img/badge/alert.svg) - - -## 🎡 介绍 - -> [HertzBeat赫兹跳动](https://github.com/apache/hertzbeat) 是一个拥有强大自定义监控能力,无需Agent的实时监控工具。应用服务,数据库,操作系统,中间件,云原生等监控,阈值告警,告警通知(邮件微信钉钉飞书)。 -> 我们也提供了对应的 **[SAAS版本监控云](https://console.tancloud.cn)**,中小团队和个人无需再为了监控自己的网站资源,而去部署一套繁琐的监控系统,**[登录即可免费开始](https://console.tancloud.cn)**。 -> HertzBeat 支持[自定义监控](https://hertzbeat.com/docs/advanced/extend-point) ,只用通过配置YML文件我们就可以自定义需要的监控类型和指标,来满足常见的个性化需求。 -> HertzBeat 模块化,`manager, collector, warehouse, alerter` 各个模块解耦合,方便理解与定制开发。 -> HertzBeat 支持更自由化的告警配置(计算表达式),支持告警通知,告警模版,`邮件` `Discord` `Slack` `Telegram` `钉钉` `微信` `飞书` `短信` `Webhook` 等及时通知送达。 -> 我们正在快速迭代中,欢迎参与加入一起共建项目开源生态。 - -> 我们将`Http, Jmx, Ssh, Snmp, Jdbc, Prometheus`等协议规范可配置化,您仅仅只需配置YML就能使用这些协议去自定义采集任何您想要采集的指标。 -> 您相信只需配置YML就能立刻适配一个K8s或Docker等新的监控类型吗? - -> `HertzBeat`的强大自定义,多类型支持,易扩展,低耦合,希望能帮助开发者和中小团队快速搭建自有监控系统。 - ----- - -![hertzbeat](/img/home/1.png) - -![hertzbeat](/img/home/9.png) - ----- - -## 🥐 模块 - -- **[manager](https://github.com/apache/hertzbeat/tree/master/manager)** 提供监控管理,系统管理基础服务 -> 提供对监控的管理,监控应用配置的管理,系统用户租户后台管理等。 -- **[collector](https://github.com/apache/hertzbeat/tree/master/collector)** 提供监控数据采集服务 -> 使用通用协议远程采集获取对端指标数据。 -- **[warehouse](https://github.com/apache/hertzbeat/tree/master/warehouse)** 提供监控数据仓储服务 -> 采集指标结果数据管理,数据落盘,查询,计算统计。 -- **[alerter](https://github.com/apache/hertzbeat/tree/master/alerter)** 提供告警服务 -> 告警计算触发,任务状态联动,告警配置,告警通知。 -- **[web-app](https://github.com/apache/hertzbeat/tree/master/web-app)** 提供可视化控制台页面 -> 监控告警系统可视化控制台前端(angular+ts+zorro) - -![hertzBeat](https://tancloud.gd2.qingstor.com/img/docs/hertzbeat-arch.svg) - ----- - -![hertzBeat](/img/docs/hertzbeat-arch.png) - -## ⛄ Supported - -- [网站监控](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-website.yml), [端口可用性](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-port.yml), - [Http Api](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-api.yml), [Ping连通性](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ping.yml), - [Jvm](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap全站](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-fullsite.yml), - [Ssl证书](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-springboot2.yml), - [FTP服务器](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ftp.yml) -- [Mysql](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-postgresql.yml), - [MariaDB](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-redis.yml), - [ElasticSearch](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-sqlserver.yml), - [Oracle](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-mongodb.yml), - [达梦](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-opengauss.yml), - [ClickHouse](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-iotdb.yml) -- [Linux](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-ubuntu.yml), - [CentOS](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-windows.yml) -- [Tomcat](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-nacos.yml), - [Zookeeper](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-rabbitmq.yml), - [Flink](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-kafka.yml), - [ShenYu](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-dynamic_tp.yml), - [Jetty](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-activemq.yml) -- [Kubernetes](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://github.com/apache/hertzbeat/tree/master/manager/src/main/resources/define/app-docker.yml) -- 和更多您的自定义监控。 -- 通知支持 `Discord` `Slack` `Telegram` `邮件` `钉钉` `微信` `飞书` `短信` `Webhook`。 diff --git a/home/versioned_docs/version-v1.1.x/others/contact.md b/home/versioned_docs/version-v1.1.x/others/contact.md deleted file mode 100644 index 02d956093b4..00000000000 --- a/home/versioned_docs/version-v1.1.x/others/contact.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -id: contact -title: Join discussion -sidebar_label: Discussion ---- - -> If you need any help or want to exchange suggestions during the use process, you can discuss and exchange through ISSUE or Github Discussion. - -[GITHUB ISSUES](https://github.com/apache/hertzbeat/issues) - -[Chat On Discord](https://discord.gg/Fb6M73htGr) - -[Follow Us Twitter](https://twitter.com/hertzbeat1024) - - -##### Github Discussion - -Welcome to Discuss in [Github Discussion](https://github.com/apache/hertzbeat/discussions) diff --git a/home/versioned_docs/version-v1.1.x/others/developer.md b/home/versioned_docs/version-v1.1.x/others/developer.md deleted file mode 100644 index 3a28dbbd90d..00000000000 --- a/home/versioned_docs/version-v1.1.x/others/developer.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -id: developer -title: 开发者们 -sidebar_label: 开发者们 ---- - -## ✨ HertzBeat的成员们 - - - - - - - - - - - - -
tomsun28
tomsun28

💻 📖 🎨
会编程的王学长
会编程的王学长

💻 📖 🎨
zcx
zcx

💻 🐛 🎨
进击的阿晨
进击的阿晨

💻 🎨 🐛
铁甲小宝
铁甲小宝

🐛 💻 📖
cuipiheqiuqiu
cuipiheqiuqiu

💻 ⚠️ 🎨
- -## ✨ HertzBeat的开发者们 - -Thanks these wonderful people, welcome to join us: [贡献者指南](contributing) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tomsun28
tomsun28

💻 📖 🎨
会编程的王学长
会编程的王学长

💻 📖 🎨
MaxKey
MaxKey

💻 🎨 🤔
观沧海
观沧海

💻 🎨 🐛
yuye
yuye

💻 📖
jx10086
jx10086

💻 🐛
winnerTimer
winnerTimer

💻 🐛
goo-kits
goo-kits

💻 🐛
brave4Time
brave4Time

💻 🐛
WalkerLee
WalkerLee

💻 🐛
jianghang
jianghang

💻 🐛
ChineseTony
ChineseTony

💻 🐛
wyt199905
wyt199905

💻
卫傅庆
卫傅庆

💻 🐛
zklmcookle
zklmcookle

💻
DevilX5
DevilX5

📖 💻
tea
tea

💻
yangshihui
yangshihui

💻 🐛
DreamGirl524
DreamGirl524

💻 📖
gzwlly
gzwlly

📖
cuipiheqiuqiu
cuipiheqiuqiu

💻 ⚠️ 🎨
lambert
lambert

💻
mroldx
mroldx

📖
woshiniusange
woshiniusange

📖
VampireAchao
VampireAchao

💻
zcx
zcx

💻 🐛 🎨
CharlieXCL
CharlieXCL

📖
Privauto
Privauto

💻 📖
emrys
emrys

📖
SxLiuYu
SxLiuYu

🐛
All Contributors
All Contributors

📖
铁甲小宝
铁甲小宝

💻 📖
click33
click33

📖
蒋小小
蒋小小

📖
Kevin Huang
Kevin Huang

📖
铁甲小宝
铁甲小宝

🐛 💻 📖
Captain Jack
Captain Jack

📖
haibo.duan
haibo.duan

⚠️ 💻
assassin
assassin

🐛 💻
Reverse wind
Reverse wind

⚠️ 💻
luxx
luxx

💻
Ikko Ashimine
Ikko Ashimine

📖
leizenan
leizenan

💻
BKing
BKing

📖
xingshuaiLi
xingshuaiLi

📖
wangke6666
wangke6666

📖
刺猬
刺猬

🐛 💻
Haste
Haste

💻
zhongshi.yi
zhongshi.yi

📖
Qi Zhang
Qi Zhang

📖
MrAndyMing
MrAndyMing

📖
idongliming
idongliming

💻
Zichao Lin
Zichao Lin

💻 📖
liudonghua
liudonghua

💻 🤔
Jerry
Jerry

💻 ⚠️ 🤔
yanhom
yanhom

📖
fsl
fsl

💻
xttttv
xttttv

📖
NavinKumarBarnwal
NavinKumarBarnwal

💻
Zakkary
Zakkary

📖
sunxinbo
sunxinbo

💻 ⚠️
ldzbook
ldzbook

📖 🐛
余与雨
余与雨

💻 ⚠️
MysticalDream
MysticalDream

💻 ⚠️
zhouyoulin12
zhouyoulin12

💻 ⚠️
jerjjj
jerjjj

💻
wjl110
wjl110

💻
Sean
Sean

📖
chenyiqin
chenyiqin

💻 ⚠️
hudongdong129
hudongdong129

💻 ⚠️ 📖
TherChenYang
TherChenYang

💻 ⚠️
HattoriHenzo
HattoriHenzo

💻 ⚠️
ycilry
ycilry

📖
aoshiguchen
aoshiguchen

📖
蔡本祥
蔡本祥

💻
浮游
浮游

💻
Grass-Life
Grass-Life

💻
xiaohe428
xiaohe428

💻 📖
TableRow
TableRow

📖
ByteIDance
ByteIDance

💻
- - - - - - diff --git a/home/versioned_docs/version-v1.1.x/others/resource.md b/home/versioned_docs/version-v1.1.x/others/resource.md deleted file mode 100644 index 11e833a6f12..00000000000 --- a/home/versioned_docs/version-v1.1.x/others/resource.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -id: resource -title: 相关资源 -sidebar_label: 相关资源 ---- - -## 图标资源 - -### HertzBeat LOGO - -![logo](/img/hertzbeat-logo.svg) - -下载: [SVG](https://gitee.com/hertzbeat/hertzbeat/raw/master/home/static/img/hertzbeat-logo.svg) [PNG](https://gitee.com/hertzbeat/hertzbeat/raw/master/home/static/img/hertzbeat-logo.png) [PNG](https://gitee.com/hertzbeat/hertzbeat/raw/master/home/static/img/hertzbeat-logo.jpg) - -### HertzBeat Brand LOGO - -![logo](/img/hertzbeat-brand.svg) - -下载: [SVG](https://gitee.com/hertzbeat/hertzbeat/raw/master/home/static/img/hertzbeat-brand.svg) [PNG](https://gitee.com/hertzbeat/hertzbeat/raw/master/home/static/img/hertzbeat-brand.png) [PNG](https://gitee.com/hertzbeat/hertzbeat/raw/master/home/static/img/hertzbeat-brand.png) - diff --git a/home/versioned_docs/version-v1.1.x/others/sponsor.md b/home/versioned_docs/version-v1.1.x/others/sponsor.md deleted file mode 100644 index 0b52c4e75a4..00000000000 --- a/home/versioned_docs/version-v1.1.x/others/sponsor.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -id: sponsor -title: 赞助我们 -sidebar_label: 赞助我们 ---- - -**HertzBeat对个人或企业完全免费,我们也在全职做这件事情,如果您喜欢这个项目并且愿意提供帮助,请我们喝杯咖啡吧** - -planet - - -感谢[吉实信息(构建全新的微波+光交易网络)](https://www.flarespeed.com) 赞助服务器采集节点 -感谢[蓝易云(全新智慧上云)](https://www.tsyvps.com/aff/BZBEGYLX) 赞助服务器采集节点 -感谢[Postcat(开源 API 管理工具)](https://datayi.cn/w/xRxVBBko) 赞助 - - - - diff --git a/home/versioned_docs/version-v1.1.x/start/iotdb-init.md b/home/versioned_docs/version-v1.1.x/start/iotdb-init.md deleted file mode 100644 index dca6a89d0a3..00000000000 --- a/home/versioned_docs/version-v1.1.x/start/iotdb-init.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: iotdb-init -title: 依赖时序数据库服务IoTDB安装初始化 -sidebar_label: 使用IoTDB存储指标数据(可选) ---- - -HertzBeat的历史数据存储依赖时序数据库 IoTDB 或 TDengine,任选其一安装初始化即可,也可不安装(注意⚠️但强烈建议生产环境配置) - -Apache IoTDB是一体化收集、存储、管理与分析物联网时序数据的软件系统,我们使用其存储分析采集到的监控指标历史数据。支持V0.12 - V0.13版本,推荐使用V0.13.*版本。 - -**注意⚠️ 时序数据库安装配置为可选项,但强烈建议生产环境配置,以提供更完善的历史图表功能和高性能** - -> 如果您已有IoTDB环境,可直接跳到YML配置那一步。 - - -### 通过Docker方式安装IoTDB -> 可参考官方网站[安装教程](https://iotdb.apache.org/zh/UserGuide/V0.13.x/QuickStart/WayToGetIoTDB.html) -1. 下载安装Docker环境 - Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 - 安装完毕后终端查看Docker版本是否正常输出。 - ``` - $ docker -v - Docker version 20.10.12, build e91ed57 - ``` -2. Docker安装IoTDB - -```shell -$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ - -v /opt/iotdb/data:/iotdb/data \ - --name iotdb \ - apache/iotdb:0.13.3-node -``` - - `-v /opt/iotdb/data:/iotdb/data` 为tdengine数据目录本地持久化挂载,需将`/iotdb/data`替换为实际本地存在的目录 - 使用```$ docker ps```查看数据库是否启动成功 - -3. 在hertzbeat的`application.yml`配置文件配置IoTDB数据库连接 - - 配置HertzBeat的配置文件 - 修改位于 `hertzbeat/config/application.yml` 的配置文件 - 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 - -**修改里面的`warehouse.store.jpa.enabled`参数为`false`, 配置`warehouse.store.iot-db`数据源参数,HOST账户密码等,并启用`enabled`为`true`** - -```yaml -warehouse: - store: - # 关闭默认JPA - jpa: - enabled: false - # 启用IotDB - iot-db: - enabled: true - host: 127.0.0.1 - rpc-port: 6667 - username: root - password: root - # V_O_12 || V_0_13 - version: V_0_13 - # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0 - query-timeout-in-ms: -1 - # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) - expire-time: '7776000000' -``` - -### 常见问题 - -1. 时序数据库IoTDB和TDengine是否都需要配置,能不能都用 -> 不需要都配置,任选其一即可,用enable参数控制其是否使用,也可都不安装配置,只影响历史图表数据。 - -2. 监控页面历史图表不显示,弹出 [无法提供历史图表数据,请配置依赖时序数据库] -> 如弹窗所示,历史图表展示的前提是需要安装配置hertzbeat的依赖服务 - IotDB数据库或TDengine数据库 - -3. 安装配置了IotDB数据库,但页面依旧显示弹出 [无法提供历史图表数据,请配置依赖时序数据库] -> 请检查配置参数是否正确 -> iot-db enable是否设置为true -> 注意⚠️若hertzbeat和IotDB都为docker容器在同一主机下启动,容器之间默认不能用127.0.0.1通讯,改为主机IP -> 可根据logs目录下启动日志排查 diff --git a/home/versioned_docs/version-v1.1.x/start/mysql-change.md b/home/versioned_docs/version-v1.1.x/start/mysql-change.md deleted file mode 100644 index 92aed428332..00000000000 --- a/home/versioned_docs/version-v1.1.x/start/mysql-change.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -id: mysql-change -title: 依赖的关系型数据库 H2 切换 为MYSQL -sidebar_label: 使用Mysql替换内置H2数据库(可选) ---- -MYSQL是一款值得信赖的关系型数据库,HertzBeat除了支持使用默认内置的H2数据库外,还可以切换为使用MYSQL存储监控信息,告警信息,配置信息等结构化关系数据。 - -注意⚠️ 使用外置Mysql数据库替换内置H2数据库为可选项,但建议生产环境配置,以提供更好的性能 - -> 如果您已有MYSQL环境,可直接跳到数据库创建那一步。 - -### 通过Docker方式安装MYSQL -1. 下载安装Docker环境 - Docker 工具自身的下载请参考 [Docker官网文档](https://docs.docker.com/get-docker/)。 - 安装完毕后终端查看Docker版本是否正常输出。 - ``` - $ docker -v - Docker version 20.10.12, build e91ed57 - ``` -2. Docker安装MYSQl - ``` - $ docker run -d --name mysql \ - -p 3306:3306 \ - -v /opt/data:/var/lib/mysql \ - -e MYSQL_ROOT_PASSWORD=123456 \ - --restart=always \ - mysql:5.7 - ``` - `-v /opt/data:/var/lib/mysql` 为mysql数据目录本地持久化挂载,需将`/opt/data`替换为实际本地存在的目录 - 使用```$ docker ps```查看数据库是否启动成功 - -### 数据库创建 -1. 进入MYSQL或使用客户端连接MYSQL服务 - `mysql -uroot -p123456` -2. 创建名称为hertzbeat的数据库 - `create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;` -3. 查看hertzbeat数据库是否创建成功 - `show databases;` - -### 修改hertzbeat的配置文件application.yml切换数据源 - -1. 配置HertzBeat的配置文件 - 修改位于 `hertzbeat/config/application.yml` 的配置文件 - 注意⚠️docker容器方式需要将application.yml文件挂载到主机本地,安装包方式解压修改位于 `hertzbeat/config/application.yml` 即可 - 替换里面的`spring.database`数据源参数,IP端口账户密码驱动 - ⚠️注意`application.yml`文件内容需完整,除下方修改内容外其他参数需保留,完整内容见[/script/application.yml](https://gitee.com/hertzbeat/hertzbeat/raw/master/script/application.yml) - -需修改部分原参数: -```yaml -spring: - datasource: - driver-class-name: org.h2.Driver - username: sa - password: 123456 - url: jdbc:h2:./data/hertzbeat;MODE=MYSQL -``` -具体替换参数如下,需根据mysql环境配置账户密码IP: -```yaml -spring: - datasource: - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: 123456 - url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false -``` - -**启动 HertzBeat 浏览器访问 http://ip:1157/ 开始使用HertzBeat进行监控告警,默认账户密码 admin/hertzbeat** diff --git a/home/versioned_docs/version-v1.1.x/start/package-deploy.md b/home/versioned_docs/version-v1.1.x/start/package-deploy.md deleted file mode 100644 index b3566ec2608..00000000000 --- a/home/versioned_docs/version-v1.1.x/start/package-deploy.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -id: package-deploy -title: 通过安装包安装 HertzBeat -sidebar_label: 安装包方式部署 ---- -> HertzBeat支持在Linux Windows Mac系统安装运行,CPU支持X86/ARM64。 -> 由于安装包自身不包含JAVA运行环境,需您提前准备JAVA运行环境。 - -1. 安装JAVA运行环境-可参考[官方网站](http://www.oracle.com/technetwork/java/javase/downloads/index.html) - 要求:JAVA11环境 - 下载JAVA安装包: [镜像站](https://repo.huaweicloud.com/java/jdk/) - 安装后命令行检查是否成功安装 - ``` - $ java -version - java version "11.0.12" - Java(TM) SE Runtime Environment 18.9 (build 11.0.12+8-LTS-237) - Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.12+8-LTS-237, mixed mode) - - ``` -2. 下载HertzBeat安装包 - 下载您系统环境对应的安装包 - - 从[GITEE Release](https://gitee.com/hertzbeat/hertzbeat/releases) 仓库下载 - - 从[GITHUB Release](https://github.com/apache/hertzbeat/releases) 仓库下载 - -3. 配置HertzBeat的配置文件(可选) - 解压安装包到主机 eg: /opt/hertzbeat - ``` - $ tar zxvf hertzbeat-[版本号].tar.gz - ``` - 修改位于 `hertzbeat/config/application.yml` 的配置文件(可选),您可以根据需求修改配置文件 - - 若需使用邮件发送告警,需替换`application.yml`里面的邮件服务器参数 - - **推荐**若需使用外置Mysql数据库替换内置H2数据库,需替换`application.yml`里面的`spring.datasource`参数 具体步骤参见 [H2数据库切换为MYSQL](mysql-change)) - - **推荐**若需使用时序数据库TDengine来存储指标数据,需替换`application.yml`里面的`warehouse.store.td-engine`参数 具体步骤参见 [使用TDengine存储指标数据](tdengine-init) - - **推荐**若需使用时序数据库IotDB来存储指标数据库,需替换`application.yml`里面的`warehouse.storeiot-db`参数 具体步骤参见 [使用IotDB存储指标数据](iotdb-init) - -4. 配置用户配置文件(可选,自定义配置用户密码) - HertzBeat默认内置三个用户账户,分别为 admin/hertzbeat tom/hertzbeat guest/hertzbeat - 若需要新增删除修改账户或密码,可以通过修改位于 `hertzbeat/config/sureness.yml` 的配置文件实现,若无此需求可忽略此步骤 - 具体参考 [配置修改账户密码](account-modify) - -5. 部署启动 - 执行位于安装目录hertzbeat/bin/下的启动脚本 startup.sh, windows环境下为 startup.bat - ``` - $ ./startup.sh - ``` -6. 开始探索HertzBeat - 浏览器访问 http://ip:1157/ 即刻开始探索使用HertzBeat,默认账户密码 admin/hertzbeat。 - -**HAVE FUN** - -### 安装包部署常见问题 - -**最多的问题就是网络问题,请先提前排查** - -1. **按照流程部署,访问 http://ip:1157/ 无界面** - 请参考下面几点排查问题: -> 一:若切换了依赖服务MYSQL数据库,排查数据库是否成功创建,是否启动成功 -> 二:HertzBeat的配置文件 `hertzbeat/config/application.yml` 里面的依赖服务IP账户密码等配置是否正确 -> 三:若都无问题可以查看 `hertzbeat/logs/` 目录下面的运行日志是否有明显错误,提issue或交流群或社区反馈 - -2. **日志报错TDengine连接或插入SQL失败** -> 一:排查配置的数据库账户密码是否正确,数据库是否创建 -> 二:若是安装包安装的TDengine2.3+,除了启动server外,还需执行 `systemctl start taosadapter` 启动 adapter - -3. **监控历史图表长时间都一直无数据** -> 一:Tdengine或IoTDB是否配置,未配置则无历史图表数据 -> 二:若使用了Tdengine,排查Tdengine的数据库`hertzbeat`是否创建 -> 三: HertzBeat的配置文件 `application.yml` 里面的依赖服务 IotDB 或 Tdengine IP账户密码等配置是否正确 diff --git a/home/versioned_docs/version-v1.1.x/start/quickstart.md b/home/versioned_docs/version-v1.1.x/start/quickstart.md deleted file mode 100644 index 135a762657b..00000000000 --- a/home/versioned_docs/version-v1.1.x/start/quickstart.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -id: quickstart -title: 快速开始 -sidebar_label: 快速开始 ---- - -### 🐕 开始使用 - -- 如果您不想部署而是直接使用,我们提供SAAS监控云-[TanCloud探云](https://console.tancloud.cn),即刻[登录注册](https://console.tancloud.cn)免费使用。 -- 如果您是想将HertzBeat部署到内网环境搭建监控系统,请参考下面的部署文档进行操作。 - -### 🐵 依赖服务部署(可选) - -> HertzBeat依赖于 **关系型数据库** H2(默认已内置无需安装) 或 [Mysql](mysql-change) 和 **时序性数据库** [TDengine2+](tdengine-init) 或 [IOTDB](iotdb-init) (可选) - -**注意⚠️ 若需要部署时序数据库,IotDB 和 TDengine 任选其一即可!** - -##### 安装Mysql(可选) - -1. docker安装Mysql - ` $ docker run -d --name mysql -p 3306:3306 -v /opt/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7` - `-v /opt/data:/var/lib/mysql` - 为mysql数据目录本地持久化挂载,需将`/opt/data`替换为实际本地存在的目录 -2. 创建名称为hertzbeat的数据库 - `create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;` -3. 在hertzbeat的配置文件`application.yml`配置Mysql数据库替换H2内置数据库连接参数 - -详细步骤参考 [使用Mysql替换内置H2数据库](mysql-change) - -##### 安装TDengine(可选) - -1. docker安装TDengine - `docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp --name tdengine tdengine/tdengine:2.4.0.12` -2. 创建名称为hertzbeat的数据库 -3. 在hertzbeat的配置文件`application.yml`配置tdengine连接 - -详细步骤参考 [使用时序数据库TDengine存储指标数据(可选)](tdengine-init) - -##### 安装IotDB(可选) - -1. Docker安装IoTDB - -```shell -$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ - -v /opt/iotdb/data:/iotdb/data \ - --name iotdb \ - apache/iotdb:0.13.3-node -``` - -详细步骤参考 [使用时序数据库IoTDB存储指标数据(可选)](iotdb-init) - -### 🍞 HertzBeat安装 -> HertzBeat支持通过源码安装启动,Docker容器运行和安装包方式安装部署,CPU架构支持X86/ARM64。 - -#### 方式一:Docker方式快速安装 - -1. `docker` 环境仅需一条命令即可开始 - -`docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat` - -2. 浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` - -更多配置详细步骤参考 [通过Docker方式安装HertzBeat](docker-deploy) - -#### 方式二:通过安装包安装 - -1. 下载您系统环境对应的安装包 [GITEE Release](https://gitee.com/hertzbeat/hertzbeat/releases) [GITHUB Release](https://github.com/apache/hertzbeat/releases) -2. 需要已安装java环境, `jdk11` -3. [可选]配置 HertzBeat 的配置文件 `hertzbeat/config/application.yml` -4. 部署启动 `$ ./startup.sh ` -5. 浏览器访问 `localhost:1157` 即可开始,默认账号密码 `admin/hertzbeat` - -更多配置详细步骤参考 [通过安装包安装HertzBeat](package-deploy) - -#### 方式三:本地代码启动 -1. 此为前后端分离项目,本地代码调试需要分别启动后端工程manager和前端工程web-app -2. 后端:需要`maven3+`, `java11`和`lombok`环境,修改YML配置信息并启动manager服务 -3. 前端:需要`nodejs npm angular-cli`环境,待本地后端启动后,在web-app目录下启动 `ng serve --open` -4. 浏览器访问 `localhost:4200` 即可开始,默认账号密码 `admin/hertzbeat` - -详细步骤参考 [参与贡献之本地代码启动](../others/contributing) - -##### 方式四:Docker-Compose 统一安装 hertzbeat+mysql+iotdb/tdengine - -通过 [docker-compose部署脚本](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) 一次性把 mysql 数据库, iotdb/tdengine 时序数据库和 hertzbeat 安装部署。 - -详细步骤参考 [docker-compose部署方案](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/README.md) - -**HAVE FUN** diff --git a/home/versioned_docs/version-v1.4.x/introduce.md b/home/versioned_docs/version-v1.4.x/introduce.md index a72703e6a33..63a35e80ab9 100644 --- a/home/versioned_docs/version-v1.4.x/introduce.md +++ b/home/versioned_docs/version-v1.4.x/introduce.md @@ -11,7 +11,7 @@ slug: / [![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) [![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) [![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) -[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/repository/docker/apache/hertzbeat/general) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) [![QQ](https://img.shields.io/badge/QQ-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) [![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-default.md b/home/versioned_docs/version-v1.5.x/advanced/extend-http-default.md similarity index 93% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-default.md rename to home/versioned_docs/version-v1.5.x/advanced/extend-http-default.md index ba3df44cd68..cb8cec5b7aa 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-default.md +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-http-default.md @@ -1,10 +1,10 @@ --- id: extend-http-default title: HTTP Protocol System Default Parsing Method -sidebar_label: System Default Parsing Method +sidebar_label: Default Parsing Method --- -> After calling the HTTP interface to obtain the response data, use the default parsing method of hertzbeat to parse the response data. +> After calling the HTTP api to obtain the response data, use the default parsing method of hertzbeat to parse the response data. **The interface response data structure must be consistent with the data structure rules specified by hertzbeat** @@ -76,7 +76,7 @@ If there are multiple virtual machines, the multilayer format is: : ] ``` -**The corresponding monitoring configuration definition file YML can be configured as follows** +**The corresponding monitoring template yml can be configured as follows** ```yaml # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring @@ -122,7 +122,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-http-example-hertzbeat.md b/home/versioned_docs/version-v1.5.x/advanced/extend-http-example-hertzbeat.md new file mode 100644 index 00000000000..4c65e29b8da --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-http-example-hertzbeat.md @@ -0,0 +1,237 @@ +--- +id: extend-http-example-hertzbeat +title: Tutorial 1 Adapting a monitoring type based on HTTP protocol +sidebar_label: Tutorial 1 Adapting an HTTP protocol monitoring +--- + +Through this tutorial, we describe step by step how to add a monitoring type based on the http protocol under the hertzbeat monitoring tool. + +Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring](extend-point) and [http Protocol Customization](extend-http). + + +### HTTP protocol parses the general response structure to obtain metric data + +> In many scenarios, we need to monitor the provided HTTP API interface and obtain the index value returned by the interface. In this article, we use the http custom protocol to parse our common http interface response structure, and obtain the fields in the returned body as metric data. + + +``` +{ + "code": 200, + "msg": "success", + "data": {} +} + +``` +As above, usually our background API interface will design such a general return. The same is true for the background of the hertzbeat system. Today, we will use the hertzbeat API as an example, add a new monitoring type **hertzbeat**, and monitor and collect its system summary statistics API +`http://localhost:1157/api/summary`, the response data is: + +``` +{ + "msg": null, + "code": 0, + "data": { + "apps": [ + { + "category": "service", + "app": "jvm", + "status": 0, + "size": 2, + "availableSize": 0, + "unManageSize": 2, + "unAvailableSize": 0, + "unReachableSize": 0 + }, + { + "category": "service", + "app": "website", + "status": 0, + "size": 2, + "availableSize": 0, + "unManageSize": 2, + "unAvailableSize": 0, + "unReachableSize": 0 + } + ] + } +} +``` + +**This time we get the metric data such as `category`, `app`, `status`, `size`, `availableSize` under the app. ** + +### Add custom monitoring template `hertzbeat` + +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + + +Here we define a custom monitoring type `app` named `hertzbeat` which use the HTTP protocol to collect data. + +**Monitoring Templates** -> **Config New Monitoring Template Yml** -> **Save and Apply** + + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +category: custom +# The monitoring type eg: linux windows tomcat mysql aws... +app: hertzbeat +# The monitoring i18n name +name: + zh-CN: HertzBeat监控系统 + en-US: HertzBeat Monitor +# 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: 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 + defaultValue: 1157 + - field: ssl + name: + zh-CN: 启用HTTPS + en-US: HTTPS + type: boolean + required: true + - field: timeout + name: + zh-CN: 超时时间(ms) + en-US: Timeout(ms) + type: number + required: false + hide: true + - field: authType + name: + zh-CN: 认证方式 + en-US: Auth Type + type: radio + required: false + hide: true + options: + - label: Basic Auth + value: Basic Auth + - label: Digest Auth + value: Digest Auth + - field: username + name: + zh-CN: 用户名 + en-US: Username + type: text + limit: 50 + required: false + hide: true + - field: password + name: + zh-CN: 密码 + en-US: Password + type: password + required: false + hide: true +metrics: + # the first metrics summary + # attention: Built-in monitoring metrics contains (responseTime - Response time) + - name: summary + # 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 + # collect metrics content + fields: + # metrics content contains field-metric name, type-metric type:0-number,1-string, label-if is metrics label, unit-metric unit('%','ms','MB') + - field: app + type: 1 + label: true + - field: category + type: 1 + - field: status + type: 0 + - field: size + type: 0 + - field: availableSize + type: 0 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here + protocol: http + # the config content when protocol is http + http: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # http url, we don't need to enter a parameter here, just set the fixed value to /api/summary + url: /api/summary + timeout: ^_^timeout^_^ + # http method: GET POST PUT DELETE PATCH, default fixed value is GET + method: GET + # if enabled https, default value is false + ssl: ^_^ssl^_^ + # http auth + authorization: + # http auth type: Basic Auth, Digest Auth, Bearer Token + type: ^_^authType^_^ + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + digestAuthUsername: ^_^username^_^ + digestAuthPassword: ^_^password^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, we use jsonpath to parse response data here + parseType: jsonPath + parseScript: '$.data.apps.*' + +``` + +**The addition is complete, now we save and apply. We can see that the system page has added a `hertzbeat` monitoring type. ** + + +![](/img/docs/advanced/extend-http-example-1.png) + + +### The system page adds the monitoring of `hertzbeat` monitoring type + +> We click Add `HertzBeat Monitoring Tool`, configure monitoring IP, port, collection cycle, account password in advanced settings, etc., click OK to add monitoring. + + +![](/img/docs/advanced/extend-http-example-2.png) + + +![](/img/docs/advanced/extend-http-example-3.png) + +> After a certain period of time (depending on the collection cycle), we can see the specific metric data and historical charts in the monitoring details! + + +![](/img/docs/advanced/extend-http-example-4.png) + + + +### Set threshold alarm notification + +> Next, we can set the threshold normally. After the alarm is triggered, we can view it in the alarm center, add recipients, set alarm notifications, etc. Have Fun!!! + + +---- + +#### over! + +This is the end of the practice of custom monitoring of the HTTP protocol. The HTTP protocol also has other parameters such as headers and params. We can define it like postman, and the playability is also very high! + +If you think hertzbeat is a good open source project, please star us on GitHub Gitee, thank you very much. + +**github: https://github.com/apache/hertzbeat** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-example-token.md b/home/versioned_docs/version-v1.5.x/advanced/extend-http-example-token.md similarity index 88% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-example-token.md rename to home/versioned_docs/version-v1.5.x/advanced/extend-http-example-token.md index 2d8389e193d..b9bbb61e72d 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-example-token.md +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-http-example-token.md @@ -4,9 +4,9 @@ title: Tutorial 2 Obtain TOKEN index value based on HTTP protocol for subsequent sidebar_label: Tutorial 2 Get TOKEN for subsequent authentication --- -Through this tutorial, we will describe step by step how to modify on the basis of tutorial 1, add an metrics, first call the authentication interface to obtain the TOKEN, and use the TOKEN as a parameter for the subsequent metrics collection and authentication. +Through this tutorial, we will describe step by step how to modify on the basis of tutorial 1, add metrics, first call the authentication interface to obtain the TOKEN, and use the TOKEN as a parameter for the subsequent metrics collection and authentication. -Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring] (extend-point) and [http Protocol Customization] (extend-http). +Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring](extend-point) and [http Protocol Customization](extend-http). ### Request process @@ -37,12 +37,19 @@ Before reading this tutorial, we hope that you are familiar with how to customiz ### Add custom monitoring type `hertzbeat_token` -1. The custom monitoring type needs to add a new configuration YML file. We directly reuse the `hertzbeat` monitoring type in Tutorial 1 and modify it based on it +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** -A monitoring configuration definition file named after the monitoring type - app-hertzbeat_token.yml needs to be located in the installation directory /hertzbeat/define/ +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. -The monitoring configuration definition file is used to define the collection type, which protocol collection method needs to be used, the collection metrics, protocol configuration parameters, etc. -We directly reuse the definition content in app-hertzbeat.yml and modify it to our current monitoring type `hertzbeat_auth` configuration parameters, such as `app, category, etc`. + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + + +1. The custom monitoring type needs to add a new configuration monitoring template yml. We directly reuse the `hertzbeat` monitoring type in Tutorial 1 and modify it based on it + +A monitoring configuration definition file named after the monitoring type - hertzbeat_token + +We directly reuse the definition content in `hertzbeat` and modify it to our current monitoring type `hertzbeat_auth` configuration parameters, such as `app, category, etc`. ```yaml # This monitoring type belongs to the category: service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring @@ -103,7 +110,7 @@ metrics: .... ### Define metrics `auth` login request to get `token` -1. Add an index group definition `auth` in `app-hertzbeat_token.yml`, set the collection priority to the highest 0, and collect the index `token`. +1. Add an index group definition `auth` in `hertzbeat_token`, set the collection priority to the highest 0, and collect the index `token`. ```yaml @@ -196,7 +203,7 @@ metrics: ``` -**At this time, restart the hertzbeat system, add `hertzbeat_token` type monitoring on the system page, configure input parameters, `content-type` fill in `application/json`, `request Body` fill in the account password json as follows: ** +**At this time, save and apply, add `hertzbeat_token` type monitoring on the system page, configure input parameters, `content-type` fill in `application/json`, `request Body` fill in the account password json as follows: ** ```json { @@ -233,7 +240,7 @@ metrics: bearerTokenToken: ^o^token^o^ ``` -**The final `app-hertzbeat_token.yml` is defined as follows:** +**The final `hertzbeat_token` template yml is defined as follows:** ```yaml @@ -368,7 +375,7 @@ metrics: ``` -**After the configuration is complete, restart the `hertzbeat` system again, and check the monitoring details page** +**After the configuration is complete, save and apply, and check the monitoring details page** ![](/img/docs/advanced/extend-http-example-8.png) @@ -384,8 +391,6 @@ metrics: This is the end of the practice of custom monitoring of the HTTP protocol. The HTTP protocol also has other parameters such as headers and params. We can define it like postman, and the playability is also very high! -If you think hertzbeat is a good open source project, please star us on GitHub Gitee, thank you very much. Thanks for the old iron support. Refill! +If you think hertzbeat is a good open source project, please star us on GitHub Gitee, thank you very much. **github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-jsonpath.md b/home/versioned_docs/version-v1.5.x/advanced/extend-http-jsonpath.md similarity index 94% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-jsonpath.md rename to home/versioned_docs/version-v1.5.x/advanced/extend-http-jsonpath.md index c38a5582d06..772c96d20d3 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http-jsonpath.md +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-http-jsonpath.md @@ -3,7 +3,7 @@ id: extend-http-jsonpath title: HTTP Protocol JsonPath Parsing Method sidebar_label: JsonPath Parsing Method --- -> After calling the HTTP interface to obtain the response data, use JsonPath script parsing method to parse the response data. +> After calling the HTTP api to obtain the response data, use JsonPath script parsing method to parse the response data. Note⚠️ The response data is JSON format. @@ -80,7 +80,7 @@ The raw data returned by the interface is as follows: } ``` -We use the jsonpath script to parse, and the corresponding script is: `$.number[*]` ,The parsed data structure is as follows: +We use the jsonpath script to parse, and the corresponding script is: `$.number[*]`,The parsed data structure is as follows: ```json [ { @@ -95,7 +95,7 @@ We use the jsonpath script to parse, and the corresponding script is: `$.number[ ``` This data structure conforms to the data format specification of HertzBeat, and the Metric `type,num` is successfully extracted. -**The corresponding monitoring configuration definition file YML can be configured as follows** +**The corresponding monitoring template yml can be configured as follows** ```yaml # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring @@ -141,7 +141,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit - field: type type: 1 - instance: true + label: true - field: num type: 0 # protocol for monitoring and collection eg: sql, ssh, http, telnet, wmi, snmp, sdk diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http.md b/home/versioned_docs/version-v1.5.x/advanced/extend-http.md similarity index 84% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http.md rename to home/versioned_docs/version-v1.5.x/advanced/extend-http.md index de20f82d944..242b63e8cf0 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-http.md +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-http.md @@ -7,7 +7,8 @@ sidebar_label: HTTP Protocol Custom Monitoring > From [Custom Monitoring](extend-point), you are familiar with how to customize types, Metrics, protocols, etc. Here we will introduce in detail how to use HTTP protocol to customize Metric monitoring ### HTTP protocol collection process -【**call HTTP interface**】->【**response verification **】->【**parse reponse data**】->【**default method parsing|JsonPath script parsing | XmlPath parsing(todo) | Prometheus parsing(todo)**】->【**Metric data extraction**】 + +【**Call HTTP API**】->【**Response Verification**】->【**Parse Response Data**】->【**Default method parsing|JsonPath script parsing | XmlPath parsing(todo) | Prometheus parsing**】->【**Metric data extraction**】 It can be seen from the process that we define a monitoring type of HTTP protocol. We need to configure HTTP request parameters, configure which Metrics to obtain, and configure the parsing method and parsing script for response data. HTTP protocol supports us to customize HTTP request path, request header, request parameters, request method, request body, etc. @@ -18,19 +19,22 @@ HTTP protocol supports us to customize HTTP request path, request header, reques ### Custom Steps -In order to configure a custom monitoring type, you need to add and configure YML file. -1. Monitoring configuration definition file named after monitoring type - eg:example.yml in the installation directory /hertzbeat/define/ -2. Restart hertzbeat system, we successfully fit a new custom monitoring type. +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** ------- -Configuration usages of the two files are detailed below. Please pay attention to usage annotation. -### Monitoring configuration definition file +Configuration usages of the monitoring templates yml are detailed below. Please pay attention to usage annotation. + +### Monitoring Templates YML + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. -> Monitoring configuration definition file is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. +eg:Define a custom monitoring type `app` named `example_http` which use the HTTP protocol to collect data. -eg:Define a custom monitoring type named example_http which use the HTTP protocol to collect data. -The file name: example_http.yml in /define/example_http.yml +**Monitoring Templates** -> **Config New Monitoring Template Yml** -> **Save and Apply** ```yaml # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring @@ -69,7 +73,7 @@ params: en-US: Username type: text # When type is text, use limit to indicate the string limit size - limit: 20 + limit: 50 required: false - field: password name: @@ -113,7 +117,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit - field: hostname type: 1 - instance: true + label: true - field: usage type: 0 unit: '%' @@ -174,7 +178,7 @@ metrics: fields: - field: hostname type: 1 - instance: true + label: true - field: total type: 0 unit: kb @@ -191,6 +195,7 @@ metrics: method: GET headers: apiVersion: v1 + # query params,support time expression params: param1: param1 param2: param2 diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-jdbc.md b/home/versioned_docs/version-v1.5.x/advanced/extend-jdbc.md similarity index 90% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-jdbc.md rename to home/versioned_docs/version-v1.5.x/advanced/extend-jdbc.md index 89db9658a98..3527ba60d5d 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-jdbc.md +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-jdbc.md @@ -49,19 +49,20 @@ Here by mapping the Metric field with the key of the response data, we can obta ### Custom Steps -In order to configure a custom monitoring type, you need to add and configure YML file. -1. Monitoring configuration definition file named after monitoring type - eg:example_sql.yml in the installation directory /hertzbeat/app/ -2. Restart hertzbeat system, we successfully fit a new custom monitoring type. +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** ------- -Configuration usages of the file is detailed below. Please pay attention to usage annotation. +Configuration usages of the monitoring templates yml are detailed below. -### Monitoring configuration definition file +### Monitoring Templates YML -> Monitoring configuration definition file is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. -eg:Define a custom monitoring type named example_sql which use the JDBC protocol to collect data. -The file name: example_sql.yml in /define/example_sql.yml + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + +eg:Define a custom monitoring type `app` named `example_sql` which use the JDBC protocol to collect data. + ```yaml # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring @@ -99,7 +100,7 @@ params: zh-CN: 用户名 en-US: Username type: text - limit: 20 + limit: 50 required: false - field: password name: @@ -124,7 +125,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit - field: version type: 1 - instance: true + label: true - field: port type: 1 - field: datadir diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-jmx.md b/home/versioned_docs/version-v1.5.x/advanced/extend-jmx.md new file mode 100644 index 00000000000..5284118f8a7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-jmx.md @@ -0,0 +1,193 @@ +--- +id: extend-jmx +title: JMX Protocol Custom Monitoring +sidebar_label: JMX Protocol Custom Monitoring +--- +> From [Custom Monitoring](extend-point), you are familiar with how to customize types, Metrics, protocols, etc. Here we will introduce in detail how to use JMX to customize Metric monitoring. +> JMX protocol custom monitoring allows us to easily monitor Metrics we want by config JMX Mbeans Object. + +### JMX protocol collection process +【**Peer Server Enable Jmx Service**】->【**HertzBeat Connect Peer Server Jmx**】->【**Query Jmx Mbean Object Data**】->【**Metric data extraction**】 + +It can be seen from the process that we define a monitoring type of JMX protocol. We need to configure JMX request parameters, configure which Metrics to obtain, and configure Mbeans Object. + +### Data parsing method + +By configuring the monitoring template YML metrics `field`, `aliasFields`, `objectName` of the `jmx` protocol to map and parse the `Mbean` object information exposed by the peer system. + +### Custom Steps + +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** + +![](/img/docs/advanced/extend-point-1.png) + +------- +Configuration usages of the monitoring templates yml are detailed below. + +### Monitoring Templates YML + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + +eg:Define a custom monitoring type `app` named `example_jvm` which use the JVM protocol to collect data. + + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +category: service +# The monitoring type eg: linux windows tomcat mysql aws... +app: example_jvm +# The monitoring i18n name +name: + zh-CN: 自定义JVM虚拟机 + en-US: CUSTOM JVM +# 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: 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 + defaultValue: 9999 + # field-param field key + - field: url + # name-param field display i18n name + name: + zh-CN: JMX URL + en-US: JMX URL + # type-param field type(most mapping the html input type) + type: text + # required-true or false + required: false + # hide param-true or false + hide: true + # param field input placeholder + placeholder: 'service:jmx:rmi:///jndi/rmi://host:port/jmxrmi' + # field-param field key + - field: username + # name-param field display i18n name + name: + zh-CN: 用户名 + en-US: Username + # type-param field type(most mapping the html input type) + type: text + # when type is text, use limit to limit string length + limit: 50 + # required-true or false + required: false + # hide param-true or false + hide: true + # field-param field key + - field: password + # name-param field display i18n name + name: + zh-CN: 密码 + en-US: Password + # type-param field type(most mapping the html input tag) + type: password + # required-true or false + required: false + # hide param-true or false + hide: true +# collect metrics config list +metrics: + # metrics - basic + - 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 + priority: 0 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-if is metrics label + - field: VmName + type: 1 + - field: VmVendor + type: 1 + - field: VmVersion + type: 1 + - field: Uptime + type: 0 + unit: ms + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: jmx + # the config content when protocol is jmx + jmx: + # host: ipv4 ipv6 domain + host: ^_^host^_^ + # port + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + # jmx mbean object name + objectName: java.lang:type=Runtime + url: ^_^url^_^ + + - name: memory_pool + priority: 1 + fields: + - field: name + type: 1 + label: true + - field: committed + type: 0 + unit: MB + - field: init + type: 0 + unit: MB + - field: max + type: 0 + unit: MB + - field: used + type: 0 + unit: MB + units: + - committed=B->MB + - init=B->MB + - max=B->MB + - used=B->MB + # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field + aliasFields: + - Name + - Usage->committed + - Usage->init + - Usage->max + - Usage->used + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime + calculates: + - name=Name + - committed=Usage->committed + - init=Usage->init + - max=Usage->max + - used=Usage->used + protocol: jmx + jmx: + # host: ipv4 ipv6 domain + host: ^_^host^_^ + # port + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + objectName: java.lang:type=MemoryPool,name=* + url: ^_^url^_^ +``` diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-ngql.md b/home/versioned_docs/version-v1.5.x/advanced/extend-ngql.md new file mode 100644 index 00000000000..c07c5ae8ca0 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-ngql.md @@ -0,0 +1,167 @@ +--- +id: extend-ngql +title: NGQL Custom Monitoring +sidebar_label: NGQL Custom Monitoring +--- + +> From [Custom Monitoring](extend-point), you are familiar with how to customize types, Metrics, protocols, etc. Here we will introduce in detail how to use JDBC(support mysql,mariadb,postgresql,sqlserver at present) to customize Metric monitoring. +> NGQL custom monitoring allows us to easily query metric data from the NebulaGraph graph database using NGQL or OpenCypher, supporting NebulaGraph 3.X versions. + +### Data Parsing Methods + +Mapping the fields returned by NGQL queries to the metrics we need allows us to obtain corresponding metric data. Currently, there are four mapping and parsing methods: filterCount, oneRow, multiRow, columns. + +#### **filterCount** + +> Counts the number of results returned by a query based on specified fields, usually used in `SHOW ...` statements. If NGQL statements can directly return the count, it is recommended to use NGQL statements for counting. +> Syntax for the `commands` field: aliasField#NGQL#filterName#filterValue +> `aliasField`: corresponds to the value in the `aliasFields` in the monitoring template +> `NGQL`: query statement +> `filterName`: filter attribute name (optional) +> `filterValue`: filter attribute value (optional) + +For example: +- online_meta_count#SHOW HOSTS META#Status#ONLINE + Counts the number of rows returned by `SHOW HOSTS META` where Status equals ONLINE. +- online_meta_count#SHOW HOSTS META## + Counts the number of rows returned by `SHOW HOSTS META`. + +#### **oneRow** + +> Queries a single row of data by mapping the column names of the query result set to the queried fields. + +For example: +- Metrics fields: a, b +- NGQL query: match (v:metrics) return v.metrics.a as a, v.metrics.b as b; + +Here, the metric fields can be mapped to the response data row by row. + +Notes: +- When using the `oneRow` method, if a single query statement returns multiple rows of results, only the first row of results will be mapped to the metric fields. +- When the `commands` field contains two or more query statements and the returned fields of multiple query statements are the same, the fields returned by the subsequent statement will overwrite those returned by the previous statement. +- It is recommended to use the limit statement to limit the number of rows returned in the result set when defining `commands`. + +#### **multiRow** + +> Queries multiple rows of data by mapping the column names of the query result set to the queried fields. + +For example: +- Metrics fields: a, b +- NGQL query: match (v:metrics) return v.metrics.a as a, v.metrics.b as b; + +Here, the metric fields can be mapped to the response data row by row. +Notes: +- When using the `multiRow` method, the `commands` field can only contain one query statement. + +#### **columns** + +> Collects a single row of metric data by mapping two columns of data (key-value), where the key matches the queried fields and the value is the value of the queried field. + +Notes: +- When using the `columns` method, the first two columns of the result set are mapped to collect data by default, where the first column corresponds to the metric name and the second column corresponds to the metric value. +- When the `commands` field contains two or more query statements and the first column of data returned by multiple query statements is duplicated, the result of the last statement will be retained. + +### Customization Steps + +**HertzBeat Page** -> **Monitoring Template Menu** -> **Add Monitoring Type** -> **Configure Custom Monitoring Template YML** -> **Click Save Application** -> **Use the New Monitoring Type to Add Monitoring** + +![HertzBeat Page](/img/docs/advanced/extend-point-1.png) + +------- +Configuration usages of the monitoring templates yml are detailed below. + +### Monitoring Template YML + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. +> Monitoring template is used to define the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information, etc. + +eg: Customize a monitoring type named example_ngql, which collects metric data using NGQL. + +```yaml +# Monitoring category: service-application service program-application program db-database custom-custom os-operating system bigdata-big data mid-middleware webserver-web server cache-cache cn-cloud native network-network monitoring, etc. +category: db +# Monitoring application type (consistent with the file name) eg: linux windows tomcat mysql aws... +app: example_ngql +name: + zh-CN: NGQL Custom Monitoring Application + en-US: NGQL Custom APP +# Monitoring parameter definition. These are input parameter variables, which can be written in the format of ^_^host^_^ to be replaced by system variable values in the later configuration +# This part is usually not modified +params: + # field-param field key + - field: host + name: + zh-CN: Target Host + en-US: Target Host + type: host + required: true + - field: graphPort + name: + zh-CN: Graph Port + en-US: Graph Port + type: number + range: '[0,65535]' + required: true + defaultValue: 9669 + - field: username + name: + zh-CN: Username + en-US: Username + type: text + required: true + - field: password + name: + zh-CN: Password + en-US: Password + type: password + required: true + - field: spaceName + name: + zh-CN: Space Name + en-US: Space Name + type: text + required: false + - field: timeout + name: + zh-CN: Connect Timeout(ms) + en-US: Connect Timeout(ms) + type: number + unit: ms + range: '[0,100000]' + required: true + defaultValue: 6000 +# Metric collection configuration list +metrics: + - name: base_info + i18n: + zh-CN: Vertex statistics + en-US: Vertex statistics + priority: 0 + fields: + - field: tag1 + type: 1 + i18n: + zh-CN: tag1 + en-US: tag1 + - field: tag1 + type: 1 + i18n: + zh-CN: tag2 + en-US: tag2 + aliasFields: + - tag1 + - tag2 + protocol: ngql + ngql: + host: ^_^host^_^ + username: ^_^username^_^ + password: ^_^password^_^ + port: ^_^graphPort^_^ + spaceName: ^_^spaceName^_^ + parseType: columns + # Define the query statements used to collect data + commands: + - match (v:tag1) return "tag1" as name ,count(v) as cnt + - match (v:tag2) return "tag2" as name ,count(v) as cnt + timeout: ^_^timeout^_^ +``` diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-point.md b/home/versioned_docs/version-v1.5.x/advanced/extend-point.md new file mode 100644 index 00000000000..eba1811e4fc --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-point.md @@ -0,0 +1,134 @@ +--- +id: extend-point +title: Custom Monitoring +sidebar_label: Custom Monitoring +--- +> HertzBeat has custom monitoring ability. You only need to configure monitoring template yml to fit a custom monitoring type. +> Custom monitoring currently supports [HTTP protocol](extend-http),[JDBC protocol](extend-jdbc), [SSH protocol](extend-ssh), [JMX protocol](extend-jmx), [SNMP protocol](extend-snmp). And it will support more general protocols in the future. + +### Custom Monitoring Steps + +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** + + +------- + +Configuration usages of the monitoring templates yml are detailed below. + +### Monitoring Templates YML + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + +eg:Define a custom monitoring type `app` named `example2` which use the HTTP protocol to collect data. + +**Monitoring Templates** -> **Config New Monitoring Template Yml** -> **Save and Apply** + + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +category: custom +# The monitoring type eg: linux windows tomcat mysql aws... +app: example2 +# The monitoring i18n name +name: + zh-CN: 模拟网站监测 + en-US: EXAMPLE WEBSITE +# 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: 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 + defaultValue: 80 + # field-param field key + - field: uri + # name-param field display i18n name + name: + zh-CN: 相对路径 + en-US: URI + # type-param field type(most mapping the html input tag) + type: text + # when type is text, use limit to limit string length + limit: 200 + # required-true or false + required: false + # param field input placeholder + placeholder: 'Website uri path(no ip port) EG:/console' + # field-param field key + - field: ssl + # name-param field display i18n name + name: + zh-CN: 启用HTTPS + en-US: HTTPS + # type-param field type(most mapping the html input type) + type: boolean + # required-true or false + required: true + # field-param field key + - field: timeout + # name-param field display i18n name + name: + zh-CN: 超时时间(ms) + en-US: Timeout(ms) + # type-param field type(most mapping the html input tag) + type: number + # required-true or false + required: false + # hide param-true or false + hide: true + +metrics: + # metrics - summary, inner monitoring metrics (responseTime - response time, keyword - number of keywords) + - name: summary + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-if is metrics label + - field: responseTime + type: 0 + unit: ms + - field: keyword + type: 0 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: http + # the config content when protocol is http + http: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # http url + url: ^_^uri^_^ + timeout: ^_^timeout^_^ + # http method: GET POST PUT DELETE PATCH + method: GET + # if enabled https + ssl: ^_^ssl^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule + parseType: website + +``` diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-push.md b/home/versioned_docs/version-v1.5.x/advanced/extend-push.md new file mode 100644 index 00000000000..18e190d7f5d --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-push.md @@ -0,0 +1,26 @@ +--- +id: extend-push +title: Push Style Custom Monitoring +sidebar_label: Push Style Custom Monitoring +--- + +> Push style curstom monitor is a type of monitor which allow user to configure metrics format and push metrics to hertzbeat with their own service. +> Here we will introduce how to use this feature. + +### Push style custom monitor collection process + +【Peer Server Start Pushing Metrics】 -> 【HertzBeat Push Module Stage Metrics】-> 【HertzBeat Collect Module collect Metrics Periodically】 + +### Data parsing method + +HertzBeat will parsing metrics with the format configured by user while adding new monitor. + +### Create Monitor Steps + +HertzBeat DashBoard -> Service Monitor -> Push Style Monitor -> New Push Style Monitor -> set Push Module Host (hertzbeat server ip, usually 127.0.0.1/localhost) -> set Push Module Port (hertzbeat server port, usually 1157) -> configure metrics field (unit: string, type: 0 number / 1 string) -> end + +--- + +### Monitor Configuration Example + +![](/img/docs/advanced/extend-push-example-1.png) diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-snmp.md b/home/versioned_docs/version-v1.5.x/advanced/extend-snmp.md new file mode 100644 index 00000000000..c97aea1f766 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-snmp.md @@ -0,0 +1,173 @@ +--- +id: extend-snmp +title: SNMP Protocol Custom Monitoring +sidebar_label: SNMP Protocol Custom Monitoring +--- + +> From [Custom Monitoring](extend-point), you are familiar with how to customize types, Metrics, protocols, etc. Here we will introduce in detail how to use SNMP to customize Metric monitoring. +> JMX protocol custom monitoring allows us to easily monitor Metrics we want by config SNMP MIB OIDs. + +### SNMP protocol collection process +【**Peer Server Enable SNMP Service**】->【**HertzBeat Connect Peer Server SNMP**】->【**Query Oids Data**】->【**Metric data extraction**】 + +It can be seen from the process that we define a monitoring type of Snmp protocol. We need to configure Snmp request parameters, configure which Metrics to obtain, and configure oids. + + +### Data parsing method + +By configuring the metrics `field`, `aliasFields`, and `oids` under the `snmp` protocol of the monitoring template YML to capture the data specified by the peer and parse the mapping. + + +### Custom Steps + +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** + +![](/img/docs/advanced/extend-point-1.png) + +------- +Configuration usages of the monitoring templates yml are detailed below. + +### Monitoring Templates YML + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + +eg:Define a custom monitoring type `app` named `example_windows` which use the SNMP protocol to collect data. + + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring +category: os +# The monitoring type eg: linux windows tomcat mysql aws... +app: windows +# The monitoring i18n name +name: + zh-CN: Windows操作系统 + en-US: OS Windows +# 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: 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 + defaultValue: 161 + # field-param field key + - field: version + # name-param field display i18n name + name: + zh-CN: SNMP 版本 + en-US: SNMP Version + # type-param field type(radio mapping the html radio tag) + type: radio + # required-true or false + required: true + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} + options: + - label: SNMPv1 + value: 0 + - label: SNMPv2c + value: 1 + # field-param field key + - field: community + # name-param field display i18n name + name: + zh-CN: SNMP 团体字 + en-US: SNMP Community + # type-param field type(most mapping the html input type) + type: text + # when type is text, use limit to limit string length + limit: 100 + # required-true or false + required: true + # param field input placeholder + placeholder: 'Snmp community for v1 v2c' + # field-param field key + - field: timeout + # name-param field display i18n name + name: + zh-CN: 超时时间(ms) + en-US: 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: false + # hide-is hide this field and put it in advanced layout + hide: true + # default value + defaultValue: 6000 +# collect metrics config list +metrics: + # metrics - system + - name: system + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-if is metrics label + - field: name + type: 1 + - field: descr + type: 1 + - field: uptime + type: 1 + - field: numUsers + type: 0 + - field: services + type: 0 + - field: processes + type: 0 + - field: responseTime + type: 0 + unit: ms + - field: location + type: 1 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: snmp + # the config content when protocol is snmp + snmp: + # server host: ipv4 ipv6 domain + host: ^_^host^_^ + # server port + port: ^_^port^_^ + # snmp connect timeout + timeout: ^_^timeout^_^ + # snmp community + community: ^_^community^_^ + # snmp version + version: ^_^version^_^ + # snmp operation: get, walk + operation: get + # metrics oids: metric_name - oid_value + oids: + name: 1.3.6.1.2.1.1.5.0 + descr: 1.3.6.1.2.1.1.1.0 + uptime: 1.3.6.1.2.1.25.1.1.0 + numUsers: 1.3.6.1.2.1.25.1.5.0 + services: 1.3.6.1.2.1.1.7.0 + processes: 1.3.6.1.2.1.25.1.6.0 + location: 1.3.6.1.2.1.1.6.0 +``` diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-ssh.md b/home/versioned_docs/version-v1.5.x/advanced/extend-ssh.md similarity index 87% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-ssh.md rename to home/versioned_docs/version-v1.5.x/advanced/extend-ssh.md index 741a959e8e8..772ee315207 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/advanced/extend-ssh.md +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-ssh.md @@ -7,7 +7,7 @@ sidebar_label: SSH Protocol Custom Monitoring > SSH protocol custom monitoring allows us to easily monitor and collect the Linux Metrics we want by writing sh command script. ### SSH protocol collection process -【**System directly connected to Linux**】->【**Run shell command script statement**】->【**parse reponse data: oneRow, multiRow**】->【**Metric data extraction**】 +【**System directly connected to Linux**】->【**Run shell command script statement**】->【**parse response data: oneRow, multiRow**】->【**Metric data extraction**】 It can be seen from the process that we define a monitoring type of SSH protocol. We need to configure SSH request parameters, configure which Metrics to obtain, and configure query script statements. @@ -39,7 +39,7 @@ Here the Metric field and the response data can be mapped into a row of collecte eg: Linux memory related Metric fields queried:total-Total memory, used-Used memory,free-Free memory, buff-cache-Cache size, available-Available memory -Memory indicaotr original query command:`free -m`, Console response: +Memory metrics original query command:`free -m`, Console response: ```shell total used free shared buff/cache available Mem: 7962 4065 333 1 3562 3593 @@ -55,21 +55,22 @@ total used free buff_cache available Here the Metric field and the response data can be mapped into collected data one by one. -### Custom Steps +### Custom Steps -In order to configure a custom monitoring type, you need to add and configure YML file. -1. Monitoring configuration definition file named after monitoring type - eg:example_linux.yml in the installation directory /hertzbeat/app/ -2. Restart hertzbeat system, we successfully fit a new custom monitoring type. +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** ------- -Configuration usages of the file are detailed below. Please pay attention to usage annotation. +Configuration usages of the monitoring templates yml are detailed below. -### Monitoring configuration definition file +### Monitoring Templates YML -> Monitoring configuration definition file is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + +eg:Define a custom monitoring type `app` named `example_linux` which use the SSH protocol to collect data. -eg:Define a custom monitoring type named example_linux which use the SSH protocol to collect data. -The file name: example_linux.yml in /define/example_linux.yml ```yaml # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring @@ -100,7 +101,7 @@ params: zh-CN: 用户名 en-US: Username type: text - limit: 20 + limit: 50 required: true - field: password name: @@ -121,7 +122,7 @@ metrics: # Metric information include field: name type: field type(0-number: number, 1-string: string) label-if is metrics label unit: Metric unit - field: hostname type: 1 - instance: true + label: true - field: version type: 1 - field: uptime diff --git a/home/versioned_docs/version-v1.5.x/advanced/extend-tutorial.md b/home/versioned_docs/version-v1.5.x/advanced/extend-tutorial.md new file mode 100644 index 00000000000..9f21219a29f --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/advanced/extend-tutorial.md @@ -0,0 +1,236 @@ +--- +id: extend-tutorial +title: Quick Tutorial Customize and adapt a monitoring based on HTTP protocol +sidebar_label: Tutorial Case +--- + +Through this tutorial, we describe step by step how to customize and adapt a monitoring type based on the http protocol under the Apache HertzBeat (incubating). + +Before reading this tutorial, we hope that you are familiar with how to customize types, metrics, protocols, etc. from [Custom Monitoring](extend-point) and [Http Protocol Customization](extend-http). + + +### HTTP protocol parses the general response structure to obtain metrics data + +> In many scenarios, we need to monitor the provided HTTP API interface and obtain the index value returned by the interface. In this article, we use the http custom protocol to parse our common http interface response structure, and obtain the fields in the returned body as metric data. + + +``` +{ + "code": 200, + "msg": "success", + "data": {} +} + +``` +As above, usually our background API interface will design such a general return. The same is true for the background of the hertzbeat system. Today, we will use the hertzbeat API as an example, add a new monitoring type **hertzbeat**, and monitor and collect its system summary statistics API +`http://localhost:1157/api/summary`, the response data is: + +``` +{ + "msg": null, + "code": 0, + "data": { + "apps": [ + { + "category": "service", + "app": "jvm", + "status": 0, + "size": 2, + "availableSize": 0, + "unManageSize": 2, + "unAvailableSize": 0, + "unReachableSize": 0 + }, + { + "category": "service", + "app": "website", + "status": 0, + "size": 2, + "availableSize": 0, + "unManageSize": 2, + "unAvailableSize": 0, + "unReachableSize": 0 + } + ] + } +} +``` + +**This time we get the metrics data such as `category`, `app`, `status`, `size`, `availableSize` under the app. ** + + +### Add Monitoring Template Yml + +**HertzBeat Dashboard** -> **Monitoring Templates** -> **New Template** -> **Config Monitoring Template Yml** -> **Save and Apply** -> **Add A Monitoring with The New Monitoring Type** + +> We define all monitoring collection types (mysql,jvm,k8s) as yml monitoring templates, and users can import these templates to support corresponding types of monitoring. + + +> Monitoring template is used to define *the name of monitoring type(international), request parameter mapping, index information, collection protocol configuration information*, etc. + + +Here we define a custom monitoring type `app` named `hertzbeat` which use the HTTP protocol to collect data. + +**Monitoring Templates** -> **Config New Monitoring Template Yml** -> **Save and Apply** + +```yaml +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +category: custom +# The monitoring type eg: linux windows tomcat mysql aws... +app: hertzbeat +# The monitoring i18n name +name: + zh-CN: HertzBeat监控系统 + en-US: HertzBeat Monitor +# 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: 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 + defaultValue: 1157 + - field: ssl + name: + zh-CN: 启用HTTPS + en-US: HTTPS + type: boolean + required: true + - field: timeout + name: + zh-CN: 超时时间(ms) + en-US: Timeout(ms) + type: number + required: false + hide: true + - field: authType + name: + zh-CN: 认证方式 + en-US: Auth Type + type: radio + required: false + hide: true + options: + - label: Basic Auth + value: Basic Auth + - label: Digest Auth + value: Digest Auth + - field: username + name: + zh-CN: 用户名 + en-US: Username + type: text + limit: 50 + required: false + hide: true + - field: password + name: + zh-CN: 密码 + en-US: Password + type: password + required: false + hide: true +metrics: + # the first metrics summary + # attention: Built-in monitoring metrics contains (responseTime - Response time) + - name: summary + # 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 + # collect metrics content + fields: + # metrics content contains field-metric name, type-metric type:0-number,1-string, label-if is metrics label, unit-metric unit('%','ms','MB') + - field: app + type: 1 + label: true + - field: category + type: 1 + - field: status + type: 0 + - field: size + type: 0 + - field: availableSize + type: 0 + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk, we use HTTP protocol here + protocol: http + # the config content when protocol is http + http: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # http url, we don't need to enter a parameter here, just set the fixed value to /api/summary + url: /api/summary + timeout: ^_^timeout^_^ + # http method: GET POST PUT DELETE PATCH, default fixed value is GET + method: GET + # if enabled https, default value is false + ssl: ^_^ssl^_^ + # http auth + authorization: + # http auth type: Basic Auth, Digest Auth, Bearer Token + type: ^_^authType^_^ + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + digestAuthUsername: ^_^username^_^ + digestAuthPassword: ^_^password^_^ + # http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, we use jsonpath to parse response data here + parseType: jsonPath + parseScript: '$.data.apps.*' +``` + +**The addition is complete, now we restart the hertzbeat system. We can see that the system page has added a `hertzbeat` monitoring type. ** + + +![](/img/docs/advanced/extend-http-example-1.png) + + +### The system page adds the monitoring of `hertzbeat` monitoring type + +> We click Add `HertzBeat Monitoring Tool`, configure monitoring IP, port, collection cycle, account password in advanced settings, etc., click OK to add monitoring. + + +![](/img/docs/advanced/extend-http-example-2.png) + + +![](/img/docs/advanced/extend-http-example-3.png) + +> After a certain period of time (depending on the collection cycle), we can see the specific metric data and historical charts in the monitoring details! + + +![](/img/docs/advanced/extend-http-example-4.png) + + + +### Set threshold alarm notification + +> Next, we can set the threshold normally. After the alarm is triggered, we can view it in the alarm center, add a new recipient, set alarm notification, etc. Have Fun!!! + + +---- + +#### over! + +This is the end of the practice of custom monitoring of the HTTP protocol. The HTTP protocol also has other parameters such as headers and params. We can define it like postman, and the playability is also very high! + +If you think hertzbeat is a good open source project, please star us on GitHub Gitee, thank you very much. Thanks for the old iron support. Refill! + +**github: https://github.com/apache/hertzbeat** diff --git a/home/versioned_docs/version-v1.5.x/community/become_committer.md b/home/versioned_docs/version-v1.5.x/community/become_committer.md new file mode 100644 index 00000000000..f2824bdc4ed --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/become_committer.md @@ -0,0 +1,84 @@ +--- +id: 'become_committer' +title: 'Become A Committer' +sidebar_position: 2 +--- + + + +## Become A Committer of Apache HertzBeat + +Anyone being supportive of the community and working in any of the +CoPDoC areas can become an Apache HertzBeat committer. The CoPDoC is an +acronym from ASF to describe how we recognize your contributions not +only by code. + +- **Community** - You can join us via our mailing list, issue + trackers, discussions page to interact with community members, and + share vision and knowledge +- **Project** - a clear vision and consensus are needed +- **Documentation** - without it, the stuff remains only in the minds + of the authors +- **Code** - discussion goes nowhere without code + +Apache HertzBeat community strives to be meritocratic. Thus, once someone +has contributed sufficiently to any area of CoPDoC they can be a +candidate for committer-ship and at last voted in as a HertzBeat +committer. Being an Apache HertzBeat committer does not necessarily mean +you must commit code with your commit privilege to the codebase; it +means you are committed to the HertzBeat project and are productively +contributing to our community's success. + +## Committer requirements: + +There are no strict rules for becoming a committer or PPMC member. +Candidates for new committers are typically people that are active +contributors and community members. Anyway, if the rules can be +clarified a little bit, it can somehow clear the doubts in the minds +of contributors and make the community more transparent, reasonable, +and fair. + +### Continuous contributions + +Committer candidates should have a decent amount of continuous +engagements and contributions (fixing bugs, adding new features, +writing documentation, maintaining issues boards, code review, or answering +community questions) to HertzBeat either by contributing to the codebase +of the main website or HertzBeat's GitHub repositories. + +- +3 months with light activity and engagement. +- +2 months of medium activity and engagement. +- +1 month with solid activity and engagement. + +### Quality of contributions +- A solid general understanding of the project +- Well tested, well-designed, following Apache HertzBeat coding + standards, and simple patches. +- Well-organized and detailed user-oriented documentation. + +### Community involvement + +- Be active, courteous, and respectful on the dev mailing list and + help mentor newer contributors + and users. +- Be active, courteous, and respectful on the issue tracker for + project maintenance +- Be active, courteous, and respectful for pull requests reviewing +- Be involved in the design road map discussions with a professional + and diplomatic approach even if there is a disagreement +- Promoting the project by writing articles or holding events diff --git a/home/versioned_docs/version-v1.5.x/community/become_pmc_member.md b/home/versioned_docs/version-v1.5.x/community/become_pmc_member.md new file mode 100644 index 00000000000..cf48cbe7c82 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/become_pmc_member.md @@ -0,0 +1,84 @@ +--- +id: 'become_pmc_member' +title: 'Become A PMC member' +sidebar_position: 3 +--- + + + +## Become A PMC member of Apache HertzBeat + +Anyone being supportive of the community and working in any of the +CoPDoC areas can become an Apache HertzBeat PMC member. The CoPDoC is an +acronym from ASF to describe how we recognize your contributions not +only by code. + +- **Community** - You can join us via our mailing list, issue + trackers, discussions page to interact with community members, and + share vision and knowledge +- **Project** - a clear vision and consensus are needed +- **Documentation** - without it, the stuff remains only in the minds + of the authors +- **Code** - discussion goes nowhere without code + +Apache HertzBeat community strives to be meritocratic. Thus, once someone +has contributed sufficiently to any area of CoPDoC they can be a +candidate for PMC membership and at last voted in as a HertzBeat +PMC member. Being an Apache HertzBeat PMC member does not necessarily mean +you must commit code with your commit privilege to the codebase; it +means you are committed to the HertzBeat project and are productively +contributing to our community's success. + +## PMC member requirements: + +There are no strict rules for becoming a committer or PPMC member. +Candidates for new PMC member are typically people that are active +contributors and community members. Anyway, if the rules can be +clarified a little bit, it can somehow clear the doubts in the minds +of contributors and make the community more transparent, reasonable, +and fair. + +### Continuous contributions + +PMC member candidates should have a decent amount of continuous +engagements and contributions (fixing bugs, adding new features, +writing documentation, maintaining issues boards, code review, or answering +community questions) to HertzBeat either by contributing to the codebase +of the main website or HertzBeat's GitHub repositories. + +- +5 months with light activity and engagement. +- +4 months of medium activity and engagement. +- +3 month with solid activity and engagement. + +### Quality of contributions +- A solid general understanding of the project +- Well tested, well-designed, following Apache HertzBeat coding + standards, and simple patches. +- Well-organized and detailed user-oriented documentation. + +### Community involvement + +- Be active, courteous, and respectful on the dev mailing list and + help mentor newer contributors + and users. +- Be active, courteous, and respectful on the issue tracker for + project maintenance +- Be active, courteous, and respectful for pull requests reviewing +- Be involved in the design road map discussions with a professional + and diplomatic approach even if there is a disagreement +- Promoting the project by writing articles or holding events diff --git a/home/versioned_docs/version-v1.5.x/community/code-style-and-quality-guide.md b/home/versioned_docs/version-v1.5.x/community/code-style-and-quality-guide.md new file mode 100644 index 00000000000..755a98f3fd7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/code-style-and-quality-guide.md @@ -0,0 +1,575 @@ +--- +id: 'code_style_and_quality_guide' +title: 'Code style and quality guide' +sidebar_position: 3 +--- + + + + +## 1 Pull Requests & Changes Rule + +1. `ISSUE`/`PR`(pull request) driving and naming + + - After creating a new `PR`, you need to associate the existing corresponding `ISSUE` at the Github Development button on the `PR` page (if there is no corresponding ISSUE, it is recommended to create a new corresponding ISSUE). + + - Title naming format + `[feature/bugfix/doc/improve/refactor/bug/cleanup] title` + +2. Description + + - Please fill in the `PR` template to describe the contribution. So that the reviewer can understand the problem and solution from the description, rather than just from the code. + - Check the CheckList + +3. It's recommended that `PR` should be arranged changes such as `cleanup`, `Refactor`, `improve`, and `feature` into separated `PRs`/`Commits`. + +4. Commit message(English, lowercase, no special characters) + The commit of messages should follow a pattern similar to the `[feature/bugfix/doc/improve/refactor/bug/cleanup] title` + +## 2 Code Checkstyle + +### 2.1 Configure Checkstyle + +1. Install the Checkstyle-IDEA plugin. +2. Open Checkstyle Settings. Click **Settings** → **Tools** → **Checkstyle**. +3. Set **Checkstyle version** to **10.14.2**. +4. Set **Scan scope** to **Only Java sources (including tests)**. +5. Click **+** button in the **Configuration** section to open a dialog to choose the checkstyle config file. + 1. Enter a **Description**. For example, hertzbeat. + 2. Select **Use a local checkstyle file**. + 3. Set **File** to **script/checkstyle/checkstyle.xml**. + 4. Select **Store relative to project location**. + 5. Click **Next** → **Next** → **Finish**. +6. Activate the configuration you just added by toggling the corresponding box. +7. Click **OK**. + +- Backend code specification Maven plugin: `checkstyle` + Just run `mvn checkstyle:checkstyle`. + +- Frontend code formatting plugin `eslint` + Just run `npm run lint:fix` in web-app + +## 3 Programming Specification + +### 3.1 Naming Style + +1. Prioritize selecting nouns for variable naming, it's easier to distinguish between `variables` or `methods`. + ```java + Cache publicKeyCache; + ``` + +2. Pinyin abbreviations are prohibited for variables (excluding nouns such as place names), such as chengdu. + +3. It is recommended to end variable names with a `type`. + For variables of type `Collection/List`, take `xxxx` (plural representing multiple elements) or end with `xxxList` (specific type). + For variables of type `map`, describe the `key` and `value` clearly: + ```java + Map idUserMap; + Map userIdNameMap; + ``` + +4. That can intuitively know the type and meaning of the variable through its name. + Method names should start with a verb first as follows: + ```java + void computeVcores(Object parameter1); + ``` + > Note: It is not necessary to strictly follow this rule in the `Builder` tool class. + + +### 3.2 Constant Variables Definition + +1. Redundant strings should be extracted as constants + >If a constant has been hardcoded twice or more times, please directly extract it as a constant and change the corresponding reference. + In generally, constants in `log` can be ignored to extract. + + - Negative demo: + + ```java + public static RestResponse success(Object data) { + RestResponse resp = new RestResponse(); + resp.put("status", "success"); + resp.put("code", ResponseCode.CODE_SUCCESS); + resp.put("data", data); + return resp; + } + + public static RestResponse error() { + RestResponse resp = new RestResponse(); + resp.put("status", "error"); + resp.put("code", ResponseCode.CODE_FAIL); + resp.put("data", null); + return resp; + } + ``` + + - Positive demo: + + > Strings are extracted as constant references. + + ```java + public static final String STATUS = "status"; + public static final String CODE = "code"; + public static final String DATA = "data"; + + public static RestResponse success(Object data) { + RestResponse resp = new RestResponse(); + resp.put(STATUS, "success"); + resp.put(CODE, ResponseCode.CODE_SUCCESS); + resp.put(DATA, data); + return resp; + } + + public static RestResponse error() { + RestResponse resp = new RestResponse(); + resp.put(STATUS, "error"); + resp.put(CODE, ResponseCode.CODE_FAIL); + resp.put(DATA, null); + return resp; + } + ``` + +2. Ensure code readability and intuitiveness + + - The string in the `annotation` symbol doesn't need to be extracted as constant. + + - The referenced `package` or `resource` name doesn't need to be extracted as constant. + +3. Variables that have not been reassigned must also be declared as final types. + +4. About the arrangement order of `constant/variable` lines + + Sort the variable lines in the class in the order of + 1. `public static final V`, `static final V`,`protected static final V`, `private static final V` + 2. `public static v`, `static v`,`protected static v`, `private static v` + 3. `public v`, `v`, `protected v`, `private v` + + +### 3.3 Methods Rule + +1. Sort the methods in the class in the order of `public`, `protected`, `private` + + Static methods of a class can be placed after non-static methods and sorted according to consistent method visibility. + +2. When there are restrictions on the method, the parameters and returned values of the method need to be annotated with `@Nonnull` or `@Nullable` annotations and constraints. + + For example, if the parameter cannot be null, it is best to add a `@Nonnull` annotation. If the returned value can be null, the `@Nullable` annotation should be added first. + + Note: that the package name is javax.validation.requirements + +3. If there are too many lines of code in the method, please have a try on using multiple sub methods at appropriate points to segment the method body. + + Generally speaking, it needs to adhere to the following principles: + - Convenient testing + - Good semantics + - Easy to read + + In addition, it is also necessary to consider whether the splitting is reasonable in terms of components, logic, abstraction, and other aspects in the scenario. + + > However, there is currently no clear definition of demo. During the evolution process, we will provide additional examples for developers to have a clearer reference and understanding. + +### 3.4 Collection Rule + +1. For `collection` returned values, unless there are special `concurrent` (such as thread safety), always return the `interface`, such as: + + - returns List if use `ArrayList` + - returns Map if use `HashMap` + - returns Set if use `HashSet` + +2. If there are multiple threads, the following declaration or returned types can be used: + + ```java + private CurrentHashMap map; + public CurrentHashMap funName(); + ``` + +3. Use `isEmpty()` instead of `length() == 0` or `size() == 0` + + - Negative demo: + + ```java + if (pathPart.length() == 0) { + return; + } + ``` + + - Positive demo: + + ```java + if (pathPart.isEmpty()) { + return; + } + ``` + +### 3.5 Concurrent Processing + +1. The `thread pool` needs to be managed, using a unified entry point to obtain the `thread pool`. + + Note: During the evolution process, we will provide additional examples for developers to have a clearer reference and understanding. + +2. `Thread pool` needs to be resource constrained to prevent resource leakage caused by improper handling + +### 3.6 Control/Condition Statements + +1. Avoid unreasonable `condition/control` branches order leads to: + + - Multiple code line `depths` of `n+1` + - Redundant lines + +Generally speaking, if a method's code line depth exceeds `2+ Tabs` due to continuous nested `if... else..`, it should be considered to try +- `merging branches`, +- `inverting branch conditions` +- `extracting private methods` + +to reduce code line depth and improve readability like follows: +- Union or merge the logic into the next level calling + - Negative demo: + ```java + if (isInsert) { + save(platform); + } else { + updateById(platform); + } + ``` + - Positive demo: + ```java + saveOrUpdate(platform); + ``` +- Merge the conditions + - Negative demo: + ```java + if (expression1) { + if(expression2) { + ...... + } + } + ``` + - Positive demo: + ```java + if (expression1 && expression2) { + ...... + } + ``` +- Reverse the condition + - Negative demo: + + ```java + public void doSomething() { + // Ignored more deeper block lines + // ..... + if (condition1) { + ... + } else { + ... + } + } + ``` + + - Positive demo: + + ```java + public void doSomething() { + // Ignored more deeper block lines + // ..... + if (!condition1) { + ... + return; + } + // ... + } + ``` +- Using a single variable or method to reduce the complex conditional expression + - Negative demo: + ```java + if (dbType.indexOf("sqlserver") >= 0 || dbType.indexOf("sql server") >= 0) { + ... + } + ``` + + - Positive demo: + ```java + if (containsSqlServer(dbType)) { + .... + } + //..... + // definition of the containsSqlServer + ``` + +> Using `sonarlint` and `better highlights` to check code depth looks like good in the future. + +### 3.7 Code Comments Rule + +1. Method lacks comments: + + - `When`: When can the method be called + - `How`: How to use this method and how to pass parameters, etc. + - `What`: What functions does this method achieve + - `Note`: What should developers pay attention to when calling this method + +2. Missing necessary class header description comments. + + Add `What`, `Note`, etc. like mentioned in the `1`. + +3. The method declaration in the interface must be annotated. + + - If the semantics of the implementation and the annotation content at the interface declaration are inconsistent, the specific implementation method also needs to be rewritten with annotations. + + - If the semantics of the method implementation are consistent with the annotation content at the interface declaration, it is not recommended to write annotations to avoid duplicate annotations. + +4. The first word in the comment lines need to be capitalized, like `param` lines, `return` lines. + If a special reference as a subject does not need to be capitalized, special symbols such as quotation marks need to be noted. + +### 3.8 Java Lambdas + +1. Prefer `non-capturing` lambdas (lambdas that do not contain references to the outer scope). + Capturing lambdas need to create a new object instance for every call. `Non-capturing` lambdas can use the same instance for each invocation. + + - Negative demo: + + ```java + map.computeIfAbsent(key, x -> key.toLowerCase()) + ``` + + - Positive demo: + + ```java + map.computeIfAbsent(key, k -> k.toLowerCase()); + ``` + +2. Consider method references instead of inline lambdas + + - Negative demo: + + ```java + map.computeIfAbsent(key, k-> Loader.load(k)); + ``` + + - Positive demo: + + ```java + map.computeIfAbsent(key, Loader::load); + ``` + +### 3.9 Java Streams + +- Avoid Java Streams in any performance critical code. + +- The main motivation to use Java Streams would be to improve code readability. As such, they can be a good match in parts of the code that are not data-intensive, but deal with coordination. + +- Even in the latter case, try to limit the scope to a method, or a few private methods within an internal class. + +### 3.10 Pre-Conditions Checking + +1. Use a unified `Utils.requireXXX` to complete the validation of the prerequisite, and if possible, replace the `AlertXXException.throwIfXXX` by new pre-conditions checking. + +### 3.11 StringUtils + +1. Use `StringUtils.isBlank` instead of `StringUtils.isEmpty` + + - Negative demo: + + ```java + if (StringUtils.isEmpty(name)) { + return; + } + ``` + + - Positive demo: + + ```java + if (StringUtils.isBlank(name)) { + return; + } + ``` + +2. Use `StringUtils.isNotBlank` instead of `StringUtils.isNotEmpty` + + - Negative demo: + + ```java + if (StringUtils.isNotEmpty(name)) { + return; + } + ``` + + - Positive demo: + + ```java + if (StringUtils.isNotBlank(name)) { + return; + } + ``` + +3. Use `StringUtils.isAllBlank` instead of `StringUtils.isAllEmpty` + + - Negative demo: + + ```java + if (StringUtils.isAllEmpty(name, age)) { + return; + } + ``` + + - Positive demo: + + ```java + if (StringUtils.isAllBlank(name, age)) { + return; + } + ``` + +### 3.12 `Enum` Class + +1. Enumeration value comparison + + - Negative demo: + + ```java + if (status.equals(JobStatus.RUNNING)) { + return; + } + ``` + + - Positive demo: + + ```java + if (status == JobStatus.RUNNING) { + return; + } + ``` + +2. Enumeration classes do not need to implement Serializable + + - Negative demo: + + ```java + public enum JobStatus implements Serializable { + ... + } + ``` + + - Positive demo: + + ```java + public enum JobStatus { + ... + } + ``` + +3. Use `Enum.name()` instead of `Enum.toString()` + + - Negative demo: + + ```java + System.out.println(JobStatus.RUNNING.toString()); + ``` + + - Positive demo: + + ```java + System.out.println(JobStatus.RUNNING.name()); + ``` + +4. Enumeration class names uniformly use the Enum suffix + + - Negative demo: + + ```java + public enum JobStatus { + ... + } + ``` + + - Positive demo: + + ```java + public enum JobStatusEnum { + ... + } + ``` + +### 3.13 `Deprecated` Annotation + + - Negative demo: + + ```java + @deprecated + public void process(String input) { + ... + } + ``` + + - Positive demo: + + ```java + @Deprecated + public void process(String input) { + ... + } + ``` + +## 4 Log + +1. Use `placeholders` for log output: + + - Negative demo + ```java + log.info("Deploy cluster request " + deployRequest); + ``` + - Positive demo + ```java + log.info("load plugin:{} to {}", file.getName(), appPlugins); + ``` + +2. Pay attention to the selection of `log level` when printing logs + + When printing the log content, if the actual parameters of the log placeholder are passed, it is necessary to avoid premature evaluation to avoid unnecessary evaluation caused by the log level. + + - Negative demo: + + Assuming the current log level is `INFO`: + + ```java + // ignored declaration lines. + List userList = getUsersByBatch(1000); + LOG.debug("All users: {}", getAllUserIds(userList)); + ``` + + - Positive demo: + + In this case, we should determine the log level in advance before making actual log calls as follows: + + ```java + // ignored declaration lines. + List userList = getUsersByBatch(1000); + if (LOG.isDebugEnabled()) { + LOG.debug("All ids of users: {}", getAllIDsOfUsers(userList)); + } + ``` + +## 5 Testing + +1. It's recommended to use `JUnit5` to develop test case preparation + +2. The implemented interface needs to write the `e2e` test case script under the `e2e` module. + +## References +- https://site.mockito.org/ +- https://alibaba.github.io/p3c/ +- https://rules.sonarsource.com/java/ +- https://junit.org/junit5/ +- https://streampark.apache.org/ diff --git a/home/versioned_docs/version-v1.5.x/community/contact.md b/home/versioned_docs/version-v1.5.x/community/contact.md new file mode 100644 index 00000000000..c5b348343f1 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/contact.md @@ -0,0 +1,25 @@ +--- +id: contact +title: Join discussion +sidebar_label: Discussion +--- + +> If you need any help or want to exchange suggestions during the use process, you can discuss and exchange through ISSUE or Github Discussion. + +[Join the Mailing Lists](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) : Mail to `dev-subscribe@hertzbeat.apache.org` to subscribe mailing lists. + +[Chat On Discord](https://discord.gg/Fb6M73htGr) + +WeChat Group : Add friend `tan-cloud` and invite to the group. + +WeChat Public : Search ID `usthecom`. + +[QQ Group](https://jq.qq.com/?_wv=1027&k=Bud9OzdI) : Group num `630061200` + +[Github Discussion](https://github.com/apache/hertzbeat/discussions) + +[Reddit Community](https://www.reddit.com/r/hertzbeat/) + +[Follow Us Twitter](https://twitter.com/hertzbeat1024) + +[Subscribe YouTube](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/contributing.md b/home/versioned_docs/version-v1.5.x/community/contribution.md similarity index 69% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/contributing.md rename to home/versioned_docs/version-v1.5.x/community/contribution.md index 23484d5320d..d433135176d 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/others/contributing.md +++ b/home/versioned_docs/version-v1.5.x/community/contribution.md @@ -1,9 +1,26 @@ --- -id: contributing -title: Contributor Guide -sidebar_label: Contributor Guide +id: 'contribution' +title: 'Contributor Guide' +sidebar_position: 0 --- + + > We are committed to maintaining a happy community that helps each other, welcome every contributor to join us! ### Kinds of Contributions @@ -30,24 +47,35 @@ Even small corrections to typos are very welcome :) ### Getting HertzBeat up and running -> To get HertzBeat code running on your development tools, and able to debug with breakpoints. -> This is a front-end and back-end separation project. To start the local code, the back-end [manager](https://github.com/apache/hertzbeat/tree/master/manager) and the front-end [web-app](https://github.com/apache/hertzbeat/tree/master/web-app) must be started separately. +> To get HertzBeat code running on your development tools, and able to debug with breakpoints. +> This is a front-end and back-end separation project. To start the local code, the back-end manager and the front-end web-app must be started separately. + + +#### Backend start + +1. Requires `maven3+`, `java17` and `lombok` environments + +2. (Optional) Modify the configuration file: `manager/src/main/resources/application.yml` +3. Execute under the project root directory: `mvn clean install -DskipTests` -- Backend start +4. Start `springboot manager` service: `manager/src/main/java/org/apache/hertzbeat/manager/Manager.java` -1. Requires `maven3+`, `java8+` and `lombok` environments -2. Modify the dependent service address and other information of the configuration file-`manager/src/main/resources/application.yml` -3. Start `springboot manager` service `manager/src/main/java/com/usthe/manager/Manager.java` +#### Frontend start -- Front-web start +1. Need `Node Yarn` Environment, Make sure `Node.js >= 18` + +2. Cd to the `web-app` directory: `cd web-app` + +3. Install yarn if not existed `npm install -g yarn` + +4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app` + +5. Install angular-cli globally: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com` -1. Need `nodejs npm angular-cli` environment -2. Install yarn: `npm install -g yarn` -3. Execute under the front-end project directory web-app: `yarn install` -5. Install angular-cli globally: `npm install -g @angular/cli@14 --registry=https://registry.npm.taobao.org` 6. After the local backend is started, start the local frontend in the web-app directory: `ng serve --open` -7. Browser access to localhost:4200 to start, default account/passwd admin/hertzbeat + +7. Browser access to localhost:4200 to start, default account/password is *admin/hertzbeat* ### Find tasks @@ -83,7 +111,7 @@ Please note that the title of the PR needs to conform to our spec, and write the ### Wait for the code to be merged -After submitting the PR, the Committer or the community's friends will review the code you submitted (Code Review), and will propose some modification suggestions or conduct some discussions. Please pay attention to your PR in time. +After submitting the PR, the Committee or the community's friends will review the code you submitted (Code Review), and will propose some modification suggestions or conduct some discussions. Please pay attention to your PR in time. If subsequent changes are required, there is no need to initiate a new PR. After submitting a commit on the original branch and pushing it to the remote repository, the PR will be automatically updated. @@ -108,13 +136,16 @@ git checkout master git pull upstream master ``` +### HertzBeat Improvement Proposal (HIP) +If you have major new features(e.g., support metrics push gateway, support logs monitoring), you need to write a design document known as a HertzBeat Improvement Proposal (HIP). Before starting to write a HIP, make sure you follow the process [here](https://github.com/apache/hertzbeat/tree/master/hip). + ### How to become a Committer? With the above steps, you are a contributor to HertzBeat. Repeat the previous steps to stay active in the community, keep at, you can become a Committer! ### Join Discussion -[Github Discussion](https://github.com/usthe/hertzbeat/discussions) +[Join the Mailing Lists](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) : Mail to `dev-subscribe@hertzbeat.apache.org` to subscribe mailing lists. Add WeChat account `tan-cloud` to pull you into the WeChat group. @@ -131,4 +162,4 @@ Add WeChat account `tan-cloud` to pull you into the WeChat group. - **[web-app](https://github.com/apache/hertzbeat/tree/master/web-app)** Provide web ui. > Angular Web UI. -![hertzBeat](https://cdn.jsdelivr.net/gh/apache/hertzbeat/home/static/img/docs/hertzbeat-arch.svg) +![hertzBeat](/img/docs/hertzbeat-arch.png) diff --git a/home/versioned_docs/version-v1.5.x/community/development.md b/home/versioned_docs/version-v1.5.x/community/development.md new file mode 100644 index 00000000000..6bc9544a900 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/development.md @@ -0,0 +1,75 @@ +--- +id: development +title: How to Run or Build HertzBeat? +sidebar_label: Development +--- + +## Getting HertzBeat code up and running + +> To get HertzBeat code running on your development tools, and able to debug with breakpoints. +> This is a front-end and back-end separation project. +> To start the local code, the back-end [manager](https://github.com/apache/hertzbeat/tree/master/manager) and the front-end [web-app](https://github.com/apache/hertzbeat/tree/master/web-app) must be started separately. + + +### Backend start + +1. Requires `maven3+`, `java17` and `lombok` environments + +2. (Optional) Modify the configuration file: `manager/src/main/resources/application.yml` + +3. Execute under the project root directory: `mvn clean install -DskipTests` + +4. Start `springboot manager` service: `manager/src/main/java/org/apache/hertzbeat/manager/Manager.java` + +### Frontend start + +1. Need `Node Yarn` Environment, Make sure `Node.js >= 18` + +2. Cd to the `web-app` directory: `cd web-app` + +3. Install yarn if not existed `npm install -g yarn` + +4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app` + +5. Install angular-cli globally: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com` + +6. After the local backend is started, start the local frontend in the web-app directory: `ng serve --open` + +7. Browser access to localhost:4200 to start, default account/password is *admin/hertzbeat* + +## Build HertzBeat binary package + +> Requires `maven3+`, `java17`, `node` and `yarn` environments. + +### Frontend build + +1. Need `Node Yarn` Environment, Make sure `Node.js >= 18` + +2. Cd to the `web-app` directory: `cd web-app` + +3. Install yarn if not existed `npm install -g yarn` + +4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app` + +5. Build web-app: `yarn package` + + +### Backend build + +1. Requires `maven3+`, `java17` environments + +2. Execute under the project root directory: `mvn clean package -Prelease` + +The HertzBeat install package will at `dist/hertzbeat-{version}.tar.gz` + +### Collector build + +1. Requires `maven3+`, `java17` environments + +2. Execute under the project root directory: `mvn clean install` + +3. Cd to the `collector` directory: `cd collector` + +4. Execute under `collector` directory: `mvn clean package -Pcluster` + +The HertzBeat collector package will at `dist/hertzbeat-collector-{version}.tar.gz` diff --git a/home/versioned_docs/version-v1.5.x/community/document.md b/home/versioned_docs/version-v1.5.x/community/document.md new file mode 100644 index 00000000000..a4f871bb753 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/document.md @@ -0,0 +1,97 @@ +--- +id: 'document' +title: 'Documentation Notice' +sidebar_position: 1 +--- + + + +Good documentation is critical for any type of software. Any contribution that can improve the HertzBeat documentation is welcome. + +## Get the document project + +Documentation for the HertzBeat project is maintained in [git repository home directory](https://github.com/apache/hertzbeat/tree/master/home). + +First you need to fork the document project into your own github repository, and then clone the document to your local computer. + +```shell +git clone git@github.com:/hertzbeat.git +``` + +## Preview and generate static files + +This website is compiled using node, using Docusaurus framework components + +1. Download and install nodejs (version 18.8.0) +2. Clone the code to the local `git clone git@github.com:apache/hertzbeat.git` +3. In `home` directory run `npm install` to install the required dependent libraries. +4. In `home` directory run `npm run start`, you can visit http://localhost:3000 to view the English mode preview of the site +5. In `home` directory run `npm run start-zh-cn`, you can visit http://localhost:3000 to view the Chinese mode preview of the site +6. To generate static website resource files, run `npm run build`. The static resources of the build are in the build directory. + +## Directory structure + +```html +|-- docs +|-- blog +|-- i18n +| `-- zh-CN // internationalized chinese +| |-- code.json +| |-- docusaurus-plugin-content-blog +| |-- docusaurus-plugin-content-docs +| `-- docusaurus-theme-classic +|-- resource // static resource file +|-- src +| |-- theme +| |-- css +| |-- js +| |-- pages +| | |-- components +| | |-- index.js +| |-- constants.js +|-- static // picture static resource +| |-- img // +| | |-- blog // blog picture +| | |-- docs // document picture +| | |-- home // product picture +| | |-- icons // icon +|-- docusaurus.config.js +|-- sidebars.js // document sidebar menu configuration +``` + +## Specification + +### Naming convention of files + +Consist entirely of lowercase letters, numbers, underscores, and dashes. + +Positive example: `render-dom.js / signup.css / index.html / company-logo.png / hertz_beat.md` + +Counter example: `renderDom.js / UserManagement.html` + +### Resource Path + +Image resources are unified under `static/img/{module name}` + +css and other style files are placed in the `src/css` directory + +### Page content modification + +> All pages doc can be directly jumped to the corresponding github resource modification page through the 'Edit this page' button at the bottom + + diff --git a/home/versioned_docs/version-v1.5.x/community/how-to-release.md b/home/versioned_docs/version-v1.5.x/community/how-to-release.md new file mode 100644 index 00000000000..8ffca0302cb --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/how-to-release.md @@ -0,0 +1,611 @@ +--- +id: 'how_to_release' +title: How to Release +sidebar_position: 4 +--- + +This tutorial describes in detail how to release Apache HertzBeat, take the release of version 1.6.0 as an example. + +## 1. Environmental requirements + +This release process is operated in the UbuntuOS(Windows,Mac), and the following tools are required: + +- JDK 17 +- Node18 Yarn +- Apache Maven 3.x +- GnuPG 2.x +- Git +- SVN (apache uses svn to host project releases) + +> Pay attention to setting environment variables `export GPG_TTY=$(tty)` + +## 2. Preparing for release + +> First summarize the account information to better understand the operation process, will be used many times later. +- apache id: `muchunjin (APACHE LDAP UserName)` +- apache passphrase: `APACHE LDAP Passphrase` +- apache email: `muchunjin@apache.org` +- gpg real name: `muchunjin (Any name can be used, here I set it to the same name as the apache id)` +- gpg key passphrase: `The password set when creating the gpg key, you need to remember this password` + +### 2.1 Key generation + +```shell +$ gpg --full-gen-key +gpg (GnuPG) 2.2.27; Copyright (C) 2021 Free Software Foundation, Inc. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Please select what kind of key you want: +(1) RSA and RSA (default) +(2) DSA and Elgamal +(3) DSA (sign only) +(4) RSA (sign only) +(14) Existing key from card +Your selection? 1 # Please enter 1 +RSA keys may be between 1024 and 4096 bits long. +What keysize do you want? (3072) 4096 # Please enter 4096 here +Requested keysize is 4096 bits +Please specify how long the key should be valid. +0 = key does not expire + = key expires in n days +w = key expires in n weeks +m = key expires in n months +y = key expires in n years +Key is valid for? (0) 0 # Please enter 0 +Key does not expire at all +Is this correct? (y/N) y # Please enter y here + +GnuPG needs to construct a user ID to identify your key. + +Real name: muchunjin # Please enter 'gpg real name' +Email address: muchunjin@apache.org # Please enter your apache email address here +Comment: apache key # Please enter some comments here +You selected this USER-ID: + "muchunjin (apache key) " + +Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O # Please enter O here +We need to generate a lot of random bytes. It is a good idea to perform +some other action (type on the keyboard, move the mouse, utilize the +disks) during the prime generation; this gives the random number +generator a better chance to gain enough entropy. + +# At this time, a dialog box will pop up, asking you to enter the key for this gpg. +# you need to remember that it will be used in subsequent steps. +┌─────────────────────────────────────────────────────┐ +│ Please enter this passphrase to │ +│ protect your new key │ +│ │ +│ Passphrase: _______________________________________ │ +│ │ +│ │ +└─────────────────────────────────────────────────────┘ + +# Here you need to re-enter the password in the previous step. +┌─────────────────────────────────────────────────────┐ +│ Please re-enter this passphrase │ +│ │ +│ Passphrase: _______________________________________ │ +│ │ +│ │ +└─────────────────────────────────────────────────────┘ +gpg: key ACFB69E705016886 marked as ultimately trusted +gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/DC12398CCC33A5349EB9663DF9D970AB18C9EDF6.rev' +public and secret key created and signed. + +pub rsa4096 2023-05-01 [SC] + 85778A4CE4DD04B7E07813ABACFB69E705016886 +uid muchunjin (apache key) +sub rsa4096 2023-05-01 [E] +``` + +Keys can be viewed through the `gpg --list-signatures` command + +### 2.2 Upload the generated key to the public server + +```shell +$ gpg --keyid-format SHORT --list-keys +/root/.gnupg/pubring.kbx +------------------------ +pub rsa4096/05016886 2023-05-01 [SC] + 85778A4CE4DD04B7E07813ABACFB69E705016886 +uid [ultimate] muchunjin (apache key) +sub rsa4096/0C5A4E1C 2023-05-01 [E] + +# Send public key to keyserver via key id +$ gpg --keyserver keyserver.ubuntu.com --send-key 05016886 +# Among them, keyserver.ubuntu.com is the selected keyserver, it is recommended to use this, because the Apache Nexus verification uses this keyserver +``` + +#### 2.3 Check if the key is created successfully + +Verify whether it is synchronized to the public network, it will take about a minute to find out the answer, if not successful, you can upload and retry multiple times. + +```shell +$ gpg --keyserver keyserver.ubuntu.com --recv-keys 05016886 # If the following content appears, it means success +gpg: key ACFB69E705016886: "muchunjin (apache key) " not changed +gpg: Total number processed: 1 +gpg: unchanged: 1 +``` + +Or enter https://keyserver.ubuntu.com/ address in the browser, enter the name of the key and click 'Search key' to search if existed. + +#### 2.4 Add the gpg public key to the KEYS file of the Apache SVN project repo + +- Apache HertzBeat Branch Dev https://dist.apache.org/repos/dist/dev/incubator/hertzbeat +- Apache HertzBeat Branch Release https://dist.apache.org/repos/dist/release/incubator/hertzbeat + +##### 2.4.1 Add public key to KEYS in dev branch + +```shell +$ mkdir -p svn/dev +$ cd svn/dev + +$ svn co https://dist.apache.org/repos/dist/dev/incubator/hertzbeat +$ cd svn/dev/hertzbeat + +# Append the KEY you generated to the file KEYS, and check if it is added correctly +$ (gpg --list-sigs muchunjin@apache.org && gpg --export --armor muchunjin@apache.org) >> KEYS + +$ svn ci -m "add gpg key for muchunjin" +``` + +##### 2.4.2 Add public key to KEYS in release branch + +```shell +$ mkdir -p svn/release +$ cd svn/release + +$ svn co https://dist.apache.org/repos/dist/release/incubator/hertzbeat +$ cd svn/release/hertzbeat + +# Append the KEY you generated to the file KEYS, and check if it is added correctly +$ (gpg --list-sigs muchunjin@apache.org && gpg --export --armor muchunjin@apache.org) >> KEYS + +$ svn ci -m "add gpg key for muchunjin" +``` + +## 3. Prepare material package & release + +#### 3.1 Based on the master branch, create a release-${release_version}-rcx branch, such as release-1.6.0-rc1, And create a tag named v1.6.0-rc1 based on the release-1.6.0-rc1 branch, and set this tag as pre-release. + + +```shell +git checkout master +git checkout -b release-1.6.0-rc1 +``` + +#### 3.2 checkout release branch to local + +```shell +git checkout release-1.6.0-rc1 +``` + +#### 3.3 Compile the binary package + +> Build HertzBeat server binary, run script in `web-app` + +```shell +yarn install + +yarn package +``` + +> run script in root + +```shell +mvn clean package -Prelease +``` + +then + +```shell +mvn clean install +``` + +> Build HertzBeat collector binary, run script in `collector` + +```shell +mvn clean package -Pcluster +``` + +The release package are here: + +- `dist/apache-hertzbeat-{version}-incubating-bin.tar.gz` +- `dist/apache-hertzbeat-collector-{version}-incubating-bin.tar.gz` + +#### 3.4 Package the source code + +> Package the project source code + +```shell +git archive \ +--format=tar.gz \ +--output="dist/apache-hertzbeat-1.6.0-incubating-src.tar.gz" \ +--prefix=apache-hertzbeat-1.6.0-incubating-src/ \ +release-1.6.0-rc1 +``` + +The archive package is here `dist/apache-hertzbeat-1.6.0-incubating-src.tar.gz` + +#### 3.5 Sign binary and source packages + +> The `gpg -u 33545C76` `33545C76` is your gpg secret ID, see from `gpg --keyid-format SHORT --list-keys` + +```shell +cd dist + +# sign +for i in *.tar.gz; do echo $i; gpg -u 33545C76 --armor --output $i.asc --detach-sig $i ; done + +# SHA512 +for i in *.tar.gz; do echo $i; sha512sum $i > $i.sha512 ; done + +# if macos sha512sum not found, you can install by brew install coreutils +``` + +> The final file list is as follows + +``` +apache-hertzbeat-1.6.0-incubating-src.tar.gz +apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc +apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512 +apache-hertzbeat-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc +apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512 +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512 +``` + +#### 3.6 Verify signature + +```shell +$ cd dist + +# Verify signature +$ for i in *.tar.gz; do echo $i; gpg --verify $i.asc $i ; done + +apache-hertzbeat-1.6.0-incubating-src.tar.gz +gpg: Signature made Tue May 2 12:16:35 2023 CST +gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886 +gpg: Good signature from "muchunjin (apache key) " [ultimate] +apache-hertzbeat_2.11-1.6.0-incubating-bin.tar.gz +gpg: Signature made Tue May 2 12:16:36 2023 CST +gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886 +gpg: Good signature from "muchunjin (apache key) " [ultimate] +apache-hertzbeat_2.12-1.6.0-incubating-bin.tar.gz +gpg: Signature made Tue May 2 12:16:37 2023 CST +gpg: using RSA key 85778A4CE4DD04B7E07813ABACFB69E705016886 +gpg: BAD signature from "muchunjin (apache key) " [ultimate] + +# Verify SHA512 +$ for i in *.tar.gz; do echo $i; sha512sum --check $i.sha512; done + +apache-hertzbeat-1.6.0-incubating-src.tar.gz +apache-hertzbeat-1.6.0-incubating-src.tar.gz: OK +apache-hertzbeat-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-1.6.0-incubating-bin.tar.gz: OK +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz +apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz: OK +``` + +#### 3.7 Publish the dev directory of the Apache SVN material package + +- Clone the dev directory + +```shell +# Check out the dev directory of the Apache SVN to the svn/dev directory under dist in the root directory of the Apache HertzBeat project +svn co https://dist.apache.org/repos/dist/dev/incubator/hertzbeat svn/dev + +svn co --depth empty https://dist.apache.org/repos/dist/dev/incubator/hertzbeat +``` + +- Copy the material package to the dev directory + +Create a version number directory and name it in the form of ${release_version}-${RC_version}. RC_version starts from 1, that is, the candidate version starts from RC1. During the release process, there is a problem that causes the vote to fail. If it needs to be corrected, it needs to iterate the RC version , the RC version number needs to be +1. For example: Vote for version 1.6.0-RC1. If the vote passes without any problems, the RC1 version material will be released as the final version material. If there is a problem (when the hertzbeat/incubator community votes, the voters will strictly check various release requirements and compliance issues) and need to be corrected, then re-initiate the vote after the correction, and the candidate version for the next vote is 1.6.0- RC2. + +```shell +mkdir -p svn/dev/1.6.0-RC1 +cp -f dist/* svn/dev/1.6.0-RC1 +``` + +- Commit to SVN + +```shell +cd svn/dev + +# 1.check svn status +svn status + +# 2. add to svn +svn add 1.6.0-RC1 + +svn status + +# 3. Submit to svn remote server +svn commit -m "release for HertzBeat 1.6.0" +``` + +- Check Apache SVN Commit Results + +> Visit the address https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1/ in the browser, check if existed the new material package + + +## 4. Enter the community voting stage + +#### 4.1 Send a Community Vote Email + +Send a voting email in the community requires at least three `+1` and no `-1`. + +> `Send to`: dev@hertzbeat.apache.org
+> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0 rc1
+> `Body`: + +``` +Hello HertzBeat Community: + +This is a call for vote to release Apache HertzBeat (incubating) version release-1.6.0-RC1. + +Apache HertzBeat - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +Release notes: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0-rc1 + +The release candidates: +https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1/ + +Git tag for the release: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0-rc1 + +The artifacts signed with PGP key [33545C76], corresponding to [muchunjin@apache.org], that can be found in keys file: +https://downloads.apache.org/incubator/hertzbeat/KEYS + +The vote will be open for at least 72 hours or until the necessary number of votes are reached. + +Please vote accordingly: + +[ ] +1 approve +[ ] +0 no opinion +[ ] -1 disapprove with the reason + +*Valid check is a requirement for a vote. *Checklist for reference: + +[ ] Download HertzBeat are valid. +[ ] Checksums and PGP signatures are valid. +[ ] Source code distributions have correct names matching the current +release. +[ ] LICENSE and NOTICE files are correct for each HertzBeat repo. +[ ] All files have license headers if necessary. +[ ] No compiled archives bundled in source archive. +[ ] Can compile from source. + +More detail checklist please refer: +https://cwiki.apache.org/confluence/display/INCUBATOR/Incubator+Release+Checklist + +Steps to validate the release,Please refer to: +https://hertzbeat.apache.org/docs/community/how_to_verify_release + +How to Build: +https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package + +Thanks! +``` + +After 72 hours, the voting results will be counted, and the voting result email will be sent, as follows. + +> `Send to`: dev@hertzbeat.apache.org
+> `Title`: [RESULT][VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
+> `Body`: + +``` +Dear HertzBeat community, + +Thanks for your review and vote for "Release Apache HertzBeat (incubating) 1.6.0-rc1" +I'm happy to announce the vote has passed: + + +4 binding +1, from: + +- cc + +1 non-binding +1, from: + +- Roc Marshal + + +no 0 or -1 votes. + +Vote thread: +https://lists.apache.org/thread/t01b2lbtqzyt7j4dsbdp5qjc3gngjsdq + + +Thank you to everyone who helped us to verify and vote for this release. We will move to the ASF Incubator voting shortly. + + +Best, +ChunJin Mu +``` + +One item of the email content is `Vote thread`, and the link is obtained here: https://lists.apache.org/list.html?dev@hertzbeat.apache.org + +#### 3.2 Send Incubator Community voting mail + +Send a voting email in the incubator community requires at least three `+1` and no `-1`. + +> `Send to`: general@incubator.apache.org
+> `cc`: dev@hertzbeat.apache.org、private@hertzbeat.apache.org
+> `Title`: [VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
+> `Body`: + +``` +Hello Incubator Community: + +This is a call for a vote to release Apache HertzBeat (incubating) version 1.6.0-RC1. +The Apache HertzBeat community has voted on and approved a proposal to release Apache HertzBeat (incubating) version 1.6.0-RC1. +We now kindly request the Incubator PMC members review and vote on this incubator release. +Apache HertzBeat, a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +HertzBeat community vote thread: +https://lists.apache.org/thread/t01b2lbtqzyt7j4dsbdp5qjc3gngjsdq + +Vote result thread: +https://lists.apache.org/thread/t5z58mvrs1drgzfyc48c9lhmd8skswn7 + +The release candidate: +https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1/ + +Git tag for the release: +https://github.com/apache/hertzbeat/releases/tag/v1.6.0-rc1 + +The artifacts signed with PGP key [33545C76], corresponding to [muchunjin@apache.org], that can be found in keys file: +https://downloads.apache.org/incubator/hertzbeat/KEYS + +The vote will be open for at least 72 hours or until the necessary number of votes are reached. + +Please vote accordingly: +[ ] +1 approve +[ ] +0 no opinion +[ ] -1 disapprove with the reason + +More detailed checklist please refer: +• https://cwiki.apache.org/confluence/display/INCUBATOR/Incubator+Release+Checklist + +Steps to validate the release, Please refer to: +• https://www.apache.org/info/verification.html +• https://hertzbeat.apache.org/docs/community/how_to_verify_release + + +How to Build: +https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package + + +Thanks, + +On behalf of Apache HertzBeat (incubating) community + + +Best, +ChunJin Mu +``` + +If there is no -1 after 72 hours, reply to the email as follows + +> `Send to`: general@incubator.apache.org
+> `Body`: + +``` +Thanks everyone for review and vote, 72H passed. I'll announce the vote result soon. + +Best, +Chunjin Mu +``` + +Then the voting results will be counted, and the voting result email will be sent, as follows. + +> `Send to`: general@incubator.apache.org
+> `Title`: [RESULT][VOTE] Release Apache HertzBeat (incubating) 1.6.0-rc1
+> `Body`: + +``` +Hi Incubator Community, + +The vote to release Apache HertzBeat (incubating) 1.6.0-rc4 has passed with 3 +1 binding and no +0 or -1 votes. + +3 binding votes, no +0 or -1 votes. + ++3 (binding) +1, from: +- xxx + +no 0 or -1 votes. + +Vote thread: + +https://lists.apache.org/thread/m1kyn4l30y55p6q39m0ys5djvdd73h0f + +Thanks everyone for your feedback and help with HertzBeat apache release. The HertzBeat team will take the steps to complete this release and will announce it soon. + +Best, +ChunJin Mu +``` + +One item of the email content is `Vote thread`, and the link is obtained here: https://lists.apache.org/list.html?general@incubator.apache.org + +Wait a day to see if the tutor has any other comments, if not, send the following announcement email + +## 4. Complete the final publishing steps + +#### 4.1 Migrating source and binary packages + +```shell +svn mv https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/1.6.0-RC1 https://dist.apache.org/repos/dist/release/incubator/hertzbeat/1.6.0 -m "transfer packages for 1.6.0-RC1" +``` + +#### 4.2 Add the new version download address to the official website + +https://github.com/apache/hertzbeat/blob/master/home/docs/download.md +https://github.com/apache/hertzbeat/blob/master/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/download.md + + +Open the official website address https://hertzbeat.apache.org/docs/download/ to see if there is a new version of the download +> It should be noted that the download link may take effect after an hour, so please pay attention to it. + + +#### 4.3 Generate a release on github + +Update pre-release to create a tag named v1.6.0 based on the release-1.6.0-rc1 branch, and set this tag to latest release. + +:::tip +You can modify it on the original RC Release without creating a new Release. +::: + +Then enter Release Title and Describe +- Release Title: +``` +v1.6.0 +``` +- Describe: +``` +xxx +release note: xxx +``` + +Then click the `Publish release` button. + +The rename the release-1.6.0-rc1 branch to release-1.6.0. + +#### 4.5 Send new version announcement email + +> `Send to`: general@incubator.apache.org
+> `cc`: dev@hertzbeat.apache.org
+> `Title`: [ANNOUNCE] Release Apache HertzBeat (incubating) 1.6.0
+> `Body`: + +``` +Hi Incubator Community, + +We are glad to announce the release of Apache HertzBeat (incubating) 1.6.0. +Once again I would like to express my thanks to your help. + +Apache HertzBeat(https://hertzbeat.apache.org/) - a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +Download Links: https://hertzbeat.apache.org/download/ + +Release Notes: https://github.com/apache/hertzbeat/releases/tag/v1.6.0 + +HertzBeat Resources: +- Issue: https://github.com/apache/hertzbeat/issues +- Mailing list: dev@hertzbeat.apache.org + + +Apache HertzBeat Team + +Best, +ChunJin Mu +``` + +This version release is over. + +--- + +This doc refer from [Apache StreamPark](https://streampark.apache.org/) diff --git a/home/versioned_docs/version-v1.5.x/community/how-to-verify.md b/home/versioned_docs/version-v1.5.x/community/how-to-verify.md new file mode 100644 index 00000000000..41c3341b59e --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/how-to-verify.md @@ -0,0 +1,206 @@ +--- +id: how_to_verify_release +title: How to Verify Release +sidebar_position: 4 +--- + +# Verify the candidate version + +For detailed check list, please refer to the official [check list](https://cwiki.apache.org/confluence/display/INCUBATOR/Incubator+Release+Checklist) + +Version content accessible in browser https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/ + +## 1. Download the candidate version + +Download the candidate version to be released to the local environment Need to rely on gpg tool, if not, it is recommended to install `gpg2`. + +:::caution + +If the network is poor, downloading may be time-consuming. The download is completed normally in about 20 minutes, please wait patiently. + +::: + +```shell +#If there is svn locally, you can clone to the local +$ svn co https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/${release_version}-${rc_version}/ +#or download the material file directly +$ wget https://dist.apache.org/repos/dist/dev/incubator/hertzbeat/${release_version}-${rc_version}/xxx.xxx +``` + +## 2. Verify that the uploaded version is compliant + +Start the verification process, which includes but is not limited to the following content and forms. + +### 2.1 Check whether the release package is complete + +The package uploaded to dist must include the source code package, and the binary package is optional. + +1. Whether to include the source code package +2. Whether to include the signature of the source code package +3. Whether to include the sha512 of the source code package +4. If the binary package is uploaded, also check the contents listed in (2)-(4) + + +### 2.2 Check gpg signature + +First import the publisher's public key. Import KEYS from the svn repository to the local environment. (The person who releases the version does not need to import it again, the person who helps to do the verification needs to import it, and the user name is enough for the person who issued the version) + +#### 2.2.1 Import public key + +```shell +$ curl https://downloads.apache.org/incubator/hertzbeat/KEYS > KEYS # Download KEYS +$ gpg --import KEYS # Import KEYS to local +``` +#### 2.2.2 Trust the public key + +Trust the KEY used in this version: + +```shell +$ gpg --edit-key xxxxxxxxxx #KEY user used in this version +gpg (GnuPG) 2.2.21; Copyright (C) 2020 Free Software Foundation, Inc. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. + +Secret key is available. +gpg> trust #trust +Please decide how far you trust this user to correctly verify other users' keys +(by looking at passports, checking fingerprints from different sources, etc.) + + 1 = I don't know or won't say + 2 = I do NOT trust + 3 = I trust marginally + 4 = I trust fully + 5 = I trust ultimately + m = back to the main menu + +Your decision? 5 #choose 5 +Do you really want to set this key to ultimate trust? (y/N) y #choose y + +gpg> + +``` + +#### 2.2.3 Check the gpg signature + +```shell +$ for i in *.tar.gz; do echo $i; gpg --verify $i.asc $i; done +``` + +check result + +> If something like the following appears, it means the signature is correct. Keyword: **`Good signature`** + +```shell +apache-hertzbeat-xxx-incubating-src.tar.gz +gpg: Signature made XXXX +gpg: using RSA key XXXXX +gpg: Good signature from "xxx @apache.org>" +``` + +### 2.3 Check sha512 hash + +```shell +$ for i in *.tar.gz; do echo $i; sha512sum --check $i.sha512; done +``` + +### 2.4 Check the binary package + +unzip `apache-hertzbeat-${release.version}-incubating-bin.tar.gz` + +```shell +tar -xzvf apache-hertzbeat-${release.version}-incubating-bin.tar.gz +``` + +check as follows: + +- [ ] Check whether the source package contains unnecessary files, which makes the tar package too large +- [ ] Folder contains the word `incubating` +- [ ] There are `LICENSE` and `NOTICE` files +- [ ] There is a `DISCLAIMER` or `DISCLAIMER-WIP` file +- [ ] The year in the `NOTICE` file is correct +- [ ] Only text files exist, not binary files +- [ ] All files have ASF license at the beginning +- [ ] Able to compile correctly +- [ ] ..... + + + +### 2.5 Check the source package + +> If the binary/web-binary package is uploaded, check the binary package. + +Unzip `apache-hertzbeat-${release_version}-incubating-src.tar.gz` + +```shell +cd apache-hertzbeat-${release_version}-incubating-src +``` + +compile the source code: [Build HertzBeat Binary Package](https://hertzbeat.apache.org/docs/community/development/#build-hertzbeat-binary-package) + +and check as follows: + +- [ ] There are `LICENSE` and `NOTICE` files +- [ ] There is a `DISCLAIMER` or `DISCLAIMER-WIP` file +- [ ] The year in the `NOTICE` file is correct +- [ ] All text files have ASF license at the beginning +- [ ] Check the third-party dependent license: +- [ ] Compatible with third-party dependent licenses +- [ ] All third-party dependent licenses are named in the `LICENSE` file +- [ ] If you are relying on the Apache license and there is a `NOTICE` file, then these `NOTICE` files also need to be added to the version of the `NOTICE` file +- [ ] ..... + +You can refer to this article: [ASF Third Party License Policy](https://apache.org/legal/resolved.html) + + +## 3. Email reply + +If you initiate a posting vote, you can refer to this response example to reply to the email after verification + +When replying to the email, you must bring the information that you have checked by yourself. Simply replying to `+1 approve` is invalid. + +When PPMC votes in the dev@hertzbeat.apache.org hertzbeat community, Please bring the binding suffix to indicate that it has a binding vote for the vote in the hertzbeat community, and it is convenient to count the voting results. + +When IPMC votes in the general@incubator.apache.org incubator community. Please bring the binding suffix to indicate that the voting in the incubator community has a binding vote, which is convenient for counting the voting results. + + +:::caution +If you have already voted on dev@hertzbeat.apache.org, you can take it directly to the incubator community when you reply to the vote, such as: + +```html +//Incubator community voting, only IPMC members have binding binding,PPMC needs to be aware of binding changes +Forward my +1 from dev@listhertzbeatnkis (non-binding) +Copy my +1 from hertzbeat DEV ML (non-binding) +```` +::: + + +Non-PPMC/Non-IPMC member: + +```text ++1 (non-binding) +I checked: + 1. All download links are valid + 2. Checksum and signature are OK + 3. LICENSE and NOTICE are exist + 4. Build successfully on macOS(Big Sur) + 5. +```` + +PPMC/IPMC member: + +```text +//Incubator community voting, only IPMC members have binding binding ++1 (binding) +I checked: + 1. All download links are valid + 2. Checksum and signature are OK + 3. LICENSE and NOTICE are exist + 4. Build successfully on macOS(Big Sur) + 5. +```` + + + +--- + +This doc refer from [Apache StreamPark](https://streampark.apache.org/) diff --git a/home/versioned_docs/version-v1.5.x/community/mailing_lists.md b/home/versioned_docs/version-v1.5.x/community/mailing_lists.md new file mode 100644 index 00000000000..fed6e3928ee --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/mailing_lists.md @@ -0,0 +1,62 @@ +--- +id: 'mailing_lists' +title: 'Mailing Lists' +sidebar_position: 1 +--- + + + +The [Developer Mailing List](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) is the community-recommended way to communicate and obtain the latest information. + +Before you post anything to the mailing lists, be sure that you already **subscribe** to them. + +## Usages + +### Developer List + +- Use this list for your HertzBeat questions +- Used by HertzBeat contributors to discuss development of HertzBeat + + +| List Name | Address | Subscribe | Unsubscribe | Archive | +|---------------------|------------------------------|------------------------------------------------------------|----------------------------------------------------------------|----------------------------------------------------------------------------| +| **Developer List** | dev@hertzbeat.apache.org | [subscribe](mailto:dev-subscribe@hertzbeat.apache.org) | [unsubscribe](mailto:dev-unsubscribe@hertzbeat.apache.org) | [archive](https://lists.apache.org/list.html?dev@hertzbeat.apache.org) | + +### Notification List + +- Notifications on changes to the HertzBeat codebase + +| List Name | Address | Subscribe | Unsubscribe | Archive | +|-------------------------|------------------------------------|------------------------------------------------------------------|----------------------------------------------------------------------|----------------------------------------------------------------------------------| +| **Notification List** | notifications@hertzbeat.apache.org | [subscribe](mailto:notifications-subscribe@hertzbeat.apache.org) | [unsubscribe](mailto:notifications-unsubscribe@hertzbeat.apache.org) | [archive](https://lists.apache.org/list.html?notifications@hertzbeat.apache.org) | + +## Steps for Subscription + +Sending a subscription email is also very simple. The steps are as follows: + +- 1、**Subscribe**: Click the **subscribe** button in the above table, and it redirects to your mail client. The subject and content are arbitrary. + After that, you will receive a confirmation email from dev-help@hertzbeat.apache.org (if not received, please confirm whether the email is automatically classified as SPAM, promotion email, subscription email, etc.). +- 2、**Confirm**: Reply directly to the confirmation email, or click on the link in the email to reply quickly. The subject and content are arbitrary. +- 3、**Welcome**: After completing the above steps, you will receive a welcome email with the subject WELCOME to dev@hertzbeat.apache.org, and you have successfully subscribed to the Apache HertzBeat mailing list. + +## Post Plain Text Mails + +When posting to the mailing lists, please use plain text emails. +**Do not use HTML emails**. +HTML emails are more likely to be targeted as spam mails and rejected. +It may get malformed through different mail clients and not easily readable by others. diff --git a/home/versioned_docs/version-v1.5.x/community/new_committer_process.md b/home/versioned_docs/version-v1.5.x/community/new_committer_process.md new file mode 100644 index 00000000000..b72ec6e30b7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/new_committer_process.md @@ -0,0 +1,245 @@ +--- +id: 'new_committer_process' +title: 'New Committer Process' +sidebar_position: 4 +--- + + + +[Apache New Committer Guideline](https://community.apache.org/newcommitter.html#new-committer-process) + +## The process of new Committer + +- Call a vote in mailing `private@hertzbeat.apache.org` + + see **Committer Vote Template** + +- Close the vote + + see **Close Vote Template** + +- If the result is positive, invite the new committer + + see **Committer Invite Template** + +- If accepted, then: Accept the committer + + see **Committer Accept Template** + +- New Committer sign CLA and wait for CLA is recorded + +- Request creation of the committer account + + see **Committer Account Creation** + + - Wait until root says it is done + - PMC Chair enables svn and other access + - Add committer to the appropriate groups in JIRA and CWiki + +- Notify the committer of completion + + see **Committer Done Template** + +## Template + +Note that, there are three placeholder in template should be replaced before using + +- NEW_COMMITTER_NAME +- NEW_COMMITTER_EMAIL +- NEW_COMMITTER_APACHE_NAME + +### Committer Vote Template + +```text +To: private@hertzbeat.apache.org +Subject: [VOTE] New committer: ${NEW_COMMITTER_NAME} +``` + +```text +Hi HertzBeat PPMC, + +This is a formal vote about inviting ${NEW_COMMITTER_NAME} as our new committer. + +${Work list}[1] + +[1] https://github.com/apache/hertzbeat/commits?author=${NEW_COMMITTER_NAME} +``` + +Note that, Voting ends one week from today, i.e. +[midnight UTC on YYYY-MM-DD](https://www.timeanddate.com/counters/customcounter.html?year=YYYY&month=MM&day=DD) +[Apache Voting Guidelines](https://community.apache.org/newcommitter.html) + +### Close Vote Template + +```text +To: private@hertzbeat.apache.org +Subject: [RESULT] [VOTE] New committer: ${NEW_COMMITTER_NAME} +``` + +```text +Hi HertzBeat PPMC, + +The vote has now closed. The results are: + +Binding Votes: + ++1 [TOTAL BINDING +1 VOTES] + 0 [TOTAL BINDING +0/-0 VOTES] +-1 [TOTAL BINDING -1 VOTES] + +The vote is ***successful/not successful*** +``` + +### Committer Invite Template + +```text +To: ${NEW_COMMITTER_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Invitation to become HertzBeat committer: ${NEW_COMMITTER_NAME} +``` + +```text +Hello ${NEW_COMMITTER_NAME}, + +The HertzBeat Project Management Committee (PMC) +hereby offers you committer privileges to the project. +These privileges are offered on the understanding that +you'll use them reasonably and with common sense. +We like to work on trust rather than unnecessary constraints. + +Being a committer enables you to more easily make +changes without needing to go through the patch +submission process. + +Being a committer does not require you to +participate any more than you already do. It does +tend to make one even more committed. You will +probably find that you spend more time here. + +Of course, you can decline and instead remain as a +contributor, participating as you do now. + +A. This personal invitation is a chance for you to +accept or decline in private. Either way, please +let us know in reply to the private@hertzbeat.apache.org +address only. + +B. If you accept, the next step is to register an iCLA: + 1. Details of the iCLA and the forms are found + through this link: https://www.apache.org/licenses/#clas + + 2. Instructions for its completion and return to + the Secretary of the ASF are found at + https://www.apache.org/licenses/#submitting + + 3. When you transmit the completed iCLA, request + to notify the Apache HertzBeat and choose a + unique Apache ID. Look to see if your preferred + ID is already taken at + https://people.apache.org/committer-index.html + This will allow the Secretary to notify the PMC + when your iCLA has been recorded. + +When recording of your iCLA is noted, you will +receive a follow-up message with the next steps for +establishing you as a committer. +``` + +### Committer Accept Template + +```text +To: ${NEW_COMMITTER_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Re: invitation to become HertzBeat committer +``` + +```text +Welcome. Here are the next steps in becoming a project committer. After that +we will make an announcement to the dev@hertzbeat.apache.org list. + +You need to send a Contributor License Agreement to the ASF. +Normally you would send an Individual CLA. If you also make +contributions done in work time or using work resources, +see the Corporate CLA. Ask us if you have any issues. +https://www.apache.org/licenses/#clas. + +You need to choose a preferred ASF user name and alternatives. +In order to ensure it is available you can view a list of taken IDs at +https://people.apache.org/committer-index.html + +Please notify us when you have submitted the CLA and by what means +you did so. This will enable us to monitor its progress. + +We will arrange for your Apache user account when the CLA has +been recorded. + +After that is done, please make followup replies to the dev@hertzbeat.apache.org list. +We generally discuss everything there and keep the +private@hertzbeat.apache.org list for occasional matters which must be private. + +The developer section of the website describes roles within the ASF and provides other +resources: + https://www.apache.org/foundation/how-it-works.html + https://www.apache.org/dev/ + +The incubator also has some useful information for new committers +in incubating projects: + https://incubator.apache.org/guides/committer.html + https://incubator.apache.org/guides/ppmc.html + +Just as before you became a committer, participation in any ASF community +requires adherence to the ASF Code of Conduct: + https://www.apache.org/foundation/policies/conduct.html + +Yours, +The Apache HertzBeat PPMC +``` + +### Committer Done Template + +```text +To: private@hertzbeat.apache.org, ${NEW_COMMITTER_EMAIL} +Subject: account request: ${NEW_COMMITTER_NAME} +``` + +```text +${NEW_COMMITTER_NAME}, as you know, the ASF Infrastructure has set up your +committer account with the username '${NEW_COMMITTER_APACHE_NAME}'. + +Please follow the instructions to set up your SSH, +svn password, svn configuration, email forwarding, etc. +https://www.apache.org/dev/#committers + +You have commit access to specific sections of the +ASF repository, as follows: + +The general "committers" at: + https://svn.apache.org/repos/private/committers + +If you have any questions during this phase, then please +see the following resources: + +Apache developer's pages: https://www.apache.org/dev/ +Incubator committer guide: https://incubator.apache.org/guides/committer.html + +Naturally, if you don't understand anything be sure to ask us on the dev@hertzbeat.apache.org mailing list. +Documentation is maintained by volunteers and hence can be out-of-date and incomplete - of course +you can now help fix that. + +A PPMC member will announce your election to the dev list soon. +``` diff --git a/home/versioned_docs/version-v1.5.x/community/new_pmc_member_process.md b/home/versioned_docs/version-v1.5.x/community/new_pmc_member_process.md new file mode 100644 index 00000000000..ebc84b92d67 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/new_pmc_member_process.md @@ -0,0 +1,285 @@ +--- +id: 'new_pmc_ember_process' +title: 'New PMC Member Process' +sidebar_position: 5 +--- + + + +[Apache New Committer Guideline](https://community.apache.org/newcommitter.html#new-committer-process) + +## The process of new PMC member + +- Call a vote in mailing `private@hertzbeat.apache.org` + + see **PMC Member Vote Template** + +- Close the vote + + see **Close Vote Template** + +- Board Approval of new PMC member + + see **Board Approval of new PMC member** + +- If the result is positive, invite the new PMC member + + see **PMC member Invite Template** + +- If accept, then: Accept the PMC member + + see **PMC Member Accept Template** + +- Notify the PMC member of completion + + see **PMC Member Done Template** + +- Announce the new PMC member + + see **PMC Member Announce Template** + +## Template + +Note that, there are three placeholder in template should be replaced before using + +- NEW_PMC_NAME +- NEW_PMC_EMAIL +- NEW_PMC_APACHE_NAME + +### PMC Member Vote Template + +```text +To: private@hertzbeat.apache.org +Subject: [VOTE] New PMC member candidate: ${NEW_PMC_NAME} +``` + +```text +Hi HertzBeat PPMC, + +This is a formal vote about inviting ${NEW_PMC_NAME} as our new PMC member. + +${Work list}[1] + +[1] https://github.com/apache/hertzbeat/commits?author=${NEW_PMC_NAME} +``` + +Note that, Voting ends one week from today, i.e. [midnight UTC on YYYY-MM-DD](https://www.timeanddate.com/counters/customcounter.html?year=YYYY&month=MM&day=DD) +[Apache Voting Guidelines](https://community.apache.org/newcommitter.html) + + +### Close Vote Template + +```text +To: private@hertzbeat.apache.org +Subject: [RESULT] [VOTE] New PMC member: ${NEW_PMC_NAME} +``` + +```text +Hi HertzBeat PPMC, + +The vote has now closed. The results are: + +Binding Votes: + ++1 [TOTAL BINDING +1 VOTES] + 0 [TOTAL BINDING +0/-0 VOTES] +-1 [TOTAL BINDING -1 VOTES] + +The vote is ***successful/not successful*** +``` + +### Board Approval of new PMC member Template + +```text +To: board@apache.org +Cc: private@.apache.org +Subject: [NOTICE] ${NEW_PMC_NAME} for HertzBeat PMC member +``` + +```text +HertzBeat proposes to invite ${NEW_PMC_NAME} to join the PMC. + +The vote result is available here: https://lists.apache.org/... +``` + +[Apache New Pmc Guide](https://www.apache.org/dev/pmc.html#newpmc) + +### PMC Member Invite Template + +```text +To: ${NEW_PMC_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Invitation to become HertzBeat PMC member: ${NEW_PMC_NAME} +``` + +```text +Hello ${NEW_PMC_NAME}, + +The HertzBeat Project Management Committee (PMC) +hereby offers you committer privileges to the project +as well as membership in the PMC. +These privileges are offered on the understanding that +you'll use them reasonably and with common sense. +We like to work on trust rather than unnecessary constraints. + +Being a PMC member enables you to guide the direction of the project. + +Being a PMC member does not require you to +participate any more than you already do. It does +tend to make one even more committed. You will +probably find that you spend more time here. + +Of course, you can decline and instead remain as a +contributor, participating as you do now. + +A. This personal invitation is a chance for you to +accept or decline in private. Either way, please +let us know in reply to the private@hertzbeat.apache.org +address only. + +B. If you accept, the next step is to register an iCLA: + 1. Details of the iCLA and the forms are found + through this link: https://www.apache.org/licenses/#clas + + 2. Instructions for its completion and return to + the Secretary of the ASF are found at + https://www.apache.org/licenses/#submitting + + 3. When you transmit the completed iCLA, request + to notify the Apache HertzBeat and choose a + unique Apache ID. Look to see if your preferred + ID is already taken at + https://people.apache.org/committer-index.html + This will allow the Secretary to notify the PMC + when your iCLA has been recorded. + +When recording of your iCLA is noted, you will +receive a follow-up message with the next steps for +establishing you as a PMC member. +``` + +### PMC Member Accept Template + +```text +To: ${NEW_PMC_EMAIL} +Cc: private@hertzbeat.apache.org +Subject: Re: invitation to become HertzBeat PMC member +``` + +```text +Welcome. Here are the next steps in becoming a project PMC. After that +we will make an announcement to the dev@hertzbeat.apache.org list. + +You need to send a Contributor License Agreement to the ASF. +Normally you would send an Individual CLA. If you also make +contributions done in work time or using work resources, +see the Corporate CLA. Ask us if you have any issues. +https://www.apache.org/licenses/#clas. + +You need to choose a preferred ASF user name and alternatives. +In order to ensure it is available you can view a list of taken IDs at +https://people.apache.org/committer-index.html + +Please notify us when you have submitted the CLA and by what means +you did so. This will enable us to monitor its progress. + +We will arrange for your Apache user account when the CLA has +been recorded. + +After that is done, please make followup replies to the dev@hertzbeat.apache.org list. +We generally discuss everything there and keep the +private@hertzbeat.apache.org list for occasional matters which must be private. + +The developer section of the website describes roles within the ASF and provides other +resources: + https://www.apache.org/foundation/how-it-works.html + https://www.apache.org/dev/ + +The incubator also has some useful information for new PMC +in incubating projects: + https://incubator.apache.org/guides/committer.html + https://incubator.apache.org/guides/ppmc.html + +Just as before you became a PMC member, participation in any ASF community +requires adherence to the ASF Code of Conduct: + https://www.apache.org/foundation/policies/conduct.html + +Yours, +The Apache HertzBeat PPMC +``` + +### PMC Member Done Template + +```text +To: private@hertzbeat.apache.org, ${NEW_PMC_EMAIL} +Subject: account request: ${NEW_PMC_NAME} +``` + +```text +${NEW_PMC_EMAIL}, as you know, the ASF Infrastructure has set up your +committer account with the username '${NEW_PMC_APACHE_NAME}'. + +Please follow the instructions to set up your SSH, +svn password, svn configuration, email forwarding, etc. +https://www.apache.org/dev/#committers + +You have commit access to specific sections of the +ASF repository, as follows: + +The general "committers" at: + https://svn.apache.org/repos/private/committers + +If you have any questions during this phase, then please +see the following resources: + +Apache developer's pages: https://www.apache.org/dev/ +Incubator committer guide: https://incubator.apache.org/guides/committer.html + +Naturally, if you don't understand anything be sure to ask us on the dev@hertzbeat.apache.org mailing list. +Documentation is maintained by volunteers and hence can be out-of-date and incomplete - of course +you can now help fix that. + +A PPMC member will announce your election to the dev list soon. +``` + +### PMC Member Announce Template + +```text +To: dev@hertzbeat.apache.org +[ANNONCE] New PMC member: ${NEW_PMC_NAME} +``` + +```text +Hi HertzBeat Community, + +The Podling Project Management Committee (PPMC) for Apache HertzBeat +has invited ${NEW_PMC_NAME} to become our PMC member and +we are pleased to announce that he has accepted. + +### add specific details here ### + +Please join me in congratulating ${NEW_PMC_NAME}! + +Being a committer enables easier contribution to the +project since there is no need to go via the patch +submission process. This should enable better productivity. +A PPMC member helps manage and guide the direction of the project. + +Thanks, +On behalf of the Apache HertzBeat (incubating) PPMC +``` diff --git a/home/versioned_docs/version-v1.5.x/community/submit-code.md b/home/versioned_docs/version-v1.5.x/community/submit-code.md new file mode 100644 index 00000000000..dfea1601d87 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/community/submit-code.md @@ -0,0 +1,76 @@ +--- +id: 'submit_code' +title: 'Submit Code' +sidebar_position: 2 +--- + + + +* First from the remote repository fork a copy of the code into your own repository + +* The remote dev and merge branch is `master`. + +* Clone your repository to your local + +```shell + git clone git@github.com:/hertzbeat.git +``` + +* Add remote repository address, named upstream + +```shell + git remote add upstream git@github.com:apache/hertzbeat.git +``` + +* View repository + +```shell + git remote -v +``` + + > At this time, there will be two repositories: origin (your own repository) and upstream (remote repository) + +* Get/Update remote repository code + + ```shell + git fetch upstream + ``` + +* Synchronize remote repository code to local repository + + ```shell + git checkout origin/dev + git merge --no-ff upstream/dev + ``` + +* **⚠️Note that you must create a new branch to develop features `git checkout -b feature-xxx`. It is not recommended to use the master branch for direct development** + +* After modifying the code locally, submit it to your own repository: + **Note that the submission information does not contain special characters** + ```shell + git commit -m 'commit content' + git push + ``` + +* Submit changes to the remote repository, you can see a green button "Compare & pull request" on your repository page, click it. + +* Select the modified local branch and the branch you want to merge with the past, you need input the message carefully, describe doc is important as code, click "Create pull request". + +* Then the community Committers will do CodeReview, and then he will discuss some details (design, implementation, performance, etc.) with you, afterward you can directly update the code in this branch according to the suggestions (no need to create a new PR). When this pr is approved, the commit will be merged into the master branch + +* Finally, congratulations, you have become an official contributor to HertzBeat ! You will be added to the contributor wall, you can contact the community to obtain a contributor certificate. diff --git a/home/versioned_docs/version-v1.5.x/download.md b/home/versioned_docs/version-v1.5.x/download.md new file mode 100644 index 00000000000..2c0df07bb7c --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/download.md @@ -0,0 +1,36 @@ +--- +id: download +title: Download Apache HertzBeat (incubating) +sidebar_label: Download +--- + +> **Here is the Apache HertzBeat (incubating) official download page.** +> **Please choose version to download from the following tables. It is recommended use the latest.** + +:::tip +- Please verify the release with corresponding hashes(sha512), signatures and [project release KEYS](https://downloads.apache.org/incubator/hertzbeat/KEYS). +- Refer to [How to Verify](https://www.apache.org/dyn/closer.cgi#verify) for how to check the hashes and signatures. +::: + +## The Latest Release + +:::tip +Previous releases of HertzBeat may be affected by security issues, please use the latest one. +::: + + +| Version | Date | Download | Release Notes | +|---------|------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------| +| v1.6.0 | 2024.06.10 | [apache-hertzbeat-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-collector-1.6.0-incubating-bin.tar.gz.sha512) )
[apache-hertzbeat-1.6.0-incubating-src.tar.gz](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz) ( [signature](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.asc) , [sha512](https://downloads.apache.org/incubator/hertzbeat/1.6.0/apache-hertzbeat-1.6.0-incubating-src.tar.gz.sha512) ) | [release note](https://github.com/apache/hertzbeat/releases/tag/v1.6.0) | + + +## All Archived Releases + +For older releases, please check the [archive](https://archive.apache.org/dist/incubator/hertzbeat/). + +## Release Docker Image + +> Apache HertzBeat provides a docker image for each release. You can pull the image from the [Docker Hub](https://hub.docker.com/r/apache/hertzbeat). + +- HertzBeat https://hub.docker.com/r/apache/hertzbeat +- HertzBeat Collector https://hub.docker.com/r/apache/hertzbeat-collector diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/activemq.md b/home/versioned_docs/version-v1.5.x/help/activemq.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/activemq.md rename to home/versioned_docs/version-v1.5.x/help/activemq.md diff --git a/home/versioned_docs/version-v1.5.x/help/airflow.md b/home/versioned_docs/version-v1.5.x/help/airflow.md new file mode 100644 index 00000000000..5323ede8110 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/airflow.md @@ -0,0 +1,41 @@ +--- +id: airflow +title: 监控:Apache Airflow监控 +sidebar_label: Apache Airflow +keywords: [开源监控系统, 开源数据库监控, Apache Airflow监控] +--- + +> 对Apache Airflow通用性能指标进行采集监控。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------ | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性 | +| 端口 | 数据库对外提供的端口,默认为8080 | +| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认3000毫秒 | +| HTTPS | 是否启用HTTPS | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:airflow_health + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ------------ | -------- | -------------------- | +| metadatabase | 无 | metadatabase健康情况 | +| scheduler | 无 | scheduler健康情况 | +| triggerer | 无 | triggerer健康情况 | + +#### 指标集合:airflow_version + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | -------- | --------------- | +| value | 无 | Airflow版本 | +| git_version | 无 | Airflow git版本 | + + + diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_console.md b/home/versioned_docs/version-v1.5.x/help/alert_console.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_console.md rename to home/versioned_docs/version-v1.5.x/help/alert_console.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_dingtalk.md b/home/versioned_docs/version-v1.5.x/help/alert_dingtalk.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_dingtalk.md rename to home/versioned_docs/version-v1.5.x/help/alert_dingtalk.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_discord.md b/home/versioned_docs/version-v1.5.x/help/alert_discord.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_discord.md rename to home/versioned_docs/version-v1.5.x/help/alert_discord.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_email.md b/home/versioned_docs/version-v1.5.x/help/alert_email.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_email.md rename to home/versioned_docs/version-v1.5.x/help/alert_email.md diff --git a/home/versioned_docs/version-v1.5.x/help/alert_enterprise_wechat_app.md b/home/versioned_docs/version-v1.5.x/help/alert_enterprise_wechat_app.md new file mode 100644 index 00000000000..f9e072e436a --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/alert_enterprise_wechat_app.md @@ -0,0 +1,34 @@ +--- +id: alert_enterprise_wechat_app +title: Alert Enterprise Wechat App notification +sidebar_label: Alert Enterprise Wechat App notification +keywords: [open source monitoring tool, open source alerter, open source Enterprise Wechat App notification] +--- + +> After the threshold is triggered send alarm information and notify the recipient by enterprise WeChat App. + +### Operation steps + +1. **【Enterprise Wechat backstage】-> 【App Management】-> 【Create an app】-> 【Set App message】->【Copy AgentId and Secret adding successfully】** + +![email](/img/docs/help/alert-wechat-1.jpg) + +2. **【Alarm notification】->【Add new recipient】 ->【Select Enterprise WeChat App notification method】->【Set Enterprise WeChat ID,Enterprise App ID and Enterprise App Secret 】-> 【Confirm】** + +![email](/img/docs/help/alert-wechat-2.jpg) + +3. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】** + +> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.** + +![email](/img/docs/help/alert-wechat-3.jpg) + + +### Enterprise WeChat App common issues + +1. Enterprise WeChat App did not receive the alarm notification. +> Please check if the user has application permissions. +> Please check if the enterprise application callback address settings are normal. +> Please check if the server IP is on the enterprise application whitelist. + +Other issues can be fed back through the communication group ISSUE! diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_feishu.md b/home/versioned_docs/version-v1.5.x/help/alert_feishu.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_feishu.md rename to home/versioned_docs/version-v1.5.x/help/alert_feishu.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_slack.md b/home/versioned_docs/version-v1.5.x/help/alert_slack.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_slack.md rename to home/versioned_docs/version-v1.5.x/help/alert_slack.md diff --git a/home/versioned_docs/version-v1.5.x/help/alert_smn.md b/home/versioned_docs/version-v1.5.x/help/alert_smn.md new file mode 100644 index 00000000000..b4013b9f902 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/alert_smn.md @@ -0,0 +1,43 @@ +--- +id: alert_smn +title: Alert Huawei Cloud SMN Notifications +sidebar_label: Alert Huawei Cloud SMN Notifications +keywords: [ open source monitoring tool, open source alerter, open source Huawei Cloud SMN notification ] +--- + +> Send an alarm message after the threshold is triggered, and notify the recipient through the Huawei Cloud SMN. + +### 操作步骤 + +1. **According to [Huawei Cloud SMN Official Document](https://support.huaweicloud.com/qs-smn/smn_json.html) activate the SMN service and configure SMN** + +![alert-notice-10](/img/docs/help/alert-notice-10.png) + +2. **Save topic URN for SMN** + +![alert-notice-11](/img/docs/help/alert-notice-11.png) + +3. **According to [Huawei Cloud Signature Document](https://support.huaweicloud.com/devg-apisign/api-sign-provide.html) obtain AK, SK, and project ID** + +![alert-notice-12](/img/docs/help/alert-notice-12.png) + +![alert-notice-13](/img/docs/help/alert-notice-13.png) + +4. **【Alarm Notification】->【Add Recipient】->【Select Slack Webhook Notification Method】->【Set Huawei Cloud SMN AK, SK and other configurations】-> 【OK】** + +![alert-notice-14](/img/docs/help/alert-notice-14.png) + +5. **Configure the associated alarm notification strategy⚠️ [Add notification strategy] -> [Associate the recipient just set] -> [OK]** + +> **Note ⚠️ Adding a new recipient does not mean that it has taken effect and can receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, specify which messages are sent to which recipients**. + +![email](/img/docs/help/alert-notice-4.png) + +### Huawei Cloud SMN Notification FAQ + +1. Huawei Cloud SMN did not receive the robot warning notification + +> Please check whether the alarm information has been triggered in the alarm center +> Please check whether the Huawei Cloud SMN AK, SK and other configurations are configured correctly, and whether the alarm policy association has been configured + +Other questions can be fed back through the communication group ISSUE! diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_telegram.md b/home/versioned_docs/version-v1.5.x/help/alert_telegram.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_telegram.md rename to home/versioned_docs/version-v1.5.x/help/alert_telegram.md diff --git a/home/versioned_docs/version-v1.5.x/help/alert_threshold.md b/home/versioned_docs/version-v1.5.x/help/alert_threshold.md new file mode 100644 index 00000000000..0574b1924ba --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/alert_threshold.md @@ -0,0 +1,54 @@ +--- +id: alert_threshold +title: Threshold Alert Configuration +sidebar_label: Threshold Alert Configuration +--- +> Configure alert thresholds for monitoring metrics (warning alert, critical alert, emergency alert). The system triggers alerts based on threshold configuration and collected metric data. + +## Operational Steps + +### 1. Setting Labels for Monitoring Services (Optional) + +If you need to categorize alerts, you can set labels for the monitored targets. For example: If you have multiple Linux systems to monitor, and each system has different monitoring metrics, such as: Server A has available memory greater than 1G, Server B has available memory greater than 2G, then you can set labels for Server A and Server B respectively, and then configure alerts based on these labels. + +#### Creating Labels + +Navigate to **Label Management -> Add Label** + +![threshold](/img/docs/help/alert-threshold-2-en.png) + +As shown in the image above, add a new label. Here we set the label as: linux:dev (Linux used in development environment). + +#### Configuring Labels + +TODO Update image name +![threshold](/img/docs/help/alert-threshold-3-en.png) + +As shown in the image above, click on `Add Label`. + +![threshold](/img/docs/help/alert-threshold-4-en.png) + +Select our label, here demonstrated as selecting the `linux:dev` label. + +### Creating Threshold Rules + +Navigate to **[Threshold Rules] -> [Add Threshold Rule] -> [Confirm Configuration]** + +![threshold](/img/docs/help/alert-threshold-1-en.png) + +The above image explains the configuration details: + +- **Metric Object**: Select the monitoring metric object for which we need to configure the threshold. For example: Under website monitoring type -> under the summary metric set -> responseTime metric. +- **Threshold Rule**: Use this expression to calculate whether to trigger the threshold. Expression variables and operators are provided on the page for reference. For example: Set an alert to trigger if response time is greater than 50, the expression would be `responseTime > 50`. For detailed help on threshold expressions, see [Threshold Expression Help](alert_threshold_expr). +- **Alert Level**: The alert level triggered by the threshold, from low to high: warning, critical, emergency. +- **Trigger Count**: Set how many times the threshold must be triggered before the alert is actually triggered. +- **Notification Template**: The template for the notification message sent after the alert is triggered. Template variables are provided on the page. For example: `${app}.${metrics}.${metric} metric value is ${responseTime}, which is greater than 50 triggering the alert`. +- **Bind Label**: Select the label we need to apply. If no label is selected, it will apply to all services corresponding to the set metric object. +- **Apply Globally**: Set whether this threshold applies globally to all such metrics, default is no. After adding a threshold, it needs to be associated with the monitoring object for the threshold to take effect. +- **Recovery Notification**: Whether to send a recovery notification after the alert is triggered, default is not to send. +- **Enable Alert**: Enable or disable this alert threshold configuration. + +**The threshold alert configuration is complete, and alerts that have been successfully triggered can be viewed in the [Alert Center].** +**If you need to send alert notifications via email, WeChat, DingTalk, or Feishu, you can configure it in [Alert Notifications].** + +For other issues, you can provide feedback through the community chat group or issue tracker! diff --git a/home/versioned_docs/version-v1.5.x/help/alert_threshold_expr.md b/home/versioned_docs/version-v1.5.x/help/alert_threshold_expr.md new file mode 100644 index 00000000000..a7a7e6bdbe0 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/alert_threshold_expr.md @@ -0,0 +1,66 @@ +--- +id: alert_threshold_expr +title: Threshold Trigger Expression +sidebar_label: Threshold Trigger Expression +--- + +> When configuring threshold alerts, it is necessary to set up threshold trigger expressions. The system calculates whether to trigger an alert based on the expression and the monitored metric values. Here, we provide a detailed explanation of expression usage. + +#### Supported Operators in Expressions + +| Operator (Visual Configuration) | Operator (Expression Configuration) | Supported Types | Description | +| ------------------------------- | ----------------------------------- | ------------------------- | -------------------------- | +| Equals | equals(str1,str2) | String | Check if strings are equal | +| Not Equals | !equals(str1,str2) | String | Check if strings are not equal | +| Contains | contains(str1,str2) | String | Check if string contains | +| Not Contains | !contains(str1,str2) | String | Check if string does not contain | +| Matches | matches(str1,str2) | String | Check if string matches regex | +| Not Matches | !matches(str1,str2) | String | Check if string does not match regex | +| Exists | exists(obj) | String, Numeric, Time | Check if value exists | +| Not Exists | !exists(obj) | String, Numeric, Time | Check if value does not exist | +| Greater than | obj1 > obj2 | Numeric, Time | Check if value is greater than | +| Less than | obj1 < obj2 | Numeric, Time | Check if value is less than | +| Greater than or Equal to | obj1 >= obj2 | Numeric, Time | Check if value is greater than or equal to | +| Less than or Equal to | obj1 <= obj2 | Numeric, Time | Check if value is less than or equal to | +| Not Equal to | obj1 != obj2 | Numeric, Time | Check if values are not equal | +| Equal to | obj1 == obj2 | Numeric, Time | Check if values are equal | + +#### Expression Function Library List + +| Supported Function Library | Description | +| -------------------------------- | -------------------------------------------------------------- | +| condition ? trueExpression : falseExpression | Ternary operator | +| toDouble(str) | Convert string to Double type | +| toBoolean(str) | Convert string to Boolean type | +| toInteger(str) | Convert string to Integer type | +| array[n] | Retrieve the nth element of an array | +| * | Multiplication | +| / | Division | +| % | Modulo | +| ( and ) | Parentheses for controlling the order of operations in logical or mathematical expressions | +| + | Addition | +| - | Subtraction | +| && | Logical AND operator | +| \|\| | Logical OR operator | + +#### Supported Environment Variables + +> Environment variables refer to variables supported by metric values, used in expressions. During threshold calculation and judgment, these variables will be replaced with actual values. + +Non-fixed Environment Variables: These variables change dynamically based on the selected monitoring metric. For example, if we choose **response time metric for website monitoring**, the environment variable would be `responseTime - this represents response time variable`. If we want to set an alert trigger for **response time greater than 400 for website monitoring**, the expression would be `responseTime>400`. + +Fixed Environment Variables (Less commonly used): `instance: instance value` +This variable is mainly used for calculations involving multiple instances. For instance, if we collect usage metrics for C drive and D drive (`usage` being a non-fixed environment variable), and we only want to set an alert for **usage greater than 80 for the C drive**, the expression would be `equals(instance,"c")&&usage>80`. + +#### Expression Configuration Examples + +1. Website Monitoring -> Alert when response time is greater than or equal to 400ms + `responseTime>=400` +2. API Monitoring -> Alert when response time is greater than 3000ms + `responseTime>3000` +3. Overall Monitoring -> Alert when response time for URL (instance) path 'https://baidu.com/book/3' is greater than 200ms + `equals(instance,"https://baidu.com/book/3")&&responseTime>200` +4. MYSQL Monitoring -> Alert when 'threads_running' metric under 'status' exceeds 7 + `threads_running>7` + +If you encounter any issues, feel free to discuss and provide feedback through our community group or ISSUE tracker! \ No newline at end of file diff --git a/home/versioned_docs/version-v1.5.x/help/alert_webhook.md b/home/versioned_docs/version-v1.5.x/help/alert_webhook.md new file mode 100644 index 00000000000..adc1b6f12f8 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/alert_webhook.md @@ -0,0 +1,66 @@ +--- +id: alert_webhook +title: Alert WebHook callback notification +sidebar_label: Alert webHook notification +keywords: [open source monitoring tool, open source alerter, open source webhook notification] +--- + +> After the threshold is triggered send alarm information and call the Webhook interface through post request to notify the recipient. + +### Operation steps + +1. **【Alarm notification】->【Add new recipient】 ->【Select WebHook notification method】-> 【Set WebHook callback address】 -> 【Confirm】** + +![email](/img/docs/help/alert-notice-5.png) + +2. **Configure the associated alarm notification strategy⚠️ 【Add new notification strategy】-> 【Associate the recipient just set】-> 【Confirm】** + +> **Note⚠️ Adding a new recipient does not mean that it is effective to receive alarm information. It is also necessary to configure the associated alarm notification strategy, that is, to specify which messages are sent to which recipients.** + +![email](/img/docs/help/alert-notice-4.png) + +### WebHook callback POST body BODY content + +Content format:JSON +```json +{ + "alarmId": 76456, + "target": "${target}", + "thresholdId": 33455, + "priority": 0, + "content": "udp_port monitoring availability alert, code is FAIL", + "status": 0, + "times": 1, + "triggerTime": "2022-02-25T13:32:13", + "tags": { + "app": "windows", + "monitorId": "180427708350720", + "metrics": "availability", + "code": "UN_CONNECTABLE", + "thresholdId": "112", + "monitorName": "WINDOWS_192.168.124.12" + } +} +``` + +| | | +|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| alarmId | integer($int64) title: Alarm record entity primary key index ID 告警记录实体主键索引ID | +| target | string title: Alert target object: monitor availability-available metrics-app.metrics.field 告警目标对象: 监控可用性-available 指标-app.metrics.field | +| thresholdId | integer($int64) title: Alarm definition ID associated with the alarm 告警关联的告警定义ID | +| priority | string($byte) title: Alarm level 0: high-emergency-critical alarm-red 1: medium-critical-critical alarm-orange 2: low-warning-warning alarm-yellow 告警级别 0:高-emergency-紧急告警-红色 1:中-critical-严重告警-橙色 2:低-warning-警告告警-黄色 | +| content | string title: The actual content of the alarm notification 告警通知实际内容 | +| status | string($byte) title: Alarm status: 0-normal alarm (to be processed) 1-threshold triggered but not reached the number of alarms 2-recovered alarm 3-processed 告警状态: 0-正常告警(待处理) 1-阈值触发但未达到告警次数 2-恢复告警 3-已处理 | +| times | integer($int32) title: Alarm threshold trigger times 告警阈值触发次数 | +| triggerTime | integer($int64) title: Alarm trigger time (timestamp in milliseconds) 首次告警触发时间(毫秒时间戳) | +| tags | example: {key1:value1} | + + + +### Webhook notification common issues + +1. WebHook callback did not take effect +> Please check whether there is any triggered alarm information in the alarm center. +> Please check whether the configured webhook callback address is correct. + +Other issues can be fed back through the communication group ISSUE! diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_wework.md b/home/versioned_docs/version-v1.5.x/help/alert_wework.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/alert_wework.md rename to home/versioned_docs/version-v1.5.x/help/alert_wework.md diff --git a/home/versioned_docs/version-v1.5.x/help/almalinux.md b/home/versioned_docs/version-v1.5.x/help/almalinux.md new file mode 100644 index 00000000000..380e1439ab4 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/almalinux.md @@ -0,0 +1,117 @@ +--- +id: almalinux +title: Monitoring AlmaLinux Operating System Monitoring +sidebar_label: AlmaLinux Operating System +keywords: [open-source monitoring system, open-source operating system monitoring, AlmaLinux operating system monitoring] +--- +> Collect and monitor common performance metrics of the AlmaLinux operating system. + +### Configuration Parameters + + +| Parameter Name | Parameter Help Description | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| Monitoring Host | The monitored peer's IPv4, IPv6, or domain name. Note ⚠️ No protocol header (e.g., https://, http://). | +| Task Name | A unique name to identify this monitoring task. | +| Port | The port provided by Linux SSH, default is 22. | +| Timeout | Set the connection timeout in milliseconds, default is 6000 ms. | +| Connection Reuse | Set whether to reuse SSH connections, default is false. If false, a new connection will be created for each retrieval of information. | +| Username | SSH connection username, optional. | +| Password | SSH connection password, optional. | +| Collector | Configure which collector to use for scheduling data collection for this monitoring. | +| Monitoring Period | The interval time for periodic data collection, in seconds, with a minimum interval of 30 seconds. | +| Binding Tags | Used for classifying and managing monitoring resources. | +| Description Note | Additional notes to identify and describe this monitoring, where users can make notes. | +| Key | The key required to connect to the server. | + +### Data Collection Metrics + +#### Metric Set: Basic System Information + + +| Metric Name | Metric Unit | Metric Help Description | +| -------------- | ----------- | ------------------------ | +| Host Name | None | Host name | +| System Version | None | Operating system version | +| Uptime | None | Uptime | + +#### Metric Set: CPU Information + + +| Metric Name | Metric Unit | Metric Help Description | +| -------------- | ----------- | --------------------------------- | +| info | None | CPU model | +| cores | Cores | Number of CPU cores | +| interrupt | Count | Number of CPU interrupts | +| load | None | Average CPU load (1/5/15 minutes) | +| context_switch | Count | Number of context switches | +| usage | % | CPU usage | + +#### Metric Set: Memory Information + + +| Metric Name | Metric Unit | Metric Help Description | +| ----------- | ----------- | ----------------------------------- | +| total | Mb | Total memory capacity | +| used | Mb | Memory used by user programs | +| free | Mb | Free memory capacity | +| buff_cache | Mb | Memory used for cache | +| available | Mb | Remaining available memory capacity | +| usage | % | Memory usage rate | + +#### Metric Set: Disk Information + + +| Metric Name | Metric Unit | Metric Help Description | +| ------------- | ----------- | -------------------------------------- | +| disk_num | Count | Total number of disks | +| partition_num | Count | Total number of partitions | +| block_write | Blocks | Total number of blocks written to disk | +| block_read | Blocks | Total number of blocks read from disk | +| write_rate | IOPS | Disk block write rate per second | + +#### Metric Set: Network Card Information + + +| Metric Name | Metric Unit | Metric Help Description | +| -------------- | ----------- | ----------------------------- | +| interface_name | None | Network card name | +| receive_bytes | Byte | Inbound data traffic (bytes) | +| transmit_bytes | Byte | Outbound data traffic (bytes) | + +#### Metric Set: File System + + +| Metric Name | Metric Unit | Metric Help Description | +| ----------- | ----------- | ----------------------- | +| filesystem | None | Name of the file system | +| used | Mb | Used disk size | +| available | Mb | Available disk size | +| usage | % | Usage rate | +| mounted | None | Mount point directory | + +#### Metric Set: Top 10 CPU Processes + +Statistics for the top 10 processes using the CPU. Statistics include: process ID, CPU usage, memory usage, and executed command. + + +| Metric Name | Metric Unit | Metric Help Description | +| ----------- | ----------- | ----------------------- | +| pid | None | Process ID | +| cpu_usage | % | CPU usage | +| mem_usage | % | Memory usage | +| command | None | Executed command | + +#### Metric Set: Top 10 Memory Processes + +Statistics for the top 10 processes using memory. Statistics include: process ID, memory usage, CPU usage, and executed command. + + +| Metric Name | Metric Unit | Metric Help Description | +| ----------- | ----------- | ----------------------- | +| pid | None | Process ID | +| mem_usage | % | Memory usage | +| cpu_usage | % | CPU usage | +| command | None | Executed command | + +--- diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/api.md b/home/versioned_docs/version-v1.5.x/help/api.md similarity index 92% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/api.md rename to home/versioned_docs/version-v1.5.x/help/api.md index ed92a722091..4d93f38e088 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/api.md +++ b/home/versioned_docs/version-v1.5.x/help/api.md @@ -19,6 +19,8 @@ keywords: [open source monitoring tool, monitoring http api] | Enable HTTPS | Whether to access the website through HTTPS. Note⚠️When HTTPS is enabled, the default corresponding port needs to be changed to 443 | | Username | User name used for interface Basic authentication or Digest authentication | | Password | Password used for interface Basic authentication or Digest authentication | +| Headers | HTTP request headers | +| Params | HTTP query params, support [time expression](time_expression) | | Content-Type | Set the resource type when carrying the BODY request body data request | | Request BODY | Set the carry BODY request body data, which is valid when PUT or POST request method is used | | Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/centos.md b/home/versioned_docs/version-v1.5.x/help/centos.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/centos.md rename to home/versioned_docs/version-v1.5.x/help/centos.md diff --git a/home/versioned_docs/version-v1.5.x/help/clickhouse.md b/home/versioned_docs/version-v1.5.x/help/clickhouse.md new file mode 100644 index 00000000000..3e09687a450 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/clickhouse.md @@ -0,0 +1,94 @@ +--- +id: clickhouse +title: Monitoring ClickHouse Database Monitoring +sidebar_label: ClickHouse Database +keywords: [open source monitoring system, open source database monitoring, ClickHouse database monitoring] +--- +> Collect and monitor general performance metrics for the ClickHouse database. + +### Configuration Parameters + +| Parameter Name | Parameter Description | +| -------------- | ------------------------------------------------------------------------- | +| Monitor Host | IP address, IPV4, IPV6, or domain name of the host being monitored. Note ⚠️ without protocol prefix (e.g., https://, http://). | +| Task Name | Name identifying this monitoring, ensuring uniqueness. | +| Port | Port number of the database exposed to the outside, default is 8123. | +| Query Timeout | Timeout for SQL queries to respond, in milliseconds (ms), default is 6000ms. | +| Database Name | Name of the database instance, optional. | +| Username | Username for database connection, optional. | +| Password | Password for database connection, optional. | +| Collection Interval | Interval for periodic data collection during monitoring, in seconds, with a minimum interval of 30 seconds. | +| Tag Binding | Used for categorizing and managing monitored resources. | +| Description | Additional information to identify and describe this monitoring, where users can add remarks. | + +### Collected Metrics + +#### Metric Set: ping Availability + +| Metric Name | Metric Unit | Metric Description | +| ------------- | ----------- | ------------------ | +| responseTime | N/A | Response time | + +#### Metric Set: Data from system.metrics table + +| Metric Name | Metric Unit | Metric Description | +| ---------------------- | ----------- | ------------------------------------------------------------- | +| Query | N/A | Number of queries being executed | +| Merge | N/A | Number of background merges being executed | +| Move | N/A | Number of background moves being executed | +| PartMutation | N/A | Number of table mutations | +| ReplicatedFetch | N/A | Number of data blocks fetched from replicas | +| ReplicatedSend | N/A | Number of data blocks sent to replicas | +| ReplicatedChecks | N/A | Number of consistency checks on data blocks | +| QueryPreempted | N/A | Number of queries stopped or waiting | +| TCPConnection | N/A | Number of TCP connections | +| HTTPConnection | N/A | Number of HTTP connections | +| OpenFileForRead | N/A | Number of open readable files | +| OpenFileForWrite | N/A | Number of open writable files | +| QueryThread | N/A | Number of threads processing queries | +| ReadonlyReplica | N/A | Number of Replicated tables in read-only state | +| EphemeralNode | N/A | Number of ephemeral nodes in ZooKeeper | +| ZooKeeperWatch | N/A | Number of ZooKeeper event subscriptions | +| StorageBufferBytes | Bytes | Bytes in Buffer tables | +| VersionInteger | N/A | ClickHouse version number | +| RWLockWaitingReaders | N/A | Number of threads waiting for read-write lock on a table | +| RWLockWaitingWriters | N/A | Number of threads waiting for write lock on a table | +| RWLockActiveReaders | N/A | Number of threads holding read lock on a table | +| RWLockActiveWriters | N/A | Number of threads holding write lock on a table | +| GlobalThread | N/A | Number of threads in global thread pool | +| GlobalThreadActive | N/A | Number of active threads in global thread pool | +| LocalThread | N/A | Number of threads in local thread pool | +| LocalThreadActive | N/A | Number of active threads in local thread pool | + +#### Metric Set: Data from system.events table + +| Metric Name | Metric Unit | Metric Description | +| ------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------- | +| Query | N/A | Number of queries to parse and possibly execute. Excludes queries rejected due to AST size limits, quota limits, or simultaneous query limits. May include internal queries initiated by ClickHouse. Subqueries are not counted. | +| SelectQuery | N/A | Number of Select queries possibly executed | +| InsertQuery | N/A | Number of Insert queries possibly executed | +| InsertedRows | N/A | Number of rows inserted into all tables | +| InsertedBytes | Bytes | Number of bytes inserted into all tables | +| FailedQuery | N/A | Number of failed queries | +| FailedSelectQuery | N/A | Number of failed Select queries | +| FileOpen | N/A | Number of file openings | +| MergeTreeDataWriterRows | N/A | Number of data rows written to MergeTree tables | +| MergeTreeDataWriterCompressedBytes | Bytes | Number of compressed data bytes written to MergeTree tables | + +#### Metric Set: Data from system.asynchronous_metrics table + +| Metric Name | Metric Unit | Metric Description | +| -------------------------------------- | ----------- | -------------------------------------- | +| AsynchronousMetricsCalculationTimeSpent | N/A | Time spent calculating asynchronous metrics (seconds) | +| jemalloc.arenas.all.muzzy_purged | N/A | Number of purged muzzy pages | +| jemalloc.arenas.all.dirty_purged | N/A | Number of purged dirty pages | +| BlockReadBytes_ram1 | N/A | Number of bytes read from ram1 block | +| jemalloc.background_thread.run_intervals | N/A | Number of intervals jemalloc background thread ran | +| BlockQueueTime_nbd13 | N/A | Queue wait time for nbd13 block | +| jemalloc.background_thread.num_threads | N/A | Number of jemalloc background threads | +| jemalloc.resident | N/A | Physical memory size allocated by jemalloc (bytes) | +| InterserverThreads | N/A | Number of Interserver threads | +| BlockWriteMerges_nbd7 | N/A | Number of block write merges for nbd7 block | +| MarkCacheBytes | N/A | Size of marks cache in StorageMergeTree | +| MarkCacheFiles | N/A | Number of files in marks cache for StorageMergeTree | +| MaxPartCountForPartition | N/A | Maximum active data blocks in partitions | \ No newline at end of file diff --git a/home/versioned_docs/version-v1.5.x/help/debian.md b/home/versioned_docs/version-v1.5.x/help/debian.md new file mode 100644 index 00000000000..65940c34a39 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/debian.md @@ -0,0 +1,101 @@ +--- +id: debian +title: Monitoring Debian System Monitoring +sidebar_label: Debian +keywords: [Open Source Monitoring System, Operating System Monitoring, Debian Monitoring] +--- +> Collect and monitor general performance metrics of the Debian system. + +## Configuration Parameters + + +| Parameter Name | Metric help description | +| ----------------------- | ----------------------------------------------------------------------------------------------------------------- | +| Target Host | The monitored destination IPV4, IPV6, or domain name. Note: no protocol header (e.g., https://, http://). | +| Task Name | A unique name to identify this monitoring task. | +| Port | SSH port of the Debian system, default: 22 | +| Timeout | Timeout for the connection, in milliseconds, default: 6000 milliseconds. | +| Connection Reuse | Whether to reuse the SSH connection, default: false. False means a new connection will be created for each query. | +| Username | Server username | +| Password | Server password | +| Collector | Configure which collector to use for scheduling this monitoring. | +| Monitoring Period | The interval for periodically collecting data, in seconds, with a minimum interval of 30 seconds. | +| Binding Tags | Used for categorizing and managing monitoring resources. | +| Metric help description | Additional notes and Metric help descriptions for this monitoring, users can add notes here. | +| Key | Key required to connect to the server. | + +### Monitoring Metrics + +#### Metric Set: Basic System Information + + +| Metric Name | Metric Unit | Metric help description | +| -------------- | ----------- | ------------------------ | +| Host Name | N/A | Host name | +| System Version | N/A | Operating system version | +| Uptime | N/A | Boot time | + +#### Metric Set: CPU Information + + +| Metric Name | Metric Unit | Metric help description | +| -------------- | ----------- | ----------------------- | +| Info | N/A | Model | +| Cores | N/A | Number of cores | +| Interrupt | N/A | Number of interrupts | +| Load | N/A | Load | +| Context Switch | N/A | Context switches | +| Usage | % | Usage rate | + +#### Metric Set: Memory Information + + +| Metric Name | Metric Unit | Metric help description | +| ------------------- | ----------- | ---------------------------- | +| Total Memory | Mb | Total memory capacity | +| User Program Memory | Mb | Memory used by user programs | +| Free Memory | Mb | Free memory capacity | +| Buff Cache Memory | Mb | Memory used by cache | +| Available Memory | Mb | Available memory | +| Memory Usage | % | Memory usage rate | + +#### Metric Set: Disk Information + + +| Metric Name | Metric Unit | Metric help description | +| ------------- | ----------- | ----------------------------- | +| Disk Num | N/A | Total number of disks | +| Partition Num | N/A | Total number of partitions | +| Block Write | N/A | Number of disk blocks written | +| Block Read | N/A | Number of disk blocks read | +| Write Rate | iops | Disk write rate | + +#### Metric Set: Network Interface Information + +Statistics for all network interface cards, including interface name, incoming data traffic, and outgoing data traffic. +Metric Unit: Mb + +#### Metric Set: File System + +Statistics for all mounted file systems. Statistics include: file system, usage, available space, usage rate, mount point. +Metric Unit: + +- Usage: Mb +- Available Space: Mb +- Usage Rate: % + +#### Metric Set: Top 10 CPU Processes + +Statistics for the top 10 processes by CPU usage. Statistics include: process ID, CPU usage rate, memory usage rate, command being executed. +Metric Unit: + +- CPU Usage Rate: % +- Memory Usage Rate: % + +#### Metric Set: Top 10 Memory Processes + +Statistics for the top 10 processes by memory usage. Statistics include: process ID, memory usage rate, CPU usage rate, command being executed. +Metric Unit: + +- Memory Usage Rate: % +- CPU Usage Rate: % diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/dm.md b/home/versioned_docs/version-v1.5.x/help/dm.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/dm.md rename to home/versioned_docs/version-v1.5.x/help/dm.md diff --git a/home/versioned_docs/version-v1.5.x/help/dns.md b/home/versioned_docs/version-v1.5.x/help/dns.md new file mode 100644 index 00000000000..7587452c1a7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/dns.md @@ -0,0 +1,70 @@ +--- +id: dns +title: Monitoring DNS +sidebar_label: DNS Monitor +keywords: [ open source monitoring tool, open source DNS monitoring tool, monitoring DNS metrics ] +--- + +> Collect and monitor the general performance Metrics of DNS. + +**Protocol Use:DNS** + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6. Note⚠️Without protocol header (eg: https://, http://). | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique. | +| Monitoring port | The port for DNS service provided to the outside,default is 53. | +| Address For DNS | The address for domain name resolution. | +| Connect Timeout | Set the timeout for connecting to the DNS server, default is 6000 milliseconds. | +| Query Class | Resource class for DNS query. Optional values include `IN`, `CHAOS`, `HESIOD`, `NONE`, and `ANY`,default is IN. | +| Use TCP Protocol | DNS queries use the TCP protocol. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metrics + +#### Metrics Set:Header + +| Metric name | Metric unit | Metric help description | +|-------------------------|-------------|---------------------------------------------------| +| Response Time | ms | Time taken for DNS server to respond to requests. | +| Opcode | none | Type of the current message. | +| Response Status | none | Status code of the response. | +| Response Flags | none | Response flags. | +| Question Record Count | none | Number of question records. | +| Answer Record Count | none | Number of answer records. | +| Authority Record Count | none | Number of authoritative resource records. | +| Additional Record Count | none | Number of additional resource records. | + +### Metrics Set: Question + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------| +| Section | none | Question record information, including the queried domain name, resource type, resource record class, and additional information. | + +### Metrics Set: Answer + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|----------------------------------------------------------------------------------------------------------------------------| +| Section0 | none | Answer record information, including the queried domain name, TTL, resource record class, resource type, and query result. | + +> The metric set collects up to 10 records, with metric names from Section0 to Section9. + +### Metrics Set: Authority + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------| +| Section0 | none | SOA (Start of Authority) record for the domain name, including queried domain name, TTL, resource type, resource record class, and other information. | + +> The metric set collects up to 10 records, with metric names from Section0 to Section9. + +### Metrics Set: Additional + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-----------------------------------------| +| Section0 | none | Additional information for DNS queries. | + +> The metric set collects up to 10 records, with metric names from Section0 to Section9. diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/docker.md b/home/versioned_docs/version-v1.5.x/help/docker.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/docker.md rename to home/versioned_docs/version-v1.5.x/help/docker.md diff --git a/home/versioned_docs/version-v1.5.x/help/doris_be.md b/home/versioned_docs/version-v1.5.x/help/doris_be.md new file mode 100644 index 00000000000..2bc212ef3fb --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/doris_be.md @@ -0,0 +1,170 @@ +--- +id: doris_be +title: 监控:DORIS数据库BE监控 +sidebar_label: DORIS数据库BE +keywords: [开源监控系统, 开源数据库监控, DORIS数据库BE监控] +--- + +> 对DORIS数据库FE的通用性能指标进行采集监控。支持DORIS2.0.0。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ------------ | ------------------------------------------------------------ | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://) | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性 | +| 端口 | 数据库对外提供的端口,默认为8040 | +| 查询超时时间 | 设置连接未响应的超时时间,单位ms毫秒,默认3000毫秒 | +| 数据库名称 | 数据库实例名称,可选 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:doris_be_load_channel_count + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------------- | +| value | 无 | 当前打开的 load channel 个数 | + +#### 指标集合:doris_be_memtable_flush_total + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------------- | +| value | 无 | memtable写入磁盘的个数累计值 | + +#### 指标集合:doris_be_plan_fragment_count + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------- | +| value | 无 | 当前已接收的 fragment instance 的数量 | + +#### 指标集合:doris_be_process_thread_num + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ----------------------------------------- | +| value | 无 | BE 进程线程数。通过 `/proc/pid/task` 采集 | + +#### 指标集合:doris_be_query_scan_rows + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------------ | +| value | 无 | 读取行数的累计值。这里只统计读取 Olap 表的数据量。并且是 RawRowsRead(部分数据行可能被索引跳过,并没有真正读取,但仍会记录到这个值中) | + +#### 指标集合:doris_be_result_buffer_block_count + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------- | +| value | 无 | 当前查询结果缓存中的 query 个数 | + +#### 指标集合:doris_be_send_batch_thread_pool_queue_size + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | -------------------------------------- | +| value | 无 | 导入时用于发送数据包的线程池的排队个数 | + +#### 指标集合:doris_be_tablet_base_max_compaction_score + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | -------------------------------- | +| value | 无 | 当前最大的 Base Compaction Score | + +#### 指标集合:doris_be_timeout_canceled_fragment_count + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | --------------------------------------------- | +| value | 无 | 因超时而被取消的 fragment instance 数量累计值 | + +#### 指标集合:doris_be_load_rows + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------- | +| value | 无 | 通过 tablet sink 发送的行数累计 | + +#### 指标集合:doris_be_all_rowsets_num + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ---------------------- | +| value | 无 | 当前所有 rowset 的个数 | + +#### 指标集合:doris_be_all_segments_num + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ----------------------- | +| value | 无 | 当前所有 segment 的个数 | + +#### 指标集合:doris_be_heavy_work_max_threads + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------ | +| value | 无 | brpc heavy线程池线程个数 | + +#### 指标集合:doris_be_light_work_max_threads + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------ | +| value | 无 | brpc light线程池线程个数 | + +#### 指标集合:doris_be_heavy_work_pool_queue_size + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ----------------------------------------------- | +| value | 无 | brpc heavy线程池队列最大长度,超过则阻塞提交work | + +#### 指标集合:doris_be_light_work_pool_queue_size + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ----------------------------------------------- | +| value | 无 | brpc light线程池队列最大长度,超过则阻塞提交work | + +#### 指标集合:doris_be_heavy_work_active_threads + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | -------------------------- | +| value | 无 | brpc heavy线程池活跃线程数 | + +#### 指标集合:doris_be_light_work_active_threads + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | -------------------------- | +| value | 无 | brpc light线程池活跃线程数 | + +#### 指标集合:doris_be_compaction_bytes_total + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ---------- | -------- | ---------------------------------- | +| base | 字节 | Base Compaction 的数据量累计 | +| cumulative | 字节 | Cumulative Compaction 的数据量累计 | + +#### 指标集合:doris_be_disks_avail_capacity + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------- | +| path | 无 | 指定数据目录 | +| value | 字节 | `{path="/path1/"}` 表示 `/path1` 目录所在磁盘的剩余空间 | + +#### 指标集合:doris_be_disks_total_capacity + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | ------------------------------------------------------- | +| path | 无 | 指定数据目录 | +| value | 字节 | `{path="/path1/"}` 表示 `/path1` 目录所在磁盘的全部空间 | + +#### 指标集合:doris_be_local_bytes_read_total + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | --------------------------------- | +| value | 字节 | 由 `LocalFileReader` 读取的字节数 | + +#### 指标集合:doris_be_local_bytes_written_total + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | --------------------------------- | +| value | 字节 | 由 `LocalFileWriter` 写入的字节数 | + +#### 指标集合:doris_be_memory_allocated_bytes + +| 指标名称 | 指标单位 | 指标帮助描述 | +| -------- | -------- | --------------------------------------------------- | +| value | 字节 | BE 进程物理内存大小,取自 `/proc/self/status/VmRSS` | diff --git a/home/versioned_docs/version-v1.5.x/help/doris_fe.md b/home/versioned_docs/version-v1.5.x/help/doris_fe.md new file mode 100644 index 00000000000..bb7a6b99d53 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/doris_fe.md @@ -0,0 +1,146 @@ +--- +id: doris_fe +title: Monitoring DORIS Database FE Monitoring +sidebar_label: DORIS Database FE +keywords: [Open Source Monitoring System, Open Source Database Monitoring, DORIS Database FE Monitoring] +--- +> Collect and monitor general performance metrics for DORIS database FE. Supports DORIS 2.0.0. + +**Protocol: HTTP** + +### Pre-monitoring operations + +Check the `fe/conf/fe.conf` file to obtain the value of the `http_port` configuration item, which is used for monitoring. + +### Configuration Parameters + + +| Parameter Name | Parameter Description | +| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Monitor Host | The monitored target's IPV4, IPV6, or domain name. Note: Without the protocol header (e.g., https://, http://) | +| Task Name | A unique name identifying this monitoring task | +| Port | The port provided by the database to the outside, default is 8030 ,get the value of the`http_port` configuration item | +| Query Timeout | The timeout for the connection to not respond, in milliseconds, default is 3000 milliseconds | +| Database Name | Optional database instance name | +| Collection Interval | The interval between periodic data collections for monitoring, in seconds, with a minimum interval of 30 seconds | +| Probe Required | Whether to probe and check the availability of monitoring before adding new monitoring, continue with the addition or modification operation only if the probe is successful | +| Description | Additional notes and descriptions for this monitoring task | + +### Collection Indicators + +#### Metric Set: doris_fe_connection_total + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | -------------------------------------------------- | +| value | None | The current number of MySQL port connections on FE | + +#### Metric Set: doris_fe_edit_log_clean + +Should not fail; if it does, manual intervention is required. + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ------------------------------------------------------------- | +| success | None | The number of successful cleanups of historical metadata logs | +| failed | None | The number of failed cleanups of historical metadata logs | + +#### Metric Set: doris_fe_edit_log + + +| Metric Name | Metric Unit | Metric help description | +| ----------------- | ----------- | ------------------------------------------- | +| write | None | The count of metadata log write operations | +| read | None | The count of metadata log read operations | +| current | None | The current number of metadata logs | +| accumulated_bytes | Bytes | The cumulative value of metadata log writes | +| current_bytes | Bytes | The current value of metadata logs | + +#### Metric Set: doris_fe_image_clean + +Should not fail; if it does, manual intervention is required. + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | -------------------------------------------------------------------- | +| success | None | The number of successful cleanups of historical metadata image files | +| failed | None | The number of failed cleanups of historical metadata image files | + +#### Metric Set: doris_fe_image_write + +Should not fail; if it does, manual intervention is required. + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ------------------------------------------------------------ | +| success | None | The number of successful generations of metadata image files | +| failed | None | The number of failed generations of metadata image files | + +#### Metric Set: doris_fe_query_err + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ----------------------------------------- | +| value | None | The cumulative value of erroneous queries | + +#### Metric Set: doris_fe_max_journal_id + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | None | The current maximum metadata log ID on the FE node. If it is a Master FE, it is the maximum ID currently written; if it is a non-Master FE, it represents the maximum metadata log ID currently being replayed. Used to observe if there is a large gap between the IDs of multiple FEs. A large gap indicates issues with metadata synchronization | + +#### Metric Set: doris_fe_max_tablet_compaction_score + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | None | The largest compaction score value among all BE nodes. This value can observe the current cluster's maximum compaction score to judge if it is too high. If too high, there may be delays in queries or writes | + +#### Metric Set: doris_fe_qps + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ------------------------------------------------------------------------------- | +| value | None | The number of queries per second on the current FE (only counts query requests) | + +#### Metric Set: doris_fe_query_err_rate + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ------------------------------------------ | +| value | None | The number of erroneous queries per second | + +#### Metric Set: doris_fe_report_queue_size + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | None | The length of the queue for various regular reporting tasks on the BE side at the FE end. This value reflects the degree of blocking of reporting tasks on the Master FE node. A larger value indicates insufficient processing capacity on the FE | + +#### Metric Set: doris_fe_rps + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ---------------------------------------------------------------------------------------------------- | +| value | None | The number of requests per second on the current FE (includes queries and other types of statements) | + +#### Metric Set: doris_fe_scheduled_tablet_num + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| value | None | The number of tablets currently being scheduled by the Master FE node. This includes tablets that are being repaired and tablets that are being balanced. This value can reflect the number of tablets currently migrating in the cluster. If there is a value for a long time, it indicates that the cluster is unstable | + +#### Metric Set: doris_fe_txn_status + +Can observe the number of import transactions in various states to determine if there is a backlog. + + +| Metric Name | Metric Unit | Metric help description | +| ----------- | ----------- | ----------------------- | +| unknown | None | Unknown state | +| prepare | None | In preparation | +| committed | None | Committed | +| visible | None | Visible | +| aborted | None | Aborted / Revoked | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/dynamic_tp.md b/home/versioned_docs/version-v1.5.x/help/dynamic_tp.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/dynamic_tp.md rename to home/versioned_docs/version-v1.5.x/help/dynamic_tp.md diff --git a/home/versioned_docs/version-v1.5.x/help/elasticsearch.md b/home/versioned_docs/version-v1.5.x/help/elasticsearch.md new file mode 100644 index 00000000000..25078850862 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/elasticsearch.md @@ -0,0 +1,63 @@ +--- +id: elasticsearch +title: Monitoring:ElasticSearch +sidebar_label: ElasticSearch +keywords: [ open source monitoring tool, monitoring ElasticSearch metrics ] +--- + +> Collect and monitor the general performance Metrics of ElasticSearch + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6. Note⚠️Without protocol header (eg: https://, http://). | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique. | +| Monitoring port | The HTTP API port opened by Elasticsearch,default is 9200. | +| SSL | Whether SSL is enabled for connecting to Elasticsearch. | +| Auth Type | Authentication type,Optional. | +| Username | Username,Optional. | +| Password | Password,Optional. | +| Connect Timeout | Set the timeout for elasticsearch query, default is 6000 milliseconds. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metrics + +#### Metrics Set:health + +| Metric name | Metric unit | Metric help description | +|-----------------------|-------------|-------------------------------------------| +| cluster_name | none | Cluster Name | +| status | none | status | +| nodes | none | Number of nodes in the cluster. | +| data_nodes | none | Number of data nodes in the cluster. | +| active_primary_shards | none | Number of active shards on primary nodes. | +| active_shards | none | Number of active shards. | +| active_percentage | % | Active Percentage | +| initializing_shards | none | Number of initialized shards. | +| unassigned_shards | none | Number of unassigned shards. | + +#### Metrics Set:nodes + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|--------------------------| +| total | none | Number of nodes. | +| successful | none | Number of online nodes. | +| failed | none | Number of offline nodes. | + +#### Metrics Set:nodes_detail + +| Metric name | Metric unit | Metric help description | +|-------------------|-------------|-------------------------| +| node_name | none | Node Name | +| ip | none | IP Address | +| cpu_load_average | none | Cpu Load Average | +| cpu_percent | % | Cpu Percent | +| heap_used | MB | Heap Used | +| heap_used_percent | % | Heap Used Percent | +| heap_total | MB | Heap Total | +| disk_free | GB | Disk Free | +| disk_total | GB | Disk Total | +| disk_used_percent | % | Disk Used Percent | diff --git a/home/versioned_docs/version-v1.5.x/help/euleros.md b/home/versioned_docs/version-v1.5.x/help/euleros.md new file mode 100644 index 00000000000..c63c6c26643 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/euleros.md @@ -0,0 +1,107 @@ +--- +id: euleros +title: Monitoring EulerOS +sidebar_label: EulerOS +keywords: [ Open Source Monitoring System, Open Source OS Monitoring, EulerOS Monitoring ] +--- + +> Collect and monitor general performance metrics for EulerOS (system information, CPU, memory, disk, network interface, file system, top resource processes, etc.). + +### Configuration Parameters + +| Parameter Name | Parameter help description | +|---------------------|----------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | The IP, IPV6, or domain name of the monitored endpoint. Note ⚠️: Do not include protocol headers (eg: https://, http://). | +| Task Name | Identifies the name of this monitoring, ensuring uniqueness. | +| Port | Port provided by Linux SSH externally, defaults to 22. | +| Timeout | Sets the timeout for connection in milliseconds (ms), defaults to 6000 ms. | +| Connection Reuse | Sets whether the SSH connection is reused, defaults to: false. Creates a new connection for each information retrieval if false. | +| Username | SSH connection username, optional. | +| Password | SSH connection password, optional. | +| Collector | Specifies which collector schedules the collection for this monitoring. | +| Monitoring Interval | Interval for periodically collecting data, in seconds. Minimum interval is 30 seconds. | +| Binding Tags | Used for categorizing and managing monitored resources. | +| Description | Additional remarks and descriptions for this monitoring, for users' reference. | +| PrivateKey | Key required for connecting to the server. | + +### Collected Metrics + +#### Metric Set: Basic Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|---------------------------| +| Host Name | None | Host name. | +| System Version | None | Operating system version. | +| Uptime | None | System uptime. | + +#### Metric Set: CPU Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|-------------------------------------------| +| info | None | CPU model. | +| cores | None | Number of CPU cores. | +| interrupt | None | Number of CPU interrupts. | +| load | None | Average load for the last 1/5/15 minutes. | +| context_switch | None | Current context switches. | +| usage | % | CPU usage percentage. | + +#### Metric Set: Memory Info + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|------------------------------------| +| total | Mb | Total memory capacity. | +| used | Mb | Used memory by user programs. | +| free | Mb | Free memory capacity. | +| buff_cache | Mb | Memory used for buffers and cache. | +| available | Mb | Available memory capacity. | +| usage | % | Memory usage percentage. | + +#### Metric Set: Disk Info + +| Metric Name | Metric Unit | Metric help description | +|---------------|-------------|------------------------------------| +| disk_num | None | Total number of disks. | +| partition_num | None | Total number of partitions. | +| block_write | None | Total blocks written to disk. | +| block_read | None | Total blocks read from disk. | +| write_rate | iops | Rate of blocks written per second. | + +#### Metric Set: Interface Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|--------------------------------| +| interface_name | None | Name of the network interface. | +| receive_bytes | Mb | Inbound data traffic. | +| transmit_bytes | Mb | Outbound data traffic. | + +#### Metric Set: Disk Free + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------| +| filesystem | None | Name of the file system. | +| used | Mb | Used disk space. | +| available | Mb | Available disk space. | +| usage | % | Disk usage percentage. | +| mounted | None | Mount point directory. | + +#### Metric Set: Top10 CPU Process + +Top 10 processes consuming CPU. Metrics include: Process ID, CPU usage, Memory usage, Command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| cpu_usage | % | CPU usage | +| mem_usage | % | Memory usage | +| command | None | Executed command | + +#### Metric Set: Top10 Memory Process + +Top 10 processes consuming memory. Metrics include: Process ID, Memory usage, CPU usage, Command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| mem_usage | % | Memory usage | +| cpu_usage | % | CPU usage | +| command | None | Executed command | diff --git a/home/versioned_docs/version-v1.5.x/help/flink.md b/home/versioned_docs/version-v1.5.x/help/flink.md new file mode 100644 index 00000000000..2115a1f0b0f --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/flink.md @@ -0,0 +1,39 @@ +--- +id: flink +title: Monitoring Flink +sidebar_label: Flink +keywords: [open source monitoring tool, open source flink monitoring tool] +--- + +> Collect and monitor the general performance Metrics of Flink. + + +### Configuration parameter + +| Parameter Name | Parameter Help Description | +|---------------------|-----------------------------------------------------------------------------------------------------------------------------| +| Monitor Host | The monitored peer IPV4, IPV6, or domain name. Note: Do not include protocol headers (e.g., https://, http://). | +| Task Name | Identifier for this monitoring task, name must be unique. | +| Port | Monitoring port. | +| Query Timeout | Sets the timeout for JVM connection in milliseconds, default is 3000 milliseconds. | +| SSL | Whether to enable SSL (default is off). | +| Username | Connection username. | +| Password | Connection password. | +| Collection Interval | Interval for periodic data collection during monitoring, in seconds. The minimum settable interval is 30 seconds. | +| Whether to detect | Whether to perform a probe check for monitoring availability before adding a new monitor; operations proceed if successful. | +| Description Remarks | Additional identifiers and descriptions for this monitoring, where users can note information. | + +### Collection Metrics + +#### Metrics Set:Overview + +| Metric Name | Metric Unit | Metric Help Description | +|---------------|-------------|-------------------------| +| slots_total | Units | Total number of slots. | +| slots_used | Units | Number of slots used. | +| task_total | Units | Total number of tasks. | +| jobs_running | Units | Number of jobs running. | +| jobs_failed | Units | Number of jobs failed. | + + + diff --git a/home/versioned_docs/version-v1.5.x/help/freebsd.md b/home/versioned_docs/version-v1.5.x/help/freebsd.md new file mode 100644 index 00000000000..96d9866743b --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/freebsd.md @@ -0,0 +1,87 @@ +--- +id: freebsd +title: Monitoring FreeBSD Operating System +sidebar_label: FreeBSD Operating System +keywords: [ Open Source Monitoring System, Open Source Operating System Monitoring, FreeBSD Operating System Monitoring ] +--- + +> Collect and monitor general performance metrics (system information, CPU, memory, disk, network cards, file systems, top resource processes, etc.) of the FreeBSD operating system. + +### Configuration Parameters + +| Parameter Name | Parameter help description | +|---------------------|------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | The IPv4, IPv6, or domain name of the monitored peer. Note ⚠️ without the protocol header (eg: https://, http://). | +| Task Name | Identifies the name of this monitor, ensuring uniqueness of the name. | +| Port | The port where SSH for Linux is exposed, default is 22. | +| Timeout | Set the connection timeout, in milliseconds, default is 6000 milliseconds. | +| Reuse Connection | Set whether SSH connections are reused, default is: false. If false, a connection is created for each information retrieval. | +| Username | SSH connection username, optional. | +| Password | SSH connection password, optional. | +| Collector | Configure which collector to use for scheduling collection for this monitor. | +| Monitoring Interval | Interval for periodically collecting data, in seconds. The minimum interval that can be set is 30 seconds. | +| Bind Labels | Used to categorize and manage monitored resources. | +| Description | Additional information for identifying and describing this monitor. Users can add remarks here. | +| PrivateKey | Private key required to connect to the server. | + +### Collection Metrics + +#### Metric Set: Basic Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|--------------------------| +| Host Name | None | Host name | +| System Version | None | Operating system version | +| Uptime | None | System uptime | + +#### Metric Set: CPU Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|----------------------------------------------| +| info | None | CPU model | +| cores | Number | Number of CPU cores | +| interrupt | Number | Number of CPU interrupts | +| load | None | Average CPU load for the last 1/5/15 minutes | +| context_switch | Number | Current context switches | +| usage | % | CPU usage | + +#### Metric Set: Memory Info + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| physmem | Mb | Physical memory | +| usermem | Mb | User program memory | +| realmem | Mb | Actual memory | +| availmem | Mb | Available memory | + +#### Metric Set: Disk Free + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| filesystem | None | File system name | +| used | Mb | Used disk space | +| available | Mb | Available disk space | +| usage | % | Usage percentage | +| mounted | None | Mount point directory | + +#### Metric Set: Top10 CPU Process + +Statistics of the top 10 processes using CPU. Statistics include: Process ID, CPU usage, memory usage, executed command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| cpu_usage | % | CPU usage | +| mem_usage | % | Memory usage | +| command | None | Executed command | + +#### Metric Set: Top10 Memory Process + +Statistics of the top 10 processes using memory. Statistics include: Process ID, memory usage, CPU usage, executed command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| mem_usage | % | Memory usage | +| cpu_usage | % | CPU usage | +| command | None | Executed command | diff --git a/home/versioned_docs/version-v1.5.x/help/ftp.md b/home/versioned_docs/version-v1.5.x/help/ftp.md new file mode 100644 index 00000000000..8802d3ab415 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/ftp.md @@ -0,0 +1,34 @@ +--- +id: ftp +title: Monitoring FTP +sidebar_label: FTP Monitor +keywords: [ open source monitoring tool, open source ftp server monitoring tool, monitoring ftp metrics ] +--- + +> Collect and monitor the general performance Metrics of FTP server. + +**Protocol Use:FTP** + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------------| +| Target Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: ftp://). | +| Monitoring name | Identify the name of this monitoring, The name needs to be unique. | +| Port | Port provided by FTP server ,default is 21. | +| Direction | Directory on the FTP server. | +| Timeout | Timeout for connecting to FTP server. | +| Username | Username for connecting to the FTP server, optional. | +| Password | Password for connecting to the FTP server, optional. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metrics + +#### Metrics Set:Basic + +| Metric name | Metric unit | Metric help description | +|---------------|-------------|----------------------------------------------------------| +| Is Active | none | Check if the directory exists and has access permission. | +| Response Time | ms | Response Time | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/fullsite.md b/home/versioned_docs/version-v1.5.x/help/fullsite.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/fullsite.md rename to home/versioned_docs/version-v1.5.x/help/fullsite.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/guide.md b/home/versioned_docs/version-v1.5.x/help/guide.md similarity index 71% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/guide.md rename to home/versioned_docs/version-v1.5.x/help/guide.md index a94eccb2420..1d9bac72dd5 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/guide.md +++ b/home/versioned_docs/version-v1.5.x/help/guide.md @@ -20,8 +20,17 @@ sidebar_label: Help Center  👉 [Port availability](port)
 👉 [Full site monitoring](fullsite)
 👉 [SSL Cert monitoring](ssl_cert)
+ 👉 [DNS monitoring](dns)
+ 👉 [FTP monitoring](ftp)
+ 👉 [Websocket monitoring](websocket)
+ +### Program monitoring + + 👉 [Process](process)
 👉 [JVM monitoring](jvm)
 👉 [SpringBoot2.0](springboot2)
+ 👉 [SpringBoot3.0](springboot3)
+ 👉 [DynamicTp](dynamic_tp)
### Database monitoring @@ -32,7 +41,16 @@ sidebar_label: Help Center  👉 [Oracle database monitoring](oracle)
 👉 [DM database monitoring](dm)
 👉 [OpenGauss database monitoring](opengauss)
- 👉 [IoTDB数据库监控](iotdb)
+ 👉 [IoTDB database monitoring](iotdb)
+ 👉 [TiDB database monitoring](tidb)
+ 👉 [MongoDB database monitoring](mongodb)
+ 👉 [NebulaGraph cluster monitoring](nebulagraph_cluster)
+ +### Cache monitoring + + 👉 [Redis monitoring](redis)
+ 👉 [Memcached monitoring](memcached)
+ ### Operating system monitoring @@ -40,6 +58,10 @@ sidebar_label: Help Center  👉 [Windows operating system monitoring](windows)
 👉 [Ubuntu operating system monitoring](ubuntu)
 👉 [Centos operating system monitoring](centos)
+ 👉 [FreeBSD operating system monitoring](freebsd)
+ 👉 [RedHat operating system monitoring](redhat)
+ 👉 [Rocky Linux operating system monitoring](rockylinux)
+ 👉 [EulerOS monitoring](euleros)
### Middleware monitoring @@ -51,12 +73,30 @@ sidebar_label: Help Center  👉 [RabbitMQ](rabbitmq)
 👉 [ActiveMQ](activemq)
 👉 [Jetty](jetty)
+ 👉 [Nacos](nacos)
### CloudNative monitoring  👉 [Docker](docker)
 👉 [Kubernetes](kubernetes)
+### Bigdata monitoring + + 👉 [Clickhouse](clickhouse)
+ 👉 [ElasticSearch](elasticsearch)
+ 👉 [Flink](flink)
+ +### Ai LLM monitoring + + 👉 [openai](openai)
+ +### Network monitoring + + 👉 [Huawei-switch](huawei_switch)
+ +### Server monitoring + + *** ## 💡 Alarm service @@ -72,7 +112,7 @@ sidebar_label: Help Center > The Metric threshold configuration provides the Metric threshold configuration in the form of expression, which can set the alarm level, trigger times, alarm notification template and whether it is enabled, correlation monitoring and other functions. -More details see 👉 [threshold alarm](alert_threshold)
+More details see 👉 [Threshold alarm](alert_threshold)
   👉 [Threshold expression](alert_threshold_expr) ### Alarm notification @@ -86,7 +126,12 @@ More details see 👉 [threshold alarm](alert_threshold)
 👉 [Configure Discord Notification](alert_webhook)
 👉 [Configure Slack Notification](alert_webhook)
 👉 [Configure Telegram Notification](alert_webhook)
- 👉 [Configure WebHook Notification](alert_webhook)
- 👉 [Configure enterprise WeChat Robot Notification](alert_wework)
- 👉 [Configure DingDing Robot Notification](alert_dingtalk)
- 👉 [Configure FeiShu Robot Notification](alert_feishu)
+ 👉 [Configure WebHook Notification](alert_webhook)
+ 👉 [Configure enterprise WeChat Robot Notification](alert_wework)
+ 👉 [Configure DingDing Robot Notification](alert_dingtalk)
+ 👉 [Configure FeiShu Robot Notification](alert_feishu)
+ 👉 [Configure Huawei Cloud SMN Notification](alert_smn)
+ +### Plugins + + 👉 [Plugin](plugin)
\ No newline at end of file diff --git a/home/versioned_docs/version-v1.5.x/help/hadoop.md b/home/versioned_docs/version-v1.5.x/help/hadoop.md new file mode 100644 index 00000000000..f0a458ecc9f --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hadoop.md @@ -0,0 +1,91 @@ +--- +id: hadoop +title: Monitoring Hadoop +sidebar_label: Hadoop +keywords: [Open Source Monitoring System, Open Source Java Monitoring, Hadoop JVM Monitoring] +--- + +> Collect and monitor general performance metrics for the JVM virtual machine in Hadoop. + +**Protocol used: JMX** + +### Pre-monitoring steps + +>You need to enable JMX service in the Hadoop application before monitoring. HertzBeat uses the JMX protocol to collect performance metrics from Hadoop's JVM. + +### Steps to enable JMX protocol in the Hadoop application +Add JVM parameters when the application starts. ⚠️Note that you can customize the exposed port and external IP. + +- 1.Enter the hadoop-env.sh configuration file and enter the following command in the terminal: + +```shell +vi $HADOOP_HOME/etc/hadoop/hadoop-env.sh +``` + +- 2.Add the following parameters, where `port` is the number of the custom-exposed port + +```shell +export HADOOP_OPTS= "$HADOOP_OPTS +-Djava.rmi.server.hostname=对外ip地址 +-Dcom.sun.management.jmxremote.port=9999 +-Dcom.sun.management.jmxremote.ssl=false +-Dcom.sun.management.jmxremote.authenticate=false " +``` +- 3.Save and exit, and then execute "start-all.sh" in the "$HADOOP_HOME/sbin" directory to restart the service. + + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by JMX | +| Username | JMX connection user name, optional | +| Password | JMX connection password, optional | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:memory_pool + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-------------------------| +| name | | metrics name | +| committed | kb | total size | +| init | kb | init size | +| max | kb | max size | +| used | kb | used size | + +#### Metrics Set:code_cache (Only Support JDK8) + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-------------------------| +| committed | kb | total size | +| init | kb | init size | +| max | kb | max size | +| used | kb | used size | + +#### Metrics Set:class_loading + +| Metric name | Metric unit | Metric help description | +|-----------------------|-------------|--------------------------| +| LoadedClassCount | | Loaded Class Count | +| TotalLoadedClassCount | | Total Loaded Class Count | +| UnloadedClassCount | | Unloaded Class Count | + + +#### Metrics Set:thread + +| Metric name | Metric unit | Metric help description | +|-------------------------|-------------|----------------------------| +| TotalStartedThreadCount | | Total Started Thread Count | +| ThreadCount | | Thread Count | +| PeakThreadCount | | Peak Thread Count | +| DaemonThreadCount | | Daemon Thread Count | +| CurrentThreadUserTime | ms | Current Thread User Time | +| CurrentThreadCpuTime | ms | Current Thread Cpu Time | + + diff --git a/home/versioned_docs/version-v1.5.x/help/hbase_master.md b/home/versioned_docs/version-v1.5.x/help/hbase_master.md new file mode 100644 index 00000000000..188ad146a5a --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hbase_master.md @@ -0,0 +1,62 @@ +--- +id: hbase_master +title: Monitoring Hbase Master +sidebar_label: HbaseMaster Monitoring +keywords: [Open Source Monitoring System, Open Source Database Monitoring, HbaseMaster Monitoring] +--- +> Collect monitoring data for general performance metrics of Hbase Master. + +**Protocol: HTTP** + +## Pre-monitoring steps + +Check the `hbase-site.xml` file to obtain the value of the `hbase.master.info.port` configuration item, which is used for monitoring. + +## Configuration Parameters + + +| Parameter Name | Parameter Description | +| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Target Host | The IPv4, IPv6, or domain name of the monitored peer. Note: without protocol header (e.g., https://, http://). | +| Port | The port number of the Hbase master, default is 16010. That is, the value of the`hbase.master.info.port` parameter. | +| Task Name | The name identifying this monitoring, which needs to be unique. | +| Query Timeout | Set the connection timeout in ms, the default is 3000 milliseconds. | +| Collection Interval | The periodic collection interval for monitoring data, in seconds, with the minimum allowable interval being 30 seconds. | +| Probe | Whether to probe and check the availability of monitoring before adding new monitoring, and proceed with the addition or modification operation only if the probe is successful. | +| Description | Additional notes and descriptions for this monitoring, users can add notes here. | + +### Collected Metrics + +#### Metric Set: server + + +| Metric Name | Unit | Metric Description | +| -------------------- | ---- | --------------------------------------- | +| numRegionServers | none | Number of currently alive RegionServers | +| numDeadRegionServers | none | Number of currently dead RegionServers | +| averageLoad | none | Cluster average load | +| clusterRequests | none | Total number of cluster requests | + +#### Metric Set: Rit + + +| Metric Name | Unit | Metric Description | +| -------------------- | ---- | -------------------------------- | +| ritnone | none | Current number of RIT | +| ritnoneOverThreshold | none | Number of RIT over the threshold | +| ritOldestAge | ms | Duration of the oldest RIT | + +#### Metric Set: basic + + +| Metric Name | Unit | Metric Description | +| ----------------------- | ---- | ------------------------------------------- | +| liveRegionServers | none | List of currently active RegionServers | +| deadRegionServers | none | List of currently offline RegionServers | +| zookeeperQuorum | none | Zookeeper list | +| masterHostName | none | Master node | +| BalancerCluster_num_ops | none | Number of cluster load balancing operations | +| numActiveHandler | none | Number of RPC handlers | +| receivedBytes | MB | Cluster received data volume | +| sentBytes | MB | Cluster sent data volume (MB) | +| clusterRequests | none | Total number of cluster requests | diff --git a/home/versioned_docs/version-v1.5.x/help/hbase_regionserver.md b/home/versioned_docs/version-v1.5.x/help/hbase_regionserver.md new file mode 100644 index 00000000000..4e676491022 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hbase_regionserver.md @@ -0,0 +1,96 @@ +--- +id: hbase_regionserver +title: Monitoring HBase RegionServer Monitoring +sidebar_label: HBase RegionServer Monitoring +keywords: [Open-source monitoring system, Open-source database monitoring, RegionServer monitoring] +--- +> Collect and monitor common performance metrics for HBase RegionServer. + +**Protocol:** HTTP + +## Pre-Monitoring Operations + +Review the `hbase-site.xml` file to obtain the value of the `hbase.regionserver.info.port` configuration item, which is used for monitoring. + +## Configuration Parameters + + +| Parameter Name | Parameter Description | +| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | +| Target Host | The IPV4, IPV6, or domain name of the monitored entity. Note ⚠️ Do not include the protocol header (e.g., https://, http://). | +| Port | The port number of the HBase regionserver, default is 16030, i.e., the value of the`hbase.regionserver.info.port` parameter | +| Task Name | A unique name to identify this monitoring task. | +| Query Timeout | Set the connection timeout in ms, the default is 3000 milliseconds. | +| Collection Interval | The interval time for periodic data collection in seconds, with a minimum interval of 30 seconds. | +| Probe Before Adding | Whether to probe and check the availability of monitoring before adding new monitoring, only proceed with the addition if the probe is successful. | +| Description Note | Additional notes to identify and describe this monitoring, users can add notes here. | + +### Collection Metrics + +> All metric names are directly referenced from the official fields, hence there may be non-standard naming. + +#### Metric Set: server + + +| Metric Name | Unit | Metric Description | +| --------------------------------- | ----- | ------------------------------------------------------------------------- | +| regionCount | None | Number of Regions | +| readRequestCount | None | Number of read requests since cluster restart | +| writeRequestCount | None | Number of write requests since cluster restart | +| averageRegionSize | MB | Average size of a Region | +| totalRequestCount | None | Total number of requests | +| ScanTime_num_ops | None | Total number of Scan requests | +| Append_num_ops | None | Total number of Append requests | +| Increment_num_ops | None | Total number of Increment requests | +| Get_num_ops | None | Total number of Get requests | +| Delete_num_ops | None | Total number of Delete requests | +| Put_num_ops | None | Total number of Put requests | +| ScanTime_mean | None | Average time of a Scan request | +| ScanTime_min | None | Minimum time of a Scan request | +| ScanTime_max | None | Maximum time of a Scan request | +| ScanSize_mean | bytes | Average size of a Scan request | +| ScanSize_min | None | Minimum size of a Scan request | +| ScanSize_max | None | Maximum size of a Scan request | +| slowPutCount | None | Number of slow Put operations | +| slowGetCount | None | Number of slow Get operations | +| slowAppendCount | None | Number of slow Append operations | +| slowIncrementCount | None | Number of slow Increment operations | +| slowDeleteCount | None | Number of slow Delete operations | +| blockCacheSize | None | Size of memory used by block cache | +| blockCacheCount | None | Number of blocks in Block Cache | +| blockCacheExpressHitPercent | None | Block cache hit ratio | +| memStoreSize | None | Size of Memstore | +| FlushTime_num_ops | None | Number of RS writes to disk/Memstore flushes | +| flushQueueLength | None | Length of Region Flush queue | +| flushedCellsSize | None | Size flushed to disk | +| storeFileCount | None | Number of Storefiles | +| storeCount | None | Number of Stores | +| storeFileSize | None | Size of Storefiles | +| compactionQueueLength | None | Length of Compaction queue | +| percentFilesLocal | None | Percentage of HFile in local HDFS Data Node | +| percentFilesLocalSecondaryRegions | None | Percentage of HFile for secondary region replicas in local HDFS Data Node | +| hlogFileCount | None | Number of WAL files | +| hlogFileSize | None | Size of WAL files | + +#### Metric Set: IPC + + +| Metric Name | Unit | Metric Description | +| ------------------------- | ---- | -------------------------------------- | +| numActiveHandler | None | Current number of RITs | +| NotServingRegionException | None | Number of RITs exceeding the threshold | +| RegionMovedException | ms | Duration of the oldest RIT | +| RegionTooBusyException | ms | Duration of the oldest RIT | + +#### Metric Set: JVM + + +| Metric Name | Unit | Metric Description | +| -------------------- | ---- | --------------------------------- | +| MemNonHeapUsedM | None | Current active RegionServer list | +| MemNonHeapCommittedM | None | Current offline RegionServer list | +| MemHeapUsedM | None | Zookeeper list | +| MemHeapCommittedM | None | Master node | +| MemHeapMaxM | None | Cluster balance load times | +| MemMaxM | None | RPC handle count | +| GcCount | MB | Cluster data reception volume | diff --git a/home/versioned_docs/version-v1.5.x/help/hdfs_datanode.md b/home/versioned_docs/version-v1.5.x/help/hdfs_datanode.md new file mode 100644 index 00000000000..2e09fb9fba1 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hdfs_datanode.md @@ -0,0 +1,56 @@ +--- +id: hdfs_datanode +title: Monitoring Apache HDFS DataNode Monitoring +sidebar_label: Apache HDFS DataNode +keywords: [big data monitoring system, distributed file system monitoring, Apache HDFS DataNode monitoring] +--- + +> Hertzbeat monitors metrics for Apache HDFS DataNode nodes. + +**Protocol Used: HTTP** + +## Pre-monitoring Operations + +Retrieve the HTTP monitoring port for the Apache HDFS DataNode. Value: `dfs.datanode.http.address` + +## Configuration Parameters + +| Parameter Name | Parameter Description | +| ----------------- |-------------------------------------------------------| +| Target Host | IP(v4 or v6) or domain name of the target to be monitored. Exclude protocol. | +| Port | Monitoring port number for Apache HDFS DataNode, default is 50075. | +| Query Timeout | Timeout for querying Apache HDFS DataNode, in milliseconds, default is 6000 milliseconds. | +| Metrics Collection Interval | Time interval for monitoring data collection, in seconds, minimum interval is 30 seconds. | +| Probe Before Monitoring | Whether to probe and check monitoring availability before adding. | +| Description/Remarks | Additional description and remarks for this monitoring. | + +### Metrics Collected + +#### Metric Set: FSDatasetState + +| Metric Name | Metric Unit | Metric Description | +| ------------ | ----------- | ------------------------------ | +| DfsUsed | GB | DataNode HDFS usage | +| Remaining | GB | Remaining space on DataNode HDFS | +| Capacity | GB | Total capacity of DataNode HDFS | + +#### Metric Set: JvmMetrics + +| Metric Name | Metric Unit | Metric Description | +| ---------------------- | ----------- | ----------------------------------------- | +| MemNonHeapUsedM | MB | Current usage of NonHeapMemory by JVM | +| MemNonHeapCommittedM | MB | Committed size of NonHeapMemory configured in JVM | +| MemHeapUsedM | MB | Current usage of HeapMemory by JVM | +| MemHeapCommittedM | MB | Committed size of HeapMemory by JVM | +| MemHeapMaxM | MB | Maximum size of HeapMemory configured in JVM | +| MemMaxM | MB | Maximum memory available for JVM at runtime | +| ThreadsRunnable | Count | Number of threads in RUNNABLE state | +| ThreadsBlocked | Count | Number of threads in BLOCKED state | +| ThreadsWaiting | Count | Number of threads in WAITING state | +| ThreadsTimedWaiting | Count | Number of threads in TIMED WAITING state | + +#### Metric Set: runtime + +| Metric Name | Metric Unit | Metric Description | +| ------------ | ----------- | ------------------ | +| StartTime | | Startup time | diff --git a/home/versioned_docs/version-v1.5.x/help/hdfs_namenode.md b/home/versioned_docs/version-v1.5.x/help/hdfs_namenode.md new file mode 100644 index 00000000000..1afd6d4b1ae --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hdfs_namenode.md @@ -0,0 +1,92 @@ +--- +id: hdfs_namenode +title: Monitoring HDFS NameNode Monitoring +sidebar_label: Apache HDFS NameNode +keywords: [big data monitoring system, distributed file system monitoring, HDFS NameNode monitoring] +--- + +> Hertzbeat monitors metrics for HDFS NameNode nodes. + +**Protocol Used: HTTP** + +## Pre-Monitoring Actions + +Ensure that you have obtained the JMX monitoring port for the HDFS NameNode. + +## Configuration Parameters + +| Parameter Name | Parameter Description | +| ------------------ |--------------------------------------------------------| +| Target Host | The IPv4, IPv6, or domain name of the target being monitored. Exclude protocol headers. | +| Port | The monitoring port number of the HDFS NameNode, default is 50070. | +| Query Timeout | Timeout for querying the HDFS NameNode, in milliseconds, default is 6000 milliseconds. | +| Metrics Collection Interval | Time interval for collecting monitoring data, in seconds, minimum interval is 30 seconds. | +| Probe Before Monitoring | Whether to probe and check the availability of monitoring before adding it. | +| Description/Remarks | Additional description and remarks for this monitoring. | + +### Collected Metrics + +#### Metric Set: FSNamesystem + +| Metric Name | Metric Unit | Metric Description | +| --------------------------- | ----------- | ------------------------------------- | +| CapacityTotal | | Total cluster storage capacity | +| CapacityTotalGB | GB | Total cluster storage capacity | +| CapacityUsed | | Used cluster storage capacity | +| CapacityUsedGB | GB | Used cluster storage capacity | +| CapacityRemaining | | Remaining cluster storage capacity | +| CapacityRemainingGB | GB | Remaining cluster storage capacity | +| CapacityUsedNonDFS | | Non-HDFS usage of cluster capacity | +| TotalLoad | | Total client connections in the cluster | +| FilesTotal | | Total number of files in the cluster | +| BlocksTotal | | Total number of BLOCKs | +| PendingReplicationBlocks | | Number of blocks awaiting replication | +| UnderReplicatedBlocks | | Number of blocks with insufficient replicas | +| CorruptBlocks | | Number of corrupt blocks | +| ScheduledReplicationBlocks | | Number of blocks scheduled for replication | +| PendingDeletionBlocks | | Number of blocks awaiting deletion | +| ExcessBlocks | | Number of excess blocks | +| PostponedMisreplicatedBlocks| | Number of misreplicated blocks postponed for processing | +| NumLiveDataNodes | | Number of live data nodes in the cluster | +| NumDeadDataNodes | | Number of data nodes marked as dead | +| NumDecomLiveDataNodes | | Number of decommissioned live nodes | +| NumDecomDeadDataNodes | | Number of decommissioned dead nodes | +| NumDecommissioningDataNodes | | Number of nodes currently being decommissioned | +| TransactionsSinceLastCheckpoint | | Number of transactions since the last checkpoint | +| LastCheckpointTime | | Time of the last checkpoint | +| PendingDataNodeMessageCount| | Number of DATANODE requests queued in the standby namenode | + +#### Metric Set: RPC + +| Metric Name | Metric Unit | Metric Description | +| ------------------------- | ----------- | -------------------------- | +| ReceivedBytes | | Data receiving rate | +| SentBytes | | Data sending rate | +| RpcQueueTimeNumOps | | RPC call rate | + +#### Metric Set: runtime + +| Metric Name | Metric Unit | Metric Description | +| ------------------------- | ----------- | ------------------- | +| StartTime | | Start time | + +#### Metric Set: JvmMetrics + +| Metric Name | Metric Unit | Metric Description | +| ------------------------- | ----------- | ------------------- | +| MemNonHeapUsedM | MB | Current usage of NonHeapMemory by JVM | +| MemNonHeapCommittedM | MB | Committed NonHeapMemory by JVM | +| MemHeapUsedM | MB | Current usage of HeapMemory by JVM | +| MemHeapCommittedM | MB | Committed HeapMemory by JVM | +| MemHeapMaxM | MB | Maximum HeapMemory configured for JVM | +| MemMaxM | MB | Maximum memory that can be used by JVM | +| GcCountParNew | Count | Number of ParNew GC events | +| GcTimeMillisParNew | Milliseconds| Time spent in ParNew GC | +| GcCountConcurrentMarkSweep| Count | Number of ConcurrentMarkSweep GC events| +| GcTimeMillisConcurrentMarkSweep | Milliseconds | Time spent in ConcurrentMarkSweep GC | +| GcCount | Count | Total number of GC events | +| GcTimeMillis | Milliseconds| Total time spent in GC events | +| ThreadsRunnable | Count | Number of threads in RUNNABLE state | +| ThreadsBlocked | Count | Number of threads in BLOCKED state | +| ThreadsWaiting | Count | Number of threads in WAITING state | +| ThreadsTimedWaiting | Count | Number of threads in TIMED WAITING state| diff --git a/home/versioned_docs/version-v1.5.x/help/hive.md b/home/versioned_docs/version-v1.5.x/help/hive.md new file mode 100644 index 00000000000..ec0d7dee398 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hive.md @@ -0,0 +1,78 @@ +--- +id: hive +Title: Monitoring Apache Hive +sidebar_label: Apache Hive +keywords: [open source monitoring tool, open source apache hive monitoring tool, monitoring apache hive metrics] +--- + +> Collect and monitor the general performance metrics exposed by the SpringBoot actuator. + +## Pre-monitoring operations + +If you want to monitor information in `Apache Hive` with this monitoring type, you need to open your `Hive Server2` in remoting mode. + +**1、Enable metastore:** + +```shell +hive --service metastore & +``` +**2. Enable hive server2:** + +```shell +hive --service hiveserver2 & +``` + +### Configure parameters + +| Parameter name | Parameter Help describes the | +| ------------ |-------------------------------------------------------------------------------------------------------------------------------------| +| Monitor Host | THE MONITORED PEER IPV4, IPV6 OR DOMAIN NAME. Note ⚠️ that there are no protocol headers (eg: https://, http://). | +| Monitoring Name | A name that identifies this monitoring that needs to be unique. | +| Port | The default port provided by the database is 10002. | +| Enable HTTPS | Whether to access the website through HTTPS, please note that ⚠️ when HTTPS is enabled, the default port needs to be changed to 443 | +| The acquisition interval is | Monitor the periodic data acquisition interval, in seconds, and the minimum interval that can be set is 30 seconds | +| Whether to probe the | Whether to check the availability of the monitoring before adding a monitoring is successful, and the new modification operation | will continue only if the probe is successful +| Description Comment | For more information identifying and describing the remarks for this monitoring, users can remark the information here | + +### Collect metrics + +#### metric Collection: basic + +| Metric Name | metric unit | Metrics help describe | +|-------------| -------- |--------------------------------| +| vm_name | None | The name of the virtual machine (VM) running HiveServer2. | +| vm_vendor | None | The vendor or provider of the virtual machine. | +| vm_version | None | The version of the virtual machine. | +| up_time | None | The duration for which HiveServer2 has been running. | + +#### metric Collection: enviroment + +| Metric Name | metric unit | Metrics help describe | +|-----------------| -------- |-------------------------------------| +| https_proxyPort | None | The port number used for HTTPS proxy communication. | +| os_name | None | The name of the operating system on which HiveServer2 is running. | +| os_version | None | The version of the operating system.| +| os_arch | None | The architecture of the operating system.| +| java_runtime_name | None | The name of the Java runtime environment used by HiveServer2. | +| java_runtime_version | None | The version of the Java runtime environment. | + +#### metric Collection: thread + +| Metric Name | metric unit | Metrics help describe | +| ---------------- |------|--------------------| +| thread_count | None | The current number of threads being used by HiveServer2. | +| total_started_thread | None | The total count of threads started by HiveServer2 since its launch. | +| peak_thread_count | None | The highest number of threads used by HiveServer2 at any given time. | +| daemon_thread_count | None | The number of daemon threads currently active in HiveServer2. | + +#### metric Collection: code_cache + +| Metric Name | metric unit | Metrics help describe | +|-------------|-------------|--------------------------------------------| +| committed | MB | The amount of memory currently allocated for the memory pool. | +| init | MB | The initial amount of memory requested for the memory pool. | +| max | MB | The maximum amount of memory that can be allocated for the memory pool. | +| used | MB | The amount of memory currently being used by the memory pool. | + + + diff --git a/home/versioned_docs/version-v1.5.x/help/http_sd.md b/home/versioned_docs/version-v1.5.x/help/http_sd.md new file mode 100644 index 00000000000..3278936d66d --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/http_sd.md @@ -0,0 +1,54 @@ +--- +id: httpsd +title: Monitoring Httpsd +sidebar_label: Httpsd Monitor +keywords: [open source monitoring tool, open source java monitoring tool, monitoring httpsd metrics] +--- + +> Collect and monitor the general performance Metrics of Httpsd. + +**Protocol Use:httpsd** + +# Steps to monitor micro services + +1. Make sure your **Register center** is available + + > We currently support for `Consul` and `Nacos`. + +2. Add http_sd monitor and enter necessary info about **Register center** on Hertzbeat, such as host, port and so on. + +3. Click **OK** + +# Configuration parameter + +| Parameter name | Parameter help description | +| --------------------- | ------------------------------------------------------------ | +| Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Task name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by Register center | +| Discovery Client Type | Select one Register center that you want to monitor | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +# Collection Metrics + +## Metrics Set:server + +| Metric name | Metric unit | Metric help description | +| ------------- | ----------- | ----------------------- | +| Address | | | +| Port | | | +| Response Time | ms | | + +## Metrics Set:service + +| Metric name | Metric unit | Metric help description | +| ------------- | ----------- | -------------------------------- | +| Service Id | | | +| Service Name | | | +| Address | | | +| Port | | | +| Health Status | | Current health status of service | + + diff --git a/home/versioned_docs/version-v1.5.x/help/huawei_switch.md b/home/versioned_docs/version-v1.5.x/help/huawei_switch.md new file mode 100644 index 00000000000..2e9982c5ef9 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/huawei_switch.md @@ -0,0 +1,53 @@ +--- +id: huawei_switch +title: Monitoring:Huawei switch +sidebar_label: Huawei switch +keywords: [ open source monitoring tool, network monitoring, Huawei switch ] +--- + +> Collect and monitor the general indicators (availability, system information, port traffic, etc.) of Huawei switches. + +**Protocol Use: SNMP** + +### Configuration parameter + +| Parameter name | Parameter help description | +|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Target Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Task Name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port of SNMP. The default is 161 | +| SNMP Version | SNMP version to use | +| SNMP Community | Used in SNMP v1 and SNMP v2c, used to complete authentication in SNMP Agent, in string form. Group name includes "read" and "write", when performing SNMP query operation, "read" group name is used for authentication; when performing SNMP setting operation, "write" group name is used for authentication. When performing SNMP query operation, "read" group name is used for authentication; when performing SNMP setting operation, "write" group name is used for authentication. | +| SNMP username | For SNMP v3, MSG username | +| SNMP contextName | For SNMP v3, used to determine the MIB view of the Context EngineID to the managed device | +| SNMP authPassword | For SNMP v3, SNMP authentication passwords | +| authPassword Encryption | For SNMP v3, SNMP authentication algorithm | +| SNMP privPassphrase | For SNMP v3, SNMP encrypted passwords | +| privPassword Encryption | For SNMP v3, SNMP encrypted algorithm | +| Timeout | Set the timeout time when querying unresponsive data, in milliseconds, the default is 6000 milliseconds | +| Intervals | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Description | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metric + +Since there are too many metrics that can be queried on Huawei switches, detailed metrics can be queried +on [Huawei MIB Query Platform](https://info.support.huawei.com/info-finder/tool/en/enterprise/mib). + +This document only introduces the monitoring indicators queried in the monitor template. + +#### Metric set: huawei_core + +| Metric Name | Metric Unit | Metric Help Description | +|---------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| ifIndex | none | Interface index. This value is greater than zero and globally unique. | +| ifDescr | none | A textual string containing information about the interface. This string should include the name of the manufacturer, the product name and the version of the interface hardware/software. | +| ifMtu | octets | The size of the largest packet which can be sent/received on the interface. For interfaces that are used for transmitting network datagrams, this is the size of the largest network datagram that can be sent on the interface. | +| ifSpeed | bit/s | An estimate of the interface's current bandwidth. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. If the bandwidth of the interface is greater than the maximum value reportable by this object then this object should report its maximum value (4,294,967,295) and ifHighSpeed must be used to report the interace's speed. For a sub-layer which has no concept of bandwidth, this object should be zero. | +| ifInOctets | octets | The total number of octets received on the interface, including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. | +| ifInDiscards | none | The number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being deliverable to a higher-layer protocol. One possible reason for discarding such a packet could be to free up buffer space. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. | +| ifInErrors | none | For packet-oriented interfaces, the number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of inbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. | +| ifOutOctets | octets | The total number of octets transmitted out of the interface, including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. | +| ifOutDiscards | none | The number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. | +| ifOutErrors | none | For packet-oriented interfaces, the number of outbound packets that could not be transmitted because of errors. For character-oriented or fixed-length interfaces, the number of outbound transmission units that could not be transmitted because of errors. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime. | +| ifAdminStatus | none | The desired state of the interface. The testing(3) state indicates that no operational packets can be passed. When a managed system initializes, all interfaces start with ifAdminStatus in the down(2) state. As a result of either explicit management action or per configuration information retained by the managed system, ifAdminStatus is then changed to either the up(1) or testing(3) states (or remains in the down(2) state). | +| ifOperStatus | none | The current operational state of the interface. The testing(3) state indicates that no operational packets can be passed. If ifAdminStatus is down(2) then ifOperStatus should be down(2). If ifAdminStatus is changed to up(1) then ifOperStatus should change to up(1) if the interface is ready to transmit and receive network traffic; it should change to dormant(5) if the interface is waiting for external actions (such as a serial line waiting for an incoming connection); it should remain in the down(2) state if and only if there is a fault that prevents it from going to the up(1) state; it should remain in the notPresent(6) state if the interface has missing (typically, hardware) components. | diff --git a/home/versioned_docs/version-v1.5.x/help/hugegraph.md b/home/versioned_docs/version-v1.5.x/help/hugegraph.md new file mode 100644 index 00000000000..4fca13f4e00 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/hugegraph.md @@ -0,0 +1,150 @@ +--- +id: hugegraph +title: Monitoring HugeGraph Monitoring +sidebar_label: Apache HugeGraph +keywords: [Open Source Monitoring System, Open Source Database Monitoring, HugeGraph Monitoring] +--- +> Collect and monitor the general performance metrics of HugeGraph + +**Protocol used: HTTP** + +## Pre-monitoring Operations + +Check the `rest-server.properties` file to obtain the value of the `restserver_port` configuration item, which is used for monitoring. + +## Configuration Parameters + + +| Parameter Name | Parameter Description | +|------------------|--------------------------------------------------------| +| Target Host | The IPv4, IPv6, or domain name of the monitored endpoint. Note ⚠️ Do not include protocol headers (eg: https://, http://). | +| Port | Port number of the HugeGraph restserver, default is 8080. i.e., the value of the `restserver_port` parameter | +| Enable SSL | Enable SSL usage | +| Base Path | Base path, default is: /metrics, usually does not need to be modified | +| Task Name | Identifies the name of this monitoring, ensuring uniqueness. | +| Collection Interval | Interval for periodically collecting data for monitoring, in seconds, with a minimum interval of 30 seconds | +| Probe Enabled | Whether to probe before adding new monitoring, only continue with add/modify operations if the probe is successful | +| Description | Additional identification and description of this monitoring, users can add information here | + +### Metrics Collection + +#### Metric Set: gauges + +| Metric Name | Metric Unit | Metric Description | +| ------------------------------------ | -------- | --------------------------------- | +| edge-hugegraph-capacity | NONE | Indicates the capacity limit of edges in the current graph | +| edge-hugegraph-expire | NONE | Indicates the expiration time of edge data | +| edge-hugegraph-hits | NONE | Indicates the number of hits in the edge data cache | +| edge-hugegraph-miss | NONE | Indicates the number of misses in the edge data cache | +| edge-hugegraph-size | NONE | Indicates the number of edges in the current graph | +| instances | NONE | Indicates the number of currently running HugeGraph instances| +| schema-id-hugegraph-capacity | NONE | Indicates the capacity limit of schema IDs in the graph | +| schema-id-hugegraph-expire | NONE | Indicates the expiration time of schema ID data | +| schema-id-hugegraph-hits | NONE | Indicates the number of hits in the schema ID data cache| +| schema-id-hugegraph-miss | NONE | Indicates the number of misses in the schema ID data cache| +| schema-id-hugegraph-size | NONE | Indicates the number of schema IDs in the current graph | +| schema-name-hugegraph-capacity | NONE | Indicates the capacity limit of schema names in the graph | +| schema-name-hugegraph-expire | NONE | Indicates the expiration time of schema name data | +| schema-name-hugegraph-hits | NONE | Indicates the number of hits in the schema name data cache| +| schema-name-hugegraph-miss | NONE | Indicates the number of misses in the schema name data cache| +| schema-name-hugegraph-size | NONE | Indicates the number of schema names in the current graph | +| token-hugegraph-capacity | NONE | Indicates the capacity limit of tokens in the graph | +| token-hugegraph-expire | NONE | Indicates the expiration time of token data | +| token-hugegraph-hits | NONE | Indicates the number of hits in the token data cache | +| token-hugegraph-miss | NONE | Indicates the number of misses in the token data cache | +| token-hugegraph-size | NONE | Indicates the number of tokens in the current graph | +| users-hugegraph-capacity | NONE | Indicates the capacity limit of users in the graph | +| users-hugegraph-expire | NONE | Indicates the expiration time of user data | +| users-hugegraph-hits | NONE | Indicates the number of hits in the user data cache | +| users-hugegraph-miss | NONE | Indicates the number of misses in the user data cache | +| users-hugegraph-size | NONE | Indicates the number of users in the current graph | +| users_pwd-hugegraph-capacity | NONE | Indicates the capacity limit of user passwords | +| users_pwd-hugegraph-expire | NONE | Indicates the expiration time of user password data | +| users_pwd-hugegraph-hits | NONE | Indicates the number of hits in the user password data cache| +| users_pwd-hugegraph-miss | NONE | Indicates the number of misses in the user password data cache| +| users_pwd-hugegraph-size | NONE | Indicates the number of user passwords in the current graph | +| vertex-hugegraph-capacity | NONE | Indicates the capacity limit of vertices in the graph | +| vertex-hugegraph-expire | NONE | Indicates the expiration time of vertex data | +| vertex-hugegraph-hits | NONE | Indicates the number of hits in the vertex data cache | +| vertex-hugegraph-miss | NONE | Indicates the number of misses in the vertex data cache | +| vertex-hugegraph-size | NONE | Indicates the number of vertices in the current graph | +| batch-write-threads | NONE | Indicates the number of threads for batch write operations | +| max-write-threads | NONE | Indicates the maximum number of threads for write operations | +| pending-tasks | NONE | Indicates the number of pending tasks | +| workers | NONE | Indicates the current number of worker threads | +| average-load-penalty | NONE | Indicates the average load penalty | +| estimated-size | NONE | Indicates the estimated data size | +| eviction-count | NONE | Indicates the number of evicted data entries | +| eviction-weight | NONE | Indicates the weight of evicted data | +| hit-count | NONE | Indicates the total cache hits | +| hit-rate | NONE | Indicates the cache hit rate | +| load-count | NONE | Indicates the number of data loads | +| load-failure-count | NONE | Indicates the number of data load failures | +| load-failure-rate | NONE | Indicates the data load failure rate | +| load-success-count | NONE | Indicates the number of successful data loads | +| long-run-compilation-count | NONE | Indicates the number of long-running compilations | +| miss-count | NONE | Indicates the total cache misses | +| miss-rate | NONE | Indicates the cache miss rate | +| request-count | NONE | Indicates the total request count | +| total-load-time | NONE | Indicates the total data load time | +| sessions | NONE | Indicates the current number of active sessions | + + + + +#### Metric Set: counters + + + +| Metric Name | Metric Unit | Metric Description | +| --------------------------------------------- | -------- | ---------------------------------------- | +| GET-SUCCESS_COUNTER | NONE | Records the number of successful GET requests | +| GET-TOTAL_COUNTER | NONE | Records the total number of GET requests | +| favicon-ico-GET-FAILED_COUNTER | NONE | Records the number of failed GET requests to retrieve favicon.ico | +| favicon-ico-GET-TOTAL_COUNTER | NONE | Records the total number of GET requests to retrieve favicon.ico | +| graphs-HEAD-FAILED_COUNTER | NONE | Records the number of failed HEAD requests for graphs resources | +| graphs-HEAD-SUCCESS_COUNTER | NONE | Records the number of successful HEAD requests for graphs resources | +| graphs-HEAD-TOTAL_COUNTER | NONE | Records the total number of HEAD requests for graphs resources | +| graphs-hugegraph-graph-vertices-GET-SUCCESS_COUNTER | NONE | Records the number of successful GET requests for vertices in HugeGraph graphs | +| graphs-hugegraph-graph-vertices-GET-TOTAL_COUNTER | NONE | Records the total number of GET requests for vertices in HugeGraph graphs | +| metrics-GET-FAILED_COUNTER | NONE | Records the number of failed GET requests to retrieve metrics | +| metrics-GET-TOTAL_COUNTER | NONE | Records the total number of GET requests to retrieve metrics | +| metrics-GET-SUCCESS_COUNTER | NONE | Records the number of successful GET requests to retrieve metrics | +| metrics-GET-TOTAL_COUNTER | NONE | Records the total number of GET requests to retrieve metrics | +| metrics-gauges-GET-SUCCESS_COUNTER | NONE | Records the number of successful GET requests to retrieve metrics gauges | +| metrics-gauges-GET-TOTAL_COUNTER | NONE | Records the total number of GET requests to retrieve metrics gauges | + + + + +#### Metric Set: system + + + +| Metric Name | Metric Unit | Metric Description | +| --------------------------------------------- | -------- | -------------------------------------------------- | +| mem | NONE | Indicates the total memory of the system | +| mem_total | NONE | Indicates the total memory of the system (same as mem) | +| mem_used | NONE | Indicates the currently used memory of the system | +| mem_free | NONE | Indicates the free memory of the system | +| mem_unit | NONE | Indicates the unit of memory (such as bytes, kilobytes, megabytes, etc.) | +| processors | NONE | Indicates the number of processors in the system | +| uptime | NONE | Indicates the system uptime, i.e., the time since booting | +| systemload_average | NONE | Indicates the average system load, reflecting the system's busyness | +| heap_committed | NONE | Indicates the committed size of JVM heap memory, i.e., the guaranteed heap memory size available to JVM | +| heap_init | NONE | Indicates the initial size of JVM heap memory | +| heap_used | NONE | Indicates the currently used JVM heap memory size | +| heap_max | NONE | Indicates the maximum available size of JVM heap memory | +| nonheap_committed | NONE | Indicates the committed size of JVM non-heap memory | +| nonheap_init | NONE | Indicates the initial size of JVM non-heap memory | +| nonheap_used | NONE | Indicates the currently used JVM non-heap memory size | +| nonheap_max | NONE | Indicates the maximum available size of JVM non-heap memory | +| thread_peak | NONE | Indicates the peak number of threads since JVM startup | +| thread_daemon | NONE | Indicates the current number of active daemon threads | +| thread_total_started | NONE | Indicates the total number of threads started since JVM startup | +| thread_count | NONE | Indicates the current number of active threads | +| garbage_collector_g1_young_generation_count | NONE | Indicates the number of young generation garbage collections by G1 garbage collector | +| garbage_collector_g1_young_generation_time | NONE | Indicates the total time spent in young generation garbage collections by G1 garbage collector | +| garbage_collector_g1_old_generation_count | NONE | Indicates the number of old generation garbage collections by G1 garbage collector | +| garbage_collector_g1_old_generation_time | NONE | Indicates the total time spent in old generation garbage collections by G1 garbage collector | +| garbage_collector_time_unit | NONE | Indicates the unit of garbage collection time (such as milliseconds, seconds, etc.) | \ No newline at end of file diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/influxdb.md b/home/versioned_docs/version-v1.5.x/help/influxdb.md similarity index 96% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/influxdb.md rename to home/versioned_docs/version-v1.5.x/help/influxdb.md index 8aaef6ae6f4..cf3d838e796 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/influxdb.md +++ b/home/versioned_docs/version-v1.5.x/help/influxdb.md @@ -1,7 +1,7 @@ --- -id: influxdb -title: Monitoring: InfluxDB Database Monitoring -sidebar_label: InfluxDB Database +id: influxdb +title: Monitoring InfluxDB Database +sidebar_label: InfluxDB Database keywords: [open source monitoring system, open source database monitoring, InfluxDB database monitoring] --- diff --git a/home/versioned_docs/version-v1.5.x/help/influxdb_promql.md b/home/versioned_docs/version-v1.5.x/help/influxdb_promql.md new file mode 100644 index 00000000000..fcef4b4acff --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/influxdb_promql.md @@ -0,0 +1,61 @@ +--- +id: influxdb_promql +title: Monitoring InfluxDB-PromQL +sidebar_label: InfluxDB-PromQL +keywords: [ Open Source Monitoring System, InfluxDB Monitoring, InfluxDB-PromQL Monitoring ] +--- + +> Monitor InfluxDB by querying generic metrics data from Prometheus server using Prometheus PromQL. This approach is suitable when Prometheus is already monitoring InfluxDB and you need to fetch InfluxDB's monitoring data from Prometheus server. + +### Configuration Parameters + +| Parameter Name | Parameter help description | +|---------------------|----------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | IP, IPv6, or domain name of the target being monitored. Note ⚠️: Do not include protocol header (e.g., https://, http://). | +| Monitoring name | Name to identify this monitoring, ensuring uniqueness of names. | +| Port | Prometheus API port, default: 9090. | +| Relative path | Relative path of Prometheus to query PromQL, default: /api/v1/query | +| Request mode | Set the request method for API calls: GET, POST, PUT, DELETE, default: GET | +| Enable HTTPS | Whether to access the website via HTTPS, note ⚠️: enabling HTTPS generally requires changing the corresponding port to 443 | +| Username | Username for Basic or Digest authentication when accessing the API. | +| Password | Password for Basic or Digest authentication when accessing the API. | +| Content-Type | Resource type when carrying BODY request data. | +| Request BODY | Set the BODY request data, effective for PUT and POST request methods. | +| Collection interval | Interval for periodic data collection in seconds, the minimum interval that can be set is 30 seconds | +| Description remarks | Additional remarks and descriptions for this monitoring. Users can add notes here. | + +### Metrics Collection + +#### Metric Set: basic_influxdb_memstats_alloc + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| instance | None | Instance to which the metric belongs | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | + +#### Metric Set: influxdb_database_numMeasurements + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| job | None | Metric name | +| instance | None | Instance to which the metric belongs | +| database | None | Name of the database | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | + +#### Metric Set: influxdb_query_rate_seconds + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| instance | None | Instance to which the metric belongs | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | + +#### Metric Set: influxdb_queryExecutor_queriesFinished_10s + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| instance | None | Instance to which the metric belongs | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/iotdb.md b/home/versioned_docs/version-v1.5.x/help/iotdb.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/iotdb.md rename to home/versioned_docs/version-v1.5.x/help/iotdb.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/issue.md b/home/versioned_docs/version-v1.5.x/help/issue.md similarity index 85% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/issue.md rename to home/versioned_docs/version-v1.5.x/help/issue.md index 572f1383afc..c3dffd147be 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/issue.md +++ b/home/versioned_docs/version-v1.5.x/help/issue.md @@ -16,20 +16,18 @@ sidebar_label: Common issues The hertzbeat installed and deployed by the installation package is not available for ping connectivity monitoring, but local direct ping is available 。 > The deployment of the installation package requires configuring the root permission of the Java virtual machine to start hertzbeat to use ICMP. If the root permission is not enabled, judge whether port 7 of telnet opposite end is opened. > When you install HertzBeat via DockerDocker root is enabled by default. No such problem. +> See https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address -4. If the history chart on the monitoring page is not displayed,popup [please configure dependency service on TDengine time series database] -> As shown in the popup window,the premise of history chart display is that you need install and configure hertzbeat's dependency service - TDengine database. -> Installation and initialization this database refers to [TDengine Installation and Initialization](../start/tdengine-init). ### Docker Deployment common issues 1. **MYSQL, TDENGINE and HertzBeat are deployed on the same host by Docker,HertzBeat use localhost or 127.0.0.1 connect to the database but fail** -The problems lies in Docker container failed to visit and connect localhost port. Beacuse the docker default network mode is Bridge mode which can't access loacl machine through localhost. +The problems lies in Docker container failed to visit and connect localhost port. Because the docker default network mode is Bridge mode which can't access local machine through localhost. > Solution A:Configure application.yml. Change database connection address from localhost to external IP of the host machine. > Solution B:Use the Host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....` 2. **According to the process deploy,visit http://ip:1157/ no interface** -Please refer to the following points to troubleshoot issuess: +Please refer to the following points to troubleshoot issues: > one:Whether the MySQL database and tdengine database as dependent services have been successfully started, whether the corresponding hertzbeat database has been created, and whether the SQL script has been executed. > two:Check whether dependent service, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. > > three:`docker logs hertzbeat` Check whether the container log has errors. If you haven't solved the issue, report it to the communication group or community. @@ -41,7 +39,7 @@ Please refer to the following points to troubleshoot issuess: ### Package Deployment common issues 1. **According to the process deploy,visit http://ip:1157/ no interface** - Please refer to the following points to troubleshoot issuess: + Please refer to the following points to troubleshoot issues: > one:Whether the MySQL database and tdengine database as dependent services have been successfully started, whether the corresponding hertzbeat database has been created, and whether the SQL script has been executed. > two:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`. > three: Check whether the running log has errors in `hertzbeat/logs/` directory. If you haven't solved the issue, report it to the communication group or community. diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/jetty.md b/home/versioned_docs/version-v1.5.x/help/jetty.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/jetty.md rename to home/versioned_docs/version-v1.5.x/help/jetty.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/jvm.md b/home/versioned_docs/version-v1.5.x/help/jvm.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/jvm.md rename to home/versioned_docs/version-v1.5.x/help/jvm.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/kafka.md b/home/versioned_docs/version-v1.5.x/help/kafka.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/kafka.md rename to home/versioned_docs/version-v1.5.x/help/kafka.md diff --git a/home/versioned_docs/version-v1.5.x/help/kafka_promql.md b/home/versioned_docs/version-v1.5.x/help/kafka_promql.md new file mode 100644 index 00000000000..e88f6eb0342 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/kafka_promql.md @@ -0,0 +1,66 @@ +--- +id: kafka_promql +title: Monitoring Kafka-PromQL +sidebar_label: Kafka-PromQL +keywords: [ Open Source Monitoring System, Open Source Middleware Monitoring, Kafka Monitoring, Kafka-PromQL Monitoring ] +--- + +> Monitor Kafka by querying generic metrics data from Prometheus server using Prometheus PromQL. This approach is suitable when Prometheus is already monitoring Kafka and you need to fetch Kafka's +> monitoring data from Prometheus server. + +### Prerequisites + +1. Deploy Kafka. +2. Deploy kafka_exporter. +3. Collect monitoring metrics exposed by kafka_exporter through Prometheus. + +### Configuration Parameters + +| Parameter Name | Parameter Description | +|---------------------|----------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | IP, IPv6, or domain name of the target being monitored. Note ⚠️: Do not include protocol header (e.g., https://, http://). | +| Monitoring name | Name to identify this monitoring, ensuring uniqueness of names. | +| Port | Prometheus API port, default: 9090. | +| Relative path | Relative path of Prometheus to query PromQL, default: /api/v1/query | +| Request mode | Set the request method for API calls: GET, POST, PUT, DELETE, default: GET | +| Enable HTTPS | Whether to access the website via HTTPS, note ⚠️: enabling HTTPS generally requires changing the corresponding port to 443 | +| Username | Username for Basic or Digest authentication when accessing the API. | +| Password | Password for Basic or Digest authentication when accessing the API. | +| Content-Type | Resource type when carrying BODY request data. | +| Request BODY | Set the BODY request data, effective for PUT and POST request methods. | +| Collection interval | Interval for periodic data collection in seconds, the minimum interval that can be set is 30 seconds | +| Description remarks | Additional remarks and descriptions for this monitoring. Users can add notes here. | + +### Metrics Collection + +#### Metric Set: kafka_brokers + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| \_\_name__ | None | Metric name | +| instance | None | Instance to which the metric belongs | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | + +#### Metric Set: kafka_topic_partitions + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| \_\_name__ | None | Metric name | +| instance | None | Instance to which the metric belongs | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | + +#### Metric Set: kafka_server_brokertopicmetrics_bytesinpersec + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------------------| +| \_\_name__ | None | Metric name | +| instance | None | Instance to which the metric belongs | +| timestamp | None | Timestamp of metric collection | +| value | None | Metric value | + +### Other Kafka Monitoring Methods Supported by HertzBeat + +1. If Kafka is enabled with JMX monitoring, you can use [Kafka](kafka) Monitoring. +2. If Kafka cluster deploys kafka_exporter to expose monitoring metrics, you can refer to [Prometheus task](prometheus) to configure the Prometheus collection task to monitor kafka. diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/kubernetes.md b/home/versioned_docs/version-v1.5.x/help/kubernetes.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/kubernetes.md rename to home/versioned_docs/version-v1.5.x/help/kubernetes.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/linux.md b/home/versioned_docs/version-v1.5.x/help/linux.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/linux.md rename to home/versioned_docs/version-v1.5.x/help/linux.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/mariadb.md b/home/versioned_docs/version-v1.5.x/help/mariadb.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/mariadb.md rename to home/versioned_docs/version-v1.5.x/help/mariadb.md diff --git a/home/versioned_docs/version-v1.5.x/help/memcached.md b/home/versioned_docs/version-v1.5.x/help/memcached.md new file mode 100644 index 00000000000..5d89ce0977b --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/memcached.md @@ -0,0 +1,69 @@ +--- +id: memcached +title: Monitoring Memcached +sidebar_label: Memcached Monitor +keywords: [ open source monitoring tool, open source Memcached monitoring tool, monitoring memcached metrics ] +--- + +> Collect and monitor the general performance Metrics of Memcached. + +**Protocol Use:Memcached** + +```text +The default YML configuration for the memcache version is in compliance with 1.4.15. +You need to use the stats command to view the parameters that your memcache can monitor +``` + +### + +**1、Obtain usable parameter indicators through commands such as stats、stats setting、stats settings. + +```shell +# telnet ip port +[root@server ~]# telnet localhost 11211 +Trying ::1... +Connected to localhost. +Escape character is '^]'. +stats +STAT pid 15168 +STAT uptime 11691 +STAT time 1702569246 +STAT version 1.4.15 +... +``` + +**There is help_doc: https://www.runoob.com/memcached/memcached-stats.html** + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by Memcached | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:server_info + +| Metric name | Metric unit | Metric help description | +|------------------|-------------|---------------------------------------------------| +| pid | | Memcache server process ID | +| uptime | s | The number of seconds the server has been running | +| version | | Memcache version | +| curr_connections | | Current number of connections | +| auth_errors | | Number of authentication failures | +| threads | | Current number of threads | +| item_size | byte | The size of the item | +| item_count | | Number of items | +| curr_items | | The total number of data currently stored | +| total_items | | The total number of data stored since startup | +| bytes | byte | The current number of bytes occupied by storage | +| cmd_get | | Get command request count | +| cmd_set | | Set command request count | +| cmd_flush | | Flush command request count | +| get_misses | | Get command misses | +| delete_misses | | Delete command misses | \ No newline at end of file diff --git a/home/versioned_docs/version-v1.5.x/help/mongodb.md b/home/versioned_docs/version-v1.5.x/help/mongodb.md new file mode 100644 index 00000000000..4a2951ec23c --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/mongodb.md @@ -0,0 +1,96 @@ +--- +id: mongodb +title: Monitoring:MongoDB +sidebar_label: MongoDB database +keywords: [ open source monitoring tool, open source database monitoring tool, monitoring MongoDB database metrics ] +--- + +> Collect and monitor the general performance Metrics of MongoDB database. + +### Configuration parameter + +| Parameter name | Parameter help description | +|------------------------|-------------------------------------------------------------------------------------------------------------------------| +| Target Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://). | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique. | +| Port | Port provided by the database. The default is 27017. | +| Username | Username for MongoDB,Optional. | +| Password | Password for MongoDB,Optional. | +| database | Database name. | +| authenticationDatabase | Credentials Storage Database. | +| Connect Timeout(ms) | Set connection timeout for MongoDB, unit: ms, default: 6000ms. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metric + +#### Metric set:Build Info + +| Metric name | Metric unit | Metric help description | +|------------------|-------------|-----------------------------------------------------------------------------------------| +| version | none | The version number of the MongoDB server. | +| gitVersion | none | The Git version of the MongoDB codebase. | +| sysInfo | none | System information, typically includes details about the operating system and platform. | +| loaderFlags | none | Loader flags used to link MongoDB binaries | +| compilerFlags | none | Compiler flags used when compiling MongoDB. | +| allocator | none | The memory allocator used by MongoDB. | +| javascriptEngine | none | The JavaScript engine used by MongoDB. | + +#### Metric set:Server Document + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-----------------------------------| +| deleted | none | The number of documents deleted. | +| inserted | none | The number of documents inserted. | +| returned | none | The number of documents returned. | +| updated | none | The number of documents updated. | + +#### Metric set:Server Operation + +| Metric name | Metric unit | Metric help description | +|----------------|-------------|------------------------------------------------------------------| +| scanAndOrder | none | The number of times a query required both scanning and ordering. | +| writeConflicts | none | The number of write conflicts that occurred. | + +#### Metric set: Max Connections + +| Metric name | Metric unit | Metric help description | +|------------------|-------------|--------------------------------------------| +| deletedDocuments | none | Number of deleted documents. | +| passes | none | Total number of passes for TTL operations. | + +#### Metric set:System Info + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|------------------------------------------------------| +| currentTime | none | Current system time. | +| hostname | none | Hostname of the server. | +| cpuAddrSize | MB | Size of CPU address in bits. | +| memSizeMB | MB | Total size of system memory in megabytes. | +| memLimitMB | MB | Memory limit for the MongoDB process in megabytes. | +| numCores | none | Total number of CPU cores. | +| cpuArch | none | CPU architecture. | +| numaEnabled | none | Whether NUMA (Non-Uniform Memory Access) is enabled. | + +#### Metric set:OS Info + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|----------------------------------| +| type | none | Type of the operating system. | +| name | none | Name of the operating system. | +| version | none | Version of the operating system. | + +#### Metric set:Extra Info + +| Metric name | Metric unit | Metric help description | +|-----------------|-------------|--------------------------------------------------------| +| versionString | none | String describing the version of the operating system. | +| libcVersion | none | Version of the C standard library (libc). | +| kernelVersion | none | Version of the operating system kernel. | +| cpuFrequencyMHz | none | Frequency of the CPU in megahertz. | +| cpuFeatures | none | Features supported by the CPU. | +| pageSize | none | Size of a memory page in bytes. | +| numPages | none | Total number of memory pages. | +| maxOpenFiles | none | Maximum number of open files allowed. | + diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/mysql.md b/home/versioned_docs/version-v1.5.x/help/mysql.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/mysql.md rename to home/versioned_docs/version-v1.5.x/help/mysql.md diff --git a/home/versioned_docs/version-v1.5.x/help/nacos.md b/home/versioned_docs/version-v1.5.x/help/nacos.md new file mode 100644 index 00000000000..721f1776c2a --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/nacos.md @@ -0,0 +1,93 @@ +--- +id: nacos +title: Monitoring:Nacos Server monitoring +sidebar_label: Nacos Server +keywords: [open source monitoring tool, open source middleware monitoring tool, monitoring Nacos Server metrics] +--- + +> Hertzbeat monitors metrics of the Nacos Server by calling the Nacos Metrics Api. + +### PreRequisites + +#### Deploy Nacos cluster to expose metrics data + +1. Deploy the Nacos cluster according to [deployment document](https://nacos.io/en-us/docs/deployment.html). +2. Configure the application. properties file to expose metrics data. +``` +management.endpoints.web.exposure.include=* +``` +3. Access ```{ip}:8848/nacos/actuator/prometheus``` to see if metrics data can be accessed. + +More information see [Nacos monitor guide](https://nacos.io/en-us/docs/monitor-guide.html). + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Target Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Target name | Identify the name of this monitoring. The name needs to be unique | +| Nacos Port | Port provided by the Nacos Server. The default is 8848 | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metric + +#### Metric set:jvm + +| Metric name | Metric unit | Metric help description | +| ----------- | ----------- | ----------- | +| system_cpu_usage | none | cpu usage | +| system_load_average_1m | none | load | +| jvm_memory_used_bytes | byte | jvm memory used | +| jvm_memory_max_bytes | byte | jvm max memory | +| jvm_gc_pause_seconds_count | none | gc count | +| jvm_gc_pause_seconds_sum | second | gc time | +| jvm_threads_daemon | none | jvm threads count | + +#### Metric set:Nacos + +| Metric name | Metric unit | Metric help description | +| ----------- | ----------- | ----------- | +| http_server_requests_seconds_count | second | http requests count | +| http_server_requests_seconds_sum | second | http requests time | +| nacos_timer_seconds_sum | second | Nacos config notify time | +| nacos_timer_seconds_count | none | Nacos config notify count | +| nacos_monitor{name='longPolling'} | none | Nacos config connection count | +| nacos_monitor{name='configCount'} | none | Nacos configuration file count | +| nacos_monitor{name='dumpTask'} | none | Nacos config dump task count | +| nacos_monitor{name='notifyTask'} | none | Nacos config notify task count | +| nacos_monitor{name='getConfig'} | none | Nacos config read configuration count | +| nacos_monitor{name='publish'} | none | Nacos config update configuration count | +| nacos_monitor{name='ipCount'} | none | Nacos naming ip count | +| nacos_monitor{name='domCount'} | none | Nacos naming domain count(1.x version) | +| nacos_monitor{name='serviceCount'} | none | Nacos naming domain count(2.x version) | +| nacos_monitor{name='failedPush'} | none | Nacos naming push fail count | +| nacos_monitor{name='avgPushCost'} | second | Nacos naming push cost time(average) | +| nacos_monitor{name='leaderStatus'} | none | Nacos naming if node is leader | +| nacos_monitor{name='maxPushCost'} | second | Nacos naming push cost time(max) | +| nacos_monitor{name='mysqlhealthCheck'} | none | Nacos naming mysql health check count | +| nacos_monitor{name='httpHealthCheck'} | none | Nacos naming http health check count | +| nacos_monitor{name='tcpHealthCheck'} | none | Nacos naming tcp health check count | + +#### Metric set:Nacos exception + +| Metric name | Metric unit | Metric help description | +| ----------- | ----------- | ----------- | +| nacos_exception_total{name='db'} | none | database exception | +| nacos_exception_total{name='configNotify'} | none | Nacos config notify exception | +| nacos_exception_total{name='unhealth'} | none | Nacos config server health check exception | +| nacos_exception_total{name='disk'} | none | Nacos naming write disk exception | +| nacos_exception_total{name='leaderSendBeatFailed'} | none | Nacos naming leader send heart beat fail count | +| nacos_exception_total{name='illegalArgument'} | none | request argument illegal count | +| nacos_exception_total{name='nacos'} | none | Nacos inner exception | + +#### Metric set:client + +| Metric name | Metric unit | Metric help description | +| ----------- | ----------- | ----------- | +| nacos_monitor{name='subServiceCount'} | none | subscribed services count | +| nacos_monitor{name='pubServiceCount'} | none | published services count | +| nacos_monitor{name='configListenSize'} | none | listened configuration file count | +| nacos_client_request_seconds_count | none | request count | +| nacos_client_request_seconds_sum | second | request time | + \ No newline at end of file diff --git a/home/versioned_docs/version-v1.5.x/help/nebulagraph.md b/home/versioned_docs/version-v1.5.x/help/nebulagraph.md new file mode 100644 index 00000000000..ae2cfb4683f --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/nebulagraph.md @@ -0,0 +1,74 @@ +--- +id: nebulaGraph +title: Monitoring NebulaGraph +sidebar_label: NebulaGraph Database +keywords: [ open source monitoring tool, open source NebulaGraph monitoring tool, monitoring NebulaGraph metrics ] +--- + +> Collect and monitor the general performance Metrics of nebulaGraph. + +**Protocol Use:nebulaGraph** + +```text +The monitoring has two parts,nebulaGraph_stats and rocksdb_stats. +nebulaGraph_stats is nebulaGraph's statistics, and rocksdb_stats is rocksdb's statistics. +``` + +### + +**1、Obtain available parameters through the stats and rocksdb stats interfaces.** + +1.1、 If you only need to get nebulaGraph_stats, you need to ensure that you have access to stats, or you'll get errors. + +The default port is 19669 and the access address is http://ip:19669/stats + +1.2、If you need to obtain additional parameters for rocksdb stats, you need to ensure that you have access to rocksdb +stats, otherwise an error will be reported. + +Once you connect to NebulaGraph for the first time, you must first register your Storage service in order to properly +query your data. + +**There is help_doc: https://docs.nebula-graph.com.cn/3.4.3/4.deployment-and-installation/connect-to-nebula-graph/** + +**https://docs.nebula-graph.com.cn/3.4.3/2.quick-start/3.quick-start-on-premise/3.1add-storage-hosts/** + +The default port is 19779 and the access address is:http://ip:19779/rocksdb_stats + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| graphPort | Port of the Graph service provided by Nebula Graph | +| timePeriod | The value can be 5 seconds, 60 seconds, 600 seconds, or 3600 seconds, indicating the last 5 seconds, last 1 minute, last 10 minutes, and last 1 hour, respectively. | +| storagePort | Port of the storage service provided by Nebula Graph | +| Timeout | Allow collection response time | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:nebulaGraph_stats + +Too many indicators, related links are as follows +**https://docs.nebula-graph.com.cn/3.4.3/6.monitor-and-metrics/1.query-performance-metrics/** + +| Metric name | Metric unit | Metric help description | +|---------------------------------------|-------------|--------------------------------------------------------------| +| num_queries_hit_memory_watermark_rate | | The rate of statements that reached the memory watermark. | +| num_queries_hit_memory_watermark_sum | | The sum of statements that reached the memory watermark. | +| num_reclaimed_expired_sessions_sum | | Number of expired sessions actively reclaimed by the server. | +| ... | | ... | + +#### Metrics Set:rocksdb_stats + +Too many indicators, related links are as follows +**https://docs.nebula-graph.com.cn/3.4.3/6.monitor-and-metrics/2.rocksdb-statistics/** + +| Metric name | Metric unit | Metric help description | +|----------------------------|-------------|-------------------------------------------------------------| +| rocksdb.backup.read.bytes | | Number of bytes read during the RocksDB database backup. | +| rocksdb.backup.write.bytes | | Number of bytes written during the RocksDB database backup. | +| ... | | ... | diff --git a/home/versioned_docs/version-v1.5.x/help/nebulagraph_cluster.md b/home/versioned_docs/version-v1.5.x/help/nebulagraph_cluster.md new file mode 100644 index 00000000000..d0da21a7adb --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/nebulagraph_cluster.md @@ -0,0 +1,91 @@ +--- +id: nebulagraph_cluster +title: Monitoring NebulaGraph Cluster +sidebar_label: NebulaGraph Cluster +keywords: [ Open Source Monitoring System, Open Source Database Monitoring, Open Source Graph Database Monitoring, NebulaGraph Cluster Monitoring ] +--- + +> Monitor basic information, nodes, tasks, etc., of the NebulaGraph cluster. + +**Protocol Use:ngql** + +### Configuration parameters + +| Parameter Name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------| +| Target Host | The IPv4, IPv6, or domain name of the monitored peer. Note ⚠️ without the protocol header (eg: https://, http://). | +| Task Name | Identifies the name of this monitor, ensuring uniqueness of the name. | +| Graph Port | The port where the graph service is open, default is 9669. | +| Connection Timeout | Timeout for connecting to the graph service, in milliseconds, default is 6000 milliseconds. | +| Username | Database connection username. | +| Password | Database connection password. | +| Collection Interval | Interval for periodically collecting data, in seconds. The minimum interval that can be set is 30 seconds. | +| Bind Labels | Used to categorize and manage monitored resources. | +| Description | Additional information for identifying and describing this monitor. Users can add remarks here. | + +### Collection Metric + +#### Metric Set: Base info + +| Metric Name | Metric Unit | Metric help description | +|--------------|-------------|-------------------------| +| responseTime | None | Response time | +| charset | None | Character set | +| collation | None | Character set collation | + +#### Metric Set: Session + +| Metric Name | Metric Unit | Metric help description | +|---------------------|-------------|----------------------------------| +| session | None | Number of sessions | +| running_query_count | None | Number of queries being executed | + +#### Metric Set: Jobs + +| Metric Name | Metric Unit | Metric help description | +|--------------|-------------|-------------------------------------------| +| queue_jobs | None | Number of pending background tasks | +| running_jobs | None | Number of background tasks being executed | + +#### Metric Set: Cluster node info + +| Metric Name | Metric Unit | Metric help description | +|----------------------|-------------|---------------------------------| +| total_storage_node | None | Number of storage nodes | +| offline_storage_node | None | Number of offline storage nodes | +| total_meta_node | None | Number of meta nodes | +| offline_meta_node | None | Number of offline meta nodes | +| total_graph_node | None | Number of graph nodes | +| offline_graph_node | None | Number of offline graph nodes | + +#### Metric Set: Storage Nodes + +| Metric Name | Metric Unit | Metric help description | +|-----------------------|-------------|-------------------------------------------------------| +| host | None | Node address | +| port | None | Port | +| status | None | Status (ONLINE/OFFLINE) | +| leaderCount | None | Number of leader partitions on the current node | +| leaderDistribution | None | Distribution of leader partitions on the current node | +| partitionDistribution | None | Distribution of partitions on the current node | +| version | None | Version | + +#### Metric Set: Meta Nodes + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| host | None | Node address | +| port | None | Port | +| status | None | Status (ONLINE/OFFLINE) | +| version | None | Version | + +#### Metric Set: Graph Nodes + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| host | None | Node address | +| port | None | Port | +| status | None | Status (ONLINE/OFFLINE) | +| version | None | Version | + +> If you need to customize monitoring templates to collect data from NebulaGraph clusters, please refer to: [NGQL Custom Monitoring](../advanced/extend-ngql.md) diff --git a/home/versioned_docs/version-v1.5.x/help/nginx.md b/home/versioned_docs/version-v1.5.x/help/nginx.md new file mode 100644 index 00000000000..99bb389000c --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/nginx.md @@ -0,0 +1,155 @@ +--- +id: nginx +title: Monitoring Nginx +sidebar_label: Nginx Monitor +keywords: [open source monitoring tool, open source java monitoring tool, monitoring nginx metrics] +--- + +> Collect and monitor the general performance Metrics of Nginx. + +**Protocol Use:Nginx** + +### Need Enable `ngx_http_stub_status_module` And `ngx_http_reqstat_module` Module + +If you want to monitor information in 'Nginx' with this monitoring type, you need to modify your nginx configure file for enable the module monitor. + +### Enable `ngx_http_stub_status_module` + +1. Check if `ngx_http_stub_status_module` has been added + +```shell +nginx -V +``` +View whether it contains `--with-http_stub_status_module`, if not, you need to recompile and install Nginx. + +2. Compile and install Nginx, add `ngx_http_stub_status_module` module + +Download Nginx and unzip it, execute the following command in the directory + +```shell + +./configure --prefix=/usr/local/nginx --with-http_stub_status_module + +make && make install +``` + +3. Modify Nginx configure file + +Modify the `nginx.conf` file and add the monitoring module exposed endpoint, as follows: + +```shell +# modify nginx.conf +server { + listen 80; # port + server_name localhost; + location /nginx-status { + stub_status on; + access_log on; + #allow 127.0.0.1; #only allow requests from localhost + #deny all; #deny all other hosts + } +} +``` +4. Reload Nginx + +```shell + +nginx -s reload +``` + +5. Access `http://localhost/nginx-status` in the browser to view the Nginx monitoring status information. + +### Enable `ngx_http_reqstat_module` + +```shell +# install `ngx_http_reqstat_module` +wget https://github.com/zls0424/ngx_req_status/archive/master.zip -O ngx_req_status.zip + +unzip ngx_req_status.zip + +patch -p1 < ../ngx_req_status-master/write_filter.patch + +./configure --prefix=/usr/local/nginx --add-module=/path/to/ngx_req_status-master + +make -j2 + +make install +``` + +2. Modify Nginx configure file + +update `nginx.conf` file, add status module exposed endpoint, as follows: + +```shell +# modify nginx.conf +http { + req_status_zone server_name $server_name 256k; + req_status_zone server_addr $server_addr 256k; + + req_status server_name server_addr; + + server { + location /req-status { + req_status_show on; + #allow 127.0.0.1; #only allow requests from localhost + #deny all; #deny all other hosts + } + } +} +``` + +3. Reload Nginx + +```shell + +nginx -s reload +``` + +4. Access `http://localhost/req-status` in the browser to view the Nginx monitoring status information. + + +**Refer Doc: https://github.com/zls0424/ngx_req_status** + +**⚠️Attention: The endpoint path of the monitoring module is `/nginx-status` `/req-status`** + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by Nginx | +| Timeout | Allow collection response time | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:nginx_status + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|------------------------------------------| +| accepts | | Accepted connections | +| handled | | Successfully processed connections | +| active | | Currently active connections | +| dropped | | Discarded connections | +| requests | | Client requests | +| reading | | Connections performing read operations | +| writing | | Connections performing write operations | +| waiting | | Waiting connections | + +#### Metrics Set:req_status + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|---------------------------------| +| zone_name | | Group category | +| key | | Group name | +| max_active | | Maximum concurrent connections | +| max_bw | kb | Maximum bandwidth | +| traffic | kb | Total traffic | +| requests | | Total requests | +| active | | Current concurrent connections | +| bandwidth | kb | Current bandwidth | + + diff --git a/home/versioned_docs/version-v1.5.x/help/ntp.md b/home/versioned_docs/version-v1.5.x/help/ntp.md new file mode 100644 index 00000000000..5eca6c58e80 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/ntp.md @@ -0,0 +1,38 @@ +--- +id: ntp +title: Monitoring NTP +sidebar_label: NTP Monitor +keywords: [ open source monitoring tool, open source NTP monitoring tool, monitoring NTP metrics ] +--- + +> Collect and monitor the general performance Metrics of NTP. + +**Protocol Use:NTP** + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:summary + +| Metric name | Metric unit | Metric help description | +|--------------|-------------|------------------------------------------------------------------------------------------| +| responseTime | ms | The time it takes for the NTP server to respond to a request). | +| time | ms | The current time reported by the NTP server). | +| date | | The date corresponding to the current time reported by the NTP server). | +| offset | ms | The time difference between the NTP server's clock and the client's clock). | +| delay | ms | The time it takes for a request to reach the NTP server and for the response to return). | +| version | | The version number of the NTP protocol used by the server). | +| mode | | The operating mode of the NTP server, such as client, server, or broadcast). | +| stratum | | The stratumevel of the NTP server, indicating its distance from a reference clock). | +| referenceId | | An identifier that indicates the reference clock or time source used by the NTP server). | +| precision | | The precision of the NTP server's clock, indicating its accuracy). | + diff --git a/home/versioned_docs/version-v1.5.x/help/openai.md b/home/versioned_docs/version-v1.5.x/help/openai.md new file mode 100644 index 00000000000..7fc70548645 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/openai.md @@ -0,0 +1,82 @@ +--- +id: openai +title: Monitoring OpenAI Account Status +sidebar_label: OpenAI Account Status +keywords: [open source monitoring system, open source network monitoring, OpenAI account monitoring] +--- + +### Preparation + +#### Obtain Session Key +> 1. Open Chrome browser's network request interface +> `Mac: cmd + option + i` +> `Windows: ctrl + shift + i` +> 2. Visit https://platform.openai.com/usage +> 3. Find the request to https://api.openai.com/dashboard/billing/usage +> 4. Find the Authorization field in the request headers, and copy the content after `Bearer`. For example: `sess-123456` + +### Notes + +> 1. Please ensure that HertzBeat has external network access capability. If unsure, you can try detecting by creating HTTP API monitoring for openai.com in HertzBeat. +> 2. The monitoring period should be at least greater than 120 seconds to avoid sending requests too frequently, resulting in return status code 429 (Too Many Requests). + +### Configuration Parameters + +| Parameter Name | Parameter Description | +|:------------------|------------------------------------------------------------------------------------------------| +| Monitoring Host | Fill in api.openai.com here. | +| Task Name | Identify the name of this monitoring, ensuring uniqueness. | +| Session Key | The session key obtained in the preparation step. | +| Collector | Configure which collector to use for scheduling collection for this monitoring. | +| Monitoring Period | Interval time for periodic data collection, in seconds, with a minimum interval of 30 seconds. | +| Bound Tags | Tags for managing classification of monitoring resources. | +| Description | Additional identification and description for this monitoring, users can leave remarks here. | + +### Collection Metrics + +#### Metric Set: Credit Grants + +| Metric Name | Metric Unit | Metric Description | +|----------------------|-------------|--------------------------------------| +| Total Granted | USD ($) | Total granted credit limit | +| Total Used | USD ($) | Total used credit limit | +| Total Available | USD ($) | Total available credit limit | +| Total Paid Available | USD ($) | Total payable available credit limit | + +#### Metric Set: Model Cost + +| Metric Name | Metric Unit | Metric Description | +|-------------|-------------|------------------------| +| Model Name | None | Name of the model | +| Cost | USD ($) | Expenses for the model | + +#### Metric Set: Billing Subscription + +| Metric Name | Metric Unit | Metric Description | +|--------------------------|-------------|-----------------------------------------| +| Has Payment Method | None | Whether payment method is available | +| Canceled | None | Whether subscription is cancelled | +| Canceled At | None | Time of subscription cancellation | +| Delinquent | None | Whether subscription is overdue | +| Soft Limit | Times | Maximum usage limit in a certain period | +| Hard Limit | Times | Maximum usage limit | +| System Hard Limit | Times | System hard limit usage | +| Soft Limit USD | USD ($) | Soft limit charge | +| Hard Limit USD | USD ($) | Hard limit charge | +| System Hard Limit USD | USD ($) | System hard limit charge | +| Plan | None | Subscription plan | +| Primary | None | Whether it's a primary subscription | +| Billing Mechanism | None | Settlement mechanism | +| Is Arrears Eligible | None | Whether eligible for overdue | +| Max Balance | USD ($) | Maximum balance | +| Auto Recharge Eligible | None | Whether eligible for auto recharge | +| Auto Recharge Enabled | None | Whether auto recharge is enabled | +| Auto Recharge Threshold | USD ($) | Auto recharge threshold | +| Auto Recharge To Balance | USD ($) | Auto recharge amount | +| Trust Tier | None | Credit level | +| Account Name | None | Account name | +| Po Number | None | Purchase order | +| Billing Email | None | Billing email | +| Tax IDs | None | Tax IDs | +| Billing Address | None | Billing address | +| Business Address | None | Business address | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/opengauss.md b/home/versioned_docs/version-v1.5.x/help/opengauss.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/opengauss.md rename to home/versioned_docs/version-v1.5.x/help/opengauss.md diff --git a/home/versioned_docs/version-v1.5.x/help/opensuse.md b/home/versioned_docs/version-v1.5.x/help/opensuse.md new file mode 100644 index 00000000000..e4220262e67 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/opensuse.md @@ -0,0 +1,106 @@ +--- +id: opensuse +title: Monitoring OpenSUSE Operating System Monitoring +sidebar_label: OpenSUSE OS +keywords: [open source monitoring system, open source operating system monitoring, OpenSUSE OS monitoring] +--- +> Collect and monitor general performance metrics of the OpenSUSE operating system. + +### Configuration Parameters + +| Parameter Name | Parameter Help Description | +| -------------- | ---------------------------------------------------------------------------- | +| Monitored Host | The IPV4, IPV6, or domain name of the host being monitored. Note ⚠️ No protocol header (e.g., https://, http://). | +| Task Name | The name that identifies this monitoring, which must be unique. | +| Port | The port provided by Linux SSH, default is 22. | +| Timeout | Sets the connection timeout in milliseconds, default is 6000 ms. | +| Connection Reuse | Sets whether SSH connections are reused, default is :false. If false, a new connection is created each time information is retrieved. | +| Username | SSH connection username, optional. | +| Password | SSH connection password, optional. | +| Collector | Configures which collector is used to schedule data collection for this monitoring. | +| Monitoring Period | The interval time for periodic data collection in seconds, with a minimum interval of 30 seconds. | +| Binding Tags | Used for categorized management of monitoring resources. | +| Description | Additional notes and descriptions for this monitoring, where users can make notes. | +| Key | The key required to connect to the server. | + +### Collection Metrics + +#### Metric Set: System Basic Information + +| Metric Name | Unit | Metric Help Description | +| --------------- | ------- | ------------------------ | +| Host Name | None | Host name | +| System Version | None | Operating system version| +| Uptime | None | Uptime | + +#### Metric Set: CPU Information + +| Metric Name | Unit | Metric Help Description | +| --------------- | ----- | ---------------------------------- | +| info | None | CPU model | +| cores | Cores | Number of CPU cores | +| interrupt | Count | Number of CPU interrupts | +| load | None | Average CPU load over the last 1/5/15 minutes | +| context_switch | Count | Number of context switches | +| usage | % | CPU usage rate | + +#### Metric Set: Memory Information + +| Metric Name | Unit | Metric Help Description | +| ----------- | ---- | ------------------------ | +| total | Mb | Total memory capacity | +| used | Mb | Memory used by user programs | +| free | Mb | Free memory capacity | +| buff_cache | Mb | Memory used for cache | +| available | Mb | Remaining available memory capacity | +| usage | % | Memory usage rate | + +#### Metric Set: Disk Information + +| Metric Name | Unit | Metric Help Description | +| --------------- | ----- | ----------------------------- | +| disk_num | Count | Total number of disks | +| partition_num | Count | Total number of partitions | +| block_write | Count | Total number of blocks written to disk | +| block_read | Count | Total number of blocks read from disk | +| write_rate | iops | Disk block write rate per second | + +#### Metric Set: Network Card Information + +| Metric Name | Unit | Metric Help Description | +| ------------------- | ---- | -------------------------- | +| interface_name | None | Network card name | +| receive_bytes | Mb | Inbound data traffic | +| transmit_bytes | Mb | Outbound data traffic | + +#### Metric Set: File System + +| Metric Name | Unit | Metric Help Description | +| ---------- | ---- | ------------------------ | +| filesystem | None | Name of the file system | +| used | Mb | Used disk size | +| available | Mb | Available disk size | +| usage | % | Usage rate | +| mounted | None | Mount point directory | + +#### Metric Set: Top 10 CPU Processes + +Statistics for the top 10 processes using the CPU. Statistics include: Process ID, CPU usage, memory usage, executed command. + +| Metric Name | Unit | Metric Help Description | +| ------------ | ---- | ------------------------ | +| pid | None | Process ID | +| cpu_usage | % | CPU usage rate | +| mem_usage | % | Memory usage rate | +| command | None | Executed command | + +#### Metric Set: Top 10 Memory Processes + +Statistics for the top 10 processes using memory. Statistics include: Process ID, memory usage, CPU usage, executed command. + +| Metric Name | Unit | Metric Help Description | +| ------------ | ---- | ------------------------ | +| pid | None | Process ID | +| mem_usage | % | Memory usage rate | +| cpu_usage | % | CPU usage rate | +| command | None | Executed command | \ No newline at end of file diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/oracle.md b/home/versioned_docs/version-v1.5.x/help/oracle.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/oracle.md rename to home/versioned_docs/version-v1.5.x/help/oracle.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ping.md b/home/versioned_docs/version-v1.5.x/help/ping.md similarity index 66% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ping.md rename to home/versioned_docs/version-v1.5.x/help/ping.md index fbf194a0abb..c5603fdfbce 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ping.md +++ b/home/versioned_docs/version-v1.5.x/help/ping.md @@ -26,3 +26,11 @@ keywords: [open source monitoring tool, open source network monitoring tool, mon | ----------- | ----------- | ----------- | | responseTime | ms | Website response time | + +### Common Problem + +1. Ping connectivity monitoring exception when installing hertzbeat for package deployment. + The hertzbeat installed and deployed by the installation package is not available for ping connectivity monitoring, but local direct ping is available 。 +> The deployment of the installation package requires configuring the root permission of the Java virtual machine to start hertzbeat to use ICMP. If the root permission is not enabled, judge whether port 7 of telnet opposite end is opened. +> When you install HertzBeat via DockerDocker root is enabled by default. No such problem. +> See https://stackoverflow.com/questions/11506321/how-to-ping-an-ip-address diff --git a/home/versioned_docs/version-v1.5.x/help/plugin.md b/home/versioned_docs/version-v1.5.x/help/plugin.md new file mode 100644 index 00000000000..b8104a3594a --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/plugin.md @@ -0,0 +1,25 @@ +--- +id: plugin +title: Custom plugin +sidebar_label: Custom plugin +--- + +## Custom plugins +### Introduction + +Currently, `Hertzbeat` relies on the `alert` module to notify the user, and then the user can take actions such as sending requests, executing `sql`, executing `shell` scripts, etc. However, this can only be automated manually or by `webhook` to receive the alert message. +However, at present, it is only possible to automate the process by receiving alert messages manually or through a `webhook`. For this reason, `HertzBeat` has added a new `plugin` module, which has a generic interface `Plugin`, which allows users to implement the `alert` method of this interface and receive the `Alert` class as a parameter to customize the operation. +After adding the customized code, you only need to package the `plugin` module, copy it to the `/ext-lib` folder under the installation directory, restart the `HertzBeat` main program, and then you can execute the customized function after the alert, without having to re-package and deploy the whole program by yourself. +Currently, `HertzBeat` only set up the trigger `alert` method after alarm, if you need to set up the trigger method at the time of acquisition, startup program, etc., please mention `Task` in `https://github.com/apache/hertzbeat/issues/new/choose`. + +### Specific uses +1. Pull the master branch code `git clone https://github.com/apache/hertzbeat.git` and locate the `plugin` module's + `Plugin` interface. + ![plugin-1.png](/img/docs/help/plugin-1.png) +2. In the `org.apache.hertzbeat.plugin.impl` directory, create a new interface implementation class, such as `org.apache.hertzbeat.plugin.impl.DemoPluginImpl`, and receive the `Alert` class as a parameter, implement the `alert ` method, the logic is customized by the user, here we simply print the object. + ![plugin-2.png](/img/docs/help/plugin-2.png) +3. Package the `hertzbeat-plugin` module. + ![plugin-3.png](/img/docs/help/plugin-3.png) +4. Copy the packaged `jar` package to the `ext-lib` directory under the installation directory (for `docker` installations, mount the `ext-lib` directory first, then copy it there). + ![plugin-4.png](/img/docs/help/plugin-4.png) +5. Then restart `HertzBeat` to enable the customized post-alert handling policy. diff --git a/home/versioned_docs/version-v1.5.x/help/pop3.md b/home/versioned_docs/version-v1.5.x/help/pop3.md new file mode 100644 index 00000000000..822192ad66d --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/pop3.md @@ -0,0 +1,50 @@ +--- +id: pop3 +title: Monitoring POP3 +sidebar_label: POP3 Monitor +keywords: [open source monitoring tool, open source java monitoring tool, monitoring POP3 metrics] +--- + +> Collect and monitor the general performance Metrics of POP3. + +**Protocol Use:POP3** + +### Enable POP3 Service + +If you want to monitor information in 'POP3' with this monitoring type, you just need to open `POP3` service in your mail server. + +**1、Open `POP3` Service:** + +```text +以qq邮箱为例【其它邮箱类似】: + 1. 点击`设置`选项 + 2. 选择`账号` + 3. 找到开启SMTP/POP3/IMAP选项,并开启 + 4. 得到POP3服务器域名,端口号,以及授权码【开启SMTP/POP3/IMAP服务后,qq邮箱提供】 + 5. 通过POP3服务器域名,端口号,qq邮箱账号以及授权码连接POP3服务器,采集监控指标 +``` + + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by POP3 | +| SSL | POP3 If enabled SSL | +| Timeout | Allow collection response time | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:email_status + +| Metric name | Metric unit | Metric help description | +|--------------|-------------|------------------------------------------| +| email_count | | Number of emails | +| mailbox_size | kb | The total size of emails in the mailbox | + + diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/port.md b/home/versioned_docs/version-v1.5.x/help/port.md similarity index 92% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/port.md rename to home/versioned_docs/version-v1.5.x/help/port.md index ef5f659ad44..e3350a8776f 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/port.md +++ b/home/versioned_docs/version-v1.5.x/help/port.md @@ -1,8 +1,8 @@ --- id: port -title: Monitoring:port availability -sidebar_label: Port availability -keywords: [open source monitoring tool, open source port monitoring tool, monitoring port metrics] +title: Monitoring:TCP port availability +sidebar_label: TCP Port availability +keywords: [open source monitoring tool, open source port monitoring tool, monitoring TCP port metrics] --- > Judge whether the exposed port of the opposite end service is available, then judge whether the opposite end service is available, and collect Metrics such as response time for monitoring. diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/postgresql.md b/home/versioned_docs/version-v1.5.x/help/postgresql.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/postgresql.md rename to home/versioned_docs/version-v1.5.x/help/postgresql.md diff --git a/home/versioned_docs/version-v1.5.x/help/process.md b/home/versioned_docs/version-v1.5.x/help/process.md new file mode 100644 index 00000000000..599c4f1ea7b --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/process.md @@ -0,0 +1,91 @@ +--- +id: process +title: Monitoring Linux Process Monitoring +sidebar_label: Process +keywords: [Open Source Monitoring System, Operating System Process Monitoring, Process Monitoring] +--- +> Collect and monitor basic information of processes on Linux systems, including CPU usage, memory usage, physical memory, IO, etc. + +## Configuration Parameters + + +| Parameter Name | Parameter Description | +| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| Target Host | The IPv4, IPv6, or domain name of the monitored endpoint. Note ⚠️: Do not include the protocol header (e.g., https://, http://). | +| Task Name | Identifies the name of this monitoring, ensuring uniqueness. | +| Port | SSH port of the Linux system, default: 22 | +| Timeout | Sets the timeout for the connection in milliseconds, default is 6000 milliseconds. | +| Reuse Connection | Sets whether SSH connection is reused, default is false. When false, a new connection is created for each information retrieval. | +| Username | Username for the server. | +| Password | Password for the server. | +| Process Name | Name or part of the name of the process to be monitored. | +| Collector | Specifies which collector to use for scheduling this monitoring. | +| Monitoring Interval | Interval for periodic data collection, in seconds. Minimum interval that can be set is 30 seconds. | +| Tags | Used for categorizing and managing monitoring resources. | +| Description | Additional notes and descriptions for identifying this monitoring. Users can add remarks here. | +| Private Key | Private key required for connecting to the server. | + +### Metrics Collected + +#### Metric Set: Process Basic Information + + +| Metric Name | Metric Unit | Metric Description | +| ----------- | ----------- | ------------------ | +| PID | NONE | Process ID | +| User | NONE | User | +| CPU | NONE | CPU Usage | +| MEM | NONE | Memory Usage | +| rss | NONE | Physical Memory | +| cmd | NONE | Command | + +#### Metric Set: Memory Usage Information + + +| Metric Name | Metric Unit | Metric Description | +| ----------- | ----------- | ------------------ | +| PID | NONE | Process ID | +| detail | NONE | Detailed metrics | + +Includes metrics for: + +- Peak Virtual Memory +- Current Virtual Memory Usage +- Locked Memory +- Fixed Memory +- Peak Physical Memory +- Current Physical Memory Usage +- Data Segment Size +- Stack Size +- Code Size +- Shared Library Size +- Page Table Entry Size + +#### Metric Set: Other Monitoring Information + + +| Metric Name | Metric Unit | Metric Description | +| ----------- | ----------- | --------------------------------- | +| PID | NONE | Process ID | +| path | NONE | Execution Path | +| date | NONE | Start Time | +| fd_count | NONE | Number of File Descriptors Opened | + +#### Metric Set: IO + + +| Metric Name | Metric Unit | Metric Description | +| ----------- | ----------- | ------------------ | +| PID | NONE | Process ID | +| metric | NONE | Metric Name | +| value | NONE | Metric Value | + +Includes metrics for: + +- rchar (Total bytes read by the process from disk or other files) +- wchar (Total bytes written by the process to disk or other files) +- syscr (Number of read operations initiated by the process) +- syscw (Number of write operations initiated by the process) +- read_bytes (Actual number of bytes read by the process from disk) +- write_bytes (Actual number of bytes written by the process to disk) +- cancelled_write_bytes (Actual number of bytes cancelled by the process while writing to disk) diff --git a/home/versioned_docs/version-v1.5.x/help/prometheus.md b/home/versioned_docs/version-v1.5.x/help/prometheus.md new file mode 100755 index 00000000000..4de9f80f67d --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/prometheus.md @@ -0,0 +1,44 @@ +--- +id: prometheus +title: Monitoring Prometheus Task +sidebar_label: Prometheus Task Monitor +keywords: [ open source monitoring tool, Prometheus protocol monitoring ] +--- + +> Collect metric data of applications that support the Prometheus protocol. + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------------| +| Target Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Task Name | Identify the name of this monitoring. The name needs to be unique. | +| Port | Monitor HTTP port. | +| Endpoint Path | Monitor the path of HTTP interfaces, Note ⚠️ It needs to start with /. | +| Query Timeout | Set the data collection timeout, unit: ms, default: 6000ms. | +| HTTPS | HTTPS enable,optional,default:false. | +| Headers | HTTP request headers,optional. | +| Params | Request params,optional. | +| Content-Type | ContentType,optional. | +| BODY | Request body,optional. | +| Auth Type | Authentication methods, optional values include: `Basic Auth`, `Digest Auth`,optional. | +| Username | Username,optional. | +| Password | Password,optional. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Example of usage + +The exposed monitoring address of the application is: `http://127.0.0.1:8080/actuator/prometheus` + +You can use the following configuration: + +- Target Host: `127.0.0.1` +- Port: `8080` +- Endpoint Path: `/actuator/prometheus` + +Keep the rest of the settings default. + + + diff --git a/home/versioned_docs/version-v1.5.x/help/pulsar.md b/home/versioned_docs/version-v1.5.x/help/pulsar.md new file mode 100644 index 00000000000..2cc520d6189 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/pulsar.md @@ -0,0 +1,76 @@ +--- +id: pulsar +title: Monitoring Pulsar Monitoring +sidebar_label: Apache Pulsar +keywords: [open-source monitoring system, open-source database monitoring, HbaseMaster monitoring] +--- +> Collecting and monitoring general performance metrics of Pulsar + +**Protocol Used: HTTP** + +## Configuration Parameters + + +| Parameter Name | Description | +| ------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| Target Host | The monitored endpoint's IPV4, IPV6, or domain name. Note⚠️: Do not include the protocol header (e.g., https://, http://). | +| Port | The webServicePort value of Pulsar, default is 8080. | +| Task Name | The name identifying this monitoring task, must be unique. | +| Query Timeout | Set the connection timeout in milliseconds, default is 3000 milliseconds. | +| Monitoring Interval | Interval time for periodic data collection, in seconds, minimum interval is 30 seconds. | +| Binding Tags | Used for categorizing monitoring resources. | +| Description/Remarks | Additional notes and descriptions for this monitoring task. Users can add more information here. | + +### Collected Metrics + +#### Metric Set: Version Information + + +| Metric Name | Unit | Description | +| ------------ | ---- | ------------------- | +| Version Info | NONE | Version Information | + +#### Metric Set: process_start_time_seconds + + +| Metric Name | Unit | Description | +| ------------------ | ---- | ------------------ | +| Process Start Time | NONE | Process Start Time | + +#### Metric Set: process_open_fds + + +| Metric Name | Unit | Description | +| --------------------- | ---- | ------------------------------- | +| Open File Descriptors | NONE | Number of Open File Descriptors | + +#### Metric Set: process_max_fds + + +| Metric Name | Unit | Description | +| -------------------- | ---- | ---------------------------------- | +| Max File Descriptors | NONE | Maximum Number of File Descriptors | + +#### Metric Set: jvm_memory_pool_allocated_bytes + +Number of bytes of memory allocated in a specific memory pool in the Java Virtual Machine (JVM). In Pulsar, this typically refers to the amount of memory allocated for various purposes in the JVM (such as heap memory, non-heap memory, etc.). + +#### Metric Set: jvm_memory_pool_used_bytes + +Unlike allocated_bytes, this metric shows the actual used memory, not just the allocated memory. + +#### Metric Set: jvm_memory_pool_committed_bytes + +Number of bytes of memory committed in a specific memory pool in the JVM. In the JVM, committed memory is the amount of memory guaranteed to be available for the application to use. This portion of memory is typically locked by the operating system to reduce swapping or garbage collection. + +#### Metric Set: jvm_memory_pool_max_bytes + +Maximum number of bytes of memory that can be allocated in a specific memory pool in the JVM. This is the upper limit on memory usage for that memory pool and helps in setting the memory usage cap. + +#### Metric Set: pulsar_broker_publish_latency + +Message publishing latency on the broker side. + +#### Metric Set: pulsar_metadata_store_ops_latency_ms + +Latency of metadata store operations on the broker side. diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/rabbitmq.md b/home/versioned_docs/version-v1.5.x/help/rabbitmq.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/rabbitmq.md rename to home/versioned_docs/version-v1.5.x/help/rabbitmq.md diff --git a/home/versioned_docs/version-v1.5.x/help/redhat.md b/home/versioned_docs/version-v1.5.x/help/redhat.md new file mode 100644 index 00000000000..d877c46df36 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/redhat.md @@ -0,0 +1,107 @@ +--- +id: redhat +title: Monitoring RedHat Operating System +sidebar_label: RedHat OS Operating System +keywords: [ Open Source Monitoring System, Open Source OS Monitoring, RedHat OS Monitoring ] +--- + +> Collect and monitor general performance metrics for RedHat operating systems (system information, CPU, memory, disk, network interface, file system, top resource processes, etc.). + +### Configuration Parameters + +| Parameter Name | Parameter help description | +|---------------------|----------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | The IP, IPV6, or domain name of the monitored endpoint. Note ⚠️: Do not include protocol headers (eg: https://, http://). | +| Task Name | Identifies the name of this monitoring, ensuring uniqueness. | +| Port | Port provided by Linux SSH externally, defaults to 22. | +| Timeout | Sets the timeout for connection in milliseconds (ms), defaults to 6000 ms. | +| Connection Reuse | Sets whether the SSH connection is reused, defaults to: false. Creates a new connection for each information retrieval if false. | +| Username | SSH connection username, optional. | +| Password | SSH connection password, optional. | +| Collector | Specifies which collector schedules the collection for this monitoring. | +| Monitoring Interval | Interval for periodically collecting data, in seconds. Minimum interval is 30 seconds. | +| Binding Tags | Used for categorizing and managing monitored resources. | +| Description | Additional remarks and descriptions for this monitoring, for users' reference. | +| PrivateKey | Key required for connecting to the server. | + +### Collected Metrics + +#### Metric Set: Basic Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|---------------------------| +| Host Name | None | Host name. | +| System Version | None | Operating system version. | +| Uptime | None | System uptime. | + +#### Metric Set: CPU Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|-------------------------------------------| +| info | None | CPU model. | +| cores | None | Number of CPU cores. | +| interrupt | None | Number of CPU interrupts. | +| load | None | Average load for the last 1/5/15 minutes. | +| context_switch | None | Current context switches. | +| usage | % | CPU usage percentage. | + +#### Metric Set: Memory Info + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|------------------------------------| +| total | Mb | Total memory capacity. | +| used | Mb | Used memory by user programs. | +| free | Mb | Free memory capacity. | +| buff_cache | Mb | Memory used for buffers and cache. | +| available | Mb | Available memory capacity. | +| usage | % | Memory usage percentage. | + +#### Metric Set: Disk Info + +| Metric Name | Metric Unit | Metric help description | +|---------------|-------------|------------------------------------| +| disk_num | None | Total number of disks. | +| partition_num | None | Total number of partitions. | +| block_write | None | Total blocks written to disk. | +| block_read | None | Total blocks read from disk. | +| write_rate | iops | Rate of blocks written per second. | + +#### Metric Set: Interface Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|--------------------------------| +| interface_name | None | Name of the network interface. | +| receive_bytes | Mb | Inbound data traffic. | +| transmit_bytes | Mb | Outbound data traffic. | + +#### Metric Set: Disk Free + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------| +| filesystem | None | Name of the file system. | +| used | Mb | Used disk space. | +| available | Mb | Available disk space. | +| usage | % | Disk usage percentage. | +| mounted | None | Mount point directory. | + +#### Metric Set: Top10 CPU Process + +Top 10 processes consuming CPU. Metrics include: Process ID, CPU usage, Memory usage, Command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| cpu_usage | % | CPU usage | +| mem_usage | % | Memory usage | +| command | None | Executed command | + +#### Metric Set: Top10 Memory Process + +Top 10 processes consuming memory. Metrics include: Process ID, Memory usage, CPU usage, Command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| mem_usage | % | Memory usage | +| cpu_usage | % | CPU usage | +| command | None | Executed command | diff --git a/home/versioned_docs/version-v1.5.x/help/redis.md b/home/versioned_docs/version-v1.5.x/help/redis.md new file mode 100644 index 00000000000..de0df0d52ca --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/redis.md @@ -0,0 +1,245 @@ +--- +id: redis +title: 监控:REDIS数据库监控 +sidebar_label: REDIS +keywords: [开源监控系统, 开源数据库监控, Redis数据库监控] +--- + +> 对REDIS数据库的通用性能指标进行采集监控。支持REDIS1.0+。 + +### 配置参数 + +| 参数名称 | 参数帮助描述 | +| ----------- | ----------- | +| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 | +| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 | +| 端口 | redis对外提供的端口,默认为6379,sentinel节点默认26379 | +| 超时时间 | 设置redis info 查询未响应数据时的超时时间,单位ms毫秒,默认3000毫秒。 | +| 数据库名称 | 数据库实例名称,可选。 | +| 用户名 | 数据库连接用户名,可选 | +| 密码 | 数据库连接密码,可选 | +| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 | +| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 | +| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 | + +### 采集指标 + +#### 指标集合:server + +| 指标名称 |指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| redis_version | 无 | Redis 服务器版本 | +| redis_git_sha1 | 无 | Git SHA1 | +| redis_git_dirty | 无 | Git dirty flag | +| redis_build_id | 无 | redis 构建的id | +| redis_mode | 无 | redis模式(包括standalone, sentinel, cluster) | +| os | 无 | Redis 服务器的宿主操作系统 | +| arch_bits | 无 | 架构(32 或 64 位) | +| multiplexing_api | 无 | Redis使用的事件循环机制| +| atomicvar_api | 无 | Redis使用的原子 API | +| gcc_version | 无 | 用于编译Redis服务器的GCC编译器版本| +| process_id | 无 | 服务器进程的PID | +| process_supervised | 无 | 受监管系统(包括:upstart、systemd、unknown、no) | +| run_id | 无 | 标识Redis服务器的随机值(由Sentinel和Cluster使用) | +| tcp_port | 无 | TCP/IP侦听端口 | +| server_time_usec | 无 | 微秒级精度的基于时间的系统时间| +| uptime_in_seconds | 无 | 自Redis服务器启动后的秒数 | +| uptime_in_days | 无 | 自Redis服务器启动后的天数 | +| hz | 无 | 服务器的当前频率设置,redis相关定时任务的执行频率(如清除过期key,关闭超时客户端) | +| configured_hz | 无 | 服务器配置的频率设置 | +| lru_clock | 无 | 时钟每分钟递增,用于LRU管理| +| executable | 无 | 服务器可执行文件的路径 | +| config_file | 无 | 配置文件的路径 | +| io_threads_active | 无 | 指示I/O线程是否处于活动状态的标志| +| shutdown_in_milliseconds | 无 | 复制副本在完成关闭序列之前赶上复制的最长剩余时间。此字段仅在停机期间出现。| + + +#### 指标集合:clients + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| connected_clients | 无 | 客户端连接数(不包括来自副本的连接) | +| cluster_connections | 无 | 群集总线使用的套接字数量的近似值| +| maxclients | 无 | maxclients配置指令的值。这是connected_clients、connected_slave和cluster_connections之和的上限。| +| client_recent_max_input_buffer | byte | 当前客户端连接中最大的输入缓冲区 | +| client_recent_max_output_buffer | byte | 当前客户端连接中最大的输出缓冲区 | +| blocked_clients | 无 | 阻塞呼叫挂起的客户端数(BLPOP、BRPOP、BRPOPLPUSH、BLMOVE、BZPOPMIN、BZPOPMAX) | +| tracking_clients | 无 | 正在跟踪的客户端数(CLIENT TRACKING)| +| clients_in_timeout_table | 无 | 客户端超时表中的客户端数 | + + +#### 指标集合:memory + +| 指标名称 |指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| used_memory | byte | Redis使用其分配器(标准libc、jemalloc或tcmalloc等替代分配器)分配的总字节数 | +| used_memory_human | GB/MB/KB | 上一个值的人类可读表示 | +| used_memory_rss | byte | 操作系统看到的Redis分配的字节数(也称为驻留集大小)。这是top(1)和ps(1)等工具报告的数字| +| used_memory_rss_human | GB/MB/KB | 上一个值的人类可读值| +| used_memory_peak | byte | Redis消耗的峰值内存(字节)| +| used_memory_peak_human | GB/MB/KB | 上一个值的人类可读值 | +| used_memory_peak_perc | 无 | used_memory_peak 与used_memory百分比 | +| used_memory_overhead | byte | 服务器分配用于管理其内部数据结构的所有开销的字节总和| +| used_memory_startup | byte | Redis在启动时消耗的初始内存量(字节)| +| used_memory_dataset | byte | 数据集的字节大小(used_memory - used_memory_overhead) | +| used_memory_dataset_perc | 无 | 已用内存数据集占净内存使用量的百分比(used_memory_dataset / (used_memory - used_memory_startup)) | +| allocator_allocated | byte| 从分配器分配的总字节数,包括内部碎片。通常与使用的内存相同| +| allocator_active | byte | 分配器活动页中的总字节数,包括外部碎片| +| allocator_resident | byte | 分配器中驻留的总字节数(RSS),包括可释放到操作系统的页面(通过MEMORY PURGE或仅等待) | +| total_system_memory | byte | Redis主机的内存总量 | +| total_system_memory_human | GB/MB/KB | 上一个值的人类可读值 | +| used_memory_lua | byte | Lua引擎使用的字节数 | +| used_memory_lua_human | KB | 上一个值的人类可读值 | +| used_memory_scripts | byte | 缓存Lua脚本使用的字节数 | +| used_memory_scripts_human | GB/MB/KB | 上一值的人类可读值 | +| number_of_cached_scripts | 无 |缓存的lua脚本数量 | +| maxmemory | byte | maxmemory配置指令的值| +| maxmemory_human | GB/MB/KB | 上一个值的人类可读值 | +| maxmemory_policy | 无 | 当达到maxmemory时的淘汰策略 | +| allocator_frag_ratio | 无 | allocator_active 和 allocator_allocated之间的比率这是真实(外部)碎片度量(不是mem_fragmentation_ratio) | +| allocator_frag_bytes | byte | allocator_active 和 allocator_allocated 之间的差值。 | +| allocator_rss_ratio | | 从操作系统角度看, 内存分配器碎片比例 | +| allocator_rss_bytes | byte | allocator_resident 和 allocator_active之间的差值 | +| rss_overhead_ratio | 无 | used_memory_rss和allocator_resident之间的比率,这包括与分配器或堆无关的RSS开销 | +| rss_overhead_bytes | byte | used_memory_rss和allocator_resident之间的增量 | +| mem_fragmentation_ratio | 无 | used_memory_rss和used_memory之间的比率,注意,这不仅包括碎片,还包括其他进程开销(请参阅allocator_* metrics),以及代码、共享库、堆栈等开销。 | +| mem_fragmentation_bytes | byte | used_memory_rss和used_memory之间的增量。注意,当总碎片字节较低(几兆字节)时,高比率(例如1.5及以上)不是问题的表现 | +| mem_not_counted_for_evict | byte | 不应驱逐的内存大小,以字节为单位。这基本上是瞬时复制和AOF缓冲区。| +| mem_replication_backlog | byte | 复制backlog的内存大小, 以字节为单位 | +| mem_clients_slaves | 无 | 副本客户端使用的内存-从Redis 7.0开始,副本缓冲区与复制积压工作共享内存,因此当副本不触发内存使用增加时,此字段可以显示0。 | +| mem_clients_normal | 无 | 普通客户端使用的内存 | +| mem_aof_buffer | 无 | 用于AOF和AOF重写缓冲区的临时大小 | +| mem_allocator | 无 | 内存分配器,在编译时选择。 | +| active_defrag_running | 无 | 启用activedefrag时,这表示碎片整理当前是否处于活动状态,以及它打算使用的CPU百分比。 | +| lazyfree_pending_objects | 无 | 等待释放的对象数(使用ASYNC选项调用UNLINK或FLUSHDB和FLUSHOLL)| +| lazyfreed_objects | 无 | 已延迟释放的对象数。| + + +#### 指标集合:persistence + +| 指标名称 |指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| loading | 无 | 服务器是否正在进行持久化 0 - 否 1 -是| +| current_cow_size | byte | 运行子fork时写入时复制内存的大小(以字节为单位) | +| current_cow_size_age | second | current_cow_size值的年龄(以秒为单位) | +| current_fork_perc | 无 | 当前fork进程的百分比,对于AOF和RDB的fork,它是current_save_keys_processed占current_save_keys_total的百分比| +| current_save_keys_processed | 无 | 当前保存操作处理的key的数量 | +| current_save_keys_total | 无 | 当前保存操作开始时的key的数量 | +| rdb_changes_since_last_save | 无 | 离最近一次成功生成rdb文件,写入命令的个数,即有多少个写入命令没有持久化 | +| rdb_bgsave_in_progress | 无 | 服务器是否正在创建rdb文件 0 - 否 1 - 是 | +| rdb_last_save_time | second | 最近一次创建rdb文件的时间戳,单位秒 | +| rdb_last_bgsave_status | 无 | 最近一次rdb持久化是否成功 ok 成功| +| rdb_last_bgsave_time_sec | second | 最近一次成功生成rdb文件耗时秒数 | +| rdb_current_bgsave_time_sec | 无 | 如果服务器正在创建rdb文件,那么这个字段记录的就是当前的创建操作已经耗费的秒数 | +| rdb_last_cow_size | 无 | RDB过程中父进程与子进程相比执行了多少修改(包括读缓冲区,写缓冲区,数据修改等) | +| aof_enabled | 无 | 是否开启了AOF 0 - 否 1 - 是 | +| aof_rewrite_in_progress | 无 | 标识aof的rewrite操作是否在进行中 0 - 否 1- 是 | +| aof_rewrite_scheduled | 无 | rewrite任务计划,当客户端发送bgrewriteaof指令,如果当前rewrite子进程正在执行,那么将客户端请求的bgrewriteaof变为计划任务,待aof子进程结束后执行rewrite| +| aof_last_rewrite_time_sec | 无 | 最近一次aof rewrite耗费的时长 | +| aof_current_rewrite_time_sec | second | 如果rewrite操作正在进行,则记录所使用的时间,单位秒 | +| aof_last_bgrewrite_status | 无 | 上次 bgrewrite aof 操作的状态 ok 成功 | +| aof_last_write_status | 无 | 上次aof写入状态 | +| aof_last_cow_size | 无 | AOF过程中父进程与子进程相比执行了多少修改(包括读缓冲区,写缓冲区,数据修改等) | +| module_fork_in_progress | 无 | 指示fork模块正在进行的标志 | +| module_fork_last_cow_size | 无 | 上一次fork操作期间写入时复制内存的字节大小 | + + +#### 指标集合:stats + +| 指标名称 |指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| total_connections_received | 无 | 服务器接受的连接总数 | +| total_commands_processed | 无 | 服务器处理的命令总数 | +| instantaneous_ops_per_sec | 无 | 每秒处理的命令数 | +| total_net_input_bytes | byte | 从网络读取的字节总数 | +| total_net_output_bytes | byte | 写入网络的总字节数 | +| instantaneous_input_kbps | KB/S | 网络每秒的读取速率(KB/秒) | +| instantaneous_output_kbps | KB/S | 网络每秒的写入速率(KB/秒) | +| rejected_connections | 无 | 由于maxclients限制而拒绝的连接数| +| sync_full | 无 | 具有副本的完整重新同步数 | +| sync_partial_ok | 无 | 接受的部分重新同步请求数 | +| sync_partial_err | 无 | 被拒绝的部分重新同步请求数 | +| expired_keys | 无 | 过期的key总数 | +| expired_stale_perc | 无 | 可能过期key的百分比 | +| expired_time_cap_reached_count | 无 | 活动过期周期提前停止的次数 | +| expire_cycle_cpu_milliseconds | 无 | 活动到期周期所花费的累计时间 | +| evicted_keys | 无 | 由于最大内存限制而收回key的数量 | +| keyspace_hits | 无 | 在主dict 中成功查找key的次数 | +| keyspace_misses | 无 | 在主dict 中未查到key的次数 | +| pubsub_channels | 无 | 客户端使用 pub/sub 频道的总和 | +| pubsub_patterns | 无 | 客户端使用 pub/sub 模式的全局数量 | +| latest_fork_usec | 无 | 最后一次fork操作的持续时间(以微秒为单位) | +| total_forks | 无 | 自服务器启动以来的fork操作总数| +| migrate_cached_sockets | 无 | 为MIGRATE目的打开的socket数量 | +| slave_expires_tracked_keys | 无 | trace key 到期的数量(仅适用于可写副本) | +| active_defrag_hits | 无 | 主动碎片整理命中次数 | +| active_defrag_misses | 无 | 主动碎片整理未命中次数 | +| active_defrag_key_hits | 无 | 主动碎片整理key命中次数 | +| active_defrag_key_misses | 无 | 主动碎片整理key未命中次数| +| tracking_total_keys | 无 | key 查询的总数| +| tracking_total_items | 无 | item查询的总数 | +| tracking_total_prefixes | 无 | 前缀查询的总数 | +| unexpected_error_replies | 无 | 意外错误回复数,即AOF加载或复制中的错误类型 | +| total_error_replies | 无 | 发出的错误回复总数,即被拒绝的命令(命令执行之前的错误)和失败的命令(在命令执行过程中的错误)的总和 | +| dump_payload_sanitizations | 无 | 参考sanitize-dump-payload配置 | +| total_reads_processed | 无 | 正在读取的请求数 | +| total_writes_processed | 无 | 正在写入的请求数 | +| io_threaded_reads_processed | 无 | 正在读取的线程数| +| io_threaded_writes_processed | 无 | 正在写入的线程数 | + + +#### 指标集合:replication + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| role | 无 | 节点角色 master 主节点 slave 从节点 | +| connected_slaves | 无 | 连接的从节点数 | +| master_failover_state | 无 | 正在进行的故障切换的状态(如果有) | +| master_replid | 无 | 实例启动的随机字符串| +| master_replid2 | 无 | 故障切换后用于PSYNC的辅助复制ID| +| master_repl_offset | 无 | 主从同步偏移量 | +| second_repl_offset | 无 | 接受从服务ID的最大偏移量| +| repl_backlog_active | 无 | 表示从服务挤压处于活动状态 | +| repl_backlog_size | byte | 从服务积压缓冲区的总大小(字节) | +| repl_backlog_first_byte_offset | 无 | 复制缓冲区里偏移量的大小 | +| repl_backlog_histlen | 无 | 此值等于 master_repl_offset - repl_backlog_first_byte_offset,该值不会超过repl_backlog_size的大小 | + +#### 指标集合:cpu + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| used_cpu_sys | 无 | Redis主进程在内核态所占用CPU时钟总和| +| used_cpu_user | 无 | Redis主进程在用户态所占用CPU时钟总和| +| used_cpu_sys_children | 无 | Redis子进程在内核态所占用CPU时钟总和| +| used_cpu_user_children | 无 | Redis子进程在用户态所占用CPU时钟总和 | +| used_cpu_sys_main_thread | 无 | Redis服务器主线程消耗的内核CPU| +| used_cpu_user_main_thread | 无 | Redis服务器主线程消耗的用户CPU | + +#### 指标集合:errorstats + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| errorstat_ERR | 无 | 错误累计出现的次数 | +| errorstat_MISCONF | 无 | | + +#### 指标集合:cluster + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| cluster_enabled | 无 | 集群是否开启 0 - 否 1 - 是| + + +#### 指标集合:commandstats + +| 指标名称 | 指标单位 | 指标帮助描述 | +| ----------- | ----------- | ----------- | +| cmdstat_set | 无 | set命令的统计信息,calls: 累计调用该命令的次数;usec: 调用该命令的累计耗时,单位微秒;usec_per_call: 调用该命令的平均耗时;rejected_call: 拒绝执行的次数;failed_calls: 调用失败的次数| +| cmdstat_get | 无 | get命令的统计信息 | +| cmdstat_setnx | 无 | setnx命令的统计信息 | +| cmdstat_hset | 无 | hset命令的统计信息 | +| cmdstat_hget | 无 | hget命令的统计信息 | +| cmdstat_lpush | 无 | lpush命令的统计信息 | +| cmdstat_rpush | 无 | rpush命令的统计信息 | +| cmdstat_lpop | 无 | lpop命令的统计信息 | +| cmdstat_rpop | 无 | rpop命令的统计信息 | +| cmdstat_llen | 无 | llen命令的统计信息 | diff --git a/home/versioned_docs/version-v1.5.x/help/rocketmq.md b/home/versioned_docs/version-v1.5.x/help/rocketmq.md new file mode 100644 index 00000000000..f56bdfc2f14 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/rocketmq.md @@ -0,0 +1,48 @@ +--- +id: rocketmq +title: Monitoring Apache RocketMQ +sidebar_label: Apache RocketMQ +keywords: [ open source monitoring tool, monitoring Apache RocketMQ metrics ] +--- + +> Monitor the broker, consumer and other related metrics of RocketMQ. + +### Configuration parameters + +| Parameter name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------------| +| Namesrv Host | IPV4,IPV6 of RocketMQ name server(eg: https://, http://)。 | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique. | +| Port | Port of RocketMQ name server. | +| accessKey | accessKey. | +| secretKey | secretKey. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metric + +#### Metric set:cluster + +| Metric name | Metric unit | Metric help description | +|-------------------------|-------------|---------------------------------------| +| BrokerId | none | Broker id | +| Address | none | Broker address | +| Version | none | Version | +| Producer_Message_TPS | none | Produce message TPS | +| Consumer_Message_TPS | none | Consume message TPS | +| Yesterday_Produce_Count | none | Number of messages produced yesterday | +| Yesterday_Consume_Count | none | Number of messages consumed yesterday | +| Today_Produce_Count | none | Number of messages produced today | +| Today_Consume_Count | none | Number of messages consumed today | + +#### Metric set:Consumer + +| Metric name | Metric unit | Metric help description | +|-----------------|-------------|-------------------------| +| Consumer_group | none | Consumer group | +| Client_quantity | none | Number of clients | +| Message_model | none | Message model | +| Consume_type | none | Consume type | +| Consume_tps | none | Consume tps | +| Delay | none | Delay | diff --git a/home/versioned_docs/version-v1.5.x/help/rockylinux.md b/home/versioned_docs/version-v1.5.x/help/rockylinux.md new file mode 100644 index 00000000000..f83eb606b0a --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/rockylinux.md @@ -0,0 +1,107 @@ +--- +id: rockylinux +title: Monitoring Rocky Linux Operating System +sidebar_label: Rocky Linux Operating System +keywords: [ Open Source Monitoring System, Open Source OS Monitoring, Rocky Linux Monitoring ] +--- + +> Collect and monitor general performance metrics for Rocky Linux operating systems (system information, CPU, memory, disk, network interface, file system, top resource processes, etc.). + +### Configuration Parameters + +| Parameter Name | Parameter help description | +|---------------------|----------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | The IP, IPV6, or domain name of the monitored endpoint. Note ⚠️: Do not include protocol headers (eg: https://, http://). | +| Task Name | Identifies the name of this monitoring, ensuring uniqueness. | +| Port | Port provided by Linux SSH externally, defaults to 22. | +| Timeout | Sets the timeout for connection in milliseconds (ms), defaults to 6000 ms. | +| Connection Reuse | Sets whether the SSH connection is reused, defaults to: false. Creates a new connection for each information retrieval if false. | +| Username | SSH connection username, optional. | +| Password | SSH connection password, optional. | +| Collector | Specifies which collector schedules the collection for this monitoring. | +| Monitoring Interval | Interval for periodically collecting data, in seconds. Minimum interval is 30 seconds. | +| Binding Tags | Used for categorizing and managing monitored resources. | +| Description | Additional remarks and descriptions for this monitoring, for users' reference. | +| PrivateKey | Key required for connecting to the server. | + +### Collected Metrics + +#### Metric Set: Basic Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|---------------------------| +| Host Name | None | Host name. | +| System Version | None | Operating system version. | +| Uptime | None | System uptime. | + +#### Metric Set: CPU Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|-------------------------------------------| +| info | None | CPU model. | +| cores | None | Number of CPU cores. | +| interrupt | None | Number of CPU interrupts. | +| load | None | Average load for the last 1/5/15 minutes. | +| context_switch | None | Current context switches. | +| usage | % | CPU usage percentage. | + +#### Metric Set: Memory Info + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|------------------------------------| +| total | Mb | Total memory capacity. | +| used | Mb | Used memory by user programs. | +| free | Mb | Free memory capacity. | +| buff_cache | Mb | Memory used for buffers and cache. | +| available | Mb | Available memory capacity. | +| usage | % | Memory usage percentage. | + +#### Metric Set: Disk Info + +| Metric Name | Metric Unit | Metric help description | +|---------------|-------------|------------------------------------| +| disk_num | None | Total number of disks. | +| partition_num | None | Total number of partitions. | +| block_write | None | Total blocks written to disk. | +| block_read | None | Total blocks read from disk. | +| write_rate | iops | Rate of blocks written per second. | + +#### Metric Set: Interface Info + +| Metric Name | Metric Unit | Metric help description | +|----------------|-------------|--------------------------------| +| interface_name | None | Name of the network interface. | +| receive_bytes | Mb | Inbound data traffic. | +| transmit_bytes | Mb | Outbound data traffic. | + +#### Metric Set: Disk Free + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|--------------------------| +| filesystem | None | Name of the file system. | +| used | Mb | Used disk space. | +| available | Mb | Available disk space. | +| usage | % | Disk usage percentage. | +| mounted | None | Mount point directory. | + +#### Metric Set: Top10 CPU Process + +Top 10 processes consuming CPU. Metrics include: Process ID, CPU usage, Memory usage, Command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| cpu_usage | % | CPU usage | +| mem_usage | % | Memory usage | +| command | None | Executed command | + +#### Metric Set: Top10 Memory Process + +Top 10 processes consuming memory. Metrics include: Process ID, Memory usage, CPU usage, Command. + +| Metric Name | Metric Unit | Metric help description | +|-------------|-------------|-------------------------| +| pid | None | Process ID | +| mem_usage | % | Memory usage | +| cpu_usage | % | CPU usage | +| command | None | Executed command | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/shenyu.md b/home/versioned_docs/version-v1.5.x/help/shenyu.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/shenyu.md rename to home/versioned_docs/version-v1.5.x/help/shenyu.md diff --git a/home/versioned_docs/version-v1.5.x/help/smtp.md b/home/versioned_docs/version-v1.5.x/help/smtp.md new file mode 100644 index 00000000000..971de82c3e0 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/smtp.md @@ -0,0 +1,42 @@ +--- +id: smtp +title: Monitoring SMTP +sidebar_label: SMTP Monitor +keywords: [ open source monitoring tool, open source SMTP monitoring tool, monitoring SMTP metrics ] +--- + +> Collect and monitor the general performance Metrics of SMTP. + +```text +Determine whether the server is available through the hello command in SMTP +``` + +> see https://datatracker.ietf.org/doc/html/rfc821#page-13 + + +**Protocol Use:SMTP** + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by SMTP | +| Email | Your email name, parameters for the hello command | +| Timeout | Allow collection response time | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:summary + +| Metric name | Metric unit | Metric help description | +|--------------|-------------|----------------------------------------------------------------| +| responseTime | ms | The time it takes for the SMTP server to respond to a request. | +| response | | Response Status. | +| smtpBanner | | Banner of SMTP server. | +| heloInfo | | Response information returned by helo. | + diff --git a/home/versioned_docs/version-v1.5.x/help/spark.md b/home/versioned_docs/version-v1.5.x/help/spark.md new file mode 100644 index 00000000000..3d4b44828ea --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/spark.md @@ -0,0 +1,128 @@ +--- +id: spark +title: Monitoring Spark +sidebar_label: Spark Monitor +keywords: [open source monitoring tool, open source java spark monitoring tool, monitoring spark metrics] +--- + +> Collect and monitor the general performance Metrics of Spark. + +**Protocol Use:JMX** + +### Spark App Enable JMX Protocol + +1. Add Spark `VM options` When Start Server ⚠️ customIP + +Refer: https://spark.apache.org/docs/latest/spark-standalone.html + + +**监控配置spark的监控主要分为Master、Worker、driver、executor监控。Master和Worker的监控在spark集群运行时即可监控,Driver和Excutor的监控需要针对某一个app来进行监控。** +**如果都要监控,需要根据以下步骤来配置** + + + +## 第一步 + +**修改$SPARK_HOME/conf/spark-env.sh,添加以下语句:** + +```shell +# JMX Port to use +SPARK_DAEMON_JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" + +# export SPARK_DAEMON_JAVA_OPTS="$SPARK_DAEMON_JAVA_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT " +export SPARK_DAEMON_JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8712 " +``` + +语句中有$JMX_PORT,这个的值可以自定义,也可以获取一个随机数作为端口号。 +如果端口自定义为一个具体的值,而 spark 的 Master 和其中之一的 Worker 在同一台机器上,会出现端口冲突的情况。 + + + +## 第二步 + +**vim $SPARK_HOME/conf/metrics.properties 添加如下内容** + +```shell +*.sink.jmx.class=org.apache.spark.metrics.sink.JmxSink +master.source.jvm.class=org.apache.spark.metrics.source.JvmSource +worker.source.jvm.class=org.apache.spark.metrics.source.JvmSource +driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource +executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource +``` + + + + + +## 第三步 + +**vim $SPARK_HOME/conf/spark-defaults.conf,添加以下项为driver和executor设置监控端口,在有程序运行的情况下,此端口会被打开。** + +```shell +spark.metrics.conf /opt/bigdata/spark/conf/metrics.properties +spark.driver.extraJavaOptions -XX:+PrintGCDetails -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.mana +gement.jmxremote.port=8712 + +spark.executor.extraJavaOptions -XX:+PrintGCDetails -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.mana +gement.jmxremote.port=8711 +``` + +在spark的Master和Worker正常运行以及spark-submit提交了一个程序的情况下,可以从linux中查询出端口号码。 + + + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique | +| Port | Port provided by JMX | +| Username | JMX connection user name, optional | +| Password | JMX connection password, optional | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + +### Collection Metrics + +#### Metrics Set:memory_pool + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-------------------------| +| name | | metrics name | +| committed | kb | total size | +| init | kb | init size | +| max | kb | max size | +| used | kb | used size | + +#### Metrics Set:code_cache (Only Support JDK8) + +| Metric name | Metric unit | Metric help description | +|-------------|-------------|-------------------------| +| committed | kb | total size | +| init | kb | init size | +| max | kb | max size | +| used | kb | used size | + +#### Metrics Set:class_loading + +| Metric name | Metric unit | Metric help description | +|-----------------------|-------------|--------------------------| +| LoadedClassCount | | Loaded Class Count | +| TotalLoadedClassCount | | Total Loaded Class Count | +| UnloadedClassCount | | Unloaded Class Count | + + +#### Metrics Set:thread + +| Metric name | Metric unit | Metric help description | +|-------------------------|-------------|----------------------------| +| TotalStartedThreadCount | | Total Started Thread Count | +| ThreadCount | | Thread Count | +| PeakThreadCount | | Peak Thread Count | +| DaemonThreadCount | | Daemon Thread Count | +| CurrentThreadUserTime | ms | Current Thread User Time | +| CurrentThreadCpuTime | ms | Current Thread Cpu Time | + + diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/springboot2.md b/home/versioned_docs/version-v1.5.x/help/spring_gateway.md similarity index 75% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/springboot2.md rename to home/versioned_docs/version-v1.5.x/help/spring_gateway.md index c55f4fcb14f..ae24228c222 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/springboot2.md +++ b/home/versioned_docs/version-v1.5.x/help/spring_gateway.md @@ -1,15 +1,15 @@ --- -id: springboot2 -Title: Monitoring SpringBoot 2.0 -sidebar_label: SpringBoot 2.0 -keywords: [open source monitoring tool, open source springboot2 monitoring tool, monitoring springboot2 metrics] +id: spring_gateway +Title: Monitoring Spring Gateway +sidebar_label: Spring Gateway +keywords: [open source monitoring tool, open source spring gateway monitoring tool, monitoring spring gateway metrics] --- -> Collect and monitor the general performance metrics exposed by the SpringBoot 2.0 actuator. +> Collect and monitor the general performance metrics exposed by the SpringBoot actuator. ## Pre-monitoring operations -If you want to monitor information in 'SpringBoot' with this monitoring type, you need to integrate your SpringBoot application and enable the SpringBoot Actuator. +If you want to monitor information in 'Spring Gateway' with this monitoring type, you need to integrate your SpringBoot application and enable the SpringBoot Actuator. **1、Add POM .XML dependencies:** @@ -23,6 +23,9 @@ If you want to monitor information in 'SpringBoot' with this monitoring type, yo ```yaml management: + endpoint: + gateway: + enabled: true # default value endpoints: web: exposure: @@ -74,3 +77,14 @@ management: |---------|------|------------| | space | None | Memory space name | | mem_used | MB | This space occupies a memory size of | + +#### metric Collection: route_info + +| Metric Name | metric unit | Metrics help describe | +|-------------|-------------|--------------------------------------| +| route_id | None | Route id | +| predicate | None | This is a routing matching rule | +| uri | None | This is a service resource identifier| +| order | None | The priority of this route | + + diff --git a/home/versioned_docs/version-v1.5.x/help/springboot2.md b/home/versioned_docs/version-v1.5.x/help/springboot2.md new file mode 100644 index 00000000000..ca46530f77b --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/springboot2.md @@ -0,0 +1,91 @@ +--- +id: springboot2 +Title: Monitoring SpringBoot 2.0 +sidebar_label: SpringBoot 2.0 +keywords: [open source monitoring tool, open source springboot2 monitoring tool, monitoring springboot2 metrics] +--- + +> Collect and monitor the general performance metrics exposed by the SpringBoot 2.0 actuator. + +## Pre-monitoring operations + +If you want to monitor information in 'SpringBoot' with this monitoring type, you need to integrate your SpringBoot application and enable the SpringBoot Actuator. + +**1、Add POM .XML dependencies:** + +```xml + + org.springframework.boot + spring-boot-starter-actuator + +``` +**2. Modify the YML configuration exposure metric interface:** + +```yaml +management: + endpoints: + web: + exposure: + include: '*' + enabled-by-default: on +``` +*Note: If your project also introduces authentication related dependencies, such as springboot security, the interfaces exposed by SpringBoot Actor may be intercepted. In this case, you need to manually release these interfaces. Taking springboot security as an example, you should add the following code to the Security Configuration class:* +```java +public class SecurityConfig extends WebSecurityConfigurerAdapter{ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception{ + httpSecurity + // Configure the interfaces to be released ----------------------------------- + .antMatchers("/actuator/**").permitAll() + .antMatchers("/metrics/**").permitAll() + .antMatchers("/trace").permitAll() + .antMatchers("/heapdump").permitAll() + // 。。。 + // For other interfaces, please refer to: https://blog.csdn.net/JHIII/article/details/126601858 ----------------------------------- + } +} +``` +### Configure parameters + +| Parameter name | Parameter Help describes the | +| ------------ |------------------------------------------------------| +| Monitor Host | THE MONITORED PEER IPV4, IPV6 OR DOMAIN NAME. Note ⚠️ that there are no protocol headers (eg: https://, http://). | +| Monitoring Name | A name that identifies this monitoring that needs to be unique. | +| Port | The default port provided by the database is 8080. | +| Enable HTTPS | Whether to access the website through HTTPS, please note that ⚠️ when HTTPS is enabled, the default port needs to be changed to 443 | +| The acquisition interval is | Monitor the periodic data acquisition interval, in seconds, and the minimum interval that can be set is 30 seconds | +| Whether to probe the | Whether to check the availability of the monitoring before adding a monitoring is successful, and the new modification operation | will continue only if the probe is successful +| Description Comment | For more information identifying and describing the remarks for this monitoring, users can remark the information here | + +### Collect metrics + +#### metric Collection: Health + +| Metric Name | metric unit | Metrics help describe | +| ------------------ | -------- |--------------------------------| +| status | None | Service health: UP, Down | + +#### metric Collection: enviroment + +| Metric Name | metric unit | Metrics help describe | +|---------| -------- |----------------------------| +| profile | None | The application runs profile: prod, dev, test | +| port | None | Apply the exposed port | +| os | None | Run the operating system | +| os_arch | None | Run the operating system architecture | +| jdk_vendor | None | jdk vendor | +| jvm_version | None | jvm version | + +#### metric Collection: threads + +| Metric Name | metric unit | Metrics help describe | +| ---------------- |------|--------------------| +| state | None | Thread status | +| number | None | This thread state corresponds to | number of threads + +#### metric Collection: memory_used + +| Metric Name | metric unit | Metrics help describe | +|---------|------|------------| +| space | None | Memory space name | +| mem_used | MB | This space occupies a memory size of | diff --git a/home/versioned_docs/version-v1.5.x/help/springboot3.md b/home/versioned_docs/version-v1.5.x/help/springboot3.md new file mode 100644 index 00000000000..0dbc32fc834 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/springboot3.md @@ -0,0 +1,87 @@ +--- +id: springboot3 +Title: Monitoring SpringBoot 3.0 +sidebar_label: SpringBoot 3.0 +keywords: [open source monitoring tool, open source monitoring tool, monitoring springboot3 metrics] +--- + +> Collect and monitor the general performance metrics exposed by the SpringBoot 3.0 actuator. + +## Pre-monitoring operations + +If you want to monitor information in 'SpringBoot' with this monitoring type, you need to integrate your SpringBoot application and enable the SpringBoot Actuator. + +**1、Add POM .XML dependencies:** + +```xml + + org.springframework.boot + spring-boot-starter-actuator + +``` + +**2. Modify the YML configuration exposure metric interface:** + +```yaml +management: + endpoints: + web: + exposure: + include: '*' + enabled-by-default: on +``` + +*Note: If your project also introduces authentication related dependencies, such as springboot security, the interfaces exposed by SpringBoot Actor may be intercepted. In this case, you need to manually release these interfaces. Taking springboot security as an example, you should add the following code to the Security Configuration class:* + +```java +public class SecurityConfig extends WebSecurityConfigurerAdapter{ + @Override + protected void configure(HttpSecurity httpSecurity) throws Exception{ + httpSecurity + // Configure the interfaces to be released ----------------------------------- + .antMatchers("/actuator/**").permitAll() + .antMatchers("/metrics/**").permitAll() + .antMatchers("/trace").permitAll() + .antMatchers("/heapdump").permitAll() + // ... + // For other interfaces, please refer to: https://blog.csdn.net/JHIII/article/details/126601858 ----------------------------------- + } +} +``` + +### Configuration Parameters + +| Parameter Name | Parameter Description | +|-------------------|----------------------------------------------------------------------------------------------------------------------| +| Monitor Host | The monitored peer's IPV4, IPV6, or domain name. Note⚠️: Do not include protocol headers (eg: https://, http://). | +| Task Name | Identifies the name of this monitor, ensuring uniqueness is necessary. | +| Port | The port provided by the application service, default is 8080. | +| Enable SSL | Whether to access the website via HTTPS. Note⚠️: Enabling HTTPS generally requires changing the default port to 443. | +| Collector | Specifies which collector to use for scheduling data collection for this monitor. | +| Monitoring Period | Interval for periodically collecting data, in seconds, with a minimum interval of 30 seconds. | +| Bind Tags | Tags for categorizing and managing monitored resources. | +| Description | Additional identification and description for this monitor, where users can add remarks. | + +### Collection Metrics + +#### Metric Set: Availability +| Metric Name | Unit | Metric Description | +|--------------|------|--------------------| +| responseTime | ms | Response time | + +#### Metric Set: Threads +| Metric Name | Unit | Metric Description | +|-------------|------|----------------------------------| +| state | None | Thread state | +| size | None | Number of threads for this state | + +#### Metric Set: Memory Usage +| Metric Name | Unit | Metric Description | +|-------------|------|-----------------------------| +| space | None | Memory space name | +| mem_used | MB | Memory usage for this space | + +#### Metric Set: Health Status +| Metric Name | Unit | Metric Description | +|-------------|------|---------------------------------| +| status | None | Service health status: UP, Down | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/sqlserver.md b/home/versioned_docs/version-v1.5.x/help/sqlserver.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/sqlserver.md rename to home/versioned_docs/version-v1.5.x/help/sqlserver.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ssl_cert.md b/home/versioned_docs/version-v1.5.x/help/ssl_cert.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ssl_cert.md rename to home/versioned_docs/version-v1.5.x/help/ssl_cert.md diff --git a/home/versioned_docs/version-v1.5.x/help/tidb.md b/home/versioned_docs/version-v1.5.x/help/tidb.md new file mode 100644 index 00000000000..541b84d6876 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/tidb.md @@ -0,0 +1,55 @@ +--- +id: tidb +title: Monitoring:TiDB database monitoring +sidebar_label: TiDB database +keywords: [open source monitoring tool, open source database monitoring tool, monitoring tidb database metrics] +--- + +> HertzBeat monitors general performance metrics of TiDB through HTTP and JDBC protocol. + +[Metrics Schema](https://docs.pingcap.com/tidb/stable/metrics-schema) + +[METRICS_SUMMARY](https://docs.pingcap.com/tidb/stable/information-schema-metrics-summary) + +[METRICS_TABLES](https://docs.pingcap.com/tidb/stable/information-schema-metrics-tables) + +**Protocol Use: HTTP and JDBC** + +### Configuration parameter + +| Parameter name | Parameter help description | +| ----------- | ----------- | +| Target Host | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://) | +| Task name | Identify the name of this monitoring. The name needs to be unique | +| Service Port | The port that the TiDB database provides externally for status reporting is 10080 by default | +| PD Port | The PD port for the TiDB database, which defaults to 2379 | +| Query timeout | Set the timeout time when SQL query does not respond to data, unit: ms, default: 6000ms | +| JDBC Port | The TiDB database externally provides the port used for client requests, which defaults to 4000 | +| Database name | Database instance name, optional | +| Username | Database connection user name, optional | +| Password | Database connection password, optional | +| JDBC URL | Database using [JDBC](https://docs.pingcap.com/tidb/stable/dev-guide-connect-to-tidb#jdbc) connection URL,optional,If configured, the database name, user name, password and other parameters in the URL will overwrite the above configured parameters | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds | +| Whether to detect | Whether to detect and check the availability of monitoring before adding monitoring. Adding and modifying operations will continue only after the detection is successful | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here | + + +### Collection Metric + +The monitoring template will retrieve the monitoring metrics from the TiDB System Variables table, and the user can retrieve the [TiDB System Variables Table](https://docs.pingcap.com/tidb/stable/system-variables) by himself to query the required information or other system variables. + +Besides, TiDB also provides default monitoring metrics table, see [Metrics Schema](https://docs.pingcap.com/tidb/stable/metrics-schema) and [METRICS_SUMMARY](https://docs.pingcap.com/tidb/stable/information-schema-metrics-summary), and users can add their own sql codes according to their needs. + +Due to the large number of metrics that can be monitored, only the metrics queried in the monitoring template are described below. + +#### Metric set: global variables + +| Metric Name | Metric Unit | Metric Help Description | +|---------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| version | none | The MySQL version, followed by the TiDB version. For example '8.0.11-TiDB-v7.5.1'. | +| version_comment | none | The TiDB version. For example, 'TiDB Server (Apache License 2.0) Community Edition, MySQL 8.0 compatible'. | +| version_compile_machine | none | The name of the CPU architecture on which TiDB is running. | +| version_compile_os | none | The name of the OS on which TiDB is running. | +| max_connections | none | The maximum number of concurrent connections permitted for a single TiDB instance. This variable can be used for resources control. The default value 0 means no limit. When the value of this variable is larger than 0, and the number of connections reaches the value, the TiDB server rejects new connections from clients. | +| datadir | none | The location where data is stored. This location can be a local path /tmp/tidb, or point to a PD server if the data is stored on TiKV. A value in the format of ${pd-ip}:${pd-port} indicates the PD server that TiDB connects to on startup. | +| port | none | The port that the tidb-server is listening on when speaking the MySQL protocol. | diff --git a/home/versioned_docs/version-v1.5.x/help/time_expression.md b/home/versioned_docs/version-v1.5.x/help/time_expression.md new file mode 100644 index 00000000000..e2cb0928b05 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/time_expression.md @@ -0,0 +1,64 @@ +--- +id: time_expression +title: Time Expression +sidebar_label: Time Expression +keywords: [ dynamic time, time expressions ] +--- + +### Introduction + +HertzBeat supports using expressions to calculate relative time during monitoring collection, allowing for more flexible time definitions in monitoring templates. + +### Syntax + +``` +${FORMATTER [{ + | - } ]} +``` + +- `FORMATTER`: Determines the format of the expression's result +- `DURATION`: Size of the time period, a positive integer +- `TIME_UNIT`: Unit of the time period + +### Supported Formatting Types + +> Example outputs are based on the current time being `2022-04-24 02:40:00.123` + +| Name | Description | Example | +|---------------|------------------------------------|------------------------| +| @now | Formats as `yyyy-MM-dd HH:mm:ss` | 2022-04-24 02:40:00 | +| @date | Formats as `yyyy-MM-dd` | 2022-04-24 | +| @timestamp10 | Returns 10-digit timestamp | 1650768000 | +| @timestamp | Returns 13-digit timestamp | 1650768000000 | +| @time | Formats as `HH:mm:ss` | 02:40:00 | +| @year | Formats as `yyyy` | 2022 | +| @month | Formats as `MM` | 04 | +| @day | Formats as `dd` | 24 | +| @hour | Formats as `HH` | 02 | +| @minute | Formats as `mm` | 40 | +| @millisecond | Formats as `SSS` | 123 | +| @second | Formats as `ss` | 00 | + +### Supported Time Units + +| Name | Description | +|------|-------------| +| y | Year | +| M | Month | +| d | Day | +| H | Hour | +| m | Minute | +| s | Second | +| w | Week | + +#### Where to Use + +- Request parameters for HTTP protocol monitoring types + +#### Usage Examples + +1. Simple expression + - `${now}` gets the current time and formats it as `yyyy-MM-dd HH:mm:ss` + - `${time+1h}` calculates the time one hour from now and formats it as `HH:mm:ss` + - `${time+1h+15s+30s}` calculates the time one hour, 15 minutes, and 30 seconds from now and formats it as `HH:mm:ss` +2. Complex expression template (if the built-in formatter does not meet your needs, you can combine multiple expressions) + - `${@year}年${@month}月${@day}日` returns the current date formatted as yyyy年MM月dd日 diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/tomcat.md b/home/versioned_docs/version-v1.5.x/help/tomcat.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/tomcat.md rename to home/versioned_docs/version-v1.5.x/help/tomcat.md diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ubuntu.md b/home/versioned_docs/version-v1.5.x/help/ubuntu.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/ubuntu.md rename to home/versioned_docs/version-v1.5.x/help/ubuntu.md diff --git a/home/versioned_docs/version-v1.5.x/help/udp_port.md b/home/versioned_docs/version-v1.5.x/help/udp_port.md new file mode 100644 index 00000000000..7fdcce3cf77 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/udp_port.md @@ -0,0 +1,34 @@ +--- +id: udp_port +title: Monitoring UDP port availability +sidebar_label: UDP Port availability +keywords: [open source monitoring tool, open source port monitoring tool, monitoring UDP port metrics] +--- + +> UDP is a connectionless transport layer protocol. We determine the availability status of its ports by sending request packets at the application layer and receiving responses. The configuration information requires filling in the hexadecimal content of the application layer packets that prompt responses from the peer. We recommend using Wireshark for packet capture to obtain the transmitted packet content. +> You can click on `Create UDP Port Availability` to configure or select `More Actions` to import existing configurations. + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------|--------------------------------------------------------------------------------------------------------------------------| +| Monitoring Host | Monitored IPV4, IPV6 or domain name. Note⚠️ Without protocol header (eg: https://, http://). | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique. | +| Port | Ports provided by website. | +| Connection timeout | The waiting timeout for port connections, in milliseconds. Default is 6000 milliseconds. | +| Sent Packet Content | The hexadecimal content of the application layer packet that prompts a response from the peer. | +| Collector | Specifies which collector to use for scheduling collection for this monitoring. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Classification management tags for monitoring resources. | +| Description | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metric + +#### Metric set:summary + +| Metric name | Metric unit | Metric help description | +|---------------|-------------------|-------------------------| +| Response Time | Milliseconds (ms) | Website response time | + + + diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/website.md b/home/versioned_docs/version-v1.5.x/help/website.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/website.md rename to home/versioned_docs/version-v1.5.x/help/website.md diff --git a/home/versioned_docs/version-v1.5.x/help/websocket.md b/home/versioned_docs/version-v1.5.x/help/websocket.md new file mode 100644 index 00000000000..8e3d29a204a --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/websocket.md @@ -0,0 +1,33 @@ +--- +id: websocket +title: Monitoring Websocket +sidebar_label: Websocket Monitor +keywords: [ open source monitoring tool, Websocket监控 ] +--- + +> Monitor metrics such as the response of the WebSocket service's first handshake. + +### Configuration parameter + +| Parameter name | Parameter help description | +|---------------------------|--------------------------------------------------------------------------------------------------------------------------| +| Host of WebSocket service | Monitored IPV4, IPV6 or domain name. Note⚠️Without protocol header (eg: https://, http://). | +| Monitoring name | Identify the name of this monitoring. The name needs to be unique. | +| Port | Port of websocket service. | +| Path of WebSocket service | WebSocket endpoint path. | +| Collection interval | Interval time of monitor periodic data collection, unit: second, and the minimum interval that can be set is 30 seconds. | +| Bind Tags | Used to classify and manage monitoring resources. | +| Description remarks | For more information about identifying and describing this monitoring, users can note information here. | + +### Collection Metric + +#### Metric set:Summary + +| Metric name | Metric unit | Metric help description | +|---------------|-------------|-------------------------| +| responseTime | ms | Response time | +| httpVersion | none | HTTP version | +| responseCode | none | Response status code | +| statusMessage | none | Status messages | +| connection | none | Connect type | +| upgrade | none | Upgraded protocols | diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/windows.md b/home/versioned_docs/version-v1.5.x/help/windows.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/windows.md rename to home/versioned_docs/version-v1.5.x/help/windows.md diff --git a/home/versioned_docs/version-v1.5.x/help/yarn.md b/home/versioned_docs/version-v1.5.x/help/yarn.md new file mode 100644 index 00000000000..176a3209fee --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/help/yarn.md @@ -0,0 +1,83 @@ +--- +id: yarn +title: Monitoring Apache Yarn Monitoring +sidebar_label: Apache Yarn +keywords: [Big Data Monitoring System, Apache Yarn Monitoring, ResourceManager Monitoring] +--- + +> Hertzbeat monitors Apache Yarn node monitoring metrics. + +**Protocol Used: HTTP** + +## Pre-monitoring Actions + +Retrieve the HTTP monitoring port of Apache Yarn. Value: `yarn.resourcemanager.webapp.address` + +## Configuration Parameters + +| Parameter Name | Parameter Description | +| ---------------- |----------------------------------------------------| +| Target Host | IP address, IPV6, or domain name of the monitored endpoint. Without protocol header. | +| Port | Monitoring port number of Apache Yarn, default is 8088. | +| Query Timeout | Timeout for querying Apache Yarn, in milliseconds, default is 6000 milliseconds. | +| Metrics Interval | Time interval for monitoring data collection, in seconds, minimum interval is 30 seconds. | + +### Collected Metrics + +#### Metric Set: ClusterMetrics + +| Metric Name | Unit | Metric Description | +| ----------------------- | ---- | -----------------------------------------| +| NumActiveNMs | | Number of currently active NodeManagers | +| NumDecommissionedNMs | | Number of currently decommissioned NodeManagers | +| NumDecommissioningNMs | | Number of nodes currently decommissioning | +| NumLostNMs | | Number of lost nodes in the cluster | +| NumUnhealthyNMs | | Number of unhealthy nodes in the cluster | + +#### Metric Set: JvmMetrics + +| Metric Name | Unit | Metric Description | +| ----------------------- | ---- | -------------------------------------------- | +| MemNonHeapCommittedM | MB | Current committed size of non-heap memory in JVM | +| MemNonHeapMaxM | MB | Maximum available non-heap memory in JVM | +| MemNonHeapUsedM | MB | Current used size of non-heap memory in JVM | +| MemHeapCommittedM | MB | Current committed size of heap memory in JVM | +| MemHeapMaxM | MB | Maximum available heap memory in JVM | +| MemHeapUsedM | MB | Current used size of heap memory in JVM | +| GcTimeMillis | | JVM GC time | +| GcCount | | Number of JVM GC occurrences | + +#### Metric Set: QueueMetrics + +| Metric Name | Unit | Metric Description | +| --------------------------- | ---- | -------------------------------------------- | +| queue | | Queue name | +| AllocatedVCores | | Allocated virtual cores (allocated) | +| ReservedVCores | | Reserved cores | +| AvailableVCores | | Available cores (unallocated) | +| PendingVCores | | Blocked scheduling cores | +| AllocatedMB | MB | Allocated (used) memory size | +| AvailableMB | MB | Available memory (unallocated) | +| PendingMB | MB | Blocked scheduling memory | +| ReservedMB | MB | Reserved memory | +| AllocatedContainers | | Number of allocated (used) containers | +| PendingContainers | | Number of blocked scheduling containers | +| ReservedContainers | | Number of reserved containers | +| AggregateContainersAllocated| | Total aggregated containers allocated | +| AggregateContainersReleased| | Total aggregated containers released | +| AppsCompleted | | Number of completed applications | +| AppsKilled | | Number of killed applications | +| AppsFailed | | Number of failed applications | +| AppsPending | | Number of pending applications | +| AppsRunning | | Number of currently running applications | +| AppsSubmitted | | Number of submitted applications | +| running_0 | | Number of jobs running for less than 60 minutes | +| running_60 | | Number of jobs running between 60 and 300 minutes | +| running_300 | | Number of jobs running between 300 and 1440 minutes | +| running_1440 | | Number of jobs running for more than 1440 minutes | + +#### Metric Set: runtime + +| Metric Name | Unit | Metric Description | +| ----------------------- | ---- | --------------------------| +| StartTime | | Startup timestamp | \ No newline at end of file diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/zookeeper.md b/home/versioned_docs/version-v1.5.x/help/zookeeper.md similarity index 100% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/help/zookeeper.md rename to home/versioned_docs/version-v1.5.x/help/zookeeper.md diff --git a/home/versioned_docs/version-v1.5.x/introduce.md b/home/versioned_docs/version-v1.5.x/introduce.md new file mode 100644 index 00000000000..98305d95ed5 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/introduce.md @@ -0,0 +1,313 @@ +--- +id: introduce +title: Apache HertzBeat (incubating) +sidebar_label: Introduce +slug: / +--- + +> A real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities. + +[![Discord](https://img.shields.io/badge/Chat-Discord-7289DA?logo=discord)](https://discord.gg/Fb6M73htGr) +[![Reddit](https://img.shields.io/badge/Reddit-Community-7289DA?logo=reddit)](https://www.reddit.com/r/hertzbeat/) +[![Twitter](https://img.shields.io/twitter/follow/hertzbeat1024?logo=twitter)](https://twitter.com/hertzbeat1024) +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8139/badge)](https://www.bestpractices.dev/projects/8139) +[![Docker Pulls](https://img.shields.io/docker/pulls/apache/hertzbeat?style=%20for-the-badge&logo=docker&label=DockerHub%20Download)](https://hub.docker.com/r/apache/hertzbeat) +[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/hertzbeat)](https://artifacthub.io/packages/search?repo=hertzbeat) +[![QQ](https://img.shields.io/badge/QQ-630061200-orange)](https://qm.qq.com/q/FltGGGIX2m) +[![YouTube Channel Subscribers](https://img.shields.io/youtube/channel/subscribers/UCri75zfWX0GHqJFPENEbLow?logo=youtube&label=YouTube%20Channel)](https://www.youtube.com/channel/UCri75zfWX0GHqJFPENEbLow) + +**Home: [hertzbeat.apache.org](https://hertzbeat.apache.org)** + +## 🎡 Introduction + +[Apache HertzBeat](https://github.com/apache/hertzbeat) (incubating) is an easy-to-use, open source, real-time monitoring system with agentless, high performance cluster, prometheus-compatible, offers powerful custom monitoring and status page building capabilities. + +### Features + +* 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, web-based and with one-click monitoring and alerting, zero learning curve. +* Makes protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` 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. +* Compatible with the `Prometheus` ecosystem and more, can monitoring what `Prometheus` can monitoring with few clicks on webui. +* High performance, supports horizontal expansion of multi-collector clusters, multi-isolated network monitoring and cloud-edge collaboration. +* Provides flexible alarm threshold rules and timely notifications delivered via `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`. +* Provides powerful status page building capabilities, easily communicate the real-time status of your service to users. + + +> HertzBeat's powerful customization, multi-type support, high performance, easy expansion, and low coupling, aims to help users quickly build their own monitoring system. + +---- + +### Powerful Monitoring Templates + +> Before we discuss the customizable monitoring capabilities of HertzBeat, which we mentioned at the beginning, let's introduce the different monitoring templates of HertzBeat. And it is because of this monitoring template design that the advanced features come later. + +HertzBeat itself did not create a data collection protocol for the monitoring client to adapt to. Instead, HertzBeat makes full use of the existing ecosystem, `SNMP protocol` to collect information from network switches and routers, `JMX specification` to collect information from Java applications, `JDBC specification` to collect information from datasets, `SSH` to directly connect to scripts to get the display information, `HTTP+ (JsonPath | prometheus, etc.) ` to parse the information from API interfaces, `IPMI protocol` to collect server information, and so on. +HertzBeat uses these existing standard protocols or specifications, makes them abstractly configurable, and finally makes them all available in the form of YML format monitoring templates that can be written to create templates that use these protocols to collect any desired metrics data. +![hertzbeat](/img/blog/multi-protocol.png) + +Do you believe that users can just write a monitoring template on the UI page, click save and immediately adapt a new monitoring type like `K8s` or `Docker`? + +![hertzbeat](/img/home/9.png) + + +### Built-in Monitoring Types + +**There are a lot of built-in monitoring templates for users to add directly on the page, one monitoring type corresponds to one YML monitoring template**. + +- [Website](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-website.yml), [Port Telnet](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-port.yml), + [Http Api](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api.yml), [Ping Connect](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ping.yml), + [Jvm](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml), + [Ssl Certificate](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot2](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml), + [FTP Server](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml), [SpringBoot3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml), + [Udp Port](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-udp.yml), [Dns](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dns.yml), + [Pop3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-pop3.yml), [Ntp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ntp.yml), + [Api Code](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api_code.yml), [Smtp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-smtp.yml), + [Nginx](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nginx.yml) +- [Mysql](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml), + [MariaDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis.yml), + [ElasticSearch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml), + [Oracle](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml), + [DM](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml), + [ClickHouse](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml), + [Redis Cluster](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml), [Redis Sentinel](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml) + [Doris BE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_be.yml), [Doris FE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_fe.yml), + [Memcached](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-memcached.yml), [NebulaGraph](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-nebulaGraph.yml) +- [Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml), + [CentOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-windows.yml), + [EulerOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml), [Fedora CoreOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml), + [OpenSUSE](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml), [Rocky Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml), + [Red Hat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml), [FreeBSD](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml), + [AlmaLinux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml), [Debian Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-debian.yml) +- [Tomcat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml), + [Zookeeper](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml), + [Flink](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml), + [ShenYu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml), + [Jetty](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml), + [Spring Gateway](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spring_gateway.yml), [EMQX MQTT](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-emqx.yml), + [AirFlow](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-airflow.yml), [Hive](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hive.yml), + [Spark](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spark.yml), [Hadoop](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hadoop.yml) +- [Kubernetes](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-docker.yml) +- [CiscoSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml), [HpeSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml), + [HuaweiSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml), [TpLinkSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml), + [H3cSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml) +- And More Your Custom Template. +- Notified Support `Discord` `Slack` `Telegram` `Email` `Dingtalk` `WeChat` `FeiShu` `Webhook` `SMS` `ServerChan`. + +### Powerful Customization + +> From the previous introduction of **Monitoring Templates**, it is clear that `HertzBeat` has powerful customization features. +> Each monitor type is considered as a monitor template, no matter it is built-in or user-defined. You can easily add, modify and delete indicators by modifying the monitoring template. +> The templates contain a series of functions such as protocol configuration, environment variables, metrics conversion, metrics calculation, units conversion, metrics collection, etc., which help users to collect the metrics they want. + +![hertzbeat](/img/docs/custom-arch.png) + +### No Agent Required + +> For users who have used various systems, the most troublesome thing is the installation, deployment, debugging and upgrading of various `agents`. +> You need to install one `agent` per host, and several corresponding `agents` to monitor different application middleware, and the number of monitoring can easily reach thousands, so writing a batch script may ease the burden. +> The problem of whether the version of `agent` is compatible with the main application, debugging the communication between `agent` and the main application, upgrading the `agent` synchronization and so on and so forth, are all big headaches. + +The principle of `HertzBeat` is to use different protocols to connect directly to the end system, and use the `PULL` form to pull the collected data, without the need for the user to deploy and install `Agent` | `Exporter` on the host of the end, etc. For example, monitoring the `linux operating system`. + +- For example, if you want to monitor `linux OS`, you can just input the IP port account password or key on `HertzBeat` side. +- For example, to monitor `linux OS`, just enter your ip/port account password or key in `HertzBeat`. + +**Password and other sensitive information is encrypted on all links**. + +### High Performance Clustering + +> When the number of monitors rises exponentially, the collection performance drops or the environment is unstable and prone to single point of failure of the collectors, then our collector clusters come into play. + +- HertzBeat supports the deployment of collector clusters and the horizontal expansion of multiple collector clusters to exponentially increase the number of monitorable tasks and collection performance. +- Monitoring tasks are self-scheduled in the collector cluster, single collector hangs without sensing the failure to migrate the collection tasks, and the newly added collector nodes are automatically scheduled to share the collection pressure. +- It is very easy to switch between stand-alone mode and cluster mode without additional component deployment. + +![hertzbeat](/img/docs/cluster-arch.png) + +### Cloud Edge Collaboration + +> Two locations, three centers, multi-cloud environments, multi-isolated networks, you may have heard of these scenarios. When there is a need for a unified monitoring system to monitor the IT resources of different isolated networks, this is where our Cloud Edge Collaboration comes in. + +In an isolated network where multiple networks are not connected, we need to deploy a monitoring system in each network in the previous solution, which leads to data non-interoperability and inconvenient management, deployment and maintenance. +`HertzBeat` provides the ability of cloud edge collaboration, can be deployed in multiple isolated networks edge collector, collector in the isolated network within the monitoring task collection, collection of data reported by the main service unified scheduling management display. + +![hertzbeat](/img/docs/cluster-arch.png) + +### Easy to Use + +- Set **Monitoring+Alarm+Notification** All in one, no need to deploy multiple component services separately. +- Full UI interface operation, no matter adding new monitor, modifying monitor template, or alarm threshold notification, all can be done in WEB interface, no need to modify files or scripts or reboot. +- No Agent is needed, we only need to fill in the required IP, port, account, password and other parameters in the WEB interface. +- Customization friendly, only need a monitoring template YML, automatically generate monitoring management page, data chart page, threshold configuration for corresponding monitoring types. +- Threshold alarm notification friendly, based on the expression threshold configuration, a variety of alarm notification channels, support alarm silence, time label alarm level filtering and so on. + +### Completely Open Source + +- An open source collaboration product using the `Apache2` protocol, maintained by a free and open source community. +- No monitoring number `License`, monitoring type and other pseudo-open source restrictions . +- Built on `Java+SpringBoot+TypeScript+Angular` mainstream technology stack , convenient secondary development . +- Open source is not the same as free, dev based on HertzBeat must retain page footnotes, copyright, etc. + + +**HertzBeat has been included in the [CNCF Observability And Analysis - Monitoring Landscape](https://landscape.cncf.io/card-mode?category=monitoring&grouping=category)** + +![cncf](/img/home/cncf-landscape-left-logo.svg) + +----- + +**HertzBeat's powerful customization, multi-type support, high performance, easy expansion, and low coupling, aims to help users quickly build their own monitoring system.** + +----- + +## Quickly Start + +Just run a single command in a Docker environment: `docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat` +Browser access `http://localhost:1157` default account password `admin/hertzbeat` + +### Landing Page + +- HertzBeat's user management is unified by the configuration file `sureness.yml`, which allows users to add, delete, and modify user information, user role permissions, and so on. Default password admin/hertzbeat + +![hertzbeat](/img/home/0.png) + +### Overview Page + +- The global overview page shows the distribution of current monitoring categories, users can visualize the current monitoring types and quantities and click to jump to the corresponding monitoring types for maintenance and management. +- Show the status of currently registered collector clusters, including collector on-line status, monitoring tasks, startup time, IP address, name and so on. +- Show the list of recent alarm messages, alarm level distribution and alarm processing rate. + +![hertzbeat](/img/home/1.png) + +### Monitoring Center + +- The monitoring portal supports the management of monitoring of application services, database, operating system, middleware, network, customization, etc. It displays the currently added monitors in the form of a list. +- It displays the currently added monitors in the form of a list and supports adding, modifying, deleting, canceling, importing, exporting and batch management of monitors. +- Support tag grouping, query filtering, view monitoring details portal. + +Built-in support for monitoring types include: + +- [Website](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-website.yml), [Port Telnet](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-port.yml), + [Http Api](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api.yml), [Ping Connect](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ping.yml), + [Jvm](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml), + [Ssl Certificate](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot2](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml), + [FTP Server](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml), [SpringBoot3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml), + [Udp Port](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-udp.yml), [Dns](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dns.yml), + [Pop3](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-pop3.yml), [Ntp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ntp.yml), + [Api Code](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api_code.yml), [Smtp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-smtp.yml), + [Nginx](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nginx.yml) +- [Mysql](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml), + [MariaDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis.yml), + [ElasticSearch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml), + [Oracle](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml), + [DM](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml), + [ClickHouse](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml), + [Redis Cluster](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml), [Redis Sentinel](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml) + [Doris BE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_be.yml), [Doris FE](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-doris_fe.yml), + [Memcached](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-memcached.yml), [NebulaGraph](https://github.com/apache/hertzbeat/blob/master/manager/src/main/resources/define/app-nebulaGraph.yml) +- [Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml), + [CentOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-windows.yml), + [EulerOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml), [Fedora CoreOS](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml), + [OpenSUSE](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml), [Rocky Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml), + [Red Hat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml), [FreeBSD](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml), + [AlmaLinux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml), [Debian Linux](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-debian.yml) +- [Tomcat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml), + [Zookeeper](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml), + [Flink](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml), + [ShenYu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml), + [Jetty](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml), + [Spring Gateway](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spring_gateway.yml), [EMQX MQTT](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-emqx.yml), + [AirFlow](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-airflow.yml), [Hive](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hive.yml), + [Spark](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-spark.yml), [Hadoop](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hadoop.yml) +- [Kubernetes](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-docker.yml) +- [CiscoSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml), [HpeSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml), + [HuaweiSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml), [TpLinkSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml), + [H3cSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml) + +![hertzbeat](/img/home/2.png) + +### Add and Modify Surveillance + +- You can add or modify monitoring instances of a specific monitoring type, configure the IP, port and other parameters of the monitoring on the other end, set the collection period, collection task scheduling method, support detecting availability in advance, etc. The monitoring instances on the page are defined by the corresponding monitoring templates. +- The monitoring parameters configured on the page are defined by the monitoring template of the corresponding monitoring type, and users can modify the configuration parameters on the page by modifying the monitoring template. +- Support associated tags to manage monitoring grouping, alarm matching, and so on. + +![hertzbeat](/img/home/10.png) + +### Monitor Details + +- The monitoring data detail page shows the basic parameter information of the current monitoring, and the monitoring indicator data information. +- Monitor Real-time Data Report displays the real-time values of all the currently monitored indicators in the form of a list of small cards, and users can configure alarm threshold rules based on the real-time values for reference. +- Monitor Historical Data Report displays the historical values of the currently monitored metrics in the form of trend charts, supports querying hourly, daily and monthly historical data, and supports configuring the page refresh time. +- ⚠️ Note that the monitoring history charts need to be configured with an external timing database in order to get the full functionality, timing database support: IOTDB, TDengine, InfluxDB, GreptimeDB + +![hertzbeat](/img/home/3.png) + +![hertzbeat](/img/home/4.png) + +### Alarm Center + +- The management display page of triggered alarm messages enables users to visualize the current alarm situation. +- Support alarm processing, alarm marking unprocessed, alarm deletion, clearing and other batch operations. + +![hertzbeat](/img/home/7.png) + +### Threshold Rules + +- Threshold rules can be configured for monitoring the availability status, and alerts can be issued when the value of a particular metric exceeds the expected range. +- There are three levels of alerts: notification alerts, critical alerts, and emergency alerts. +- Threshold rules support visual page configuration or expression rule configuration for more flexibility. +- It supports configuring the number of triggers, alarm levels, notification templates, associated with a specific monitor and so on. + +![hertzbeat](/img/home/6.png) + +![hertzbeat](/img/home/11.png) + +### Alarm Convergence + +- When the alarm is triggered by the threshold rule, it will enter into the alarm convergence, the alarm convergence will be based on the rules of the specific time period of the duplicate alarm message de-emphasis convergence, to avoid a large number of repetitive alarms lead to the receiver alarm numbness. +- Alarm convergence rules support duplicate alarm effective time period, label matching and alarm level matching filter. + +![hertzbeat](/img/home/12.png) + +![hertzbeat](/img/home/13.png) + + +### Alarm Silence + +- When the alarm is triggered by the threshold rule, it will enter into the alarm silence, the alarm silence will be based on the rules of a specific one-time time period or periodic time period of the alarm message blocking silence, this time period does not send alarm messages. +- This application scenario, such as users in the system maintenance, do not need to send known alarms. Users will only receive alarm messages on weekdays, and users need to avoid disturbances at night. +- Alarm silence rules support one-time time period or periodic time period, support label matching and alarm level matching. + +![hertzbeat](/img/home/14.png) + +![hertzbeat](/img/home/15.png) + +### Message Notification + +- Message notification is a function to notify alarm messages to specified recipients through different media channels, so that the alarm messages can reach them in time. +- It includes recipient information management and notification policy management. Recipient management maintains the information of recipients and their notification methods, while notification policy management maintains the policy rules of which recipients will be notified of the alert messages. +- Notification methods support `Email` `Discord` `Slack` `Telegram` `Pinning` `WeChat` `Flybook` `SMS` `Webhook` and so on. +- The notification policy supports tag matching and alert level matching, which makes it convenient to assign alerts with different tags and alert levels to different receivers and handlers. +- Support notification templates, users can customize the content format of the templates to meet their own personalized notification display needs. + +![hertzbeat](/img/home/16.png) + +![hertzbeat](/img/home/17.png) + +![hertzbeat](/img/home/8.png) + +### Monitoring Templates + +- HertzBeat makes `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` and other protocols configurable so that you can customize the metrics you want to collect using these protocols by simply configuring the monitoring template `YML` in your browser. Would you believe that you can instantly adapt a new monitoring type such as `K8s` or `Docker` just by configuring it? +- All our built-in monitoring types (mysql, website, jvm, k8s) are also mapped to corresponding monitoring templates, so you can add and modify monitoring templates to customize your monitoring functions. + +![hertzbeat](/img/home/9.png) + + +----- + +**There's so much more to discover. Have Fun!** + +----- + +**Github: https://github.com/apache/hertzbeat** diff --git a/home/versioned_docs/version-v1.5.x/others/design.md b/home/versioned_docs/version-v1.5.x/others/design.md new file mode 100644 index 00000000000..e7f80d164d7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/others/design.md @@ -0,0 +1,9 @@ +--- +id: design +title: 设计文档 +sidebar_label: 设计文档 +--- + +### HertzBeat Arch + +![architecture](/img/docs/hertzbeat-arch.svg) diff --git a/home/versioned_docs/version-v1.5.x/others/resource.md b/home/versioned_docs/version-v1.5.x/others/resource.md new file mode 100644 index 00000000000..79c16b4ab56 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/others/resource.md @@ -0,0 +1,19 @@ +--- +id: resource +title: Related resources +sidebar_label: Related resources +--- + +## Icon Resources + +### HertzBeat Logo + +![logo](/img/hertzbeat-logo.svg) + +Download: [SVG](/img/hertzbeat-logo.svg) [PNG](/img/hertzbeat-logo.png) + +### HertzBeat Brand Logo + +![logo](/img/hertzbeat-brand.svg) + +Download: [SVG](/img/hertzbeat-brand.svg) [PNG](/img/hertzbeat-brand.png) diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/account-modify.md b/home/versioned_docs/version-v1.5.x/start/account-modify.md similarity index 91% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/account-modify.md rename to home/versioned_docs/version-v1.5.x/start/account-modify.md index da8a549890e..64bba7d72df 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/account-modify.md +++ b/home/versioned_docs/version-v1.5.x/start/account-modify.md @@ -1,12 +1,14 @@ --- id: account-modify -title: Modify Account Username Password -sidebar_label: Update Account +title: Modify Account Username Password And Secret +sidebar_label: Update Account Secret --- -HertzBeat default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat +## Update Account + +Apache HertzBeat (incubating) default built-in three user accounts, respectively admin/hertzbeat tom/hertzbeat guest/hertzbeat If you need add, delete or modify account or password, configure `sureness.yml`. Ignore this step without this demand. -The configuration file content refer to project repository[/script/sureness.yml](https://gitee.com/hertzbeat/hertzbeat/blob/master/script/sureness.yml) +The configuration file content refer to project repository[/script/sureness.yml](https://github.com/hertzbeat/hertzbeat/blob/master/script/sureness.yml) Modify the following **part parameters** in sureness.yml:**[Note⚠️Other default sureness configuration parameters should be retained]** ```yaml @@ -110,12 +112,12 @@ account: role: [guest] ``` -## Update Security Secret +## Update Security Secret -> This secret is the key for account security encryption management and needs to be updated to your custom key string of the same length. +> This secret is the key for account security encryption management and needs to be updated to your custom key string of the same length. -Update the `application.yml` file in the `config` directory, modify the `sureness.jwt.secret` parameter to your custom key string of the same length. +Update the `application.yml` file in the `config` directory, modify the `sureness.jwt.secret` parameter to your custom key string of the same length. ```yaml sureness: diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/custom-config.md b/home/versioned_docs/version-v1.5.x/start/custom-config.md similarity index 64% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/custom-config.md rename to home/versioned_docs/version-v1.5.x/start/custom-config.md index 5f7837c4e56..91282bf5055 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/custom-config.md +++ b/home/versioned_docs/version-v1.5.x/start/custom-config.md @@ -1,7 +1,7 @@ --- id: custom-config -title: Advanced Config -sidebar_label: Advanced Config +title: Advanced Params Config +sidebar_label: Advanced Params Config --- This describes how to configure the SMS server, the number of built-in availability alarm triggers, etc. @@ -32,18 +32,11 @@ common: 2. Configure alarm custom parameters -> If you receive frequent built-in availability alarms, or the network jitter is severe in your area, it is recommended to adjust the following parameters ```yaml alerter: # Custom console address console-url: https://console.tancloud.cn - # Alarm trigger evaluation interval basic time, the same repeated alarm will not be repeatedly triggered continuously within 2 times this time, unit milliseconds - alert-eval-interval-base: 600000 - # The maximum time between alarm trigger evaluation intervals, the same repeated alarms can be suppressed at most during this time period, in milliseconds - max-alert-eval-interval: 86400000 - # The built-in availability alarm will be triggered several times in a row before the actual alarm is sent. The default is 1 time. When the network environment is not good and you don't want to receive availability alarms frequently, you can increase this value (3) - system-alert-trigger-times: 1 ``` 3. Use external redis instead of memory to store real-time metric data diff --git a/home/versioned_docs/version-v1.5.x/start/docker-deploy.md b/home/versioned_docs/version-v1.5.x/start/docker-deploy.md new file mode 100644 index 00000000000..7671366e9ad --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/docker-deploy.md @@ -0,0 +1,136 @@ +--- +id: docker-deploy +title: Install HertzBeat via Docker +sidebar_label: Install via Docker +--- + +> Recommend to use docker deploy Apache HertzBeat (incubating) + + +1. Download and install the Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/)。 + After the installation you can check if the Docker version normally output at the terminal. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` + +2. pull HertzBeat Docker mirror + you can look up the mirror version TAG in [dockerhub mirror repository](https://hub.docker.com/r/apache/hertzbeat/tags) + or in [quay.io mirror repository](https://quay.io/repository/apache/hertzbeat) + ```shell + $ docker pull apache/hertzbeat + $ docker pull apache/hertzbeat-collector + ``` + or + ```shell + $ docker pull quay.io/tancloud/hertzbeat + $ docker pull quay.io/tancloud/hertzbeat-collector + ``` + +3. Mounted HertzBeat configuration file (optional) + Download and config `application.yml` in the host directory, eg:`$(pwd)/application.yml` + Download from [github/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + You can modify the configuration yml file according to your needs. + - If you need to use email to send alarms, you need to replace the email server parameters `spring.mail` in `application.yml` + - **Recommended** If you need to use an external Mysql database to replace the built-in H2 database, you need to replace the `spring.datasource` parameter in `application.yml` For specific steps, see [Using Mysql to replace H2 database](mysql-change) + - **Recommended** If you need to use the time series database TDengine to store metric data, you need to replace the `warehouse.store.td-engine` parameter in `application.yml` for specific steps, see [Using TDengine to store metrics data](tdengine-init) + - **Recommended** If you need to use the time series database IotDB to store the metric database, you need to replace the `warehouse.storeiot-db` parameter in `application.yml` For specific steps, see [Use IotDB to store metrics data](iotdb-init) + +4. Mounted the account file(optional) + HertzBeat default built-in three user accounts, respectively `admin/hertzbeat tom/hertzbeat guest/hertzbeat` + If you need update account or password, configure `sureness.yml`. Ignore this step without this demand. + Download and config `sureness.yml` in the host directory,eg:`$(pwd)/sureness.yml` + Download from [github/script/sureness.yml](https://github.com/apache/hertzbeat/raw/master/script/sureness.yml) + For detail steps, please refer to [Configure Account Password](account-modify) + +5. Start the HertzBeat Docker container + +```shell +$ docker run -d -p 1157:1157 -p 1158:1158 \ + -e LANG=en_US.UTF-8 \ + -e TZ=Asia/Shanghai \ + -v $(pwd)/data:/opt/hertzbeat/data \ + -v $(pwd)/logs:/opt/hertzbeat/logs \ + -v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml \ + -v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml \ + --name hertzbeat apache/hertzbeat +``` + + This command starts a running HertzBeat Docker container with mapping port 1157-1158. If existing processes on the host use the port, please modify host mapped port. + - `docker run -d` : Run a container in the background via Docker + - `-p 1157:1157 -p 1158:1158` : Mapping container ports to the host, 1157 is web-ui port, 1158 is cluster port. + - `-e LANG=en_US.UTF-8` : Set the system language + - `-e TZ=Asia/Shanghai` : Set the system timezone + - `-v $(pwd)/data:/opt/hertzbeat/data` : (optional, data persistence) Important⚠️ Mount the H2 database file to the local host, to ensure that the data is not lost due creating or deleting container. + - `-v $(pwd)/logs:/opt/hertzbeat/logs` : (optional, if you don't have a need, just delete it) Mount the log file to the local host, to ensure the log will not be lost due creating or deleting container. + - `-v $(pwd)/application.yml:/opt/hertzbeat/config/application.yml` : (optional, if you don't have a need, just delete it) Mount the local configuration file into the container which has been modified in the previous step, namely using the local configuration file to cover container configuration file. + - `-v $(pwd)/sureness.yml:/opt/hertzbeat/config/sureness.yml` : (optional, if you don't have a need, just delete it) Mount account configuration file modified in the previous step into the container. Delete this command parameters if no needs. + - `--name hertzbeat` : Naming container name hertzbeat + - `apache/hertzbeat` : Use the pulled latest HertzBeat official application mirror to start the container. **Use `quay.io/tancloud/hertzbeat` instead if you pull `quay.io` docker image.** + +6. Begin to explore HertzBeat + + Access `http://ip:1157/` using browser. You can explore HertzBeat with default account `admin/hertzbeat` now! + +7. Deploy collector cluster (Optional) + +```shell +$ docker run -d \ + -e IDENTITY=custom-collector-name \ + -e MODE=public \ + -e MANAGER_HOST=127.0.0.1 \ + -e MANAGER_PORT=1158 \ + --name hertzbeat-collector apache/hertzbeat-collector +``` + + This command starts a running HertzBeat-Collector container. + - `docker run -d` : Run a container in the background via Docker + - `-e IDENTITY=custom-collector-name` : (optional) Set the collector unique identity name. Attention the clusters collector name must unique. + - `-e MODE=public` : set the running mode(public or private), public cluster or private cloud-edge. + - `-e MANAGER_HOST=127.0.0.1` : Important⚠️ Set the main hertzbeat server ip. + - `-e MANAGER_PORT=1158` : (optional) Set the main hertzbeat server port, default 1158. + - `-v $(pwd)/logs:/opt/hertzbeat-collector/logs` : (optional) Mount the log file to the local host, to ensure the log will not be lost due creating or deleting container. + - `--name hertzbeat-collector` : Naming container name hertzbeat-collector + - `apache/hertzbeat-collector` : Use the pulled latest HertzBeat-Collector official application mirror to start the container. **Use `quay.io/tancloud/hertzbeat-collector` instead if you pull `quay.io` docker image.** + +8. Access `http://localhost:1157` and you will see the registered new collector in dashboard. + +**HAVE FUN** + +### FAQ + +**The most common problem is network problems, please check in advance** + +1. **MYSQL, TDENGINE, IoTDB and HertzBeat are deployed on the same host by Docker,HertzBeat use localhost or 127.0.0.1 connect to the database but fail** +The problems lies in Docker container failed to visit and connect localhost port. Because the docker default network mode is Bridge mode which can't access local machine through localhost. +> Solution A:Configure application.yml. Change database connection address from localhost to external IP of the host machine. +> Solution B:Use the Host network mode to start Docker, namely making Docker container and hosting share network. `docker run -d --network host .....` + +2. **According to the process deploy,visit http://ip:1157/ no interface** +Please refer to the following points to troubleshoot issues: +> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully. +> 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. +> 3:`docker logs hertzbeat` Check whether the container log has errors. If you haven't solved the issue, report it to the communication group or community. + +3. **Log an error TDengine connection or insert SQL failed** +> 1:Check whether database account and password configured is correct, the database is created. +> 2:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server. + +4. **Historical monitoring charts have been missing data for a long time** +> 1:Check whether you configure Tdengine or IoTDB. No configuration means no historical chart data. +> 2:Check whether Tdengine database `hertzbeat` is created. +> 3: Check whether IP account and password configuration is correct in HertzBeat's configuration file `application.yml`. + +5. If the history chart on the monitoring page is not displayed,popup [please configure time series database] +> As shown in the popup window,the premise of history chart display is that you need install and configure hertzbeat's dependency service - IoTDB or TDengine database. +> Installation and initialization this database refer to [TDengine Installation](tdengine-init) or [IoTDB Installation](iotdb-init) + +6. The historical picture of monitoring details is not displayed or has no data, and TDengine has been deployed +> Please confirm whether the installed TDengine version is near 2.4.0.12, version 3.0 and 2.2 are not compatible. + +7. The time series database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure dependent time series database] +> Please check if the configuration parameters are correct +> Is iot-db or td-engine enable set to true +> Note⚠️If both hertzbeat and IotDB, TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed +> You can check the startup logs according to the logs directory diff --git a/home/versioned_docs/version-v1.5.x/start/greptime-init.md b/home/versioned_docs/version-v1.5.x/start/greptime-init.md new file mode 100644 index 00000000000..cfb148ecea7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/greptime-init.md @@ -0,0 +1,65 @@ +--- +id: greptime-init +title: Use Time Series Database GreptimeDB to Store Metrics Data (Optional) +sidebar_label: Use GreptimeDB Store Metrics +--- + +Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) + +> It is recommended to use VictoriaMetrics as metrics storage. + +GreptimeDB is an open-source time-series database with a special focus on scalability, analytical capabilities and efficiency. + +It's designed to work on infrastructure of the cloud era, and users benefit from its elasticity and commodity storage. + +**⚠️ If you do not configure a time series database, only the last hour of historical data is retained.** + +### Install GreptimeDB via Docker +> Refer to the official website [installation tutorial](https://docs.greptime.com/getting-started/overview) +1. Download and install Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). + After the installation you can check if the Docker version normally output at the terminal. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Install GreptimeDB with Docker + +```shell +$ docker run -p 4000-4004:4000-4004 \ + -p 4242:4242 -v /opt/greptimedb:/tmp/greptimedb \ + --name greptime \ + greptime/greptimedb standalone start \ + --http-addr 0.0.0.0:4000 \ + --rpc-addr 0.0.0.0:4001 \ +``` + `-v /opt/greptimedb:/tmp/greptimedb` is local persistent mount of greptimedb data directory. `/opt/greptimedb` should be replaced with the actual local directory. + use```$ docker ps``` to check if the database started successfully + +### Configure the database connection in hertzbeat `application.yml` configuration file + +1. Configure HertzBeat's configuration file + Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Replace `warehouse.store.greptime` data source parameters, URL account and password. + +```yaml +warehouse: + store: + # disable jpa + jpa: + enabled: false + # enable greptime + greptime: + enabled: true + endpoint: localhost:4001 +``` + +2. Restart HertzBeat + +### FAQ + +1. Do both the time series databases Greptime, IoTDB or TDengine need to be configured? Can they both be used? + +> You don't need to configure all of them, you can choose one of them. Use the enable parameter to control whether it is used or not. You can also install and configure neither, which only affects the historical chart data. + diff --git a/home/versioned_docs/version-v1.5.x/start/influxdb-init.md b/home/versioned_docs/version-v1.5.x/start/influxdb-init.md new file mode 100644 index 00000000000..b752fc82a21 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/influxdb-init.md @@ -0,0 +1,72 @@ +--- +id: influxdb-init +title: Use Time Series Database InfluxDB to Store Metrics Data (Optional) +sidebar_label: Use InfluxDB Store Metrics +--- + +Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) + +> It is recommended to use VictoriaMetrics as metrics storage. + + +**Note⚠️ Time series database is optional, but production environment configuration is strongly recommended to provide more complete historical chart functions and high performance** +**⚠️ If you do not configure a time series database, only the last hour of historical data is retained.** +Note⚠️ Need InfluxDB 1.x Version. + +### 1. Use HuaweiCloud GaussDB For Influx + +> Use [HuaweiCloud GaussDB For Influx](https://www.huaweicloud.com/product/gaussdbforinflux.html) + +> Get the `GaussDB For Influx` service url, username and password config. + +⚠️Note `GaussDB For Influx` enable SSL default, the service url should use `https:` + +### 2. Install TDengine via Docker +> Refer to the official website [installation tutorial](https://hub.docker.com/_/influxdb) +1. Download and install Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). + After the installation you can check if the Docker version normally output at the terminal. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Install InfluxDB with Docker + ``` + $ docker run -p 8086:8086 \ + -v /opt/influxdb:/var/lib/influxdb \ + influxdb:1.8 + ``` + `-v /opt/influxdb:/var/lib/influxdb` is local persistent mount of InfluxDB data directory. `/opt/influxdb` should be replaced with the actual local directory. + use```$ docker ps``` to check if the database started successfully + + +### Configure the database connection in hertzbeat `application.yml` configuration file + +1. Configure HertzBeat's configuration file + Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Replace `warehouse.store.influxdb` data source parameters, URL account and password. + +```yaml +warehouse: + store: + # disable jpa + jpa: + enabled: false + # enable influxdb + influxdb: + enabled: true + server-url: http://localhost:8086 + username: root + password: root + expire-time: '30d' + replication: 1 +``` + +2. Restart HertzBeat + +### FAQ + +1. Do both the time series databases InfluxDB, IoTDB and TDengine need to be configured? Can they both be used? + +> You don't need to configure all of them, you can choose one of them. Use the enable parameter to control whether it is used or not. You can also install and configure neither, which only affects the historical chart data. diff --git a/home/versioned_docs/version-v1.5.x/start/iotdb-init.md b/home/versioned_docs/version-v1.5.x/start/iotdb-init.md new file mode 100644 index 00000000000..ee7a66a87f4 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/iotdb-init.md @@ -0,0 +1,122 @@ +--- +id: iotdb-init +title: Use Time Series Database IoTDB to Store Metrics Data (Optional) +sidebar_label: Use IoTDB Store Metrics +--- +Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) + +> It is recommended to use VictoriaMetrics as metrics storage. + +Apache IoTDB is a software system that integrates the collection, storage, management and analysis of time series data of the Internet of Things. We use it to store and analyze the historical data of monitoring metrics collected. Support V1.0.+ version. + +**Note⚠️ Time series database is optional, but production environment configuration is strongly recommended to provide more complete historical chart functions and high performance** + +**⚠️ If you do not configure a time series database, only the last hour of historical data is retained.** + +> If you already have an IoTDB environment, you can skip directly to the YML configuration step. + +### Install IoTDB via Docker + +> Refer to the official website [installation tutorial](https://iotdb.apache.org/UserGuide/V0.13.x/QuickStart/WayToGetIoTDB.html) + +1. Download and install Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). + After the installation you can check if the Docker version normally output at the terminal. + + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Install IoTDB via Docker + +```shell +$ docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 \ + -v /opt/iotdb/data:/iotdb/data \ + --name iotdb \ + apache/iotdb:1.2.2-standalone +``` + +`-v /opt/iotdb/data:/iotdb/data` is local persistent mount of IotDB data directory.`/iotdb/data` should be replaced with the actual local directory. +use```$ docker ps``` to check if the database started successfully + +3. Configure the database connection in hertzbeat `application.yml`configuration file + + Modify `hertzbeat/config/application.yml` configuration file + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Config the `warehouse.store.jpa.enabled` `false`. Replace `warehouse.store.iot-db` data source parameters, HOST account and password. + +``` +warehouse: + store: + # disable JPA + jpa: + enabled: false + # enable iot-db + iot-db: + enabled: true + host: 127.0.0.1 + rpc-port: 6667 + username: root + password: root + query-timeout-in-ms: -1 + # default '7776000000'(90days,unit:ms,-1:no-expire) + expire-time: '7776000000' +``` + +**IoTDB Cluster Configuration** + +If you are using IoTDB for clustering, please refer to the configuration below: + +```yaml +warehouse: + store: + # Disable default JPA + jpa: + enabled: false + # Enable IoTDB + iot-db: + enabled: true + node-urls: ['127.0.0.1:6667','127.0.0.2:6667','127.0.0.3:6667'] + username: root + password: root + # if iotdb version >= 0.13 use default queryTimeoutInMs = -1; else use default queryTimeoutInMs = 0 + query-timeout-in-ms: -1 + # Data storage time: default '7776000000' (90 days, in milliseconds, -1 means never expire) + expire-time: '7776000000' +``` + +Configuration parameters: + + +| Parameter Name | Description | +| ------------------- |-------------------------------------------------------------------------------------------| +| enabled | Whether to enable | +| host | IoTDB database address | +| rpc-port | IoTDB database port | +| node-urls | IoTDB cluster addresses | +| username | IoTDB database account | +| password | IoTDB database password | +| version | deprecated | +| query-timeout-in-ms | Query timeout | +| expire-time | Data storage time, default '7776000000' (90 days, in milliseconds, -1 means never expire) | + +> If both cluster configuration `node-urls` and standalone configuration are set simultaneously, the cluster `node-urls` configuration takes precedence. + +4. Restart HertzBeat + +### FAQ + +1. Do both the time series databases IoTDB and TDengine need to be configured? Can they both be used? + +> You don't need to configure all of them, you can choose one of them. Use the enable parameter to control whether it is used or not. You can also install and configure neither, which only affects the historical chart data. + +2. The historical chart of the monitoring page is not displayed, and pops up [Unable to provide historical chart data, please configure to rely on the time series database] + +> As shown in the pop-up window, the premise of displaying the history chart is to install and configure the dependent services of hertzbeat - IotDB database or TDengine database + +3. The TDengine database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure the dependent time series database] + +> Please check if the configuration parameters are correct +> Is td-engine enable set to true +> Note⚠️If both hertzbeat and TDengine are started under the same host for docker containers, 127.0.0.1 cannot be used for communication between containers by default, and the host IP is changed +> You can check the startup logs according to the logs directory diff --git a/home/versioned_docs/version-v1.5.x/start/mysql-change.md b/home/versioned_docs/version-v1.5.x/start/mysql-change.md new file mode 100644 index 00000000000..1095f538b0c --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/mysql-change.md @@ -0,0 +1,69 @@ +--- +id: mysql-change +title: Use MYSQL Replace H2 Database to Store Metadata(Optional) +sidebar_label: Use MYSQL Instead of H2 +--- +MYSQL is a reliable relational database. In addition to default built-in H2 database, Apache HertzBeat (incubating) allow you to use MYSQL to store structured relational data such as monitoring information, alarm information and configuration information. + +> If you have the MYSQL environment, can be directly to database creation step. + +### Install MYSQL via Docker +1. Download and install the Docker environment + For Docker installation, please refer to the [Docker official documentation](https://docs.docker.com/get-docker/). + After the installation, please verify in the terminal that the Docker version can be printed normally. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Install MYSQl with Docker + ``` + $ docker run -d --name mysql \ + -p 3306:3306 \ + -v /opt/data:/var/lib/mysql \ + -e MYSQL_ROOT_PASSWORD=123456 \ + --restart=always \ + mysql:5.7 + ``` + `-v /opt/data:/var/lib/mysql` is local persistent mount of mysql data directory. `/opt/data` should be replaced with the actual local directory. + use ```$ docker ps``` to check if the database started successfully + +### Database creation +1. Enter MYSQL or use the client to connect MYSQL service + `mysql -uroot -p123456` +2. Create database named hertzbeat + `create database hertzbeat default charset utf8mb4 collate utf8mb4_general_ci;` +3. Check if hertzbeat database has been successfully created + `show databases;` + +### Modify hertzbeat's configuration file application.yml and switch data source + +- Configure HertzBeat's configuration file + Modify `hertzbeat/config/application.yml` configuration file + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Replace `spring.database` data source parameters, URL account and password. + + For example: + ```yaml + spring: + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL + ``` + Specific replacement parameters are as follows and you need to configure account according to the mysql environment: + ```yaml + spring: + datasource: + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: 123456 + url: jdbc:mysql://localhost:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&useSSL=false + platform: mysql + jpa: + database: mysql + ``` + +- It is recommended to set the host field in the MySQL URL or Redis URL to the public IP address when using Hertzbeat in docker. + +**Start HertzBeat visit http://ip:1157/ on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat** diff --git a/home/versioned_docs/version-v1.5.x/start/package-deploy.md b/home/versioned_docs/version-v1.5.x/start/package-deploy.md new file mode 100644 index 00000000000..050121f5c55 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/package-deploy.md @@ -0,0 +1,92 @@ +--- +id: package-deploy +title: Install HertzBeat via Package +sidebar_label: Install via Package +--- + +> You can install and run Apache HertzBeat (incubating) on Linux Windows Mac system, and CPU supports X86/ARM64. + +1. Download HertzBeat installation package + Download installation package `hertzbeat-xx.tar.gz` `hertzbeat-collector-xx.tar.gz` corresponding to your system environment + - [Download Page](/docs/download) + +2. Configure HertzBeat's configuration file(optional) + Unzip the installation package to the host eg: /opt/hertzbeat + ``` + $ tar zxvf hertzbeat-xx.tar.gz + or + $ unzip -o hertzbeat-xx.zip + ``` + Modify the configuration file `hertzbeat/config/application.yml` params according to your needs. + - If you need to use email to send alarms, you need to replace the email server parameters `spring.mail` in `application.yml` + - **Recommended** If you need to use an external Mysql database to replace the built-in H2 database, you need to replace the `spring.datasource` parameter in `application.yml` For specific steps, see [Using Mysql to replace H2 database](mysql-change) + - **Highly recommended** From now on we will mainly support VictoriaMetrics as a time-series database, if you need to use the time series database VictoriaMetrics to store metric data, you need to replace the `warehouse.store.victoria-metrics` parameter in `application.yml` for specific steps, see [Using VictoriaMetrics to store metrics data](victoria-metrics-init) + - **Recommended** If you need to use the time series database TDengine to store metric data, you need to replace the `warehouse.store.td-engine` parameter in `application.yml` for specific steps, see [Using TDengine to store metrics data](tdengine-init) + - **Recommended** If you need to use the time series database IotDB to store the metric database, you need to replace the `warehouse.storeiot-db` parameter in `application.yml` For specific steps, see [Use IotDB to store metrics data](iotdb-init) + +3. Configure the account file(optional) + HertzBeat default built-in three user accounts, respectively `admin/hertzbeat tom/hertzbeat guest/hertzbeat` + If you need add, delete or modify account or password, configure `hertzbeat/config/sureness.yml`. Ignore this step without this demand. + For detail steps, please refer to [Configure Account Password](account-modify) + +4. Start the service + Execute the startup script `startup.sh` in the installation directory `hertzbeat/bin/`, or `startup.bat` in windows. + ``` + $ ./startup.sh + ``` + +5. Begin to explore HertzBeat + + Access http://localhost:1157/ using browser. You can explore HertzBeat with default account `admin/hertzbeat` now! + +6. Deploy collector clusters (Optional) + + - Download and unzip the collector release package `hertzbeat-collector-xx.tar.gz` to new machine [Download Page](/docs/download) + - Configure the collector configuration yml file `hertzbeat-collector/config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port` + ```yaml + collector: + dispatch: + entrance: + netty: + enabled: true + identity: ${IDENTITY:} + mode: ${MODE:public} + manager-host: ${MANAGER_HOST:127.0.0.1} + manager-port: ${MANAGER_PORT:1158} + ``` + - Run command `$ ./bin/startup.sh ` or `bin/startup.bat` + - Access `http://localhost:1157` and you will see the registered new collector in dashboard + +**HAVE FUN** + +### FAQ + +1. **If using the package not contains JDK, you need to prepare the JAVA environment in advance** + + Install JAVA runtime environment-refer to [official website](http://www.oracle.com/technetwork/java/javase/downloads/index.html) + requirement:JDK17 ENV + download JAVA installation package: [mirror website](https://repo.huaweicloud.com/java/jdk/) + After installation use command line to check whether you install it successfully. + ``` + $ java -version + java version "17.0.9" + Java(TM) SE Runtime Environment 17.0.9 (build 17.0.9+8-LTS-237) + Java HotSpot(TM) 64-Bit Server VM 17.0.9 (build 17.0.9+8-LTS-237, mixed mode) + + ``` + +2. **According to the process deploy,visit http://ip:1157/ no interface** + Please refer to the following points to troubleshoot issues: +> 1:If you switch to dependency service MYSQL database,check whether the database is created and started successfully. +> 2:Check whether dependent services, IP account and password configuration is correct in HertzBeat's configuration file `hertzbeat/config/application.yml`. +> 3:Check whether the running log has errors in `hertzbeat/logs/` directory. If you haven't solved the issue, report it to the communication group or community. + +3. **Log an error TDengine connection or insert SQL failed** +> 1:Check whether database account and password configured is correct, the database is created. +> 2:If you install TDengine2.3+ version, you must execute `systemctl start taosadapter` to start adapter in addition to start the server. + +4. **Monitoring historical charts with no data for a long time ** +> 1: Whether the time series database is configured or not, if it is not configured, there is no historical chart data. +> 2: If you are using Tdengine, check whether the database `hertzbeat` of Tdengine is created. +> 3: HertzBeat's configuration file `application.yml`, the dependent services in it, the time series, the IP account password, etc. are configured correctly. + diff --git a/home/versioned_docs/version-v1.5.x/start/postgresql-change.md b/home/versioned_docs/version-v1.5.x/start/postgresql-change.md new file mode 100644 index 00000000000..c78a24a1ca7 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/postgresql-change.md @@ -0,0 +1,73 @@ +--- +id: postgresql-change +title: Use PostgreSQL Replace H2 Database to Store Metadata(Optional) +sidebar_label: Use PostgreSQL Instead of H2 +--- +PostgreSQL is a RDBMS emphasizing extensibility and SQL compliance. In addition to default built-in H2 database, Apache HertzBeat (incubating) allow you to use PostgreSQL to store structured relational data such as monitoring information, alarm information and configuration information. + +> If you have the PostgreSQL environment, can be directly to database creation step. + +### Install PostgreSQL via Docker +1. Download and install the Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/)。 + After the installation you can check if the Docker version normally output at the terminal. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` +2. Install PostgreSQL with Docker + ``` + $ docker run -d --name postgresql -p 5432:5432 -e POSTGRES_USER=root -e POSTGRES_PASSWORD=123456 -e TZ=Asia/Shanghai postgresql:15 + ``` + use```$ docker ps```to check if the database started successfully +3. Create database in container manually or with [script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sql/schema.sql). + +### Database creation +1. Enter postgreSQL or use the client to connect postgreSQL service + ``` + su - postgres + psql + ``` +2. Create database named hertzbeat + `CREATE DATABASE hertzbeat;` +3. Check if hertzbeat database has been successfully created + `\l` + +### Modify hertzbeat's configuration file application.yml and switch data source + +1. Configure HertzBeat's configuration file + Modify `hertzbeat/config/application.yml` configuration file + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Replace `spring.database` data source parameters, URL account and password. +```yaml +spring: + datasource: + driver-class-name: org.h2.Driver + username: sa + password: 123456 + url: jdbc:h2:./data/hertzbeat;MODE=MYSQL +``` +Specific replacement parameters are as follows and you need to configure account, ip, port according to the postgresql environment: +```yaml +spring: + config: + activate: + on-profile: prod + datasource: + driver-class-name: org.postgresql.Driver + username: root + password: 123456 + url: jdbc:postgresql://127.0.0.1:5432/hertzbeat + hikari: + max-lifetime: 120000 + + jpa: + database: postgresql + hibernate: + ddl-auto: update + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect +``` + +**Start HertzBeat visit http://ip:1157/ on the browser You can use HertzBeat monitoring alarm, default account and password are admin/hertzbeat** diff --git a/home/versioned_docs/version-v1.5.x/start/quickstart.md b/home/versioned_docs/version-v1.5.x/start/quickstart.md new file mode 100644 index 00000000000..087e7db2367 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/quickstart.md @@ -0,0 +1,85 @@ +--- +id: quickstart +title: Quick Start +sidebar_label: Quick Start +--- + +### 🐕 Quick Start + +- If you wish to deploy Apache HertzBeat (incubating) locally, please refer to the following Deployment Documentation for instructions. + +### 🍞 Install HertzBeat + +> Apache HertzBeat (incubating) supports installation through source code, docker or package, cpu support X86/ARM64. + +##### 1:Install quickly via docker + +1. Just one command to get started: + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat apache/hertzbeat``` + +```or use quay.io (if dockerhub network connect timeout)``` + +```docker run -d -p 1157:1157 -p 1158:1158 --name hertzbeat quay.io/tancloud/hertzbeat``` + +2. Access `http://localhost:1157` to start, default account: `admin/hertzbeat` + +3. Deploy collector clusters(Optional) + +``` +docker run -d -e IDENTITY=custom-collector-name -e MANAGER_HOST=127.0.0.1 -e MANAGER_PORT=1158 --name hertzbeat-collector apache/hertzbeat-collector +``` +- `-e IDENTITY=custom-collector-name` : set the collector unique identity name. +- `-e MODE=public` : set the running mode(public or private), public cluster or private cloud-edge. +- `-e MANAGER_HOST=127.0.0.1` : set the main hertzbeat server ip. +- `-e MANAGER_PORT=1158` : set the main hertzbeat server port, default 1158. + +Detailed config refer to [Install HertzBeat via Docker](https://hertzbeat.apache.org/docs/start/docker-deploy) + +##### 2:Install via package + +1. Download the release package `hertzbeat-xx.tar.gz` [GITHUB Release](https://github.com/apache/hertzbeat/releases) +2. Configure the HertzBeat configuration yml file `hertzbeat/config/application.yml` (optional) +3. Run command `$ ./bin/startup.sh ` or `bin/startup.bat` +4. Access `http://localhost:1157` to start, default account: `admin/hertzbeat` +5. Deploy collector clusters(Optional) + - Download the release package `hertzbeat-collector-xx.tar.gz` to new machine [GITHUB Release](https://github.com/apache/hertzbeat/releases) + - Configure the collector configuration yml file `hertzbeat-collector/config/application.yml`: unique `identity` name, running `mode` (public or private), hertzbeat `manager-host`, hertzbeat `manager-port` + ```yaml + collector: + dispatch: + entrance: + netty: + enabled: true + identity: ${IDENTITY:} + mode: ${MODE:public} + manager-host: ${MANAGER_HOST:127.0.0.1} + manager-port: ${MANAGER_PORT:1158} + ``` + - Run command `$ ./bin/startup.sh ` or `bin/startup.bat` + - Access `http://localhost:1157` and you will see the registered new collector in dashboard + +Detailed config refer to [Install HertzBeat via Package](https://hertzbeat.apache.org/docs/start/package-deploy) + +##### 3:Start via source code + +1. Local source code debugging needs to start the back-end project `manager` and the front-end project `web-app`. +2. Backend:need `maven3+`, `java17`, `lombok`, start the `manager` service. +3. Web:need `nodejs npm angular-cli` environment, Run `ng serve --open` in `web-app` directory after backend startup. +4. Access `http://localhost:4200` to start, default account: `admin/hertzbeat` + +Detailed steps refer to [CONTRIBUTING](../community/contribution) + +##### 4:Install All(hertzbeat+mysql+iotdb/tdengine) via Docker-compose + +Install and deploy the mysql database, iotdb/tdengine database and hertzbeat at one time through [docker-compose deployment script](https://github.com/apache/hertzbeat/tree/master/script/docker-compose). + +Detailed steps refer to [Install via Docker-Compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose) + +##### 5. Install All(hertzbeat+collector+mysql+iotdb) via kubernetes helm charts + +Install HertzBeat cluster in a Kubernetes cluster by Helm chart. + +Detailed steps refer to [Artifact Hub](https://artifacthub.io/packages/helm/hertzbeat/hertzbeat) + +**HAVE FUN** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/rainbond-deploy.md b/home/versioned_docs/version-v1.5.x/start/rainbond-deploy.md similarity index 80% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/rainbond-deploy.md rename to home/versioned_docs/version-v1.5.x/start/rainbond-deploy.md index 1ff4de9428f..57f537aa4ac 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/rainbond-deploy.md +++ b/home/versioned_docs/version-v1.5.x/start/rainbond-deploy.md @@ -4,7 +4,7 @@ title: Use Rainbond Deploy HertzBeat sidebar_label: Install via Rainbond --- -If you are unfamiliar with Kubernetes, and want to install HertzBeat in Kubernetes, you can use Rainbond to deploy. Rainbond is a cloud-native application management platform built on Kubernetes and simplifies the application deployment to Kubernetes. +If you are unfamiliar with Kubernetes, and want to install Apache HertzBeat (incubating) in Kubernetes, you can use Rainbond to deploy. Rainbond is a cloud-native application management platform built on Kubernetes and simplifies the application deployment to Kubernetes. ## Prerequisites diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/sslcert-practice.md b/home/versioned_docs/version-v1.5.x/start/sslcert-practice.md similarity index 61% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/sslcert-practice.md rename to home/versioned_docs/version-v1.5.x/start/sslcert-practice.md index 6fe9427aed3..d8c06a8beba 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/sslcert-practice.md +++ b/home/versioned_docs/version-v1.5.x/start/sslcert-practice.md @@ -10,22 +10,18 @@ This article introduces how to use the hertzbeat monitoring tool to detect the v #### What is HertzBeat -HertzBeat is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu). +Apache HertzBeat (incubating) is a real-time monitoring tool with powerful custom monitoring capabilities without Agent. Website monitoring, PING connectivity, port availability, database, operating system, middleware, API monitoring, threshold alarms, alarm notification (email, WeChat, Ding Ding Feishu). -**Official website: https://hertzbeat.com | https://tancloud.cn** github: https://github.com/apache/hertzbeat -gitee: https://gitee.com/hertzbeat/hertzbeat #### Install HertzBeat -1. If you don't want to install, you can use the cloud service directly [TanCloud exploration cloud console.tancloud.cn](https://console.tancloud.cn) - -2. The `docker` environment can be installed with just one command +1. The `docker` environment can be installed with just one command `docker run -d -p 1157:1157 --name hertzbeat apache/hertzbeat` -3. After the installation is successful, the browser can access `localhost:1157` to start, the default account password is `admin/hertzbeat` +2. After the installation is successful, the browser can access `localhost:1157` to start, the default account password is `admin/hertzbeat` #### Monitoring SSL certificates @@ -34,45 +30,41 @@ gitee: https://gitee.com/hertzbeat/hertzbeat > System Page -> Monitor Menu -> SSL Certificate -> Add SSL Certificate -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bd53f343a5b54feab62e71458d076441~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_1.png) 2. Configure the monitoring website > Here we take the example of monitoring Baidu website, configure monitoring host domain name, name, collection interval, etc. > Click OK Note ⚠️Before adding, it will test the connectivity of the website by default, and the connection will be successful before adding. Of course, you can also gray out the **Test or not** button. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ad1154670648413bb82c8bdeb5b13609~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_2.png) 3. View the detection index data > In the monitoring list, you can view the monitoring status, and in the monitoring details, you can view the metric data chart, etc. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f874b45e909c4bb0acdd28b3fb034a61~tplv-k3u1fbpfcp-zoom-1.image) - - -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ef5d7443f8c04818ae5aa28d421203be~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_3.png) +![](/img/docs/start/ssl_11.png) 4. Set the threshold (triggered when the certificate expires) > System Page -> Alarms -> Alarm Thresholds -> New Thresholds -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8d6205172d43463aa34e534477f132f1~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_4.png) > Configure the threshold, select the SSL certificate metric object, configure the alarm expression-triggered when the metric `expired` is `true`, that is, `equals(expired,"true")`, set the alarm level notification template information, etc. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/83d17b381d994f26a6240e01915b2001~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_5.png) > Associating thresholds with monitoring, in the threshold list, set which monitoring this threshold applies to. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9b9063d7bcf9454387be0491fc382bd1~tplv-k3u1fbpfcp-zoom-1.image) - - +![](/img/docs/start/ssl_6.png) 5. Set the threshold (triggered one week before the certificate expires) @@ -80,12 +72,12 @@ gitee: https://gitee.com/hertzbeat/hertzbeat > In the same way, add a new configuration threshold and configure an alarm expression - when the metric expires timestamp `end_timestamp`, the `now()` function is the current timestamp, if the configuration triggers an alarm one week in advance: `end_timestamp <= (now( ) + 604800000)` , where `604800000` is the 7-day total time difference in milliseconds. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/0d6f837f57c247e09f668f60eff4a0ff~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_7.png) > Finally, you can see the triggered alarm in the alarm center. -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a61b23127524976b2c209ce0ca6a339~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_8.png) 6. Alarm notification (in time notification via Dingding WeChat Feishu, etc.) @@ -93,17 +85,16 @@ gitee: https://gitee.com/hertzbeat/hertzbeat > Monitoring Tool -> Alarm Notification -> New Receiver -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/7f36956060ef410a82bbecafcbb2957f~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_10.png) For token configuration such as Dingding WeChat Feishu, please refer to the help document -https://hertzbeat.com/docs/help/alert_dingtalk -https://tancloud.cn/docs/help/alert_dingtalk +https://hertzbeat.apache.org/docs/help/alert_dingtalk > Alarm Notification -> New Alarm Notification Policy -> Enable Notification for the Recipient Just Configured -![](https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d976343e81f843138344a039f3aff8a3~tplv-k3u1fbpfcp-zoom-1.image) +![](/img/docs/start/ssl_11.png) 7. OK When the threshold is triggered, we can receive the corresponding alarm message. If there is no notification, you can also view the alarm information in the alarm center. @@ -114,5 +105,3 @@ https://tancloud.cn/docs/help/alert_dingtalk The practice of monitoring SSL certificates is here. Of course, for hertzbeat, this function is just the tip of the iceberg. If you think hertzbeat is a good open source project, please give us a Gitee star on GitHub, thank you very much. Thank you for your support. Refill! **github: https://github.com/apache/hertzbeat** - -**gitee: https://gitee.com/hertzbeat/hertzbeat** diff --git a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/tdengine-init.md b/home/versioned_docs/version-v1.5.x/start/tdengine-init.md similarity index 53% rename from home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/tdengine-init.md rename to home/versioned_docs/version-v1.5.x/start/tdengine-init.md index 27cb5e729ae..1f73a4151eb 100644 --- a/home/i18n/en/docusaurus-plugin-content-docs/version-v1.1.x/start/tdengine-init.md +++ b/home/versioned_docs/version-v1.5.x/start/tdengine-init.md @@ -1,78 +1,102 @@ --- id: tdengine-init -title: Dependency Service TDengine Installation -sidebar_label: TDengine Init(optional) +title: Use Time Series Database TDengine to Store Metrics Data (Optional) +sidebar_label: Use TDengine Store Metrics --- -HertzBeat's historical data storage depends on the time series database TDengine or IoTDB, you can choose one of them to initialize, or not to install (note ⚠️If you don't install it, there will be no historical chart data). +Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) -TDengine is a time series database. We use TDengine to replace the InfluxDb, to store the history data collected monitoring Metrics. -Note⚠️ TDengine is optional. And no configuration means no historical chart data. -Note⚠️ Need TDengine 2.4.x Version. +> It is recommended to use VictoriaMetrics as metrics storage. -> If you have TDengine environment, can directly skip to create a database instance. +TDengine is an open-source IoT time-series database, which we use to store the collected historical data of monitoring metrics. Pay attention to support ⚠️ 3.x version. + +**Note⚠️ Time series database is optional, but production environment configuration is strongly recommended to provide more complete historical chart functions and high performance** +**⚠️ If you do not configure a time series database, only the last hour of historical data is retained.** +Note⚠️ Need TDengine 3.x Version. + +> If you have TDengine environment, can directly skip to create a database instance. ### Install TDengine via Docker -> Refer to the official website [installation tutorial](https://www.taosdata.com/docs/cn/v2.0/getting-started/docker) -1. Download and install Docker environment - Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). - After the installation you can check if the Docker version normally output at the terminal. +> Refer to the official website [installation tutorial](https://docs.taosdata.com/get-started/docker/) +1. Download and install Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). + After the installation you can check if the Docker version normally output at the terminal. ``` $ docker -v Docker version 20.10.12, build e91ed57 ``` -2. Install TDengine with Docker +2. Install TDengine with Docker + ```shell + $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp \ + -v /opt/taosdata:/var/lib/taos \ + --name tdengine -e TZ=Asia/Shanghai \ + tdengine/tdengine:3.0.4.0 ``` - $ docker run -d -p 6030-6049:6030-6049 -p 6030-6049:6030-6049/udp -v /opt/taosdata:/var/lib/taos --name tdengine -e TZ=Asia/Shanghai tdengine/tdengine:2.4.0.12 - ``` - `-v /opt/taosdata:/var/lib/taos` is local persistent mount of TDengine data directory.`/opt/taosdata` should be replaced with the actual local directory. - `-e TZ="Asia/Shanghai"` can set time zone for TDengine.Set up the corresponding time zone you want. + `-v /opt/taosdata:/var/lib/taos` is local persistent mount of TDengine data directory. `/opt/taosdata` should be replaced with the actual local directory. + `-e TZ="Asia/Shanghai"` can set time zone for TDengine.Set up the corresponding time zone you want. use```$ docker ps``` to check if the database started successfully ### Create database instance + 1. Enter database Docker container ``` $ docker exec -it tdengine /bin/bash ``` -2. Create database named hertzbeat - After entering the container,execute `taos` command as follows: +2. Create database named hertzbeat + After entering the container,execute `taos` command as follows: + ``` - root@tdengine-server:~/TDengine-server-2.4.0.4# taos - Welcome to the TDengine shell from Linux, Client Version:2.4.0.4 + root@tdengine-server:~/TDengine-server# taos + Welcome to the TDengine shell from Linux, Client Version Copyright (c) 2020 by TAOS Data, Inc. All rights reserved. taos> ``` - execute commands to create database + + execute commands to create database + ``` taos> show databases; - taos> CREATE DATABASE hertzbeat KEEP 90 DAYS 10 BLOCKS 6 UPDATE 1; + taos> CREATE DATABASE hertzbeat KEEP 90 DURATION 10 BUFFER 16; ``` - The above statements will create a database named hertzbeat. The data will be saved for 90 days (more than 90 days data will be automatically deleted). - A data file every 10 days, memory blocks is 6, allow you to update the data. -3. Check if hertzbeat database has been successfully created + + The above statements will create a database named hertzbeat. The data will be saved for 90 days (more than 90 days data will be automatically deleted). + A data file every 10 days, memory blocks buffer is 16MB. + +3. Check if hertzbeat database has been created success + ``` taos> show databases; taos> use hertzbeat; ``` -**Note⚠️If you install TDengine2.3+ version** +**Note⚠️If you install TDengine using package** + > In addition to start the server,you must execute `systemctl start taosadapter` to start adapter -### Configure the database connection in hertzbeat `application.yml`configuration file +### Configure the database connection in hertzbeat `application.yml` configuration file -1. Configure HertzBeat's configuration file - Modify `hertzbeat/config/application.yml` configuration file +1. Configure HertzBeat's configuration file + Modify `hertzbeat/config/application.yml` configuration file [/script/application.yml](https://github.com/apache/hertzbeat/raw/master/script/application.yml) Note⚠️The docker container way need to mount application.yml file locally,while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` - Replace `warehouse.store.td-engine` data source parameters, URL account and password. - + Replace `warehouse.store.td-engine` data source parameters, URL account and password. + +```yaml +warehouse: + store: + # disable jpa + jpa: + enabled: false + # enable td-engine + td-engine: + enabled: true + driver-class-name: com.taosdata.jdbc.rs.RestfulDriver + url: jdbc:TAOS-RS://localhost:6041/hertzbeat + username: root + password: taosdata ``` - warehouse.store.td-engine.enable - warehouse.store.td-engine.url - warehouse.store.td-engine.username - warehouse.store.td-engine.password -``` +2. Restart HertzBeat ### FAQ @@ -83,7 +107,7 @@ Note⚠️ Need TDengine 2.4.x Version. > As shown in the pop-up window, the premise of displaying the history chart is to install and configure the dependent services of hertzbeat - IotDB database or TDengine database 3. The historical picture of monitoring details is not displayed or has no data, and TDengine has been deployed -> Please confirm whether the installed TDengine version is near 2.4.0.12, version 3.0 and 2.2 are not compatible. +> Please confirm whether the installed TDengine version is 3.x, version 2.x are not compatible. 4. The TDengine database is installed and configured, but the page still displays a pop-up [Unable to provide historical chart data, please configure the dependent time series database] > Please check if the configuration parameters are correct diff --git a/home/versioned_docs/version-v1.5.x/start/upgrade.md b/home/versioned_docs/version-v1.5.x/start/upgrade.md new file mode 100644 index 00000000000..917b8ffbe54 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/upgrade.md @@ -0,0 +1,51 @@ +--- +id: upgrade +title: HertzBeat New Version Upgrade +sidebar_label: Version Upgrade Guide +--- + +**HertzBeat Release Version List** + +- [Download Page](/docs/download) +- [Github Release](https://github.com/apache/hertzbeat/releases) +- [DockerHub Release](https://hub.docker.com/r/apache/hertzbeat/tags) + +Apache HertzBeat (incubating)'s metadata information is stored in H2 or Mysql, PostgreSQL relational databases, and the collected metric data is stored in time series databases such as TDengine and IotDB. + +**You need to save and back up the data files of the database and monitoring templates yml files before upgrading** + + +### Upgrade For Docker Deploy + +1. If using custom monitoring templates + - Need to back up docker templates directory `docker cp hertzbeat:/opt/hertzbeat/define ./define` in the container `/opt/hertzbeat/define` + - `docker cp hertzbeat:/opt/hertzbeat/define ./define` + - And mount the template define directory when docker start `-v $(pwd)/define:/opt/hertzbeat/define` + - `-v $(pwd)/define:/opt/hertzbeat/define` + +2. If using the built-in default H2 database + - Need to mount or back up `-v $(pwd)/data:/opt/hertzbeat/data` database file directory in the container `/opt/hertzbeat/data` + - Stop and delete the container, delete the local HertzBeat docker image, and pull the new version image + - Refer to [Docker installation of HertzBeat](docker-deploy) to create a new container using a new image. Note that the database file directory needs to be mounted `-v $(pwd)/data:/opt/hertzbeat/data` + +3. If using external relational database Mysql, PostgreSQL + - No need to mount the database file directory in the backup container + - Stop and delete the container, delete the local HertzBeat docker image, and pull the new version image + - Refer to [Docker installation HertzBeat](docker-deploy) to create a new container using the new image, and configure the database connection in `application.yml` + + +### Upgrade For Package Deploy + +1. If using the built-in default H2 database + - Back up the database file directory under the installation package `/opt/hertzbeat/data` + - If there is a custom monitoring template, you need to back up the template YML under `/opt/hertzbeat/define` + - `bin/shutdown.sh` stops the HertzBeat process and downloads the new installation package + - Refer to [Installation package to install HertzBeat](package-deploy) to start using the new installation package + +2. If using external relational database Mysql, PostgreSQL + - No need to back up the database file directory under the installation package + - If there is a custom monitoring template, you need to back up the template YML under `/opt/hertzbeat/define` + - `bin/shutdown.sh` stops the HertzBeat process and downloads the new installation package + - Refer to [Installation package to install HertzBeat](package-deploy) to start with the new installation package and configure the database connection in `application.yml` + +**HAVE FUN** diff --git a/home/versioned_docs/version-v1.5.x/start/victoria-metrics-init.md b/home/versioned_docs/version-v1.5.x/start/victoria-metrics-init.md new file mode 100644 index 00000000000..327bc4999af --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/start/victoria-metrics-init.md @@ -0,0 +1,65 @@ +--- +id: victoria-metrics-init +title: Use Time Series Database VictoriaMetrics to Store Metrics Data (Recommended) +sidebar_label: Use VictoriaMetrics Store Metrics(Recommended) +--- + +Apache HertzBeat (incubating)'s historical data storage relies on the time series database, you can choose one of them to install and initialize, or not to install (note ⚠️ but it is strongly recommended to configure in the production environment) + +> It is recommended to use VictoriaMetrics as metrics storage. + +VictoriaMetrics is a fast, cost-effective and scalable monitoring solution and time series database.Recommend Version(VictoriaMetrics:v1.95.1+, HertzBeat:v1.4.3+) + +**Note⚠️ Time series database is optional, but production environment configuration is strongly recommended to provide more complete historical chart functions and high performance** +**⚠️ If you do not configure a time series database, only the last hour of historical data is retained.** + +> If you already have an VictoriaMetrics environment, you can skip directly to the YML configuration step. + +### Install VictoriaMetrics via Docker +> Refer to the official website [installation tutorial](https://docs.victoriametrics.com/Quick-Start.html#how-to-install) +1. Download and install Docker environment + Docker tools download refer to [Docker official document](https://docs.docker.com/get-docker/). + After the installation you can check if the Docker version normally output at the terminal. + ``` + $ docker -v + Docker version 20.10.12, build e91ed57 + ``` + +2. Install VictoriaMetrics via Docker + +```shell +$ docker run -d -p 8428:8428 \ + -v $(pwd)/victoria-metrics-data:/victoria-metrics-data \ + --name victoria-metrics \ + victoriametrics/victoria-metrics:v1.95.1 +``` + + `-v $(pwd)/victoria-metrics-data:/victoria-metrics-data` is local persistent mount of VictoriaMetrics data directory + use```$ docker ps``` to check if the database started successfully + +3. Configure the database connection in hertzbeat `application.yml`configuration file + + Modify `hertzbeat/config/application.yml` configuration file + Note⚠️The docker container way need to mount application.yml file locally, while you can use installation package way to unzip and modify `hertzbeat/config/application.yml` + Config the `warehouse.store.jpa.enabled` `false`. Replace `warehouse.store.victoria-metrics` data source parameters, HOST account and password. + +```yaml +warehouse: + store: + # disable JPA + jpa: + enabled: false + # enable victoria-metrics + victoria-metrics: + enabled: true + url: http://localhost:8428 + username: root + password: root +``` + +4. Restart HertzBeat + +### FAQ + +1. Do both the time series databases need to be configured? Can they both be used? +> You don't need to configure all of them, you can choose one of them. Use the enable parameter to control whether it is used or not. You can also install and configure neither, which can affects the historical chart data. diff --git a/home/versioned_docs/version-v1.5.x/template.md b/home/versioned_docs/version-v1.5.x/template.md new file mode 100644 index 00000000000..4bdf785e588 --- /dev/null +++ b/home/versioned_docs/version-v1.5.x/template.md @@ -0,0 +1,97 @@ +--- +id: template +title: Monitoring Template Here +sidebar_label: Monitoring Template +--- + +> Apache HertzBeat (incubating) is an open source, real-time monitoring tool with custom-monitor and agentLess. + +> We make protocols such as `Http, Jmx, Ssh, Snmp, Jdbc, Prometheus` configurable, and you only need to configure `YML` online to collect any metrics you want. +> Do you believe that you can immediately adapt a new monitoring type such as K8s or Docker just by configuring online? + +Here is the architecture. + +![hertzBeat](/img/docs/hertzbeat-arch.png) + +**We define all monitoring collection types (mysql, website, jvm, k8s) as yml templates, and users can import these templates into the hertzbeat system to support corresponding types of monitoring, which is very convenient!** + +![](/img/docs/advanced/extend-point-1.png) + +**Welcome everyone to contribute your customized general monitoring type YML template during use. The available templates are as follows:** + +### Application service monitoring + + 👉 [Website monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-website.yml)
+ 👉 [HTTP API](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-api.yml)
+ 👉 [PING Connectivity](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ping.yml)
+ 👉 [Port Telnet](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-port.yml)
+ 👉 [Full site monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml)
+ 👉 [SSL Cert monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml)
+ 👉 [JVM monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml)
+ 👉 [SpringBoot2.0](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml)
+ 👉 [SpringBoot3.0](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml)
+ 👉 [FTP Server](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml)
+ +### Database monitoring + + 👉 [MYSQL database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml)
+ 👉 [MariaDB database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml)
+ 👉 [PostgreSQL database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml)
+ 👉 [SqlServer database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml)
+ 👉 [Oracle database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml)
+ 👉 [DM database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dm.yml)
+ 👉 [OpenGauss database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml)
+ 👉 [IoTDB database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml)
+ 👉 [ElasticSearch database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml)
+ 👉 [MongoDB database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml)
+ 👉 [ClickHouse database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml)
+ 👉 [Redis database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis.yml)
+ 👉 [Redis Sentinel database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml)
+ 👉 [Redis Cluster database monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml)
+ +### Operating system monitoring + + 👉 [Linux operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-linux.yml)
+ 👉 [Windows operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-windows.yml)
+ 👉 [Ubuntu operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml)
+ 👉 [Centos operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-centos.yml)
+ 👉 [EulerOS operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml)
+ 👉 [Fedora CoreOS operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml)
+ 👉 [OpenSUSE operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml)
+ 👉 [Rocky Linux operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml)
+ 👉 [Red Hat operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml)
+ 👉 [FreeBSD operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml)
+ 👉 [AlmaLinux operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml)
+ 👉 [Debian operating system monitoring](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-debian.yml)
+ + +### Middleware monitoring + + 👉 [Zookeeper](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml)
+ 👉 [Kafka](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml)
+ 👉 [Tomcat](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml)
+ 👉 [ShenYu](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml)
+ 👉 [DynamicTp](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml)
+ 👉 [RabbitMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml)
+ 👉 [ActiveMQ](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml)
+ 👉 [Jetty](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml)
+ 👉 [Flink](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-flink.yml)
+ 👉 [Nacos](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml)
+ + +### CloudNative monitoring + + 👉 [Docker](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-docker.yml)
+ 👉 [Kubernetes](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml)
+ +### Network monitoring + + 👉 [CiscoSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml)
+ 👉 [HpeSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml)
+ 👉 [HuaweiSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml)
+ 👉 [TpLinkSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml)
+ 👉 [H3CSwitch](https://raw.githubusercontent.com/apache/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml)
+ +--- + +**Have Fun!** diff --git a/home/versioned_sidebars/version-v1.1.x-sidebars.json b/home/versioned_sidebars/version-v1.1.x-sidebars.json deleted file mode 100644 index d2d2b576fcb..00000000000 --- a/home/versioned_sidebars/version-v1.1.x-sidebars.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "docs": [ - { - "type": "category", - "label": "Quickstart", - "items": [ - "introduce", - "start/quickstart", - "start/docker-deploy", - "start/package-deploy", - "start/rainbond-deploy", - "start/iotdb-init", - "start/tdengine-init", - "start/mysql-change", - "start/account-modify", - "start/custom-config", - "start/ssl-cert-practice" - ] - }, - { - "type": "category", - "label": "自定义监控", - "items": [ - "advanced/extend-point", - "advanced/extend-tutorial", - { - "type": "category", - "label": "HTTP协议", - "items": [ - "advanced/extend-http", - "advanced/extend-http-default", - "advanced/extend-http-jsonpath", - "advanced/extend-http-example-hertzbeat", - "advanced/extend-http-example-token" - ] - }, - { - "type": "category", - "label": "JDBC协议", - "items": [ - "advanced/extend-jdbc" - ] - }, - { - "type": "category", - "label": "SSH协议", - "items": [ - "advanced/extend-ssh" - ] - } - ] - }, - { - "type": "category", - "label": "帮助文档", - "items": [ - "help/guide", - { - "type": "category", - "label": "应用服务监控", - "items": [ - "help/website", - "help/api", - "help/ping", - "help/port", - "help/fullsite", - "help/ssl_cert", - "help/jvm", - "help/springboot2" - ] - }, - { - "type": "category", - "label": "数据库监控", - "items": [ - "help/mysql", - "help/mariadb", - "help/postgresql", - "help/sqlserver", - "help/oracle", - "help/dm", - "help/opengauss", - "help/iotdb", - "help/redis" - ] - }, - { - "type": "category", - "label": "操作系统", - "items": [ - "help/linux", - "help/windows", - "help/ubuntu", - "help/centos" - ] - }, - { - "type": "category", - "label": "中间件", - "items": [ - "help/zookeeper", - "help/kafka", - "help/tomcat", - "help/shenyu", - "help/dynamic_tp", - "help/rabbitmq", - "help/activemq", - "help/jetty" - ] - }, - { - "type": "category", - "label": "云原生", - "items": [ - "help/docker", - "help/kubernetes" - ] - }, - { - "type": "category", - "label": "阈值告警配置", - "items": [ - "help/alert_threshold", - "help/alert_threshold_expr" - ] - }, - { - "type": "category", - "label": "告警通知配置", - "items": [ - "help/alert_email", - "help/alert_webhook", - "help/alert_discord", - "help/alert_slack", - "help/alert_telegram", - "help/alert_wework", - "help/alert_dingtalk", - "help/alert_feishu", - "help/alert_console" - ] - }, - "help/issue" - ] - }, - { - "type": "category", - "label": "Others", - "items": [ - "others/developer", - "others/contact", - "others/sponsor", - "others/resource", - "others/contributing" - ] - } - ] -} diff --git a/home/versioned_sidebars/version-v1.5.x-sidebars.json b/home/versioned_sidebars/version-v1.5.x-sidebars.json new file mode 100644 index 00000000000..39819426a4a --- /dev/null +++ b/home/versioned_sidebars/version-v1.5.x-sidebars.json @@ -0,0 +1,325 @@ +{ + "docs": [ + { + "type": "category", + "label": "quickstart", + "items": [ + "introduce", + "start/quickstart", + "start/docker-deploy", + "start/package-deploy", + "start/rainbond-deploy", + { + "type": "link", + "label": "Install via Helm", + "href": "https://artifacthub.io/packages/helm/hertzbeat/hertzbeat" + }, + "start/account-modify", + "start/upgrade", + "start/victoria-metrics-init", + "start/iotdb-init", + "start/tdengine-init", + "start/greptime-init", + "start/influxdb-init", + "start/mysql-change", + "start/postgresql-change", + "start/custom-config", + "start/ssl-cert-practice" + ] + }, + { + "type": "category", + "label": "custom", + "items": [ + "advanced/extend-point", + "advanced/extend-tutorial", + { + "type": "category", + "label": "http", + "items": [ + "advanced/extend-http", + "advanced/extend-http-default", + "advanced/extend-http-jsonpath", + "advanced/extend-http-example-hertzbeat", + "advanced/extend-http-example-token" + ] + }, + { + "type": "category", + "label": "jdbc", + "items": [ + "advanced/extend-jdbc" + ] + }, + { + "type": "category", + "label": "ssh", + "items": [ + "advanced/extend-ssh" + ] + }, + { + "type": "category", + "label": "jmx", + "items": [ + "advanced/extend-jmx" + ] + }, + { + "type": "category", + "label": "snmp", + "items": [ + "advanced/extend-snmp" + ] + }, + { + "type": "category", + "label": "push", + "items": [ + "advanced/extend-push" + ] + }, + { + "type": "category", + "label": "NGQL", + "items": [ + "advanced/extend-ngql" + ] + } + ] + }, + { + "type": "doc", + "id": "template" + }, + { + "type": "category", + "label": "Community", + "items": [ + "community/contact", + "community/development", + { + "type": "category", + "label": "contribution", + "items": [ + "community/contribution", + "community/mailing_lists", + "community/become_committer", + "community/become_pmc_member", + "community/new_committer_process", + "community/new_pmc_ember_process" + ] + }, + { + "type": "category", + "label": "submit", + "items": [ + "community/document", + "community/submit_code", + "community/code_style_and_quality_guide" + ] + }, + { + "type": "category", + "label": "release", + "items": [ + "community/how_to_release", + "community/how_to_verify_release" + ] + } + ] + }, + { + "type": "category", + "label": "help", + "items": [ + "help/guide", + "help/prometheus", + { + "type": "category", + "label": "service", + "items": [ + "help/website", + "help/api", + "help/ping", + "help/port", + "help/udp_port", + "help/fullsite", + "help/ssl_cert", + "help/nginx", + "help/pop3", + "help/smtp", + "help/ntp", + "help/dns", + "help/ftp", + "help/websocket" + ] + }, + { + "type": "category", + "label": "program", + "items": [ + "help/process", + "help/jvm", + "help/springboot2", + "help/springboot3", + "help/dynamic_tp" + ] + }, + { + "type": "category", + "label": "database", + "items": [ + "help/mysql", + "help/mariadb", + "help/postgresql", + "help/sqlserver", + "help/oracle", + "help/dm", + "help/opengauss", + "help/nebulaGraph", + "help/nebulagraph_cluster", + "help/tidb", + "help/mongodb" + ] + }, + { + "type": "category", + "label": "cache", + "items": [ + "help/redis", + "help/memcached" + ] + }, + { + "type": "category", + "label": "os", + "items": [ + "help/linux", + "help/windows", + "help/ubuntu", + "help/debian", + "help/centos", + "help/almalinux", + "help/opensuse", + "help/freebsd", + "help/redhat", + "help/rockylinux", + "help/euleros" + ] + }, + { + "type": "category", + "label": "mid", + "items": [ + "help/zookeeper", + "help/shenyu", + "help/rabbitmq", + "help/activemq", + "help/rocketmq", + "help/spring_gateway", + "help/nacos", + "help/kafka", + "help/pulsar" + ] + }, + { + "type": "category", + "label": "bigdata", + "items": [ + "help/spark", + "help/flink", + "help/doris_be", + "help/doris_fe", + "help/hadoop", + "help/yarn", + "help/hbase_master", + "help/hbase_regionserver", + "help/hdfs_namenode", + "help/hdfs_datanode", + "help/iotdb", + "help/hive", + "help/airflow", + "help/clickhouse", + "help/elasticsearch", + "help/influxdb", + "help/hugegraph" + ] + }, + { + "type": "category", + "label": "webserver", + "items": [ + "help/tomcat", + "help/jetty" + ] + }, + { + "type": "category", + "label": "cloud-native", + "items": [ + "help/docker", + "help/kubernetes" + ] + }, + { + "type": "category", + "label": "llm", + "items": [ + "help/openai" + ] + }, + { + "type": "category", + "label": "custom", + "items": [ + "help/kafka_promql", + "help/influxdb_promql" + ] + }, + { + "type": "category", + "label": "network", + "items": [ + "help/huawei_switch" + ] + }, + { + "type": "category", + "label": "threshold", + "items": [ + "help/alert_threshold", + "help/alert_threshold_expr" + ] + }, + { + "type": "category", + "label": "notice", + "items": [ + "help/alert_email", + "help/alert_webhook", + "help/alert_discord", + "help/alert_slack", + "help/alert_telegram", + "help/alert_wework", + "help/alert_dingtalk", + "help/alert_feishu", + "help/alert_console", + "help/alert_enterprise_wechat_app", + "help/alert_smn" + ] + }, + "help/issue", + "help/plugin", + "help/time_expression" + ] + }, + { + "type": "category", + "label": "Others", + "items": [ + "others/resource" + ] + } + ] +} diff --git a/home/versions.json b/home/versions.json index 386845dd788..25ff5db779c 100644 --- a/home/versions.json +++ b/home/versions.json @@ -1,5 +1,5 @@ [ + "v1.5.x", "v1.4.x", - "v1.3.x", - "v1.1.x" + "v1.3.x" ] diff --git a/manager/pom.xml b/manager/pom.xml index 20d9f4f95d9..2e0e1120445 100644 --- a/manager/pom.xml +++ b/manager/pom.xml @@ -106,6 +106,13 @@ org.springframework.boot spring-boot-starter-thymeleaf + + + + org.springframework.boot + spring-boot-starter-webflux + + org.springframework.boot diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/DispatcherAlarm.java b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/DispatcherAlarm.java index a192bf34f66..f9cee2a5dbd 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/DispatcherAlarm.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/DispatcherAlarm.java @@ -20,6 +20,7 @@ import com.google.common.collect.Maps; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.ServiceLoader; import lombok.extern.slf4j.Slf4j; import org.apache.hertzbeat.alert.AlerterWorkerPool; @@ -85,7 +86,15 @@ public boolean sendNoticeMsg(NoticeReceiver receiver, NoticeTemplate noticeTempl } byte type = receiver.getType(); if (alertNotifyHandlerMap.containsKey(type)) { - alertNotifyHandlerMap.get(type).send(receiver, noticeTemplate, alert); + AlertNotifyHandler alertNotifyHandler = alertNotifyHandlerMap.get(type); + if (noticeTemplate == null) { + noticeTemplate = noticeConfigService.getDefaultNoticeTemplateByType(alertNotifyHandler.type()); + } + if (noticeTemplate == null) { + log.error("alert does not have mapping default notice template. type: {}.", alertNotifyHandler.type()); + throw new NullPointerException(alertNotifyHandler.type() + " does not have mapping default notice template"); + } + alertNotifyHandler.send(receiver, noticeTemplate, alert); return true; } return false; @@ -96,11 +105,14 @@ private NoticeReceiver getOneReceiverById(Long id) { } private NoticeTemplate getOneTemplateById(Long id) { + if (id == null) { + return null; + } return noticeConfigService.getOneTemplateById(id); } - private List matchNoticeRulesByAlert(Alert alert) { - return noticeConfigService.getReceiverFilterRule(alert); + private Optional> matchNoticeRulesByAlert(Alert alert) { + return Optional.ofNullable(noticeConfigService.getReceiverFilterRule(alert)); } private class DispatchTask implements Runnable { @@ -131,29 +143,21 @@ public void run() { } private void sendNotify(Alert alert) { - List noticeRules = matchNoticeRulesByAlert(alert); - // todo Send notification here temporarily single thread - if (noticeRules != null) { - for (NoticeRule rule : noticeRules) { - try { - if (rule.getTemplateId() == null) { - List receiverIdList = rule.getReceiverId(); - for (Long receiverId : receiverIdList) { - sendNoticeMsg(getOneReceiverById(receiverId), - null, alert); - } - } else { - List receiverIdList = rule.getReceiverId(); - for (Long receiverId : receiverIdList) { - sendNoticeMsg(getOneReceiverById(receiverId), - getOneTemplateById(rule.getTemplateId()), alert); - } - } - } catch (AlertNoticeException e) { - log.warn("DispatchTask sendNoticeMsg error, message: {}", e.getMessage()); - } - } - } + matchNoticeRulesByAlert(alert).ifPresent(noticeRules -> { + noticeRules.forEach(rule -> { + workerPool.executeNotify(() -> { + rule.getReceiverId() + .forEach(receiverId -> { + try { + sendNoticeMsg(getOneReceiverById(receiverId), + getOneTemplateById(rule.getTemplateId()), alert); + } catch (AlertNoticeException e) { + log.warn("DispatchTask sendNoticeMsg error, message: {}", e.getMessage()); + } + }); + }); + }); + }); } } diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java index 0b8d44aef1c..43f9b88de13 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/AbstractAlertNotifyHandlerImpl.java @@ -107,13 +107,6 @@ protected String renderContent(NoticeTemplate noticeTemplate, Alert alert) throw model.put("content", alert.getContent()); model.put("tagsLabel", bundle.getString("alerter.notify.tags")); model.put("tags", alert.getTags()); - if (noticeTemplate == null) { - noticeTemplate = noticeConfigService.getDefaultNoticeTemplateByType(type()); - } - if (noticeTemplate == null) { - log.error("alert does not have mapping default notice template. type: {}.", type()); - throw new NullPointerException(type() + " does not have mapping default notice template"); - } // Single instance reuse cache considers mulitple-threading issues String templateName = "freeMakerTemplate"; stringLoader.putTemplate(templateName, noticeTemplate.getContent()); diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java index d20cf681ab2..26d4ff078e7 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/DingTalkRobotAlertNotifyHandlerImpl.java @@ -17,12 +17,16 @@ package org.apache.hertzbeat.manager.component.alerter.impl; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; import org.apache.hertzbeat.common.entity.alerter.Alert; import org.apache.hertzbeat.common.entity.manager.NoticeReceiver; import org.apache.hertzbeat.common.entity.manager.NoticeTemplate; +import org.apache.hertzbeat.common.util.StrUtil; import org.apache.hertzbeat.manager.support.exception.AlertNoticeException; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -43,7 +47,7 @@ final class DingTalkRobotAlertNotifyHandlerImpl extends AbstractAlertNotifyHandl public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert alert) { try { DingTalkWebHookDto dingTalkWebHookDto = new DingTalkWebHookDto(); - MarkdownDTO markdownDTO = new MarkdownDTO(); + DingTalkWebHookDto.MarkdownDTO markdownDTO = new DingTalkWebHookDto.MarkdownDTO(); markdownDTO.setText(renderContent(noticeTemplate, alert)); markdownDTO.setTitle(bundle.getString("alerter.notify.title")); dingTalkWebHookDto.setMarkdown(markdownDTO); @@ -57,6 +61,13 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a assert responseEntity.getBody() != null; if (responseEntity.getBody().getErrCode() == 0) { log.debug("Send dingTalk webHook: {} Success", webHookUrl); + DingTalkWebHookDto dingTalkWebHookTextDto = checkNeedAtNominator(receiver); + if (dingTalkWebHookTextDto != null) { + HttpEntity httpEntityText = new HttpEntity<>(dingTalkWebHookTextDto, headers); + restTemplate.postForEntity(webHookUrl, + httpEntityText, CommonRobotNotifyResp.class); + } + log.debug("Send dingTalk @ message webHook: {} Success", webHookUrl); } else { log.warn("Send dingTalk webHook: {} Failed: {}", webHookUrl, responseEntity.getBody().getErrMsg()); throw new AlertNoticeException(responseEntity.getBody().getErrMsg()); @@ -70,6 +81,27 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a } } + + private DingTalkWebHookDto checkNeedAtNominator(NoticeReceiver receiver) { + if (StringUtils.isBlank(receiver.getPhone()) && StringUtils.isBlank(receiver.getTgUserId())) { + return null; + } + DingTalkWebHookDto dingTalkWebHookDto = new DingTalkWebHookDto(); + dingTalkWebHookDto.setMsgType(DingTalkWebHookDto.TEXT_MSG_TYPE); + DingTalkWebHookDto.AtDTO atDTO = new DingTalkWebHookDto.AtDTO(); + dingTalkWebHookDto.setAt(atDTO); + if (StringUtils.isNotBlank(receiver.getPhone())) { + atDTO.setAtMobiles(StrUtil.analysisArgToList(receiver.getPhone())); + } + if (StringUtils.isNotBlank(receiver.getTgUserId())) { + atDTO.setAtUserIds(StrUtil.analysisArgToList(receiver.getTgUserId())); + } + DingTalkWebHookDto.TextDTO textDTO = new DingTalkWebHookDto.TextDTO(); + textDTO.setContent(bundle.getString("alerter.notify.title")); + dingTalkWebHookDto.setText(textDTO); + return dingTalkWebHookDto; + } + @Override public byte type() { return 5; @@ -81,31 +113,79 @@ public byte type() { */ @Data private static class DingTalkWebHookDto { - private static final String MARKDOWN = "markdown"; + + private static final String DEFAULT_MSG_TYPE = "markdown"; + + /** + * text format + */ + private static final String TEXT_MSG_TYPE = "text"; /** * Message type */ - private String msgtype = MARKDOWN; + @JsonProperty(value = "msgtype") + private String msgType = DEFAULT_MSG_TYPE; /** * markdown message */ private MarkdownDTO markdown; - } - - @Data - private static class MarkdownDTO { /** - * Message content + * @ UserId list */ - private String text; + private AtDTO at; /** - * Message title + * text message */ - private String title; + private TextDTO text; + + @Data + private static class TextDTO { + /** + * Message content + */ + private String content; + + } + + @Data + private static class MarkdownDTO { + /** + * Message content + */ + private String text; + + /** + * Message title + */ + private String title; + } + + + @Data + private static class AtDTO { + /** + * Message content + */ + private Boolean isAtAll; + + /** + * @ UserId list + */ + private List atUserIds; + + /** + * @ Mobiles list + */ + private List atMobiles; + + } + } + + } diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java index 94e61ea01d4..0ee227fdb33 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/FlyBookAlertNotifyHandlerImpl.java @@ -19,13 +19,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.stream.Collectors; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.hertzbeat.common.entity.alerter.Alert; import org.apache.hertzbeat.common.entity.manager.NoticeReceiver; import org.apache.hertzbeat.common.entity.manager.NoticeTemplate; +import org.apache.hertzbeat.common.util.StrUtil; import org.apache.hertzbeat.manager.support.exception.AlertNoticeException; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -46,28 +49,50 @@ final class FlyBookAlertNotifyHandlerImpl extends AbstractAlertNotifyHandlerImpl public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert alert) { try { FlyBookWebHookDto flyBookWebHookDto = new FlyBookWebHookDto(); + flyBookWebHookDto.setMsgType("post"); + Content content = new Content(); + flyBookWebHookDto.setContent(content); + Post post = new Post(); - ZhCn zhCn = new ZhCn(); content.setPost(post); + + ZhCn zhCn = new ZhCn(); post.setZhCn(zhCn); - flyBookWebHookDto.setMsgType("post"); - List> contents = new ArrayList<>(); - List contents1 = new ArrayList<>(); - FlyBookContent flyBookContent = new FlyBookContent(); - flyBookContent.setTag("text"); - flyBookContent.setText(renderContent(noticeTemplate, alert)); - contents1.add(flyBookContent); - FlyBookContent bookContent = new FlyBookContent(); - bookContent.setTag("a"); - bookContent.setText(bundle.getString("alerter.notify.console")); - bookContent.setHref(alerterProperties.getConsoleUrl()); - contents1.add(bookContent); - contents.add(contents1); + zhCn.setTitle("[" + bundle.getString("alerter.notify.title") + "]"); + + List contentList = new ArrayList<>(); + + FlyBookContent textContent = new FlyBookContent(); + textContent.setTag("text"); + textContent.setText(renderContent(noticeTemplate, alert)); + contentList.add(textContent); + + FlyBookContent linkContent = new FlyBookContent(); + linkContent.setTag("a"); + linkContent.setText(bundle.getString("alerter.notify.console")); + linkContent.setHref(alerterProperties.getConsoleUrl()); + contentList.add(linkContent); + + String userId = receiver.getUserId(); + List userIdList = StrUtil.analysisArgToList(userId); + if (userIdList != null && !userIdList.isEmpty()) { + List atContents = userIdList.stream() + .map(userID -> { + FlyBookContent atContent = new FlyBookContent(); + atContent.setTag("at"); + atContent.setUserId(userID); + return atContent; + }) + .collect(Collectors.toList()); + contentList.addAll(atContents); + } + + List> contents = Collections.singletonList(contentList); zhCn.setContent(contents); - flyBookWebHookDto.setContent(content); - String webHookUrl = alerterProperties.getFlyBookWebhookUrl() + receiver.getWechatId(); + + String webHookUrl = alerterProperties.getFlyBookWebhookUrl() + receiver.getAccessToken(); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity flyEntity = new HttpEntity<>(flyBookWebHookDto, headers); @@ -90,6 +115,7 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a } } + @Override public byte type() { return 6; @@ -97,13 +123,15 @@ public byte type() { @Data private static class FlyBookWebHookDto { - private static final String MARKDOWN = "post"; + + private static final String DEFAULT_MSG_TYPE = "post"; /** * Message type */ @JsonProperty("msg_type") - private String msgType = MARKDOWN; + private String msgType = DEFAULT_MSG_TYPE; + private Content content; diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java index 29457c51b65..f921c1b9c1a 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/component/alerter/impl/WeWorkRobotAlertNotifyHandlerImpl.java @@ -18,8 +18,6 @@ package org.apache.hertzbeat.manager.component.alerter.impl; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Arrays; -import java.util.Collections; import java.util.List; import java.util.Objects; import lombok.AllArgsConstructor; @@ -32,6 +30,7 @@ import org.apache.hertzbeat.common.entity.alerter.Alert; import org.apache.hertzbeat.common.entity.manager.NoticeReceiver; import org.apache.hertzbeat.common.entity.manager.NoticeTemplate; +import org.apache.hertzbeat.common.util.StrUtil; import org.apache.hertzbeat.manager.support.exception.AlertNoticeException; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; @@ -84,31 +83,24 @@ public void send(NoticeReceiver receiver, NoticeTemplate noticeTemplate, Alert a } private WeWorkWebHookDto checkNeedAtNominator(NoticeReceiver receiver, Alert alert) { - if (StringUtils.isBlank(receiver.getPhone()) && StringUtils.isBlank(receiver.getTgUserId())) { + if (StringUtils.isBlank(receiver.getPhone()) && StringUtils.isBlank(receiver.getUserId())) { return null; } WeWorkWebHookDto weWorkWebHookTextDto = new WeWorkWebHookDto(); - weWorkWebHookTextDto.setMsgtype(WeWorkWebHookDto.TEXT); + weWorkWebHookTextDto.setMsgtype(WeWorkWebHookDto.TEXT_MSG_TYPE); WeWorkWebHookDto.TextDTO textDto = new WeWorkWebHookDto.TextDTO(); if (StringUtils.isNotBlank(receiver.getPhone())) { - textDto.setMentionedMobileList(analysisArgToList(receiver.getPhone())); + textDto.setMentionedMobileList(StrUtil.analysisArgToList(receiver.getPhone())); weWorkWebHookTextDto.setText(textDto); } - if (StringUtils.isNotBlank(receiver.getTgUserId())) { - textDto.setMentionedList(analysisArgToList(receiver.getTgUserId())); + if (StringUtils.isNotBlank(receiver.getUserId())) { + textDto.setMentionedList(StrUtil.analysisArgToList(receiver.getUserId())); weWorkWebHookTextDto.setText(textDto); } return weWorkWebHookTextDto; } - private List analysisArgToList(String arg) { - if (StringUtils.isBlank(arg)) { - return Collections.emptyList(); - } - //english symbol - return Arrays.asList(arg.split("\\s*,\\s*")); - } @Override public byte type() { @@ -124,20 +116,20 @@ private static class WeWorkWebHookDto { public static final String WEBHOOK_URL = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key="; /** - * markdown format + * default msg type : markdown format */ - private static final String MARKDOWN = "markdown"; + private static final String DEFAULT_MSG_TYPE = "markdown"; /** * text format */ - private static final String TEXT = "text"; + private static final String TEXT_MSG_TYPE = "text"; /** * message type */ @Builder.Default - private String msgtype = MARKDOWN; + private String msgtype = DEFAULT_MSG_TYPE; /** * markdown message diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/controller/AiController.java b/manager/src/main/java/org/apache/hertzbeat/manager/controller/AiController.java new file mode 100644 index 00000000000..0e456260892 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/controller/AiController.java @@ -0,0 +1,63 @@ +/* + * 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.manager.controller; + +import static org.springframework.http.MediaType.TEXT_EVENT_STREAM_VALUE; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.apache.hertzbeat.manager.service.AiService; +import org.apache.hertzbeat.manager.service.impl.AiServiceFactoryImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Flux; + + +/** + * AI Management API + */ +@Tag(name = "AI Manage API") +@RestController +@RequestMapping(value = "/api/ai") +public class AiController { + + /** + * AI beanFactory + */ + @Autowired + private AiServiceFactoryImpl aiServiceFactory; + + @Value("${aiConfig.type:0}") + private String type; + + /** + * request AI + * @param text request text + * @param currentlyDisabledType Currently disabled, later released + * @return AI response + */ + @GetMapping(path = "/get", produces = {TEXT_EVENT_STREAM_VALUE}) + public Flux requestAi(@RequestParam("text") String text, + @RequestParam(value = "type", required = false) String currentlyDisabledType) { + AiService aiServiceImplBean = aiServiceFactory.getAiServiceImplBean(type); + + return aiServiceImplBean.requestAi(text); + } +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorController.java b/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorController.java index ef7c64a8a1f..f159fec5943 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorController.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorController.java @@ -55,10 +55,6 @@ public class MonitorController { public ResponseEntity> addNewMonitor(@Valid @RequestBody MonitorDto monitorDto) { // Verify request data monitorService.validate(monitorDto, false); - if (monitorDto.isDetected()) { - // Probe - monitorService.detectMonitor(monitorDto.getMonitor(), monitorDto.getParams(), monitorDto.getCollector()); - } monitorService.addMonitor(monitorDto.getMonitor(), monitorDto.getParams(), monitorDto.getCollector()); return ResponseEntity.ok(Message.success("Add success")); } @@ -68,10 +64,6 @@ public ResponseEntity> addNewMonitor(@Valid @RequestBody MonitorDt public ResponseEntity> modifyMonitor(@Valid @RequestBody MonitorDto monitorDto) { // Verify request data monitorService.validate(monitorDto, true); - if (monitorDto.isDetected()) { - // Probe - monitorService.detectMonitor(monitorDto.getMonitor(), monitorDto.getParams(), monitorDto.getCollector()); - } monitorService.modifyMonitor(monitorDto.getMonitor(), monitorDto.getParams(), monitorDto.getCollector()); return ResponseEntity.ok(Message.success("Modify success")); } @@ -115,9 +107,6 @@ public ResponseEntity> detectMonitor(@Valid @RequestBody MonitorDt @Operation(summary = "Add a monitor that can select metrics", description = "Add a monitor that can select metrics") public ResponseEntity> addNewMonitorOptionalMetrics(@Valid @RequestBody MonitorDto monitorDto) { monitorService.validate(monitorDto, false); - if (monitorDto.isDetected()) { - monitorService.detectMonitor(monitorDto.getMonitor(), monitorDto.getParams(), monitorDto.getCollector()); - } monitorService.addNewMonitorOptionalMetrics(monitorDto.getMetrics(), monitorDto.getMonitor(), monitorDto.getParams()); return ResponseEntity.ok(Message.success("Add success")); } diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorsController.java b/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorsController.java index fee0b89e8c7..46e1129b3d7 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorsController.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/controller/MonitorsController.java @@ -152,6 +152,7 @@ public ResponseEntity>> getAppMonitors( return ResponseEntity.ok(message); } + @DeleteMapping @Operation(summary = "Delete monitoring items in batches according to the monitoring ID list", description = "Delete monitoring items in batches according to the monitoring ID list") diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/dao/StatusPageIncidentComponentBindDao.java b/manager/src/main/java/org/apache/hertzbeat/manager/dao/StatusPageIncidentComponentBindDao.java new file mode 100644 index 00000000000..615ccbcf0cb --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/dao/StatusPageIncidentComponentBindDao.java @@ -0,0 +1,35 @@ +/* + * 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.manager.dao; + +import org.apache.hertzbeat.common.entity.manager.StatusPageIncidentComponentBind; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** + * StatusPageComponent DAO interface. + */ +public interface StatusPageIncidentComponentBindDao extends JpaRepository, JpaSpecificationExecutor { + + /** + * count by component id + * @param componentId component id + * @return count + */ + long countByComponentId(long componentId); +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/dao/TagMonitorBindDao.java b/manager/src/main/java/org/apache/hertzbeat/manager/dao/TagMonitorBindDao.java index 8d7c7701d95..055ab10c2bb 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/dao/TagMonitorBindDao.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/dao/TagMonitorBindDao.java @@ -32,11 +32,19 @@ public interface TagMonitorBindDao extends JpaRepository, * @param monitorId monitorId */ void deleteTagMonitorBindsByMonitorId(Long monitorId); - + /** * delete tags bind by monitor id * @param monitorIds monitor list */ void deleteTagMonitorBindsByMonitorIdIn(Set monitorIds); - + + + /** + * count tags bind relation by tag id + * @param tagIds list of tagId + * @return count + */ + long countByTagIdIn(Set tagIds); + } diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AiMessage.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AiMessage.java new file mode 100644 index 00000000000..61001a81e90 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AiMessage.java @@ -0,0 +1,41 @@ +/* + * 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.manager.pojo.dto; + + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * ai message + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class AiMessage { + /** + * role + */ + private String role; + + /** + * content + */ + private String content; +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AliAiRequestParamDTO.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AliAiRequestParamDTO.java new file mode 100644 index 00000000000..8d30624c00b --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AliAiRequestParamDTO.java @@ -0,0 +1,120 @@ +/* + * 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.manager.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * Alibaba Ai Request param + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class AliAiRequestParamDTO { + + /** + * ai version + */ + private String model; + + /** + * Enter information about the model + */ + private Input input; + + /** + * Parameters used to control model generation + */ + private Parameters parameters; + + /** + * Input + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class Input { + + /** + * request message + */ + private List messages; + + } + + /** + * Parameters + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + @Builder + public static class Parameters { + + /** + * The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 1024 + */ + @JsonProperty("max_tokens") + private Integer maxTokens; + + /** + * Used to control the degree of randomness and variety. Specifically, the temperature value controls the + * degree to which the probability distribution for each candidate word is smoothed when text is generated. + * A higher temperature will reduce the peak value of the probability distribution, so that more low-probability + * words will be selected and the results will be more diversified. A lower temperature will increase the peak of the probability distribution, + * making it easier for high-probability words to be selected and producing more certain results. + */ + private float temperature; + + /** + * The Internet search service is built into the model, and this parameter controls whether the model refers + * to the Internet search results when generating text. The value can be: + * true: If Internet search is enabled, the model uses the search results as reference information in the text + * generation process, but the model "decides" whether to use the Internet search results based on its internal logic. + * false: Turn off Internet search. + */ + @JsonProperty("enable_search") + private boolean enableSearch; + + /** + * Set return format,default message + */ + @JsonProperty("result_format") + private String resultFormat; + + /** + * Control whether incremental output is enabled in stream output mode, that is, whether the subsequent output content contains + * the output content. If the value is set to True, the incremental output mode will be enabled, and the subsequent output will + * not contain the output content, you need to splice the overall output by yourself. Set to False to contain the output. + */ + @JsonProperty("incremental_output") + private boolean incrementalOutput; + + } + + + +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AliAiResponse.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AliAiResponse.java new file mode 100644 index 00000000000..2654879aaf5 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/AliAiResponse.java @@ -0,0 +1,112 @@ +/* + * 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.manager.pojo.dto; + + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * AliAiResponse + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class AliAiResponse { + + /** + * response + */ + private AliAiOutput output; + + /** + * Returns the number of tokens invoked by the model at the end. + */ + private Tokens usage; + + /** + * AliAiOutput + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public class AliAiOutput { + + /** + * response message + */ + private List choices; + + } + + /** + * Choice + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public static class Choice { + + /** + * Stop cause: + * null: being generated + * stop: stop token causes the end + * length: indicates that the generation length ends + */ + @JsonProperty("finish_reason") + private String finishReason; + + /** + * response message + */ + private AiMessage message; + } + + /** + * Tokens + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public class Tokens { + + /** + * The number of tokens of the model output content + */ + @JsonProperty("output_tokens") + private Integer outputTokens; + + /** + * The number of tokens entered this request. + * When enable_search is set to true, the number of tokens entered is greater than the number of + * tokens you entered the request because you need to add search related content. + */ + @JsonProperty("input_tokens") + private Integer inputTokens; + + /** + * usage.output_tokens and usage.input_tokens sum + */ + @JsonProperty("total_tokens") + private Integer totalTokens; + } + +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/KimiAiRequestParamDTO.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/KimiAiRequestParamDTO.java new file mode 100644 index 00000000000..29153ad4579 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/KimiAiRequestParamDTO.java @@ -0,0 +1,70 @@ +/* + * 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.manager.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * zhiPu Request param + */ + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class KimiAiRequestParamDTO { + + /** + * ai version + */ + private String model; + + /** + * request message + */ + private List messages; + + /** + * The sampling temperature, which controls the randomness of the output, must be positive + * The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. + * The larger the value, the more random and creative the output will be. The smaller the value, the more stable or certain the output will be + * You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time + */ + private float temperature; + + /** + * The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 1024 + */ + @JsonProperty("max_tokens") + private Integer maxTokens; + + /** + * stream response + */ + private Boolean stream = Boolean.FALSE; + + +} + + + diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/KimiAiResponse.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/KimiAiResponse.java new file mode 100644 index 00000000000..58458565d64 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/KimiAiResponse.java @@ -0,0 +1,93 @@ +/* + * 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.manager.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * ZhiPuAiResponse + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class KimiAiResponse { + + /** + * Task order number generated by the AI open platform. Use this order number when invoking the request result interface + */ + private String id; + + /** + * The request creation time is a Unix timestamp in seconds + */ + private Long created; + + /** + * response message + */ + private List choices; + + /** + * Returns the number of tokens invoked by the model at the end. + */ + private Tokens usage; + + /** + * Choice + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public class Choice { + private int index; + private AiMessage delta; + } + + /** + * Tokens + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public class Tokens { + + /** + * The number of tokens entered by users + */ + @JsonProperty("prompt_tokens") + private Integer promptTokens; + + /** + * The number of tokens that the model outputs + */ + @JsonProperty("completion_tokens") + private Integer completionTokens; + + /** + * Total number of tokens + */ + @JsonProperty("total_tokens") + private Integer totalTokens; + } + +} + diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/ZhiPuAiResponse.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/ZhiPuAiResponse.java new file mode 100644 index 00000000000..2b64384c526 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/ZhiPuAiResponse.java @@ -0,0 +1,93 @@ +/* + * 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.manager.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * ZhiPuAiResponse + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ZhiPuAiResponse { + + /** + * Task order number generated by the AI open platform. Use this order number when invoking the request result interface + */ + private String id; + + /** + * The request creation time is a Unix timestamp in seconds + */ + private Long created; + + /** + * response message + */ + private List choices; + + /** + * Returns the number of tokens invoked by the model at the end. + */ + private Tokens usage; + + /** + * Choice + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public class Choice { + private int index; + private AiMessage delta; + } + + /** + * Tokens + */ + @Data + @AllArgsConstructor + @NoArgsConstructor + public class Tokens { + + /** + * The number of tokens entered by users + */ + @JsonProperty("prompt_tokens") + private Integer promptTokens; + + /** + * The number of tokens that the model outputs + */ + @JsonProperty("completion_tokens") + private Integer completionTokens; + + /** + * Total number of tokens + */ + @JsonProperty("total_tokens") + private Integer totalTokens; + } + +} + diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/ZhiPuRequestParamDTO.java b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/ZhiPuRequestParamDTO.java new file mode 100644 index 00000000000..47917ff7262 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/pojo/dto/ZhiPuRequestParamDTO.java @@ -0,0 +1,70 @@ +/* + * 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.manager.pojo.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + + +/** + * zhiPu Request param + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ZhiPuRequestParamDTO { + + + /** + * ai version + */ + private String model; + + /** + * request message + */ + private List messages; + + /** + * The sampling temperature, which controls the randomness of the output, must be positive + * The value ranges from 0.0 to 1.0, and cannot be equal to 0. The default value is 0.95. + * The larger the value, the more random and creative the output will be. The smaller the value, the more stable or certain the output will be + * You are advised to adjust top_p or temperature parameters based on application scenarios, but do not adjust the two parameters at the same time + */ + private double temperature; + + /** + * The model outputs the maximum tokens, with a maximum output of 8192 and a default value of 1024 + */ + @JsonProperty("max_tokens") + private Integer maxTokens; + + /** + * stream response + */ + private Boolean stream = Boolean.FALSE; + +} + + + diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/CollectorJobScheduler.java b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/CollectorJobScheduler.java index ac882e89090..a2e49645dfd 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/CollectorJobScheduler.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/CollectorJobScheduler.java @@ -107,6 +107,7 @@ public void collectorGoOnline(String identity, CollectorInfo collectorInfo) { if (collectorInfo != null) { collector.setIp(collectorInfo.getIp()); collector.setMode(collectorInfo.getMode()); + collector.setVersion(collectorInfo.getVersion()); } } else { if (collectorInfo == null) { @@ -117,6 +118,7 @@ public void collectorGoOnline(String identity, CollectorInfo collectorInfo) { .name(identity) .ip(collectorInfo.getIp()) .mode(collectorInfo.getMode()) + .version(collectorInfo.getVersion()) .status(CommonConstants.COLLECTOR_STATUS_ONLINE) .build(); } @@ -267,6 +269,7 @@ public boolean onlineCollector(String identity) { CollectorInfo collectorInfo = CollectorInfo.builder() .name(collector.getName()) .ip(collector.getIp()) + .version(collector.getVersion()) .mode(collector.getMode()) .build(); this.collectorGoOnline(identity, collectorInfo); diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConcurrentTreeMap.java b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConcurrentTreeMap.java index 3aa84b55019..7cba010a5ce 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConcurrentTreeMap.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConcurrentTreeMap.java @@ -72,6 +72,19 @@ public Map.Entry higherEntry(K key) { } } + public Map.Entry higherOrFirstEntry(K key){ + readWriteLock.readLock().lock(); + try { + Map.Entry entry = super.higherEntry(key); + if (entry == null) { + return super.firstEntry(); + } + return entry; + } finally { + readWriteLock.readLock().unlock(); + } + } + @Override public Map.Entry ceilingEntry(K key) { readWriteLock.readLock().lock(); diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConsistentHash.java b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConsistentHash.java index ec410983468..7e08b7770fa 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConsistentHash.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/ConsistentHash.java @@ -64,6 +64,43 @@ public ConsistentHash() { dispatchJobCache = Collections.synchronizedList(new LinkedList<>()); } + /** + * add virtual node + * @param newNode node + * @param identity virtual node identity + */ + public synchronized void addVirtualNode(Node newNode, String identity){ + int virtualHashKey = hash(identity); + hashCircle.put(virtualHashKey, newNode); + newNode.addVirtualNodeJobs(virtualHashKey, ConcurrentHashMap.newKeySet(16)); + Map.Entry higherVirtualNode = hashCircle.higherOrFirstEntry(virtualHashKey); + // Reassign tasks that are routed to the higherVirtualNode virtual node + // Tasks are either on the original virtual node or on the new virtual node + Integer higherVirtualNodeKey = higherVirtualNode.getKey(); + Node higherNode = higherVirtualNode.getValue(); + Set dispatchJobs = higherNode.clearVirtualNodeJobs(higherVirtualNodeKey); + if (dispatchJobs != null && !dispatchJobs.isEmpty()) { + Set reDispatchJobs = ConcurrentHashMap.newKeySet(dispatchJobs.size()); + Iterator iterator = dispatchJobs.iterator(); + while (iterator.hasNext()) { + Long[] jobHash = iterator.next(); + int dispatchHash = jobHash[1].intValue(); + if (dispatchHash <= virtualHashKey) { + reDispatchJobs.add(jobHash); + iterator.remove(); + } + } + higherNode.virtualNodeMap.put(higherVirtualNodeKey, dispatchJobs); + Set jobIds = reDispatchJobs.stream().map(item -> item[0]).collect(Collectors.toSet()); + newNode.addVirtualNodeJobs(virtualHashKey, reDispatchJobs); + if (higherNode != newNode) { + higherNode.assignJobs.removeAssignJobs(jobIds); + higherNode.assignJobs.addRemovingJobs(jobIds); + newNode.assignJobs.addAddingJobs(jobIds); + } + } + } + /** * add collector node * @param newNode node @@ -73,47 +110,48 @@ public void addNode(Node newNode) { if (!CommonConstants.MODE_PRIVATE.equals(newNode.mode)) { byte virtualNodeNum = newNode.quality == null ? VIRTUAL_NODE_DEFAULT_SIZE : newNode.quality; for (byte i = 0; i < virtualNodeNum; i++) { - int virtualHashKey = hash(newNode.identity + i); - hashCircle.put(virtualHashKey, newNode); - newNode.addVirtualNodeJobs(virtualHashKey, ConcurrentHashMap.newKeySet(16)); - Map.Entry higherVirtualNode = hashCircle.higherEntry(virtualHashKey); - if (higherVirtualNode == null) { - higherVirtualNode = hashCircle.firstEntry(); - } - // Reassign tasks that are routed to the higherVirtualNode virtual node - // Tasks are either on the original virtual node or on the new virtual node - Integer higherVirtualNodeKey = higherVirtualNode.getKey(); - Node higherNode = higherVirtualNode.getValue(); - Set dispatchJobs = higherNode.clearVirtualNodeJobs(higherVirtualNodeKey); - if (dispatchJobs != null && !dispatchJobs.isEmpty()) { - Set reDispatchJobs = ConcurrentHashMap.newKeySet(dispatchJobs.size()); - Iterator iterator = dispatchJobs.iterator(); - while (iterator.hasNext()) { - Long[] jobHash = iterator.next(); - int dispatchHash = jobHash[1].intValue(); - if (dispatchHash <= virtualHashKey) { - reDispatchJobs.add(jobHash); - iterator.remove(); - } - } - higherNode.virtualNodeMap.put(higherVirtualNodeKey, dispatchJobs); - Set jobIds = reDispatchJobs.stream().map(item -> item[0]).collect(Collectors.toSet()); - newNode.addVirtualNodeJobs(virtualHashKey, reDispatchJobs); - if (higherNode != newNode) { - higherNode.assignJobs.removeAssignJobs(jobIds); - higherNode.assignJobs.addRemovingJobs(jobIds); - newNode.assignJobs.addAddingJobs(jobIds); - } - } - } + addVirtualNode(newNode, newNode.identity + i); + } } existNodeMap.put(newNode.identity, newNode); - if (!dispatchJobCache.isEmpty()) { - int size = dispatchJobCache.size(); - for (int index = 0; index < size; index++) { - DispatchJob dispatchJob = dispatchJobCache.remove(0); - dispatchJob(dispatchJob.dispatchHash, dispatchJob.jobId, false); - } + dispatchJobInCache(); + } + + /** + * remove virtual node + * @param deletedNode node + * @param virtualNodeHash virtual node hash key + */ + public synchronized void removeVirtualNode(Node deletedNode, Integer virtualNodeHash) { + Set removeJobHashSet = deletedNode.virtualNodeMap.get(virtualNodeHash); + // Migrate the virtualNodeEntry collection task to the nearest virtual node that is larger than it + hashCircle.remove(virtualNodeHash); + if (removeJobHashSet == null || removeJobHashSet.isEmpty()) { + return; + } + Map.Entry higherVirtualEntry = hashCircle.higherOrFirstEntry(virtualNodeHash); + if (higherVirtualEntry == null || higherVirtualEntry.getValue() == deletedNode) { + higherVirtualEntry = null; + } + // jobId + Set removeJobIds = removeJobHashSet.stream().map(item -> item[0]).collect(Collectors.toSet()); + deletedNode.assignJobs.removeAssignJobs(removeJobIds); + deletedNode.assignJobs.addRemovingJobs(removeJobIds); + if (higherVirtualEntry == null) { + // jobId-dispatchHash + removeJobHashSet.forEach(value -> { + Long jobId = value[0]; + Integer dispatchHash = value[1].intValue(); + if (removeJobIds.contains(jobId)) { + dispatchJobCache.add(new DispatchJob(dispatchHash, jobId)); + } else { + log.error("Get job {} from removeJobMap null.", jobId); + } + }); + } else { + Node higherVirtualNode = higherVirtualEntry.getValue(); + higherVirtualNode.addVirtualNodeJobs(higherVirtualEntry.getKey(), removeJobHashSet); + higherVirtualNode.assignJobs.addAddingJobs(removeJobIds); } } @@ -126,43 +164,15 @@ public Node removeNode(String name) { if (deletedNode == null) { return null; } - for (Map.Entry> virtualNodeEntry : deletedNode.virtualNodeMap.entrySet()) { - Integer virtualNodeHash = virtualNodeEntry.getKey(); - Set removeJobHashSet = virtualNodeEntry.getValue(); - // Migrate the virtualNodeEntry collection task to the nearest virtual node that is larger than it - hashCircle.remove(virtualNodeHash); - if (removeJobHashSet == null || removeJobHashSet.isEmpty()) { - continue; - } - Map.Entry higherVirtualEntry = hashCircle.higherEntry(virtualNodeHash); - if (higherVirtualEntry == null) { - higherVirtualEntry = hashCircle.firstEntry(); - } - if (higherVirtualEntry == null || higherVirtualEntry.getValue() == deletedNode) { - higherVirtualEntry = null; - } - // jobId - Set removeJobIds = removeJobHashSet.stream().map(item -> item[0]).collect(Collectors.toSet()); - deletedNode.assignJobs.removeAssignJobs(removeJobIds); - deletedNode.assignJobs.addRemovingJobs(removeJobIds); - if (higherVirtualEntry == null) { - // jobId-dispatchHash - virtualNodeEntry.getValue().forEach(value -> { - Long jobId = value[0]; - Integer dispatchHash = value[1].intValue(); - if (removeJobIds.contains(jobId)) { - dispatchJobCache.add(new DispatchJob(dispatchHash, jobId)); - } else { - log.error("Get job {} from removeJobMap null.", jobId); - } - }); - } else { - Node higherVirtualNode = higherVirtualEntry.getValue(); - higherVirtualNode.addVirtualNodeJobs(higherVirtualEntry.getKey(), removeJobHashSet); - higherVirtualNode.assignJobs.addAddingJobs(removeJobIds); - } + for (Integer virtualNodeHash : deletedNode.virtualNodeMap.keySet()) { + removeVirtualNode(deletedNode, virtualNodeHash); } deletedNode.destroy(); + dispatchJobInCache(); + return deletedNode; + } + + public synchronized void dispatchJobInCache() { if (!dispatchJobCache.isEmpty()) { int size = dispatchJobCache.size(); for (int index = 0; index < size; index++) { @@ -170,7 +180,6 @@ public Node removeNode(String name) { dispatchJob(dispatchJob.dispatchHash, dispatchJob.jobId, false); } } - return deletedNode; } /** @@ -180,7 +189,7 @@ public Node removeNode(String name) { public Map getAllNodes() { return existNodeMap; } - + /** * get node * @param collectorName collector name @@ -213,7 +222,7 @@ public Node dispatchJob(String dispatchKey, Long jobId) { int dispatchHash = hash(dispatchKey); return dispatchJob(dispatchHash, jobId, true); } - + /** * The collector node to which the collector is assigned is obtained in advance based on the collection task information * @@ -250,7 +259,7 @@ public Node dispatchJob(Integer dispatchHash, Long jobId, boolean isFlushed) { curNode.addJob(virtualKey, dispatchHash, jobId, isFlushed); return curNode; } - + /** * The collector node to which the collector is assigned is obtained in advance based on the collection task information * @@ -383,7 +392,7 @@ private synchronized void addJob(Integer virtualNodeKey, Integer dispatchHash, L Set virtualNodeJob = virtualNodeMap.computeIfAbsent(virtualNodeKey, k -> ConcurrentHashMap.newKeySet(16)); virtualNodeJob.add(new Long[]{jobId, dispatchHash.longValue()}); if (isFlushed) { - assignJobs.addAssignJob(jobId); + assignJobs.addAssignJob(jobId); } else { assignJobs.addAddingJob(jobId); } @@ -416,7 +425,7 @@ private void addVirtualNodeJobs(Integer virtualHashKey, Set reDispatchJo }); virtualNodeMap.put(virtualHashKey, reDispatchJobs); } - + public void removeVirtualNodeJob(Long jobId) { if (jobId == null || virtualNodeMap == null) { return; diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/SchedulerInit.java b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/SchedulerInit.java index 29b1acc937c..3a79aa1f6a6 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/SchedulerInit.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/SchedulerInit.java @@ -57,7 +57,8 @@ public class SchedulerInit implements CommandLineRunner { private CollectJobScheduling collectJobScheduling; private static final String MAIN_COLLECTOR_NODE_IP = "127.0.0.1"; - + private static final String DEFAULT_COLLECTOR_VERSION = "DEBUG"; + @Autowired private AppService appService; @@ -84,6 +85,7 @@ public void run(String... args) throws Exception { CollectorInfo collectorInfo = CollectorInfo.builder() .name(CommonConstants.MAIN_COLLECTOR_NODE) .ip(MAIN_COLLECTOR_NODE_IP) + .version(DEFAULT_COLLECTOR_VERSION) .build(); collectorScheduling.collectorGoOnline(CommonConstants.MAIN_COLLECTOR_NODE, collectorInfo); // init jobs diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/netty/process/CollectorOnlineProcessor.java b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/netty/process/CollectorOnlineProcessor.java index 66f7d62a7c9..ab48b220380 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/netty/process/CollectorOnlineProcessor.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/scheduler/netty/process/CollectorOnlineProcessor.java @@ -18,12 +18,14 @@ package org.apache.hertzbeat.manager.scheduler.netty.process; import io.netty.channel.ChannelHandlerContext; +import java.net.InetSocketAddress; import lombok.extern.slf4j.Slf4j; import org.apache.hertzbeat.common.entity.dto.CollectorInfo; import org.apache.hertzbeat.common.entity.message.ClusterMsg; import org.apache.hertzbeat.common.util.JsonUtil; import org.apache.hertzbeat.manager.scheduler.netty.ManageServer; import org.apache.hertzbeat.remoting.netty.NettyRemotingProcessor; +import org.springframework.util.StringUtils; /** * handle collector online message @@ -41,6 +43,12 @@ public ClusterMsg.Message handle(ChannelHandlerContext ctx, ClusterMsg.Message m String collector = message.getIdentity(); log.info("the collector {} actively requests to go online.", collector); CollectorInfo collectorInfo = JsonUtil.fromJson(message.getMsg(), CollectorInfo.class); + if (collectorInfo != null && !StringUtils.hasText(collectorInfo.getIp())) { + // fetch remote ip address + InetSocketAddress socketAddress = (InetSocketAddress) ctx.channel().remoteAddress(); + String clientIP = socketAddress.getAddress().getHostAddress(); + collectorInfo.setIp(clientIP); + } this.manageServer.addChannel(collector, ctx.channel()); this.manageServer.getCollectorAndJobScheduler().collectorGoOnline(collector, collectorInfo); return null; diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/AiService.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/AiService.java new file mode 100644 index 00000000000..ad2292ac774 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/AiService.java @@ -0,0 +1,43 @@ +/* + * 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.manager.service; + + +import org.apache.hertzbeat.common.constants.AiTypeEnum; +import reactor.core.publisher.Flux; + + +/** + * AI Service + */ +public interface AiService { + + /** + * get AI type + * @return type + */ + AiTypeEnum getType(); + + /** + * AI response + * @param text text + * @return AI response + */ + Flux requestAi(String text); + +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/KimiAiServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/KimiAiServiceImpl.java new file mode 100644 index 00000000000..31820487230 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/KimiAiServiceImpl.java @@ -0,0 +1,112 @@ +/* + * 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.manager.service; + +import com.alibaba.fastjson.JSON; +import java.util.List; +import java.util.Objects; +import javax.annotation.PostConstruct; +import lombok.extern.slf4j.Slf4j; +import org.apache.hertzbeat.common.constants.AiConstants; +import org.apache.hertzbeat.common.constants.AiTypeEnum; +import org.apache.hertzbeat.manager.pojo.dto.AiMessage; +import org.apache.hertzbeat.manager.pojo.dto.KimiAiRequestParamDTO; +import org.apache.hertzbeat.manager.pojo.dto.KimiAiResponse; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.ExchangeStrategies; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; + +/** + * Kimi Ai + */ +@Service("KimiAiServiceImpl") +@Slf4j +public class KimiAiServiceImpl implements AiService { + + @Value("${aiConfig.model:moonshot-v1-8k}") + private String model; + + @Value("${aiConfig.api-key}") + private String apiKey; + + private WebClient webClient; + + @PostConstruct + private void init() { + this.webClient = WebClient.builder() + .baseUrl(AiConstants.KimiAiConstants.URL) + .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + apiKey) + .exchangeStrategies(ExchangeStrategies.builder() + .codecs(item -> item.defaultCodecs().maxInMemorySize(16 * 1024 * 1024)) + .build()) + .build(); + } + + @Override + public AiTypeEnum getType() { + return AiTypeEnum.kimiAi; + } + + @Override + public Flux requestAi(String text) { + + checkParam(text, apiKey); + KimiAiRequestParamDTO zhiPuRequestParamDTO = KimiAiRequestParamDTO.builder() + .model(model) + .stream(Boolean.TRUE) + .maxTokens(AiConstants.KimiAiConstants.MAX_TOKENS) + .temperature(AiConstants.KimiAiConstants.TEMPERATURE) + .messages(List.of(new AiMessage(AiConstants.KimiAiConstants.REQUEST_ROLE, text))) + .build(); + + + return webClient.post() + .body(BodyInserters.fromValue(zhiPuRequestParamDTO)) + .retrieve() + .bodyToFlux(String.class) + .filter(aiResponse -> !"[DONE]".equals(aiResponse)) + .map(this::convertToResponse) + .doOnError(error -> log.info("AiResponse Exception:{}", error.toString())); + + } + + private String convertToResponse(String aiRes) { + try { + KimiAiResponse kimiAiResponse = JSON.parseObject(aiRes, KimiAiResponse.class); + if (Objects.nonNull(kimiAiResponse)) { + KimiAiResponse.Choice choice = kimiAiResponse.getChoices().get(0); + return choice.getDelta().getContent(); + } + } catch (Exception e) { + log.info("convertToResponse Exception:{}", e.toString()); + } + return ""; + } + + private void checkParam(String param, String apiKey) { + Assert.notNull(param, "text is null"); + Assert.notNull(apiKey, "aiConfig.api-key is null"); + } +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AiServiceFactoryImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AiServiceFactoryImpl.java new file mode 100644 index 00000000000..55a752f2f82 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AiServiceFactoryImpl.java @@ -0,0 +1,58 @@ +/* + * 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.manager.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.PostConstruct; +import org.apache.hertzbeat.common.constants.AiTypeEnum; +import org.apache.hertzbeat.manager.service.AiService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.util.Assert; + +/** + * AI bean factory + */ +@Component +public class AiServiceFactoryImpl { + + @Autowired + private List aiService; + + private Map aiServiceFactoryMap = new HashMap<>(); + + @PostConstruct + public void init() { + aiServiceFactoryMap = aiService.stream() + .collect(Collectors.toMap(AiService::getType, Function.identity())); + } + + public AiService getAiServiceImplBean(String type) { + Assert.notNull(type, "type is null"); + AiTypeEnum typeByName = AiTypeEnum.getTypeByName(type); + Assert.notNull(typeByName, "The current type is not supported"); + AiService aiServiceImpl = aiServiceFactoryMap.get(typeByName); + Assert.notNull(aiServiceImpl, "No bean for current type found"); + return aiServiceImpl; + } + +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AlibabaAiServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AlibabaAiServiceImpl.java new file mode 100644 index 00000000000..06e79a9925e --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AlibabaAiServiceImpl.java @@ -0,0 +1,118 @@ +/* + * 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.manager.service.impl; + +import java.util.List; +import java.util.Objects; +import javax.annotation.PostConstruct; +import lombok.extern.slf4j.Slf4j; +import org.apache.hertzbeat.common.constants.AiConstants; +import org.apache.hertzbeat.common.constants.AiTypeEnum; +import org.apache.hertzbeat.manager.pojo.dto.AiMessage; +import org.apache.hertzbeat.manager.pojo.dto.AliAiRequestParamDTO; +import org.apache.hertzbeat.manager.pojo.dto.AliAiResponse; +import org.apache.hertzbeat.manager.service.AiService; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.ExchangeStrategies; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; + + +/** + * alibaba Ai + */ +@Service("AlibabaAiServiceImpl") +@Slf4j +public class AlibabaAiServiceImpl implements AiService { + + @Value("${aiConfig.model:qwen-turbo}") + private String model; + @Value("${aiConfig.api-key}") + private String apiKey; + + + private WebClient webClient; + + @PostConstruct + private void init() { + this.webClient = WebClient.builder() + .baseUrl(AiConstants.AliAiConstants.URL) + .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + apiKey) + //sse + .defaultHeader(HttpHeaders.ACCEPT, MediaType.TEXT_EVENT_STREAM_VALUE) + .exchangeStrategies(ExchangeStrategies.builder() + .codecs(item -> item.defaultCodecs().maxInMemorySize(16 * 1024 * 1024)) + .build()) + .build(); + } + + @Override + public AiTypeEnum getType() { + return AiTypeEnum.alibabaAi; + } + + @Override + public Flux requestAi(String text) { + checkParam(text, apiKey); + + AliAiRequestParamDTO aliAiRequestParamDTO = AliAiRequestParamDTO.builder() + .model(model) + .input(AliAiRequestParamDTO.Input.builder() + .messages(List.of(new AiMessage(AiConstants.AliAiConstants.REQUEST_ROLE, text))) + .build()) + .parameters(AliAiRequestParamDTO.Parameters.builder() + .maxTokens(AiConstants.AliAiConstants.MAX_TOKENS) + .temperature(AiConstants.AliAiConstants.TEMPERATURE) + .enableSearch(true) + .resultFormat("message") + .incrementalOutput(true) + .build()) + .build(); + + + return webClient.post() + .body(BodyInserters.fromValue(aliAiRequestParamDTO)) + .retrieve() + .bodyToFlux(AliAiResponse.class) + .map(aliAiResponse -> { + if (Objects.nonNull(aliAiResponse)) { + List choices = aliAiResponse.getOutput().getChoices(); + if (CollectionUtils.isEmpty(choices)) { + return ""; + } + return choices.get(0).getMessage().getContent(); + } + return ""; + }) + .doOnError(error -> log.info("AiResponse Exception:{}", error.toString())); + + } + + + private void checkParam(String param, String apiKey) { + Assert.notNull(param, "text is null"); + Assert.notNull(apiKey, "aiConfig.api-key is null"); + } +} diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MailServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MailServiceImpl.java index 77baadda444..4e91ea73d6f 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MailServiceImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MailServiceImpl.java @@ -95,12 +95,6 @@ public String buildAlertHtmlTemplate(final Alert alert, NoticeTemplate noticeTem model.put("consoleUrl", alerterProperties.getConsoleUrl()); model.put("nameContent", bundle.getString("alerter.notify.content")); model.put("content", alert.getContent()); - if (noticeTemplate == null) { - noticeTemplate = noticeConfigService.getDefaultNoticeTemplateByType((byte) 1); - } - if (noticeTemplate == null) { - throw new NullPointerException("email does not have mapping default notice template"); - } StringTemplateLoader stringLoader = new StringTemplateLoader(); String templateName = "mailTemplate"; stringLoader.putTemplate(templateName, noticeTemplate.getContent()); diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java index 2548f904c39..2684ea1910c 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/MonitorServiceImpl.java @@ -161,11 +161,14 @@ public void detectMonitor(Monitor monitor, List params, String collector) } else { collectRep = collectJobScheduling.collectSyncJobData(appDefine); } + monitor.setStatus(CommonConstants.MONITOR_UP_CODE); // If the detection result fails, a detection exception is thrown if (collectRep == null || collectRep.isEmpty()) { + monitor.setStatus(CommonConstants.MONITOR_DOWN_CODE); throw new MonitorDetectException("Collect Timeout No Response"); } if (collectRep.get(0).getCode() != CollectRep.Code.SUCCESS) { + monitor.setStatus(CommonConstants.MONITOR_DOWN_CODE); throw new MonitorDetectException(collectRep.get(0).getMsg()); } } @@ -201,6 +204,10 @@ public void addMonitor(Monitor monitor, List params, String collector) th long jobId = collector == null ? collectJobScheduling.addAsyncCollectJob(appDefine, null) : collectJobScheduling.addAsyncCollectJob(appDefine, collector); + try { + detectMonitor(monitor, params, collector); + } catch (Exception ignored) {} + try { if (collector != null) { CollectorMonitorBind collectorMonitorBind = CollectorMonitorBind.builder() @@ -211,7 +218,6 @@ public void addMonitor(Monitor monitor, List params, String collector) th } monitor.setId(monitorId); monitor.setJobId(jobId); - monitor.setStatus(CommonConstants.MONITOR_UP_CODE); monitorDao.save(monitor); paramDao.saveAll(params); } catch (Exception e) { @@ -254,11 +260,15 @@ public void addNewMonitorOptionalMetrics(List metrics, Monitor monitor, appDefine.setConfigmap(configmaps); // Send the collection task to get the job ID long jobId = collectJobScheduling.addAsyncCollectJob(appDefine, null); + + try { + detectMonitor(monitor, params, null); + } catch (Exception ignored) {} + // Brush the library after the download is successful try { monitor.setId(monitorId); monitor.setJobId(jobId); - monitor.setStatus(CommonConstants.MONITOR_UP_CODE); monitorDao.save(monitor); paramDao.saveAll(params); } catch (Exception e) { @@ -538,6 +548,9 @@ public void modifyMonitor(Monitor monitor, List params, String collector) } monitor.setJobId(newJobId); } + try { + detectMonitor(monitor, params, collector); + } catch (Exception ignored) {} // After the update is successfully released, refresh the database try { collectorMonitorBindDao.deleteCollectorMonitorBindsByMonitorId(monitorId); @@ -547,7 +560,6 @@ public void modifyMonitor(Monitor monitor, List params, String collector) .build(); collectorMonitorBindDao.save(collectorMonitorBind); } - monitor.setStatus(preMonitor.getStatus()); // force update gmtUpdate time, due the case: monitor not change, param change. we also think monitor change monitor.setGmtUpdate(LocalDateTime.now()); monitorDao.save(monitor); @@ -686,11 +698,13 @@ public void enableManageMonitors(HashSet ids) { // Issue collection tasks Optional bindOptional = collectorMonitorBindDao.findCollectorMonitorBindByMonitorId(monitor.getId()); - long newJobId = bindOptional.map(bind -> - collectJobScheduling.addAsyncCollectJob(appDefine, bind.getCollector())) - .orElseGet(() -> collectJobScheduling.addAsyncCollectJob(appDefine, null)); + String collector = bindOptional.map(CollectorMonitorBind::getCollector).orElseGet(() -> null); + long newJobId = collectJobScheduling.addAsyncCollectJob(appDefine, collector); monitor.setJobId(newJobId); applicationContext.publishEvent(new MonitorDeletedEvent(applicationContext, monitor.getId())); + try { + detectMonitor(monitor, params, collector); + } catch (Exception ignored) {} } monitorDao.saveAll(unManagedMonitors); } diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java index dd880ba5f20..a0fd59cce57 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/StatusPageServiceImpl.java @@ -24,14 +24,17 @@ import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; import org.apache.hertzbeat.common.constants.CommonConstants; import org.apache.hertzbeat.common.entity.manager.StatusPageComponent; import org.apache.hertzbeat.common.entity.manager.StatusPageHistory; import org.apache.hertzbeat.common.entity.manager.StatusPageIncident; import org.apache.hertzbeat.common.entity.manager.StatusPageOrg; +import org.apache.hertzbeat.common.support.exception.CommonException; import org.apache.hertzbeat.manager.component.status.CalculateStatus; import org.apache.hertzbeat.manager.dao.StatusPageComponentDao; import org.apache.hertzbeat.manager.dao.StatusPageHistoryDao; +import org.apache.hertzbeat.manager.dao.StatusPageIncidentComponentBindDao; import org.apache.hertzbeat.manager.dao.StatusPageIncidentDao; import org.apache.hertzbeat.manager.dao.StatusPageOrgDao; import org.apache.hertzbeat.manager.pojo.dto.ComponentStatus; @@ -44,25 +47,29 @@ * status page service implement. */ @Service +@RequiredArgsConstructor public class StatusPageServiceImpl implements StatusPageService { - + private static final int HISTORY_SPAN_DAYS = 29; - + @Autowired private StatusPageOrgDao statusPageOrgDao; - + @Autowired private StatusPageComponentDao statusPageComponentDao; @Autowired private StatusPageHistoryDao statusPageHistoryDao; - + @Autowired private StatusPageIncidentDao statusPageIncidentDao; - + @Autowired private CalculateStatus calculateStatus; - + + private final StatusPageIncidentComponentBindDao statusPageIncidentComponentBindDao; + + @Override public StatusPageOrg queryStatusPageOrg() { return statusPageOrgDao.findAll().stream().findFirst().orElse(null); @@ -96,6 +103,10 @@ public void updateStatusPageComponent(StatusPageComponent statusPageComponent) { @Override public void deleteStatusPageComponent(long id) { + long count = statusPageIncidentComponentBindDao.countByComponentId(id); + if (count != 0) { + throw new CommonException("The component is associated with an event and cannot be deleted. Please delete the event and try again!"); + } statusPageComponentDao.deleteById(id); } @@ -134,7 +145,7 @@ public List queryComponentsStatus() { for (int index = 0; index < HISTORY_SPAN_DAYS; index++) { long startTimestamp = startTime.toInstant(zoneOffset).toEpochMilli(); long endTimestamp = endTime.toInstant(zoneOffset).toEpochMilli(); - List thisDayHistory = historyList.stream().filter(item -> + List thisDayHistory = historyList.stream().filter(item -> item.getTimestamp() >= startTimestamp && item.getTimestamp() <= endTimestamp) .collect(Collectors.toList()); if (thisDayHistory.isEmpty()) { @@ -157,7 +168,7 @@ public List queryComponentsStatus() { } return componentStatusList; } - + private StatusPageHistory combineOneDayStatusPageHistory(List statusPageHistories, StatusPageComponent component, long nowTimestamp) { if (statusPageHistories.isEmpty()) { return StatusPageHistory.builder().timestamp(nowTimestamp) diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java index a663c93efc4..479de1c4737 100644 --- a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/TagServiceImpl.java @@ -27,7 +27,9 @@ import org.apache.commons.lang3.StringUtils; import org.apache.hertzbeat.common.entity.manager.Monitor; import org.apache.hertzbeat.common.entity.manager.Tag; +import org.apache.hertzbeat.common.support.exception.CommonException; import org.apache.hertzbeat.manager.dao.TagDao; +import org.apache.hertzbeat.manager.dao.TagMonitorBindDao; import org.apache.hertzbeat.manager.service.TagService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -47,6 +49,9 @@ public class TagServiceImpl implements TagService { @Autowired private TagDao tagDao; + @Autowired + private TagMonitorBindDao tagMonitorBindDao; + @Override public void addTags(List tags) { tagDao.saveAll(tags); @@ -70,6 +75,9 @@ public Page getTags(Specification specification, PageRequest pageReque @Override public void deleteTags(HashSet ids) { + if (tagMonitorBindDao.countByTagIdIn(ids) != 0) { + throw new CommonException("The tag is in use and cannot be deleted."); + } tagDao.deleteTagsByIdIn(ids); } diff --git a/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/ZhiPuServiceImpl.java b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/ZhiPuServiceImpl.java new file mode 100644 index 00000000000..f1407672028 --- /dev/null +++ b/manager/src/main/java/org/apache/hertzbeat/manager/service/impl/ZhiPuServiceImpl.java @@ -0,0 +1,117 @@ +/* + * 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.manager.service.impl; + +import com.alibaba.fastjson.JSON; +import java.util.List; +import java.util.Objects; +import javax.annotation.PostConstruct; +import lombok.extern.slf4j.Slf4j; +import org.apache.hertzbeat.common.constants.AiConstants; +import org.apache.hertzbeat.common.constants.AiTypeEnum; +import org.apache.hertzbeat.manager.pojo.dto.AiMessage; +import org.apache.hertzbeat.manager.pojo.dto.ZhiPuAiResponse; +import org.apache.hertzbeat.manager.pojo.dto.ZhiPuRequestParamDTO; +import org.apache.hertzbeat.manager.service.AiService; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Service; +import org.springframework.util.Assert; +import org.springframework.web.reactive.function.BodyInserters; +import org.springframework.web.reactive.function.client.ExchangeStrategies; +import org.springframework.web.reactive.function.client.WebClient; +import reactor.core.publisher.Flux; + + +/** + * 智普AI + */ +@Service("ZhiPuServiceImpl") +@Slf4j +public class ZhiPuServiceImpl implements AiService { + @Value("${aiConfig.model:glm-4}") + private String model; + @Value("${aiConfig.api-key}") + private String apiKey; + + private WebClient webClient; + + + @PostConstruct + private void init() { + this.webClient = WebClient.builder() + .baseUrl(AiConstants.ZhiPuConstants.URL) + .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) + .defaultHeader(HttpHeaders.AUTHORIZATION, "Bearer " + apiKey) + .exchangeStrategies(ExchangeStrategies.builder() + .codecs(item -> item.defaultCodecs().maxInMemorySize(16 * 1024 * 1024)) + .build()) + .build(); + } + + @Override + public AiTypeEnum getType() { + return AiTypeEnum.zhiPu; + } + + @Override + public Flux requestAi(String text) { + checkParam(text, model, apiKey); + ZhiPuRequestParamDTO zhiPuRequestParamDTO = ZhiPuRequestParamDTO.builder() + .model(model) + //sse + .stream(Boolean.TRUE) + .maxTokens(AiConstants.ZhiPuConstants.MAX_TOKENS) + .temperature(AiConstants.ZhiPuConstants.TEMPERATURE) + .messages(List.of(new AiMessage(AiConstants.ZhiPuConstants.REQUEST_ROLE, text))) + .build(); + + return webClient.post() + .body(BodyInserters.fromValue(zhiPuRequestParamDTO)) + .retrieve() + .bodyToFlux(String.class) + .filter(aiResponse -> !"[DONE]".equals(aiResponse)) + .map(this::convertToResponse) + .doOnError(error -> log.info("AiResponse Exception:{}", error.toString())); + + + } + + private String convertToResponse(String aiRes) { + try { + ZhiPuAiResponse zhiPuAiResponse = JSON.parseObject(aiRes, ZhiPuAiResponse.class); + if (Objects.nonNull(zhiPuAiResponse)) { + ZhiPuAiResponse.Choice choice = zhiPuAiResponse.getChoices().get(0); + return choice.getDelta().getContent(); + } + } catch (Exception e) { + log.info("convertToResponse Exception:{}", e.toString()); + } + + return ""; + } + + + private void checkParam(String param, String model, String apiKey) { + Assert.notNull(param, "text is null"); + Assert.notNull(apiKey, "aiConfig.api-key is null"); + } + + +} diff --git a/manager/src/main/resources/application-test.yml b/manager/src/main/resources/application-test.yml index 5562e96e0d7..0faf4d01f0b 100644 --- a/manager/src/main/resources/application-test.yml +++ b/manager/src/main/resources/application-test.yml @@ -85,3 +85,12 @@ scheduler: server: enabled: true port: 1158 + +#AI config +aiConfig: + #AI Type:zhiPu + type: zhiPu + #Model name:glm-4 + model: glm-4 + #api key + api-key: xxx \ No newline at end of file diff --git a/manager/src/main/resources/application.yml b/manager/src/main/resources/application.yml index e086e4952de..90d6e43e703 100644 --- a/manager/src/main/resources/application.yml +++ b/manager/src/main/resources/application.yml @@ -141,7 +141,12 @@ warehouse: password: taosdata greptime: enabled: false - endpoint: localhost:4001 + grpc-endpoints: localhost:4001 + url: jdbc:mysql://localhost:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true + driver-class-name: com.mysql.cj.jdbc.Driver + username: greptime + password: greptime + expire-time: 30d iot-db: enabled: false host: 127.0.0.1 @@ -194,3 +199,13 @@ scheduler: server: enabled: true port: 1158 + +# AI config +# See the documentation for details : https://hertzbeat.apache.org/zh-cn/docs/help/aiConfig +aiConfig: + # AI Type:zhiPu、alibabaAi、kimiAi + type: + # Model name:glm-4、qwen-turbo、moonshot-v1-8k + model: glm-4 + # api key + api-key: \ No newline at end of file diff --git a/manager/src/main/resources/db/migration/mysql/V160__update_column.sql b/manager/src/main/resources/db/migration/mysql/V160__update_column.sql index 068bc47b45a..74879732c52 100644 --- a/manager/src/main/resources/db/migration/mysql/V160__update_column.sql +++ b/manager/src/main/resources/db/migration/mysql/V160__update_column.sql @@ -30,3 +30,6 @@ # UPDATE hzb_status_page_history SET unknowing = `unknown` WHERE `unknown` IS NOT NULL AND unknowing IS NULL; # ALTER TABLE hzb_status_page_history DROP COLUMN `unknown`; # commit; +# +# ALTER TABLE `hertzbeat`.`hzb_notice_rule` MODIFY COLUMN `receiver_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL AFTER `receiver_id`; +# commit; diff --git a/manager/src/main/resources/define/app-almalinux.yml b/manager/src/main/resources/define/app-almalinux.yml index f97d9d71d7b..2452a389d5c 100644 --- a/manager/src/main/resources/define/app-almalinux.yml +++ b/manager/src/main/resources/define/app-almalinux.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-centos.yml b/manager/src/main/resources/define/app-centos.yml index 3b673942268..4b5a579037a 100644 --- a/manager/src/main/resources/define/app-centos.yml +++ b/manager/src/main/resources/define/app-centos.yml @@ -467,7 +467,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -508,5 +508,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-coreos.yml b/manager/src/main/resources/define/app-coreos.yml index 04c64b3c7a7..e074c2c9ede 100644 --- a/manager/src/main/resources/define/app-coreos.yml +++ b/manager/src/main/resources/define/app-coreos.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-euleros.yml b/manager/src/main/resources/define/app-euleros.yml index f677d037f86..761830403dc 100644 --- a/manager/src/main/resources/define/app-euleros.yml +++ b/manager/src/main/resources/define/app-euleros.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-flink_on_yarn.yml b/manager/src/main/resources/define/app-flink_on_yarn.yml new file mode 100644 index 00000000000..3757ae2bf96 --- /dev/null +++ b/manager/src/main/resources/define/app-flink_on_yarn.yml @@ -0,0 +1,480 @@ +# 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. + +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +category: bigdata +# The monitoring type eg: linux windows tomcat mysql aws... +app: flink_on_yarn +# The monitoring i18n name +name: + zh-CN: Apache Flink On Yarn + en-US: Apache Flink On Yarn +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 Flink 流引擎 Yarn 模式的通用指标进行测量监控。
您可以点击 “新建 Flink On Yarn” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitoring Flink Stream through general performance metric. You could click the "New Flink Stream" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat 對 Flink 流引擎 Yarn 模式的通用指標進行測量監控。
您可以點擊 “新建 Flink On Yarn” 並進行配置,或者選擇“更多操作”,導入已有配置。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/flink_on_yarn + en-US: https://hertzbeat.apache.org/docs/help/flink_on_yarn +# 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 + # 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: Yarn端口 + en-US: Yarn 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 + defaultValue: 8088 + # field-param field key + - field: application_id + # name-param field display i18n name + name: + zh-CN: 应用ID + en-US: Application ID + # type-param field type(most mapping the html input type) + type: text + # required-true or false + required: true + # field-param field key + - field: ssl + # name-param field display i18n name + name: + zh-CN: 启动SSL + en-US: SSL + # type-param field type(boolean mapping the html switch tag) + type: boolean + # required-true or false + required: false + # field-param field key + - field: authType + name: + zh-CN: 认证方式 + en-US: Auth Type + # type-param field type(most mapping the html input type) + type: radio + required: false + hide: true + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} + options: + - label: Basic Auth + value: Basic Auth + - label: Digest Auth + value: Digest Auth + - field: username + name: + zh-CN: 用户名 + en-US: Username + type: text + limit: 50 + required: false + hide: true + - field: password + name: + zh-CN: 密码 + en-US: Password + type: password + required: false + hide: true +# collect metrics config list +metrics: + - name: jobmanager + i18n: + zh-CN: JobManager Metrics + en-US: JobManager Metrics + priority: 0 + fields: + - field: id + type: 1 + label: true + i18n: + zh-CN: 监控项 + en-US: key + - field: value + type: 0 + i18n: + zh-CN: 值 + en-US: value + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /proxy/^_^application_id^_^/jobmanager/metrics?get=Status.JVM.Memory.Heap.Used,Status.JVM.Memory.Heap.Max,Status.JVM.Memory.Metaspace.Used,Status.JVM.Memory.Metaspace.Max,Status.JVM.Memory.Heap.Committed,Status.JVM.Memory.Heap.Used,Status.JVM.Memory.Heap.Max,Status.JVM.Memory.NonHeap.Committed,Status.JVM.Memory.NonHeap.Used,Status.JVM.Memory.NonHeap.Max,Status.JVM.Memory.Direct.Count,Status.JVM.Memory.Direct.MemoryUsed,Status.JVM.Memory.Direct.TotalCapacity,Status.JVM.Memory.Mapped.Count,Status.JVM.Memory.Mapped.MemoryUsed,Status.JVM.Memory.Mapped.TotalCapacity,Status.JVM.GarbageCollector.G1_Young_Generation.Count,Status.JVM.GarbageCollector.G1_Old_Generation.Count,Status.JVM.GarbageCollector.G1_Old_Generation.Time,Status.JVM.GarbageCollector.G1_Young_Generation.Time + method: GET + ssl: ^_^ssl^_^ + authorization: + type: ^_^authType^_^ + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + digestAuthUsername: ^_^username^_^ + digestAuthPassword: ^_^password^_^ + parseType: jsonPath + parseScript: '$.*' + - name: jobmanager_config + i18n: + zh-CN: JobManager Config + en-US: JobManager Config + priority: 0 + fields: + - field: key + type: 1 + i18n: + zh-CN: 监控项 + en-US: key + - field: value + type: 1 + i18n: + zh-CN: 值 + en-US: value + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /proxy/^_^application_id^_^/jobmanager/config + method: GET + ssl: ^_^ssl^_^ + authorization: + type: ^_^authType^_^ + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + digestAuthUsername: ^_^username^_^ + digestAuthPassword: ^_^password^_^ + parseType: jsonPath + parseScript: '$.*' + + - name: taskmanager + i18n: + zh-CN: TaskManager + en-US: TaskManager + priority: 1 + fields: + - field: id + type: 1 + label: true + i18n: + zh-CN: Container ID + en-US: Container ID + - field: path + type: 1 + i18n: + zh-CN: Path + en-US: Path + - field: dataPort + type: 1 + i18n: + zh-CN: Data Port + en-US: Data Port + - field: jmxPort + type: 1 + i18n: + zh-CN: JMX Port + en-US: JMX Port + - field: timeSinceLastHeartbeat + type: 0 + i18n: + zh-CN: Last Heartbeat + en-US: Last Heartbeat + - field: slotsNumber + type: 0 + i18n: + zh-CN: All Slots + en-US: All Slots + - field: freeSlots + type: 0 + i18n: + zh-CN: Free Slots + en-US: Free Slots + - field: totalResourceCpuCores + type: 0 + i18n: + zh-CN: totalResourceCpuCores + en-US: totalResourceCpuCores + - field: totalResourceTaskHeapMemory + type: 0 + i18n: + zh-CN: totalResourceTaskHeapMemory + en-US: totalResourceTaskHeapMemory + unit: MB + - field: totalResourceManagedMemory + type: 0 + i18n: + zh-CN: totalResourceManagedMemory + en-US: totalResourceManagedMemory + unit: MB + - field: totalResourceNetworkMemory + type: 0 + i18n: + zh-CN: totalResourceNetworkMemory + en-US: totalResourceNetworkMemory + unit: MB + - field: freeResourceCpuCores + type: 0 + i18n: + zh-CN: freeResourceCpuCores + en-US: freeResourceCpuCores + - field: freeResourceTaskHeapMemory + type: 0 + i18n: + zh-CN: freeResourceTaskHeapMemory + en-US: freeResourceTaskHeapMemory + unit: MB + - field: freeResourceTaskOffHeapMemory + type: 0 + i18n: + zh-CN: freeResourceTaskOffHeapMemory + en-US: freeResourceTaskOffHeapMemory + unit: MB + - field: freeResourceManagedMemory + type: 0 + i18n: + zh-CN: freeResourceManagedMemory + en-US: freeResourceManagedMemory + unit: MB + - field: freeResourceNetworkMemory + type: 0 + i18n: + zh-CN: freeResourceNetworkMemory + en-US: freeResourceNetworkMemory + unit: MB + - field: hardwareCpuCores + type: 0 + i18n: + zh-CN: CPU Cores + en-US: CPU Cores + - field: hardwarePhysicalMemory + type: 0 + i18n: + zh-CN: Physical MEM + en-US: Physical MEM + unit: GB + - field: hardwareFreeMemory + type: 0 + i18n: + zh-CN: JVM Heap Size + en-US: JVM Heap Size + unit: MB + - field: hardwareManagedMemory + type: 0 + i18n: + zh-CN: Flink Managed MEM + en-US: Flink Managed MEM + unit: MB + - field: memoryConfigurationFrameworkHeap + type: 0 + i18n: + zh-CN: Framework Heap + en-US: Framework Heap + unit: MB + - field: memoryConfigurationTaskHeap + type: 0 + i18n: + zh-CN: Task Heap + en-US: Task Heap + unit: MB + - field: memoryConfigurationFrameworkOffHeap + type: 0 + i18n: + zh-CN: Framework Off-Heap + en-US: Framework Off-Heap + unit: MB + - field: memoryConfigurationTaskOffHeap + type: 0 + i18n: + zh-CN: Task Off-Heap + en-US: Task Off-Heap + unit: MB + - field: memoryConfigurationNetworkMemory + type: 0 + i18n: + zh-CN: Network + en-US: Network + unit: MB + - field: memoryConfigurationManagedMemory + type: 0 + i18n: + zh-CN: Managed Memory + en-US: Managed Memory + unit: MB + - field: memoryConfigurationJvmMetaspace + type: 0 + i18n: + zh-CN: JVM Metaspace + en-US: JVM Metaspace + unit: MB + - field: memoryConfigurationJvmOverhead + type: 0 + i18n: + zh-CN: JVM Overhead + en-US: JVM Overhead + - field: memoryConfigurationTotalFlinkMemory + type: 0 + i18n: + zh-CN: memoryConfigurationTotalFlinkMemory + en-US: memoryConfigurationTotalFlinkMemory + - field: memoryConfigurationTotalProcessMemory + type: 0 + i18n: + zh-CN: memoryConfigurationTotalProcessMemory + en-US: memoryConfigurationTotalProcessMemory + aliasFields: + - $.id + - $.path + - $.dataPort + - $.jmxPort + - $.timeSinceLastHeartbeat + - $.slotsNumber + - $.freeSlots + - $.totalResource.cpuCores + - $.totalResource.taskHeapMemory + - $.totalResource.managedMemory + - $.totalResource.networkMemory + - $.freeResource.cpuCores + - $.freeResource.taskHeapMemory + - $.freeResource.taskOffHeapMemory + - $.freeResource.managedMemory + - $.freeResource.networkMemory + - $.hardware.cpuCores + - $.hardware.physicalMemory + - $.hardware.freeMemory + - $.hardware.managedMemory + - $.memoryConfiguration.frameworkHeap + - $.memoryConfiguration.taskHeap + - $.memoryConfiguration.frameworkOffHeap + - $.memoryConfiguration.taskOffHeap + - $.memoryConfiguration.networkMemory + - $.memoryConfiguration.managedMemory + - $.memoryConfiguration.jvmMetaspace + - $.memoryConfiguration.jvmOverhead + - $.memoryConfiguration.totalFlinkMemory + - $.memoryConfiguration.totalProcessMemory + calculates: + - id=$.id + - path=$.path + - dataPort=$.dataPort + - jmxPort=$.jmxPort + - timeSinceLastHeartbeat=$.timeSinceLastHeartbeat + - slotsNumber=$.slotsNumber + - freeSlots=$.freeSlots + - totalResourceCpuCores=$.totalResource.cpuCores + - totalResourceTaskHeapMemory=$.totalResource.taskHeapMemory + - totalResourceManagedMemory=$.totalResource.managedMemory + - totalResourceNetworkMemory=$.totalResource.networkMemory + - freeResourceCpuCores=$.freeResource.cpuCores + - freeResourceTaskHeapMemory=$.freeResource.taskHeapMemory + - freeResourceTaskOffHeapMemory=$.freeResource.taskOffHeapMemory + - freeResourceManagedMemory=$.freeResource.managedMemory + - freeResourceNetworkMemory=$.freeResource.networkMemory + - hardwareCpuCores=$.hardware.cpuCores + - hardwarePhysicalMemory=$.hardware.physicalMemory + - hardwareFreeMemory=$.hardware.freeMemory + - hardwareManagedMemory=$.hardware.managedMemory + - memoryConfigurationFrameworkHeap=$.memoryConfiguration.frameworkHeap + - memoryConfigurationTaskHeap=$.memoryConfiguration.taskHeap + - memoryConfigurationFrameworkOffHeap=$.memoryConfiguration.frameworkOffHeap + - memoryConfigurationTaskOffHeap=$.memoryConfiguration.taskOffHeap + - memoryConfigurationNetworkMemory=$.memoryConfiguration.networkMemory + - memoryConfigurationManagedMemory=$.memoryConfiguration.managedMemory + - memoryConfigurationJvmMetaspace=$.memoryConfiguration.jvmMetaspace + - memoryConfigurationJvmOverhead=$.memoryConfiguration.jvmOverhead + - memoryConfigurationTotalFlinkMemory=$.memoryConfiguration.totalFlinkMemory + - memoryConfigurationTotalProcessMemory=$.memoryConfiguration.totalProcessMemory + units: + - hardwarePhysicalMemory = B->GB + - hardwareFreeMemory = B->MB + - hardwareManagedMemory = B->MB + - memoryConfigurationFrameworkHeap = B->MB + - memoryConfigurationTaskHeap = B->MB + - memoryConfigurationManagedMemory = B->MB + - memoryConfigurationFrameworkOffHeap = B->MB + - memoryConfigurationTaskOffHeap = B->MB + - memoryConfigurationNetworkMemory = B->MB + - memoryConfigurationJvmMetaspace = B->MB + - memoryConfigurationJvmOverhead = B->MB + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /proxy/^_^application_id^_^/taskmanagers + method: GET + ssl: ^_^ssl^_^ + authorization: + type: ^_^authType^_^ + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + digestAuthUsername: ^_^username^_^ + digestAuthPassword: ^_^password^_^ + parseType: jsonPath + parseScript: '$.taskmanagers.*' + + - name: taskmanager_metrics + i18n: + zh-CN: TaskManager Metrics + en-US: TaskManager Metrics + priority: 2 + fields: + - field: container_id + i18n: + zh-CN: Container ID + en-US: Container ID + type: 1 + label: true + - field: id + type: 1 + i18n: + zh-CN: 监控项 + en-US: key + label: true + - field: value + type: 0 + i18n: + zh-CN: 值 + en-US: value + unit: MB + units: + - value=B->MB + calculates: + - container_id="^o^id^o^" + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /proxy/^_^application_id^_^/taskmanagers/^o^id^o^/metrics?get=Status.JVM.Memory.Heap.Used,Status.JVM.Memory.Heap.Max,Status.Shuffle.Netty.UsedMemory,Status.Shuffle.Netty.TotalMemory,Status.Flink.Memory.Managed.Used,Status.Flink.Memory.Managed.Total,Status.JVM.Memory.Metaspace.Used,Status.JVM.Memory.Metaspace.Max + method: GET + ssl: ^_^ssl^_^ + authorization: + type: ^_^authType^_^ + basicAuthUsername: ^_^username^_^ + basicAuthPassword: ^_^password^_^ + digestAuthUsername: ^_^username^_^ + digestAuthPassword: ^_^password^_^ + parseType: jsonPath + parseScript: '$.*' diff --git a/manager/src/main/resources/define/app-freebsd.yml b/manager/src/main/resources/define/app-freebsd.yml index 270d76be2af..80aaefe0f4b 100644 --- a/manager/src/main/resources/define/app-freebsd.yml +++ b/manager/src/main/resources/define/app-freebsd.yml @@ -381,7 +381,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -422,5 +422,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-linux.yml b/manager/src/main/resources/define/app-linux.yml index 68a89d7c411..698f43b0b2d 100644 --- a/manager/src/main/resources/define/app-linux.yml +++ b/manager/src/main/resources/define/app-linux.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-mongodb-atlas.yml b/manager/src/main/resources/define/app-mongodb-atlas.yml new file mode 100644 index 00000000000..eea14240d6f --- /dev/null +++ b/manager/src/main/resources/define/app-mongodb-atlas.yml @@ -0,0 +1,346 @@ +# 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. + + +# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring +category: db +# The monitoring type eg: linux windows tomcat mysql aws... +app: mongodb_atlas +# The monitoring i18n name +name: + zh-CN: MongoDB Atlas 数据库 + en-US: MongoDB Atlas Database +# The description and help of this monitoring type +help: + zh-CN: Hertzbeat 对 MongoDB Atlas 数据库的通用指标进行测量监控。
您可以点击 “新建 MongoDB Atlas 数据库” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Hertzbeat monitors MongoDB Atlas general performance metrics. You could click the "New MongoDB Atlas" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: Hertzbeat 對 MongoDB Atlas 數據庫的通用指標進行測量監控。
您可以點擊 “新建 MongoDB Atlas 數據庫” 並進行配置,或者選擇“更多操作”,導入已有配置。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/mongodb + en-US: https://hertzbeat.apache.org/docs/help/mongodb +# 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 + # type-param field type(most mapping the html input type) + type: host + # required-true or false + required: true + # field-param field key + - field: username + name: + zh-CN: 用户名 + en-US: Username + type: text + limit: 50 + required: false + - field: password + name: + zh-CN: 密码 + en-US: Password + type: password + required: false + - field: database + name: + zh-CN: 数据库 + en-US: database + type: text + # when type is text, use limit to limit string length + limit: 50 + required: true + defaultValue: 'test' + - field: authenticationDatabase + name: + zh-CN: 认证数据库 + en-US: authenticationDatabase + type: text + limit: 50 + required: true + defaultValue: 'admin' + - 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: model + hide: true + defaultValue: 'mongodb-atlas' + # name-param field display i18n name + name: + zh-CN: 集群模式 + 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 +# https://www.mongodb.com/docs/manual/reference/command/nav-diagnostic/ +# name must be Diagnostic Commands 's name,support . way to get subdocument, should be careful about if the user that need connection have the right to run command + +# collect metrics config list +metrics: + # https://www.mongodb.com/docs/manual/reference/command/buildInfo/#usage + # metrics - buildInfo + - name: buildInfo + # 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 + # collect metrics content + i18n: + zh-CN: 构建信息 + en-US: Build Info + # 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 + - field: version + type: 1 + i18n: + zh-CN: 版本 + en-US: Version + - field: gitVersion + type: 1 + i18n: + zh-CN: git版本 + en-US: Git Version + - field: sysInfo + type: 1 + i18n: + zh-CN: 系统信息 + en-US: Sys Info + - field: allocator + type: 1 + i18n: + zh-CN: 分配器 + en-US: Allocator + - field: javascriptEngine + type: 1 + i18n: + zh-CN: JavaScript引擎 + en-US: JavaScript Engine + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: mongodb + # the config content when protocol is mongodb + mongodb: + #mongodb host: + host: ^_^host^_^ + #mongodb port + port: ^_^port^_^ + #user's username + username: ^_^username^_^ + #user's password + password: ^_^password^_^ + #mongodb's database + database: ^_^database^_^ + #mongodb's model + model: ^_^model^_^ + #Specifies the database in which the User is created + authenticationDatabase: ^_^authenticationDatabase^_^ + #The buildInfo command is an administrative command which returns a build summary for the current mongod. + command: buildInfo + # timeout unit:ms + timeout: ^_^timeout^_^ + + # https://www.mongodb.com/docs/manual/reference/command/serverStatus/#metrics + - name: server_document + priority: 0 + i18n: + zh-CN: 服务器文档 + en-US: Server Document + fields: + - field: delete + type: 0 + i18n: + zh-CN: 已删除数 + en-US: delete + - field: insert + type: 0 + i18n: + zh-CN: 已插入数 + en-US: insert + - field: update + type: 0 + i18n: + zh-CN: 更新数 + en-US: update + - field: query + type: 0 + i18n: + zh-CN: 查询数 + en-US: query + - field: getmore + type: 0 + i18n: + zh-CN: 光标中剩余文档的请求数 + en-US: getmore + - field: command + type: 0 + i18n: + zh-CN: 执行命令操作的总数 + en-US: command + protocol: mongodb + mongodb: + host: ^_^host^_^ + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + database: ^_^database^_^ + model: ^_^model^_^ + authenticationDatabase: ^_^authenticationDatabase^_^ + command: serverStatus.opcounters + timeout: ^_^timeout^_^ + + - name: network + priority: 1 + i18n: + zh-CN: 网络操作 + en-US: Network Operation + fields: + - field: bytesIn + type: 0 + i18n: + zh-CN: 读取字节数 + en-US: Bytes In + - field: bytesOut + type: 0 + i18n: + zh-CN: 写入字节数 + en-US: Bytes Out + - field: numRequests + type: 0 + i18n: + zh-CN: 请求数 + en-US: Request Num + protocol: mongodb + mongodb: + host: ^_^host^_^ + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + database: ^_^database^_^ + model: ^_^model^_^ + authenticationDatabase: ^_^authenticationDatabase^_^ + command: serverStatus.network + timeout: ^_^timeout^_^ + + - name: connections + priority: 1 + i18n: + zh-CN: 连接信息 + en-US: Connection Info + fields: + - field: current + type: 0 + i18n: + zh-CN: 当前正在进行连接数 + en-US: Current Connections + - field: available + type: 0 + i18n: + zh-CN: 可用连接数 + en-US: Available Connections + - field: totalCreated + type: 0 + i18n: + zh-CN: 总创建连接数 + en-US: Total Created Connections + protocol: mongodb + mongodb: + host: ^_^host^_^ + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + database: ^_^database^_^ + model: ^_^model^_^ + authenticationDatabase: ^_^authenticationDatabase^_^ + command: serverStatus.connections + timeout: ^_^timeout^_^ + + - name: dbstats + priority: 1 + i18n: + zh-CN: 数据库统计 + en-US: Database Statistics + fields: + - field: db + type: 1 + i18n: + zh-CN: 数据库名称 + en-US: Database Name + - field: collections + type: 0 + i18n: + zh-CN: 集合数 + en-US: Collections + - field: views + type: 0 + i18n: + zh-CN: 视图数 + en-US: Views + - field: objects + type: 0 + i18n: + zh-CN: 文档数 + en-US: Objects + - field: avgObjSize + type: 0 + unit: Bytes + i18n: + zh-CN: 文档平均大小 + en-US: Document Avg Size + - field: dataSize + type: 0 + unit: Bytes + i18n: + zh-CN: 文档大小 + en-US: Document Size + - field: storageSize + type: 0 + unit: Bytes + i18n: + zh-CN: 使用存储空间大小 + en-US: Storage Size + - field: indexes + type: 0 + i18n: + zh-CN: 索引数 + en-US: Indexes + - field: indexSize + type: 0 + unit: Bytes + i18n: + zh-CN: 索引大小 + en-US: Index Size + protocol: mongodb + mongodb: + host: ^_^host^_^ + port: ^_^port^_^ + username: ^_^username^_^ + password: ^_^password^_^ + database: ^_^database^_^ + model: ^_^model^_^ + authenticationDatabase: ^_^authenticationDatabase^_^ + command: dbStats + timeout: ^_^timeout^_^ \ No newline at end of file diff --git a/manager/src/main/resources/define/app-netease_mailbox.yml b/manager/src/main/resources/define/app-netease_mailbox.yml new file mode 100644 index 00000000000..0088fa23ff1 --- /dev/null +++ b/manager/src/main/resources/define/app-netease_mailbox.yml @@ -0,0 +1,418 @@ +# 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. + +# The monitoring type category:service-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring +category: service +# Monitoring application type name (consistent with file name) eg: linux windows tomcat mysql aws... +app: netease_mailbox +# The app api i18n name +name: + zh-CN: 网易邮箱监控 + en-US: NetEase Mailbox +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 使用 IMAP 协议对网易邮箱的详细信息进行采集监控。
您可以点击“新建 POP3”并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: HertzBeat uses IMAP protocol to collect detailed metrics of NetEase mailbox.
You can click "New POP3" and configure it, or select "More Operations" to import the existing configuration. + zh-TW: HertzBeat 使用 IMAP 協議對網易郵箱的詳細信息進行採集監控。
您可以點擊“新建 POP3”並進行配置,或者選擇“更多操作”,導入已有配置。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/imap + en-US: https://hertzbeat.apache.org/docs/help/imap +# Input params define for app api(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 + # type-param field type(most mapping the html input type) + type: host + # required-true or false + required: true + # field-param field key + - field: ssl + # name-param field display i18n name + name: + zh-CN: 启动SSL + en-US: SSL + # When the type is boolean, the frontend will display a switch for it. + type: boolean + # required-true or false + required: false + - 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 + # 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: email + # name-param field display i18n name + name: + zh-CN: 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 + required: true + # field-param field key + - field: authorize + # name-param field display i18n name + name: + zh-CN: 授权码 + en-US: Authorize Code + # 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 + required: true + +# collect metrics config list +metrics: + # metrics - available + - name: available + i18n: + zh-CN: 可用性 + en-US: Available + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: responseTime + type: 0 + unit: ms + i18n: + zh-CN: 响应时间 + en-US: Response Time + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: placeholder + + - name: inboxInfo + i18n: + zh-CN: 收件箱信息 + en-US: Inbox info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total message count + - field: recentMessageCount + type: 0 + i18n: + zh-CN: 最近收到邮件总数 + en-US: Recent message count + - field: unseenMessageCount + type: 0 + i18n: + zh-CN: 未读邮件总数 + 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 + - INBOXRecentMessageCount + - INBOXUnseenMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = INBOXTotalMessageCount + - recentMessageCount = INBOXRecentMessageCount + - unseenMessageCount = INBOXUnseenMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: INBOX + + - name: sentInfo + i18n: + zh-CN: 已发送信息 + en-US: Sent info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total 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 + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = 已发送TotalMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: 已发送 + + - name: draftsInfo + i18n: + zh-CN: 草稿箱信息 + en-US: Drafts info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total 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 + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = 草稿箱TotalMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: 草稿箱 + + - name: deletedMessagesInfo + i18n: + zh-CN: 已删除信息 + en-US: Deleted Messages info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total 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 + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = 已删除TotalMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: 已删除 + + - name: JunkInfo + i18n: + zh-CN: 垃圾箱信息 + en-US: Junk info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total message count + - field: recentMessageCount + type: 0 + i18n: + zh-CN: 最近收到邮件总数 + en-US: Recent message count + - field: unseenMessageCount + type: 0 + i18n: + zh-CN: 未读邮件总数 + 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 + - 垃圾邮件RecentMessageCount + - 垃圾邮件UnseenMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = 垃圾邮件TotalMessageCount + - recentMessageCount = 垃圾邮件RecentMessageCount + - unseenMessageCount = 垃圾邮件UnseenMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: 垃圾邮件 + + - name: virusInfo + i18n: + zh-CN: 病毒邮件信息 + en-US: Virus Info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total message count + - field: recentMessageCount + type: 0 + i18n: + zh-CN: 最近收到邮件总数 + en-US: Recent message count + - field: unseenMessageCount + type: 0 + i18n: + zh-CN: 未读邮件总数 + 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 + - 病毒邮件RecentMessageCount + - 病毒邮件UnseenMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = 病毒邮件TotalMessageCount + - recentMessageCount = 病毒邮件RecentMessageCount + - unseenMessageCount = 病毒邮件UnseenMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: 病毒邮件 diff --git a/manager/src/main/resources/define/app-opensuse.yml b/manager/src/main/resources/define/app-opensuse.yml index cc3a7432ed0..75546e737d5 100644 --- a/manager/src/main/resources/define/app-opensuse.yml +++ b/manager/src/main/resources/define/app-opensuse.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-qq_mailbox.yml b/manager/src/main/resources/define/app-qq_mailbox.yml new file mode 100644 index 00000000000..785708c57f2 --- /dev/null +++ b/manager/src/main/resources/define/app-qq_mailbox.yml @@ -0,0 +1,418 @@ +# 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. + +# The monitoring type category:service-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring +category: service +# Monitoring application type name (consistent with file name) eg: linux windows tomcat mysql aws... +app: qq_mailbox +# The app api i18n name +name: + zh-CN: QQ 邮箱监控 + en-US: QQ Mailbox +# The description and help of this monitoring type +help: + zh-CN: HertzBeat 使用 IMAP 协议对 QQ 邮箱的详细信息进行采集监控。
您可以点击“新建 POP3”并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: HertzBeat uses IMAP protocol to collect detailed metrics of QQ mailbox.
You can click "New POP3" and configure it, or select "More Operations" to import the existing configuration. + zh-TW: HertzBeat 使用 IMAP 協議對 QQ 郵箱的詳細信息進行採集監控。
您可以點擊“新建 POP3”並進行配置,或者選擇“更多操作”,導入已有配置。 +helpLink: + zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/imap + en-US: https://hertzbeat.apache.org/docs/help/imap +# Input params define for app api(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 + # type-param field type(most mapping the html input type) + type: host + # required-true or false + required: true + # field-param field key + - field: ssl + # name-param field display i18n name + name: + zh-CN: 启动SSL + en-US: SSL + # When the type is boolean, the frontend will display a switch for it. + type: boolean + # required-true or false + required: false + - 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 + # 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: email + # name-param field display i18n name + name: + zh-CN: 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 + required: true + # field-param field key + - field: authorize + # name-param field display i18n name + name: + zh-CN: 授权码 + en-US: Authorize Code + # 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 + required: true + +# collect metrics config list +metrics: + # metrics - available + - name: available + i18n: + zh-CN: 可用性 + en-US: Available + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: responseTime + type: 0 + unit: ms + i18n: + zh-CN: 响应时间 + en-US: Response Time + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: placeholder + + - name: inboxInfo + i18n: + zh-CN: 收件箱信息 + en-US: Inbox info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total message count + - field: recentMessageCount + type: 0 + i18n: + zh-CN: 最近收到邮件总数 + en-US: Recent message count + - field: unseenMessageCount + type: 0 + i18n: + zh-CN: 未读邮件总数 + 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 + - INBOXRecentMessageCount + - INBOXUnseenMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = INBOXTotalMessageCount + - recentMessageCount = INBOXRecentMessageCount + - unseenMessageCount = INBOXUnseenMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: INBOX + + - name: sentInfo + i18n: + zh-CN: 已发送信息 + en-US: Sent info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total 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: + - Sent MessagesTotalMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = Sent MessagesTotalMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: Sent Messages + + - name: draftsInfo + i18n: + zh-CN: 草稿箱信息 + en-US: Drafts info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total 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: + - DraftsTotalMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = DraftsTotalMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: Drafts + + - name: deletedMessagesInfo + i18n: + zh-CN: 已删除信息 + en-US: Deleted Messages info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total 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: + - Deleted MessagesTotalMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = Deleted MessagesTotalMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: Deleted Messages + + - name: JunkInfo + i18n: + zh-CN: 垃圾箱信息 + en-US: Junk info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total message count + - field: recentMessageCount + type: 0 + i18n: + zh-CN: 最近收到邮件总数 + en-US: Recent message count + - field: unseenMessageCount + type: 0 + i18n: + zh-CN: 未读邮件总数 + 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: + - JunkTotalMessageCount + - JunkRecentMessageCount + - JunkUnseenMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = JunkTotalMessageCount + - recentMessageCount = JunkRecentMessageCount + - unseenMessageCount = JunkUnseenMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: Junk + + - name: QQMailInfo + i18n: + zh-CN: QQ邮件订阅信息 + en-US: QQ Mail Subscribe Info + # 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 + # collect metrics content + fields: + # field-metric name, type-metric type(0-number,1-string), instance-is instance primary key, unit-metric unit + - field: allMessageCount + type: 0 + i18n: + zh-CN: 邮件总数 + en-US: Total message count + - field: recentMessageCount + type: 0 + i18n: + zh-CN: 最近收到邮件总数 + en-US: Recent message count + - field: unseenMessageCount + type: 0 + i18n: + zh-CN: 未读邮件总数 + 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: + - 其他文件夹/QQ邮件订阅TotalMessageCount + - 其他文件夹/QQ邮件订阅RecentMessageCount + - 其他文件夹/QQ邮件订阅UnseenMessageCount + # mapping and conversion expressions, use these and aliasField above to calculate metrics value + calculates: + - allMessageCount = 其他文件夹/QQ邮件订阅TotalMessageCount + - recentMessageCount = 其他文件夹/QQ邮件订阅RecentMessageCount + - unseenMessageCount = 其他文件夹/QQ邮件订阅UnseenMessageCount + # the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk + protocol: imap + # Specific collection configuration when protocol is http protocol + imap: + # http host: ipv4 ipv6 domain + host: ^_^host^_^ + # http port + port: ^_^port^_^ + # timeout + timeout: ^_^timeout^_^ + # enable SSL/TLS, that is, whether it is http or https, the default is false + ssl: ^_^ssl^_^ + # email + email: ^_^email^_^ + # authorize code + authorize: ^_^authorize^_^ + # mailbox folder name + folderName: 其他文件夹/QQ邮件订阅 diff --git a/manager/src/main/resources/define/app-redhat.yml b/manager/src/main/resources/define/app-redhat.yml index f51ab1a6a3b..d9f47b8e091 100644 --- a/manager/src/main/resources/define/app-redhat.yml +++ b/manager/src/main/resources/define/app-redhat.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-rockylinux.yml b/manager/src/main/resources/define/app-rockylinux.yml index 7987b3db4fa..e608572e60e 100644 --- a/manager/src/main/resources/define/app-rockylinux.yml +++ b/manager/src/main/resources/define/app-rockylinux.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-ubuntu.yml b/manager/src/main/resources/define/app-ubuntu.yml index 43284a31012..3a5d3e0fbd7 100644 --- a/manager/src/main/resources/define/app-ubuntu.yml +++ b/manager/src/main/resources/define/app-ubuntu.yml @@ -466,7 +466,7 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow - name: top_mem_process @@ -507,5 +507,5 @@ metrics: privateKey: ^_^privateKey^_^ timeout: ^_^timeout^_^ reuseConnection: ^_^reuseConnection^_^ - script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf "&"; } print ""}' | head -n 11 + script: ps aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {printf "%s %s %s ", $2, $3, $4; for (i=11; i<=NF; i++) { printf "%s", $i; if (i < NF) printf " "; } print ""}' | head -n 11 parseType: multiRow diff --git a/manager/src/main/resources/define/app-zookeeper.yml b/manager/src/main/resources/define/app-zookeeper.yml index dea1f4e8dd5..7708c94beef 100644 --- a/manager/src/main/resources/define/app-zookeeper.yml +++ b/manager/src/main/resources/define/app-zookeeper.yml @@ -242,3 +242,119 @@ metrics: port: ^_^port^_^ timeout: ^_^timeout^_^ cmd: mntr + - name: envi + priority: 1 + fields: + - field: zk_version + type: 1 + i18n: + zh-CN: ZooKeeper版本 + en-US: ZooKeeper Version + - field: hostname + type: 1 + i18n: + zh-CN: 主机名 + en-US: Host Name + - field: java_version + type: 1 + i18n: + zh-CN: Java版本 + en-US: Java Version + - field: java_vendor + type: 1 + i18n: + zh-CN: Java供应商 + en-US: Java Vendor + - field: java_home + type: 1 + i18n: + zh-CN: Java主目录 + en-US: Java Home + - field: java_class_path + type: 1 + i18n: + zh-CN: Java类路径 + en-US: Java Class Path + - field: java_library_path + type: 1 + i18n: + zh-CN: Java库路径 + en-US: Java Library Path + - field: java_io_tmpdir + type: 1 + i18n: + zh-CN: Java临时目录 + en-US: Java IO Temp Directory + - field: java_compiler + type: 1 + i18n: + zh-CN: Java编译器 + en-US: Java Compiler + - field: os_name + type: 1 + i18n: + zh-CN: 操作系统名称 + en-US: OS Name + - field: os_arch + type: 1 + i18n: + zh-CN: 操作系统架构 + en-US: OS Architecture + - field: os_version + type: 1 + i18n: + zh-CN: 操作系统版本 + en-US: OS Version + - field: user_name + type: 1 + i18n: + zh-CN: 用户名 + en-US: User Name + - field: user_home + type: 1 + i18n: + zh-CN: 用户主目录 + en-US: User Home + - field: user_dir + type: 1 + i18n: + zh-CN: 用户当前目录 + en-US: User Directory + aliasFields: + - zookeeper.version + - host.name + - java.version + - java.vendor + - user.dir + - java.home + - java.class.path + - java.library.path + - java.io.tmpdir + - java.compiler + - os.name + - os.arch + - os.version + - user.name + - user.home + calculates: + - zk_version=zookeeper.version + - hostname=host.name + - java_version=java.version + - java_vendor=java.vendor + - user_dir=user.dir + - java_home=java.home + - java_class_path=java.class.path + - java_library_path=java.library.path + - java_io_tmpdir=java.io.tmpdir + - java_compiler=java.compiler + - os_name=os.name + - os_arch=os.arch + - os_version=os.version + - user_name=user.name + - user_home=user.home + protocol: telnet + telnet: + host: ^_^host^_^ + port: ^_^port^_^ + timeout: ^_^timeout^_^ + cmd: envi \ No newline at end of file diff --git a/manager/src/test/java/org/apache/hertzbeat/manager/scheduler/ConsistentHashTest.java b/manager/src/test/java/org/apache/hertzbeat/manager/scheduler/ConsistentHashTest.java new file mode 100644 index 00000000000..cb2132359b8 --- /dev/null +++ b/manager/src/test/java/org/apache/hertzbeat/manager/scheduler/ConsistentHashTest.java @@ -0,0 +1,100 @@ +/* + * 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.manager.scheduler; + +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import org.apache.hertzbeat.common.util.SnowFlakeIdGenerator; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Test case for {@link ConsistentHash} + */ +public class ConsistentHashTest { + + private ConsistentHash consistentHash; + + @BeforeEach + void setUp() { + consistentHash = new ConsistentHash(); + } + + @Test + void testAddNode() { + String job1 = "job1"; + long jobId1 = SnowFlakeIdGenerator.generateId(); + String job2 = "job2"; + long jobId2 = SnowFlakeIdGenerator.generateId(); + String job3 = "job3"; + long jobId3 = SnowFlakeIdGenerator.generateId(); + ConsistentHash.Node node1 = new ConsistentHash.Node("node1", "public","192.168.0.1", System.currentTimeMillis(), (byte) 10); + ConsistentHash.Node node2 = new ConsistentHash.Node("node2", "public","192.168.0.2", System.currentTimeMillis(), (byte) 10); + consistentHash.addNode(node1); + consistentHash.dispatchJob(job1, jobId1); + consistentHash.dispatchJob(job2, jobId2); + consistentHash.dispatchJob(job3, jobId3); + consistentHash.addNode(node2); + assertTrue(node2.getAssignJobs().getAddingJobs().containsAll(node1.getAssignJobs().getRemovingJobs())); + assertTrue(node2.getAssignJobs().getAddingJobs().containsAll(node2.getAssignJobs().getRemovingJobs())); + assertSame(consistentHash.getNode("node1"), node1); + assertSame(consistentHash.getNode("node2"), node2); + } + + @Test + void testDispatchJob() { + String job1 = "job1"; + long jobId1 = SnowFlakeIdGenerator.generateId(); + ConsistentHash.Node res1 = consistentHash.dispatchJob(job1, jobId1); + assertNull(res1); + ConsistentHash.Node node1 = new ConsistentHash.Node("node1", "public","192.168.0.1", System.currentTimeMillis(), (byte) 10); + consistentHash.addNode(node1); + String job2 = "job2"; + long jobId2 = SnowFlakeIdGenerator.generateId(); + ConsistentHash.Node res2 = consistentHash.dispatchJob(job2, jobId2); + assertSame(res2, node1); + assertTrue(consistentHash.getDispatchJobCache().isEmpty()); + } + + @Test + void testRemoveNode() { + String job1 = "job1"; + long jobId1 = SnowFlakeIdGenerator.generateId(); + String job2 = "job2"; + long jobId2 = SnowFlakeIdGenerator.generateId(); + String job3 = "job3"; + long jobId3 = SnowFlakeIdGenerator.generateId(); + ConsistentHash.Node node1 = new ConsistentHash.Node("node1", "public", "192.168.0.1", System.currentTimeMillis(), (byte) 10); + ConsistentHash.Node node2 = new ConsistentHash.Node("node2", "public", "192.168.0.2", System.currentTimeMillis(), (byte) 10); + consistentHash.addNode(node1); + consistentHash.addNode(node2); + consistentHash.dispatchJob(job1, jobId1); + consistentHash.dispatchJob(job2, jobId2); + consistentHash.dispatchJob(job3, jobId3); + consistentHash.removeNode(node2.getIdentity()); + assertTrue(node1.getAssignJobs().getAddingJobs().containsAll(node2.getAssignJobs().getRemovingJobs())); + assertSame(consistentHash.getNode("node1"), node1); + assertNull(consistentHash.getNode("node2")); + consistentHash.removeNode(node1.getIdentity()); + assertEquals(3, consistentHash.getDispatchJobCache().size()); + } + +} + \ No newline at end of file diff --git a/manager/src/test/java/org/apache/hertzbeat/manager/service/TagServiceTest.java b/manager/src/test/java/org/apache/hertzbeat/manager/service/TagServiceTest.java index 1c8ab77cf42..f8f7bdc73c0 100644 --- a/manager/src/test/java/org/apache/hertzbeat/manager/service/TagServiceTest.java +++ b/manager/src/test/java/org/apache/hertzbeat/manager/service/TagServiceTest.java @@ -26,11 +26,14 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.reset; import static org.mockito.Mockito.when; + import java.util.Collections; import java.util.HashSet; import java.util.Optional; import org.apache.hertzbeat.common.entity.manager.Tag; +import org.apache.hertzbeat.common.support.exception.CommonException; import org.apache.hertzbeat.manager.dao.TagDao; +import org.apache.hertzbeat.manager.dao.TagMonitorBindDao; import org.apache.hertzbeat.manager.service.impl.TagServiceImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -53,6 +56,9 @@ class TagServiceTest { @Mock private TagDao tagDao; + @Mock + private TagMonitorBindDao tagMonitorBindDao; + @Test void addTags() { when(tagDao.saveAll(anyList())).thenReturn(anyList()); @@ -80,6 +86,13 @@ void getTags() { @Test void deleteTags() { doNothing().when(tagDao).deleteTagsByIdIn(anySet()); + when(tagMonitorBindDao.countByTagIdIn(anySet())).thenReturn(0L); assertDoesNotThrow(() -> tagService.deleteTags(new HashSet<>(1))); } + + @Test + void deleteUsingTags() { + when(tagMonitorBindDao.countByTagIdIn(anySet())).thenReturn(1L); + assertThrows(CommonException.class,() -> tagService.deleteTags(new HashSet<>(1))); + } } diff --git a/material/licenses/LICENSE b/material/licenses/LICENSE index 027ab61f393..db28f69455a 100644 --- a/material/licenses/LICENSE +++ b/material/licenses/LICENSE @@ -392,6 +392,9 @@ The text of each license is the standard Apache 2.0 license. https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf/3.2.3 Apache-2.0 + https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-webflux/3.2.3 Apache-2.0 + https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-reactor-netty/3.2.3 Apache-2.0 + https://mvnrepository.com/artifact/org.springframework/spring-webflux/6.1.4 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web/3.2.3 Apache-2.0 @@ -528,6 +531,7 @@ The text of each license is also included in licenses/LICENSE-[project].txt. https://mvnrepository.com/artifact/org.slf4j/slf4j-api/2.0.9 MIT https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket/1.5.2 https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver/3.0.0 + https://mvnrepository.com/artifact/com.beetstra.jutf7/jutf7/1.0.0 ======================================================================== MPL-1.1 licenses diff --git a/material/licenses/backend/LICENSE b/material/licenses/backend/LICENSE index 27dc1b9ec39..4f00a926f5b 100644 --- a/material/licenses/backend/LICENSE +++ b/material/licenses/backend/LICENSE @@ -392,6 +392,9 @@ The text of each license is the standard Apache 2.0 license. https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-logging/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-mail/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-thymeleaf/3.2.3 Apache-2.0 + https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-webflux/3.2.3 Apache-2.0 + https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-reactor-netty/3.2.3 Apache-2.0 + https://mvnrepository.com/artifact/org.springframework/spring-webflux/6.1.4 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation/3.2.3 Apache-2.0 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web/3.2.3 Apache-2.0 @@ -528,6 +531,7 @@ The text of each license is also included in licenses/LICENSE-[project].txt. https://mvnrepository.com/artifact/org.slf4j/slf4j-api/2.0.9 MIT https://mvnrepository.com/artifact/org.java-websocket/Java-WebSocket/1.5.2 https://mvnrepository.com/artifact/com.taosdata.jdbc/taos-jdbcdriver/3.0.0 + https://mvnrepository.com/artifact/com.beetstra.jutf7/jutf7/1.0.0 ======================================================================== MPL-1.1 licenses diff --git a/material/licenses/backend/LICENSE-jutf7.txt b/material/licenses/backend/LICENSE-jutf7.txt new file mode 100644 index 00000000000..fcff7d5c026 --- /dev/null +++ b/material/licenses/backend/LICENSE-jutf7.txt @@ -0,0 +1,20 @@ +Copyright (c) 2006,2008 J.T. Beetstra + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/material/licenses/collector/LICENSE b/material/licenses/collector/LICENSE index 2ec7f4c0348..1fbaa5618eb 100644 --- a/material/licenses/collector/LICENSE +++ b/material/licenses/collector/LICENSE @@ -394,6 +394,7 @@ The text of each license is also included in licenses/LICENSE-[project].txt. https://mvnrepository.com/artifact/org.slf4j/jcl-over-slf4j/2.0.9 MIT https://mvnrepository.com/artifact/org.slf4j/jul-to-slf4j/2.0.9 MIT https://mvnrepository.com/artifact/org.slf4j/slf4j-api/2.0.9 MIT + https://mvnrepository.com/artifact/com.beetstra.jutf7/jutf7/1.0.0 ======================================================================== MIT-0 licenses diff --git a/material/licenses/collector/LICENSE-jutf7.txt b/material/licenses/collector/LICENSE-jutf7.txt new file mode 100644 index 00000000000..fcff7d5c026 --- /dev/null +++ b/material/licenses/collector/LICENSE-jutf7.txt @@ -0,0 +1,20 @@ +Copyright (c) 2006,2008 J.T. Beetstra + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 60a476dda7a..0cb8d67aa96 100644 --- a/pom.xml +++ b/pom.xml @@ -138,6 +138,7 @@ 4.4 3.2.1 3.10.0 + 0.8.11 @@ -461,6 +462,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco-maven-plugin.version} + + + + prepare-agent + + + + report + test + + report + + + +
diff --git a/script/application.yml b/script/application.yml index a2421f2418e..d5118623c5a 100644 --- a/script/application.yml +++ b/script/application.yml @@ -12,7 +12,6 @@ # 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. - server: port: 1157 spring: @@ -29,12 +28,13 @@ spring: static-locations: - classpath:/dist/ - classpath:../dist/ - # need to disable spring boot mongodb auto config, or default mongodb connection tried and failed.. + # 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 freemarker: enabled: false + management: health: mail: @@ -48,6 +48,7 @@ management: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -73,36 +74,60 @@ spring: max-lifetime: 120000 jpa: - hibernate: - ddl-auto: update - - # Not Require, Please config if you need email notify - # 非必填:不使用邮箱作为警告通知可以去掉spring.mail配置 + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform + database: h2 + properties: + eclipselink: + logging: + level: SEVERE + + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} + mail: - # Attention: this is mail server address. - # 请注意此为邮件服务器地址:qq邮箱为 smtp.qq.com qq企业邮箱为 smtp.exmail.qq.com + # Mail server address, eg: qq-mailbox is smtp.qq.com, qq-exmail is smtp.exmail.qq.com host: smtp.qq.com - username: example@apache.org - # Attention: this is not email account password, this requires an email authorization code + username: tancloud@qq.com + # Attention this is not email account password, this requires an email authorization code # 请注意此非邮箱账户密码 此需填写邮箱授权码 - password: example + password: your-password + # Mailbox smtp server port, eg: qq-mailbox is 465, qq-exmail is 587 port: 465 - default-encoding: UTF-8 properties: mail: smtp: socketFactoryClass: javax.net.ssl.SSLSocketFactory ssl: enable: true - debug: false + +common: + queue: + # memory or kafka + type: memory + # properties when queue type is kafka + kafka: + servers: 127.0.0.1:9092 + metrics-data-topic: async-metrics-data + alerts-data-topic: async-alerts-data warehouse: store: -# store history metrics data, enable only one below -# 存储历史数据方式, 下方只能enabled启用一种方式 + # store history metrics data, enable only one below + # 存储历史数据方式, 下方只能 enabled 启用一种方式 jpa: enabled: true + # The maximum retention time for history records, after which records will be deleted expire-time: 1h + # The maximum number of history records retained, if this number is exceeded, half of the data in this configuration item will be deleted + # (please set this configuration reasonably as history records can affect performance when it is large) + # 历史数据的最大保留条数,超过此数量时,将会删除一半于此配量的数据(由于历史数据较大时会影响性能,请合理设置此配置) + max-history-record-num: 6000 victoria-metrics: enabled: false url: http://localhost:8428 @@ -123,10 +148,7 @@ warehouse: rpc-port: 6667 username: root password: root - # org.apache.hertzbeat.warehouse.config.IotDbVersion: V_0_13 || V_1_0 - version: V_1_0 query-timeout-in-ms: -1 - # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) # data expire time, unit:ms, default '7776000000'(90 days, -1:never expire) expire-time: '7776000000' influxdb: @@ -136,9 +158,9 @@ warehouse: password: root expire-time: '30d' replication: 1 - -# store real-time metrics data, enable only one below -# 存储实时数据方式, 下方只能enabled启用一种方式 + + # store real-time metrics data, enable only one below + # 存储实时数据方式, 下方只能 enabled 启用一种方式 memory: enabled: true init-size: 16 @@ -147,20 +169,26 @@ warehouse: host: 127.0.0.1 port: 6379 password: 123456 + # redis db index, default: DB0 + db: 0 alerter: # custom console url - console-url: https://hertzbeat.apache.org - -common: - queue: - # memory or kafka - type: memory - # properties when queue type is kafka - kafka: - servers: 127.0.0.1:9092 - metrics-data-topic: async-metrics-data - alerts-data-topic: async-alerts-data + console-url: https://console.tancloud.cn + # 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 + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: diff --git a/script/docker-compose/README.md b/script/docker-compose/README.md index 2af823ea563..6f7fd427d33 100644 --- a/script/docker-compose/README.md +++ b/script/docker-compose/README.md @@ -1,6 +1,9 @@ ## Docker-Compose Deploy +Suggest the [HertzBeat + VictoriaMetrics + Postgresql Solution](hertzbeat-postgresql-victoria-metrics) for the best performance and stability. + +- Use Postgresql + VictoriaMetrics as Hertzbeat dependent storage -> [HertzBeat+PostgreSQL+VictoriaMetrics Solution](hertzbeat-postgresql-victoria-metrics) - Use Mysql + VictoriaMetrics as Hertzbeat dependent storage -> [HertzBeat+Mysql+VictoriaMetrics Solution](hertzbeat-mysql-victoria-metrics) - Use Mysql + IoTDB as Hertzbeat dependent storage -> [HertzBeat+Mysql+IoTDB Solution](hertzbeat-mysql-iotdb) - Use Mysql + Tdengine as Hertzbeat dependent storage -> [HertzBeat+Mysql+Tdengine Solution](hertzbeat-mysql-tdengine) -- Use Postgresql + IoTDB as Hertzbeat dependent storage -> [HertzBeat+PostgreSQL+IoTDB Solution](hertzbeat-postgresql-iotdb) + diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/README.md b/script/docker-compose/hertzbeat-mysql-iotdb/README.md index 9461296afd4..e96f7bda2a9 100644 --- a/script/docker-compose/hertzbeat-mysql-iotdb/README.md +++ b/script/docker-compose/hertzbeat-mysql-iotdb/README.md @@ -17,8 +17,12 @@ 1. Download the hertzbeat-docker-compose installation deployment script file The script file is located in `script/docker-compose/hertzbeat-mysql-iotdb` link [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/ hertzbeat-mysql-iotdb) +2. Add MYSQL jdbc driver jar -2. Enter the deployment script docker-compose directory, execute + Download the MYSQL jdbc driver jar package, such as mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 + Copy the jar package to the ext-lib directory. + +3. Enter the deployment script docker-compose directory, execute `docker compose up -d` diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/README_CN.md b/script/docker-compose/hertzbeat-mysql-iotdb/README_CN.md index 624c61866b5..498c92a1597 100644 --- a/script/docker-compose/hertzbeat-mysql-iotdb/README_CN.md +++ b/script/docker-compose/hertzbeat-mysql-iotdb/README_CN.md @@ -17,10 +17,13 @@ ##### docker compose部署hertzbeat及其依赖服务 1. 下载hertzbeat-docker-compose安装部署脚本文件 - 脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-iotdb` 链接 [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-iotdb) + 脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-iotdb` 链接 [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-iotdb) +2. 添加 MYSQL jdbc 驱动 jar + 下载 MYSQL jdbc driver jar, 例如 mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 + 将此 jar 包拷贝放入 ext-lib 目录下. -2. 进入部署脚本 docker-compose 目录, 执行 +3. 进入部署脚本 docker-compose 目录, 执行 `docker compose up -d` diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/conf/application.yml b/script/docker-compose/hertzbeat-mysql-iotdb/conf/application.yml index 66c9bb0d935..436f2d99bd7 100644 --- a/script/docker-compose/hertzbeat-mysql-iotdb/conf/application.yml +++ b/script/docker-compose/hertzbeat-mysql-iotdb/conf/application.yml @@ -48,6 +48,7 @@ management: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -58,6 +59,7 @@ sureness: 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp' + --- spring: config: @@ -72,9 +74,22 @@ spring: hikari: max-lifetime: 120000 jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform database: mysql - hibernate: - ddl-auto: update + properties: + eclipselink: + logging: + level: SEVERE + + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} + # Not Require, Please config if you need email notify # 非必填:不使用邮箱作为警告通知可以去掉spring.mail配置 mail: @@ -107,9 +122,6 @@ warehouse: rpc-port: 6667 username: root password: root - # org.apache.hertzbeat.warehouse.config.IotDbVersion: V_0_13 || V_1_0 - # 如果你使用docker-compose-1.0.yaml, 不要忘记修i该version为V_1_0 - version: V_1_0 query-timeout-in-ms: -1 # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) # data expire time, unit:ms, default '7776000000'(90 days, -1:never expire) @@ -129,13 +141,27 @@ common: queue: # memory or kafka type: memory - # properties when queue type is kafka - kafka: - servers: 127.0.0.1:9092 - metrics-data-topic: async-metrics-data - alerts-data-topic: async-alerts-data + +alerter: + # custom console url + console-url: https://console.tancloud.cn + # 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 + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: enabled: true port: 1158 + diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/docker-compose.yaml b/script/docker-compose/hertzbeat-mysql-iotdb/docker-compose.yaml index 32d14b498a9..e7716c86f7c 100644 --- a/script/docker-compose/hertzbeat-mysql-iotdb/docker-compose.yaml +++ b/script/docker-compose/hertzbeat-mysql-iotdb/docker-compose.yaml @@ -78,6 +78,8 @@ services: volumes: - ./conf/application.yml:/opt/hertzbeat/config/application.yml - ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml + - ./ext-lib:/opt/hertzbeat/ext-lib + - ./logs:/opt/hertzbeat/logs ports: - "1157:1157" - "1158:1158" diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/ext-lib/.gitignore b/script/docker-compose/hertzbeat-mysql-iotdb/ext-lib/.gitignore new file mode 100644 index 00000000000..c087c266df0 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-iotdb/ext-lib/.gitignore @@ -0,0 +1,2 @@ +!.gitignore +*.jar diff --git a/script/docker-compose/hertzbeat-mysql-iotdb/ext-lib/README b/script/docker-compose/hertzbeat-mysql-iotdb/ext-lib/README new file mode 100644 index 00000000000..5898fde6b91 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-iotdb/ext-lib/README @@ -0,0 +1,21 @@ +# 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. + +Please move external libs to this folder like: + +ojdbc8-21.5.0.0.jar +orai18n-21.5.0.0.jar +mysql-connector-java-8.0.30.jar + diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/README.md b/script/docker-compose/hertzbeat-mysql-tdengine/README.md index dba1bce6f35..14b24c20fb8 100644 --- a/script/docker-compose/hertzbeat-mysql-tdengine/README.md +++ b/script/docker-compose/hertzbeat-mysql-tdengine/README.md @@ -17,12 +17,16 @@ 1. Download the hertzbeat-docker-compose installation deployment script file The script file is located in `script/docker-compose/hertzbeat-mysql-tdengine` link [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-tdengine) +2. Add MYSQL jdbc driver jar -2. Enter the deployment script docker-compose directory, execute + Download the MYSQL jdbc driver jar package, such as mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 + Copy the jar package to the ext-lib directory. + +3. Enter the deployment script docker-compose directory, execute `docker compose up -d` -3. Enter tdengine to create hertzbeat database +4. Enter tdengine to create hertzbeat database ```shell $ docker exec -it tdengine /bin/bash diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/README_CN.md b/script/docker-compose/hertzbeat-mysql-tdengine/README_CN.md index 7530617cca0..4fce7449449 100644 --- a/script/docker-compose/hertzbeat-mysql-tdengine/README_CN.md +++ b/script/docker-compose/hertzbeat-mysql-tdengine/README_CN.md @@ -19,12 +19,15 @@ 1. 下载hertzbeat-docker-compose安装部署脚本文件 脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-tdengine` 链接 [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-tdengine) +2. 添加 MYSQL jdbc 驱动 jar + 下载 MYSQL jdbc driver jar, 例如 mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 + 将此 jar 包拷贝放入 ext-lib 目录下. -2. 进入部署脚本 docker-compose 目录, 执行 +3. 进入部署脚本 docker-compose 目录, 执行 `docker compose up -d` -3. 进入tdengine创建hertzbeat数据库 +4. 进入tdengine创建hertzbeat数据库 ```bash $ docker exec -it tdengine /bin/bash diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/conf/application.yml b/script/docker-compose/hertzbeat-mysql-tdengine/conf/application.yml index c5f4753f313..c3eaece6453 100644 --- a/script/docker-compose/hertzbeat-mysql-tdengine/conf/application.yml +++ b/script/docker-compose/hertzbeat-mysql-tdengine/conf/application.yml @@ -48,6 +48,7 @@ management: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -58,6 +59,7 @@ sureness: 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp' + --- spring: config: @@ -72,9 +74,22 @@ spring: hikari: max-lifetime: 120000 jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform database: mysql - hibernate: - ddl-auto: update + properties: + eclipselink: + logging: + level: SEVERE + + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} + # Not Require, Please config if you need email notify # 非必填:不使用邮箱作为警告通知可以去掉spring.mail配置 mail: @@ -96,8 +111,8 @@ spring: warehouse: store: -# store history metrics data, enable only one below -# 存储历史数据方式, 下方只能enabled启用一种方式 + # store history metrics data, enable only one below + # 存储历史数据方式, 下方只能enabled启用一种方式 jpa: enabled: false expire-time: 1h @@ -107,8 +122,6 @@ warehouse: url: jdbc:TAOS-RS://tdengine:6041/hertzbeat username: root password: taosdata -# store real-time metrics data, enable only one below -# 存储实时数据方式, 下方只能enabled启用一种方式 memory: enabled: true init-size: 16 @@ -122,13 +135,27 @@ common: queue: # memory or kafka type: memory - # properties when queue type is kafka - kafka: - servers: 127.0.0.1:9092 - metrics-data-topic: async-metrics-data - alerts-data-topic: async-alerts-data + +alerter: + # custom console url + console-url: https://console.tancloud.cn + # 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 + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: enabled: true port: 1158 + diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/docker-compose.yaml b/script/docker-compose/hertzbeat-mysql-tdengine/docker-compose.yaml index a632bfb0934..3b449cfb214 100644 --- a/script/docker-compose/hertzbeat-mysql-tdengine/docker-compose.yaml +++ b/script/docker-compose/hertzbeat-mysql-tdengine/docker-compose.yaml @@ -77,6 +77,8 @@ services: volumes: - ./conf/application.yml:/opt/hertzbeat/config/application.yml - ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml + - ./ext-lib:/opt/hertzbeat/ext-lib + - ./logs:/opt/hertzbeat/logs ports: - "1157:1157" - "1158:1158" diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/ext-lib/.gitignore b/script/docker-compose/hertzbeat-mysql-tdengine/ext-lib/.gitignore new file mode 100644 index 00000000000..c087c266df0 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-tdengine/ext-lib/.gitignore @@ -0,0 +1,2 @@ +!.gitignore +*.jar diff --git a/script/docker-compose/hertzbeat-mysql-tdengine/ext-lib/README b/script/docker-compose/hertzbeat-mysql-tdengine/ext-lib/README new file mode 100644 index 00000000000..5898fde6b91 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-tdengine/ext-lib/README @@ -0,0 +1,21 @@ +# 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. + +Please move external libs to this folder like: + +ojdbc8-21.5.0.0.jar +orai18n-21.5.0.0.jar +mysql-connector-java-8.0.30.jar + diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/README.md b/script/docker-compose/hertzbeat-mysql-victoria-metrics/README.md index 59ee57107b0..8c22307f333 100644 --- a/script/docker-compose/hertzbeat-mysql-victoria-metrics/README.md +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/README.md @@ -17,8 +17,12 @@ 1. Download the hertzbeat-docker-compose installation deployment script file The script file is located in `script/docker-compose/hertzbeat-mysql-victoria-metrics` link [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-victoria-metrics) +2. Add MYSQL jdbc driver jar -2. Enter the deployment script docker-compose directory, execute + Download the MYSQL jdbc driver jar package, such as mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 + Copy the jar package to the ext-lib directory. + +3. Enter the deployment script docker-compose directory, execute `docker compose up -d` diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/README_CN.md b/script/docker-compose/hertzbeat-mysql-victoria-metrics/README_CN.md index 4c34978f414..2abef233d7f 100644 --- a/script/docker-compose/hertzbeat-mysql-victoria-metrics/README_CN.md +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/README_CN.md @@ -19,8 +19,11 @@ 1. 下载hertzbeat-docker-compose安装部署脚本文件 脚本文件位于代码仓库下`script/docker-compose/hertzbeat-mysql-victoria-metrics` 链接 [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-mysql-mysql-victoria-metrics) +2. 添加 MYSQL jdbc 驱动 jar + 下载 MYSQL jdbc driver jar, 例如 mysql-connector-java-8.0.26.jar. https://mvnrepository.com/artifact/com.mysql/mysql-connector-j/8.1.0 + 将此 jar 包拷贝放入 ext-lib 目录下. -2. 进入部署脚本 docker-compose 目录, 执行 +3. 进入部署脚本 docker-compose 目录, 执行 `docker compose up -d` diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/application.yml b/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/application.yml index ea78aa63956..c48a28dae62 100644 --- a/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/application.yml +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/conf/application.yml @@ -48,6 +48,7 @@ management: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -58,6 +59,7 @@ sureness: 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp' + --- spring: config: @@ -72,9 +74,22 @@ spring: hikari: max-lifetime: 120000 jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.MySQLPlatform database: mysql - hibernate: - ddl-auto: update + properties: + eclipselink: + logging: + level: SEVERE + + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} + # Not Require, Please config if you need email notify # 非必填:不使用邮箱作为警告通知可以去掉spring.mail配置 mail: @@ -96,18 +111,18 @@ spring: warehouse: store: -# store history metrics data, enable only one below -# 存储历史数据方式, 下方只能enabled启用一种方式 + # store history metrics data, enable only one below + # 存储历史数据方式, 下方只能enabled启用一种方式 jpa: enabled: false expire-time: 1h victoria-metrics: enabled: true - url: http://victoria-metrics:8428 + url: http://victoria-metrics:8428 username: root password: root -# store real-time metrics data, enable only one below -# 存储实时数据方式, 下方只能enabled启用一种方式 + # store real-time metrics data, enable only one below + # 存储实时数据方式, 下方只能enabled启用一种方式 memory: enabled: true init-size: 16 @@ -121,11 +136,24 @@ common: queue: # memory or kafka type: memory - # properties when queue type is kafka - kafka: - servers: 127.0.0.1:9092 - metrics-data-topic: async-metrics-data - alerts-data-topic: async-alerts-data + +alerter: + # custom console url + console-url: https://console.tancloud.cn + # 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 + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/dbdata/mysqldata/.gitignore b/script/docker-compose/hertzbeat-mysql-victoria-metrics/dbdata/mysqldata/.gitignore new file mode 100644 index 00000000000..951452536a6 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/dbdata/mysqldata/.gitignore @@ -0,0 +1,3 @@ +!.gitignore +**.** +** diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/dbdata/tsdbdata/.gitignore b/script/docker-compose/hertzbeat-mysql-victoria-metrics/dbdata/tsdbdata/.gitignore new file mode 100644 index 00000000000..951452536a6 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/dbdata/tsdbdata/.gitignore @@ -0,0 +1,3 @@ +!.gitignore +**.** +** diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/docker-compose.yaml b/script/docker-compose/hertzbeat-mysql-victoria-metrics/docker-compose.yaml index 1e2018b1a43..7e30d211b2b 100644 --- a/script/docker-compose/hertzbeat-mysql-victoria-metrics/docker-compose.yaml +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/docker-compose.yaml @@ -77,6 +77,8 @@ services: volumes: - ./conf/application.yml:/opt/hertzbeat/config/application.yml - ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml + - ./ext-lib:/opt/hertzbeat/ext-lib + - ./logs:/opt/hertzbeat/logs ports: - "1157:1157" - "1158:1158" diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/ext-lib/.gitignore b/script/docker-compose/hertzbeat-mysql-victoria-metrics/ext-lib/.gitignore new file mode 100644 index 00000000000..c087c266df0 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/ext-lib/.gitignore @@ -0,0 +1,2 @@ +!.gitignore +*.jar diff --git a/script/docker-compose/hertzbeat-mysql-victoria-metrics/ext-lib/README b/script/docker-compose/hertzbeat-mysql-victoria-metrics/ext-lib/README new file mode 100644 index 00000000000..5898fde6b91 --- /dev/null +++ b/script/docker-compose/hertzbeat-mysql-victoria-metrics/ext-lib/README @@ -0,0 +1,21 @@ +# 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. + +Please move external libs to this folder like: + +ojdbc8-21.5.0.0.jar +orai18n-21.5.0.0.jar +mysql-connector-java-8.0.30.jar + diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/README.md b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/README.md similarity index 74% rename from script/docker-compose/hertzbeat-postgresql-iotdb/README.md rename to script/docker-compose/hertzbeat-postgresql-victoria-metrics/README.md index 7588870b46f..ff4edb7525e 100644 --- a/script/docker-compose/hertzbeat-postgresql-iotdb/README.md +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/README.md @@ -1,7 +1,7 @@ ## docker-compose deployment HertzBeat+PostgreSQL+IoTDB solution -> The docker-compose deployment scheme uses PostgreSQL + IoTDB as the dependent storage service of Hertzbeat. -> This solution will start three container services PostgreSQL, IoTDB, HertzBeat +> The docker-compose deployment scheme uses PostgreSQL + VictoriaMetrics as the dependent storage service of Hertzbeat. +> This solution will start three container services PostgreSQL, VictoriaMetrics, HertzBeat ##### Install Docker & Docker-compose @@ -15,7 +15,7 @@ ##### docker compose deploys hertzbeat and its dependent services 1. Download the hertzbeat-docker-compose installation deployment script file - The script file is located in `script/docker-compose/hertzbeat-postgresql-iotdb` link [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-iotdb) + The script file is located in `script/docker-compose/hertzbeat-postgresql-victoria-metrics` link [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgresql-victoria-metrics) 2. Enter the deployment script docker-compose directory, execute diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/README_CN.md b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/README_CN.md similarity index 71% rename from script/docker-compose/hertzbeat-postgresql-iotdb/README_CN.md rename to script/docker-compose/hertzbeat-postgresql-victoria-metrics/README_CN.md index 653aa4cf10c..88d6ae2f6f6 100644 --- a/script/docker-compose/hertzbeat-postgresql-iotdb/README_CN.md +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/README_CN.md @@ -2,8 +2,8 @@ - 如果想自己本地快速部署的话,可以参考下面进行操作。 -> docker-compose 部署方案使用了 PostgreSQL + IoTDB 作为 Hertzbeat 依赖存储服务。 -> 此方案会启动三个容器服务 PostgreSQL, IoTDB, HertzBeat +> docker-compose 部署方案使用了 PostgreSQL + victoria-metrics 作为 Hertzbeat 依赖存储服务。 +> 此方案会启动三个容器服务 PostgreSQL, victoria-metrics, HertzBeat ##### 安装Docker & Docker-compose @@ -17,7 +17,7 @@ ##### docker compose部署hertzbeat及其依赖服务 1. 下载hertzbeat-docker-compose安装部署脚本文件 - 脚本文件位于代码仓库下`script/docker-compose/hertzbeat-postgre-iotdb` 链接 [script/docker-compose](https://github.com/hertzbeat/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgre-iotdb) + 脚本文件位于代码仓库下`script/docker-compose/hertzbeat-postgre-victoria-metrics` 链接 [script/docker-compose](https://github.com/apache/hertzbeat/tree/master/script/docker-compose/hertzbeat-postgre-victoria-metrics) 2. 进入部署脚本 docker-compose 目录, 执行 diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/conf/application.yml b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/application.yml similarity index 70% rename from script/docker-compose/hertzbeat-postgresql-iotdb/conf/application.yml rename to script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/application.yml index 34dccf3538f..4a084aa5c46 100644 --- a/script/docker-compose/hertzbeat-postgresql-iotdb/conf/application.yml +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/application.yml @@ -48,6 +48,7 @@ management: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -58,6 +59,7 @@ sureness: 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp' + --- spring: config: @@ -70,15 +72,23 @@ spring: url: jdbc:postgresql://postgresql:5432/hertzbeat hikari: max-lifetime: 120000 - jpa: + show-sql: false + database-platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform database: postgresql - hibernate: - ddl-auto: update properties: - hibernate: - dialect: org.hibernate.dialect.PostgreSQLDialect - + eclipselink: + logging: + level: SEVERE + + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} + # Not Require, Please config if you need email notify # 非必填:不使用邮箱作为警告通知可以去掉spring.mail配置 mail: @@ -100,26 +110,18 @@ spring: warehouse: store: -# store history metrics data, enable only one below -# 存储历史数据方式, 下方只能enabled启用一种方式 + # store history metrics data, enable only one below + # 存储历史数据方式, 下方只能enabled启用一种方式 jpa: enabled: false expire-time: 1h - iot-db: + victoria-metrics: enabled: true - host: iotdb - rpc-port: 6667 + url: http://victoria-metrics:8428 username: root password: root - # org.apache.hertzbeat.warehouse.config.IotDbVersion: V_0_13 || V_1_0 - # 如果你使用docker-compose-1.0.yaml, 不要忘记修i该version为V_1_0 - version: V_1_0 - query-timeout-in-ms: -1 - # 数据存储时间:默认'7776000000'(90天,单位为毫秒,-1代表永不过期) - # data expire time, unit:ms, default '7776000000'(90 days, -1:never expire) - expire-time: '7776000000' -# store real-time metrics data, enable only one below -# 存储实时数据方式, 下方只能enabled启用一种方式 + # store real-time metrics data, enable only one below + # 存储实时数据方式, 下方只能enabled启用一种方式 memory: enabled: true init-size: 16 @@ -133,11 +135,24 @@ common: queue: # memory or kafka type: memory - # properties when queue type is kafka - kafka: - servers: 127.0.0.1:9092 - metrics-data-topic: async-metrics-data - alerts-data-topic: async-alerts-data + +alerter: + # custom console url + console-url: https://console.tancloud.cn + # 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 + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sql/schema.sql b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sql/schema.sql similarity index 100% rename from script/docker-compose/hertzbeat-postgresql-iotdb/conf/sql/schema.sql rename to script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sql/schema.sql diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/conf/sureness.yml b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sureness.yml similarity index 100% rename from script/docker-compose/hertzbeat-postgresql-iotdb/conf/sureness.yml rename to script/docker-compose/hertzbeat-postgresql-victoria-metrics/conf/sureness.yml diff --git a/script/docker-compose/hertzbeat-postgresql-victoria-metrics/dbdata/pgdata/.gitignore b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/dbdata/pgdata/.gitignore new file mode 100644 index 00000000000..951452536a6 --- /dev/null +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/dbdata/pgdata/.gitignore @@ -0,0 +1,3 @@ +!.gitignore +**.** +** diff --git a/script/docker-compose/hertzbeat-postgresql-victoria-metrics/dbdata/tsdbdata/.gitignore b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/dbdata/tsdbdata/.gitignore new file mode 100644 index 00000000000..951452536a6 --- /dev/null +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/dbdata/tsdbdata/.gitignore @@ -0,0 +1,3 @@ +!.gitignore +**.** +** diff --git a/script/docker-compose/hertzbeat-postgresql-iotdb/docker-compose.yaml b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/docker-compose.yaml similarity index 76% rename from script/docker-compose/hertzbeat-postgresql-iotdb/docker-compose.yaml rename to script/docker-compose/hertzbeat-postgresql-victoria-metrics/docker-compose.yaml index 9910f34eaeb..39acc2540bc 100644 --- a/script/docker-compose/hertzbeat-postgresql-iotdb/docker-compose.yaml +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/docker-compose.yaml @@ -34,32 +34,33 @@ services: ports: - '5432:5432' environment: - - POSTGRES_USER=root - - POSTGRES_PASSWORD=123456 - - TZ=Asia/Shanghai + POSTGRES_USER: root + POSTGRES_PASSWORD: 123456 + TZ: Asia/Shanghai volumes: - - ./conf/sql:/docker-entrypoint-initdb.d/ + - ./dbdata/pgdata/data:/var/lib/postgresql/data + - ./conf/sql:/docker-entrypoint-initdb.d/ + - ./ext-lib:/opt/hertzbeat/ext-lib networks: - hertzbeat - iotdb: - image: apache/iotdb:1.2.2-standalone - container_name: compose-iotdb - hostname: iotdb + victoria-metrics: + image: victoriametrics/victoria-metrics:v1.95.1 + container_name: compose-victoria-metrics + hostname: victoria-metrics restart: always healthcheck: - test: ["CMD", "ls", "/iotdb/data"] + test: ["CMD", "wget", "-q", "-O", "-", "http://victoria-metrics:8428/-/healthy"] interval: 10s - timeout: 5s retries: 5 + timeout: 5s start_period: 30s environment: TZ: Asia/Shanghai ports: - - "8181" - - "6667" + - "8428" volumes: - - ./dbdata/iotdbdata:/iotdb/data + - ./dbdata/tsdbdata:/victoria-metrics-data networks: - hertzbeat @@ -74,11 +75,12 @@ services: depends_on: postgres: condition: service_healthy - iotdb: + victoria-metrics: condition: service_healthy volumes: - ./conf/application.yml:/opt/hertzbeat/config/application.yml - ./conf/sureness.yml:/opt/hertzbeat/config/sureness.yml + - ./logs:/opt/hertzbeat/logs ports: - "1157:1157" - "1158:1158" diff --git a/script/docker-compose/hertzbeat-postgresql-victoria-metrics/ext-lib/.gitignore b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/ext-lib/.gitignore new file mode 100644 index 00000000000..c087c266df0 --- /dev/null +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/ext-lib/.gitignore @@ -0,0 +1,2 @@ +!.gitignore +*.jar diff --git a/script/docker-compose/hertzbeat-postgresql-victoria-metrics/ext-lib/README b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/ext-lib/README new file mode 100644 index 00000000000..5898fde6b91 --- /dev/null +++ b/script/docker-compose/hertzbeat-postgresql-victoria-metrics/ext-lib/README @@ -0,0 +1,21 @@ +# 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. + +Please move external libs to this folder like: + +ojdbc8-21.5.0.0.jar +orai18n-21.5.0.0.jar +mysql-connector-java-8.0.30.jar + diff --git a/script/docker/server/Dockerfile b/script/docker/server/Dockerfile index aaeef00636c..8d04a3ff815 100644 --- a/script/docker/server/Dockerfile +++ b/script/docker/server/Dockerfile @@ -34,8 +34,10 @@ ADD apache-hertzbeat-${VERSION}-incubating-bin.tar.gz /opt/ ENV TZ=Asia/Shanghai ENV LANG=en_US.UTF-8 +RUN mv /opt/apache-hertzbeat-${VERSION}-incubating-bin /opt/hertzbeat + EXPOSE 1157 1158 22 -WORKDIR /opt/apache-hertzbeat-${VERSION}-incubating-bin/ +WORKDIR /opt/hertzbeat/ ENTRYPOINT ["./bin/entrypoint.sh"] diff --git a/script/helm/hertzbeat/Chart.yaml b/script/helm/hertzbeat/Chart.yaml index 00978ec25d4..224c75a5570 100644 --- a/script/helm/hertzbeat/Chart.yaml +++ b/script/helm/hertzbeat/Chart.yaml @@ -16,7 +16,7 @@ # under the License. apiVersion: v2 -name: HertzBeat +name: hertzbeat description: An open-source, real-time monitoring system with custom monitoring, high performance cluster and agentless capabilities. type: application home: https://hertzbeat.apache.org/ @@ -24,8 +24,8 @@ sources: - https://github.com/apache/hertzbeat - https://charts.hertzbeat.com maintainers: - - name: tom - email: tomsun28@outlook.com + - name: hertzbeat-dev + email: dev@hertzbeat.apache.org icon: https://raw.githubusercontent.com/apache/hertzbeat/master/home/static/img/hertzbeat-logo.png # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. diff --git a/script/helm/hertzbeat/templates/database/configmap.yaml b/script/helm/hertzbeat/templates/database/configmap.yaml index 2f80a8915de..4c9c3e91c43 100644 --- a/script/helm/hertzbeat/templates/database/configmap.yaml +++ b/script/helm/hertzbeat/templates/database/configmap.yaml @@ -23,8 +23,14 @@ metadata: {{- include "hertzbeat.labels" . | nindent 4 }} data: TZ: "{{ .Values.database.timezone }}" - MYSQL_ROOT_PASSWORD: "{{ .Values.database.rootPassword }}" + POSTGRES_PASSWORD: "{{ .Values.database.rootPassword }}" + POSTGRES_USER: "root" schema.sql: |+ - set names utf8mb4; - create database if not exists hertzbeat default charset utf8mb4 collate utf8mb4_general_ci; - commit; + CREATE EXTENSION IF NOT EXISTS dblink; + + DO $$ + BEGIN + PERFORM dblink_exec('', 'CREATE DATABASE hertzbeat'); + EXCEPTION WHEN duplicate_database THEN RAISE NOTICE '%, skipping', SQLERRM USING ERRCODE = SQLSTATE; + END + $$; diff --git a/script/helm/hertzbeat/templates/database/service.yaml b/script/helm/hertzbeat/templates/database/service.yaml index 589fd218afa..e95d860d24d 100644 --- a/script/helm/hertzbeat/templates/database/service.yaml +++ b/script/helm/hertzbeat/templates/database/service.yaml @@ -24,8 +24,8 @@ metadata: spec: type: ClusterIP ports: - - port: 3306 - targetPort: 3306 + - port: 5432 + targetPort: 5432 protocol: TCP selector: {{- include "hertzbeat.selectorLabels" . | nindent 4 }} diff --git a/script/helm/hertzbeat/templates/database/statefulset.yaml b/script/helm/hertzbeat/templates/database/statefulset.yaml index 181af838ebe..85d4e9f608c 100644 --- a/script/helm/hertzbeat/templates/database/statefulset.yaml +++ b/script/helm/hertzbeat/templates/database/statefulset.yaml @@ -47,12 +47,12 @@ spec: imagePullPolicy: {{ .Values.database.image.pullPolicy }} livenessProbe: tcpSocket: - port: 3306 + port: 5432 initialDelaySeconds: 300 periodSeconds: 10 readinessProbe: tcpSocket: - port: 3306 + port: 5432 initialDelaySeconds: 1 periodSeconds: 10 resources: @@ -62,7 +62,7 @@ spec: name: "{{ include "hertzbeat.database" . }}" volumeMounts: - name: data - mountPath: /var/lib/mysql + mountPath: /var/lib/postgresql/data subPath: "" - mountPath: /docker-entrypoint-initdb.d/schema.sql subPath: schema.sql diff --git a/script/helm/hertzbeat/templates/manager/configmap.yaml b/script/helm/hertzbeat/templates/manager/configmap.yaml index 3efb85f671f..b7f1fa7be67 100644 --- a/script/helm/hertzbeat/templates/manager/configmap.yaml +++ b/script/helm/hertzbeat/templates/manager/configmap.yaml @@ -58,6 +58,7 @@ data: enabled-by-default: on sureness: + container: jakarta_servlet auths: - digest - basic @@ -72,17 +73,27 @@ data: on-profile: prod datasource: - driver-class-name: com.mysql.cj.jdbc.Driver + driver-class-name: org.postgresql.Driver username: root password: {{ .Values.database.rootPassword }} - url: jdbc:mysql://{{ include "hertzbeat.database" . }}:3306/hertzbeat?useUnicode=true&characterEncoding=utf-8&allowPublicKeyRetrieval=true&useSSL=false + url: jdbc:postgresql://{{ include "hertzbeat.database" . }}:5432/hertzbeat hikari: max-lifetime: 120000 - jpa: - hibernate: - ddl-auto: update - + show-sql: false + database-platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform + database: postgresql + properties: + eclipselink: + logging: + level: SEVERE + flyway: + enabled: true + clean-disabled: true + baseline-on-migrate: true + baseline-version: 1 + locations: + - classpath:db/migration/{vendor} mail: # Attention: this is mail server address. # 请注意此为邮件服务器地址:qq邮箱为 smtp.qq.com qq 企业邮箱为 smtp.exmail.qq.com @@ -166,13 +177,27 @@ data: alerter: # custom console url console-url: https://console.tancloud.cn + # 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 + # server酱 + server-chan-webhook-url: https://sctapi.ftqq.com/%s.send + # gotify + gotify-webhook-url: http://127.0.0.1/message?token=%s scheduler: server: enabled: true port: 1158 - + sureness.yml: |+ resourceRole: - /api/account/auth/refresh===post===[admin,user,guest] @@ -213,7 +238,10 @@ data: - /api/status/page/**===post===[admin,user] - /api/status/page/**===put===[admin,user] - /api/status/page/**===delete===[admin] - + + # config the resource restful api that need bypass auth protection + # rule: api===method + # eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth. excludedResource: - /api/alerts/report/**===* - /api/account/auth/**===* @@ -221,6 +249,7 @@ data: - /api/apps/hierarchy===get - /api/push/**===* - /api/status/page/public/**===* + # web ui resource - /===get - /dashboard/**===get - /monitors/**===get @@ -241,9 +270,11 @@ data: - /**/*.json===get - /**/*.woff===get - /**/*.eot===get + # swagger ui resource - /swagger-resources/**===get - /v2/api-docs===get - /v3/api-docs===get + # h2 database - /h2-console/**===* # account info config diff --git a/script/helm/hertzbeat/values.yaml b/script/helm/hertzbeat/values.yaml index 844b4da98d2..49ff4443988 100644 --- a/script/helm/hertzbeat/values.yaml +++ b/script/helm/hertzbeat/values.yaml @@ -26,7 +26,7 @@ manager: account: username: "admin" password: "hertzbeat" - jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6bx3sDJeFV143R + jwtSecretKey: "CyaFv0bwq2Eik0jdrKUtsA6dx3sDJeFV143R LnfKefTjsIfJLBa2YkhEqEGtcHDTNe4CU6+9 8tVt4bisXQ13rbN0oxhUZR73M6EByXIO+SV5 dKhaX0csgOCTlCxq20yhmUea6H6JIpSE2Rwp" @@ -62,10 +62,10 @@ collector: database: image: - repository: mysql + repository: postgres pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - tag: "8" + tag: "15" timezone: "Asia/Shanghai" rootPassword: "123456" persistence: diff --git a/warehouse/pom.xml b/warehouse/pom.xml index c89770e3755..0db9386496d 100644 --- a/warehouse/pom.xml +++ b/warehouse/pom.xml @@ -29,7 +29,8 @@ 2.23 3.0.5 3.0.0 - 0.4.0 + 0.7.3 + 8.0.33 4.0.0 @@ -81,10 +82,10 @@ influxdb-java ${influxdb.version} - + io.greptime - greptimedb-protocol + ingester-all ${greptimedb.version} @@ -105,28 +106,11 @@ + - io.greptime - greptimedb-grpc - ${greptimedb.version} - - - io.grpc - grpc-all - - - com.google.code.gson - gson - - - com.google.guava - guava - - - com.google.protobuf - protobuf-java - - + mysql + mysql-connector-java + ${mysql-jdbcdriver.version} diff --git a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GrepTimeDbDataStorage.java b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GrepTimeDbDataStorage.java deleted file mode 100644 index 4109cf025e9..00000000000 --- a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GrepTimeDbDataStorage.java +++ /dev/null @@ -1,427 +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.warehouse.store.history.greptime; - -import io.greptime.GreptimeDB; -import io.greptime.models.ColumnDataType; -import io.greptime.models.Err; -import io.greptime.models.QueryOk; -import io.greptime.models.QueryRequest; -import io.greptime.models.Result; -import io.greptime.models.Row; -import io.greptime.models.SelectExprType; -import io.greptime.models.SelectRows; -import io.greptime.models.SemanticType; -import io.greptime.models.TableName; -import io.greptime.models.TableSchema; -import io.greptime.models.WriteOk; -import io.greptime.models.WriteRows; -import io.greptime.options.GreptimeOptions; -import java.math.BigDecimal; -import java.math.RoundingMode; -import java.time.Duration; -import java.time.ZonedDateTime; -import java.time.temporal.TemporalAmount; -import java.util.Arrays; -import java.util.Calendar; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import lombok.extern.slf4j.Slf4j; -import org.apache.arrow.flight.FlightRuntimeException; -import org.apache.hertzbeat.common.constants.CommonConstants; -import org.apache.hertzbeat.common.entity.dto.Value; -import org.apache.hertzbeat.common.entity.message.CollectRep; -import org.apache.hertzbeat.common.util.JsonUtil; -import org.apache.hertzbeat.common.util.TimePeriodUtil; -import org.apache.hertzbeat.warehouse.store.history.AbstractHistoryDataStorage; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Component; - -/** - * greptimeDB data storage - */ -@Component -@ConditionalOnProperty(prefix = "warehouse.store.greptime", name = "enabled", havingValue = "true") -@Slf4j -public class GrepTimeDbDataStorage extends AbstractHistoryDataStorage { - - /** - * storage database - */ - private static final String STORAGE_DATABASE = "hertzbeat"; - private static final String QUERY_HISTORY_SQL = - "SELECT CAST (ts AS Int64) ts, instance, \"%s\" FROM %s WHERE ts >= %s and monitor_id = %s order by ts desc;"; - private static final String QUERY_HISTORY_WITH_INSTANCE_SQL = - "SELECT CAST (ts AS Int64) ts, instance, \"%s\" FROM %s WHERE ts >= %s and monitor_id = %s and instance = %s order by ts desc;"; - private static final String QUERY_INSTANCE_SQL = - "SELECT DISTINCT instance FROM %s WHERE ts >= now() - interval '1' WEEK"; - private static final String QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL = - "SELECT first, avg ,max, min FROM (SELECT \"%s\" as first FROM %s WHERE monitor_id = %s and ts >= %s" - + " and ts < %s ORDER BY ts LIMIT 1) LEFT JOIN (SELECT avg(\"%s\") as avg, min(\"%s\") as min, max(\"%s\") as max FROM %s WHERE ts >= %s and ts < %s) ON 1=1"; - private static final String TABLE_NOT_EXIST = "not exist"; - private static final String DATABASE_NOT_EXIST = "not exist"; - private GreptimeDB greptimeDb; - - public GrepTimeDbDataStorage(GreptimeProperties greptimeProperties) { - this.serverAvailable = this.initDbSession(greptimeProperties); - } - - private boolean initDbSession(GreptimeProperties properties) { - String endpoint = properties.endpoint(); - GreptimeOptions opts = GreptimeOptions.newBuilder(endpoint) - .writeMaxRetries(1) - .readMaxRetries(2) - .routeTableRefreshPeriodSeconds(-1) - .build(); - greptimeDb = new GreptimeDB(); - if (!greptimeDb.init(opts)) { - log.error("Fail to start Greptime client"); - return false; - } - return createDatabase(); - } - - /** - * Checks if the database exists; if not, creates the Database. - */ - private boolean createDatabase() { - // 查询现有数据库 - QueryRequest showDatabases = QueryRequest.newBuilder() - .exprType(SelectExprType.Sql) - .ql("SHOW DATABASES;") - .build(); - Result result = null; - try { - CompletableFuture> future = greptimeDb.query(showDatabases); - result = future.get(); - } catch (Exception e) { - log.info("TABLE_NOT_EXIST: {}", e.getMessage()); - String msg = e.getMessage(); - if (msg != null && !msg.contains(DATABASE_NOT_EXIST)) { - log.warn(msg); - } - - } - // Check if the existing database includes“Hertzbeat” - boolean isDatabaseExist = false; - if (result != null && result.isOk()) { - QueryOk queryOk = result.getOk(); - SelectRows rows = queryOk.getRows(); - List rowsList = rows.collect(); - for (Row row : rowsList) { - for (io.greptime.models.Value value : row.values()) { - if (STORAGE_DATABASE.equals(value.value().toString())) { - log.info("Exist Database {}", STORAGE_DATABASE); - isDatabaseExist = true; - break; - } - } - } - } - // If it does not exist, create database - if (!isDatabaseExist) { - QueryRequest createDatabase = QueryRequest.newBuilder() - .exprType(SelectExprType.Sql) - .ql("CREATE DATABASE %s;", STORAGE_DATABASE) - .build(); - try { - CompletableFuture> createFuture = greptimeDb.query(createDatabase); - isDatabaseExist = createFuture.get().isOk(); - log.info("Database {} does not exist,and has been created", STORAGE_DATABASE); - } catch (InterruptedException | ExecutionException e) { - log.error("Error creating database"); - } - } - return isDatabaseExist; - } - - @Override - public void saveData(CollectRep.MetricsData metricsData) { - if (!isServerAvailable() || metricsData.getCode() != CollectRep.Code.SUCCESS) { - return; - } - if (metricsData.getValuesList().isEmpty()) { - log.info("[warehouse greptime] flush metrics data {} is null, ignore.", metricsData.getId()); - return; - } - String monitorId = String.valueOf(metricsData.getId()); - String table = metricsData.getApp() + "_" + metricsData.getMetrics(); - TableSchema.Builder tableSchemaBuilder = TableSchema.newBuilder(TableName.with(STORAGE_DATABASE, table)); - - List semanticTypes = new LinkedList<>(Arrays.asList(SemanticType.Tag, SemanticType.Tag, SemanticType.Timestamp)); - List dataTypes = new LinkedList<>(Arrays.asList(ColumnDataType.String, ColumnDataType.String, ColumnDataType.TimestampMillisecond)); - List columnNames = new LinkedList<>(Arrays.asList("monitor_id", "instance", "ts")); - - List fieldsList = metricsData.getFieldsList(); - for (CollectRep.Field field : fieldsList) { - semanticTypes.add(SemanticType.Field); - columnNames.add(field.getName()); - // handle field type - if (field.getType() == CommonConstants.TYPE_NUMBER) { - dataTypes.add(ColumnDataType.Float64); - } else if (field.getType() == CommonConstants.TYPE_STRING) { - dataTypes.add(ColumnDataType.String); - } - } - tableSchemaBuilder.semanticTypes(semanticTypes.toArray(new SemanticType[0])); - tableSchemaBuilder.dataTypes(dataTypes.toArray(new ColumnDataType[0])); - tableSchemaBuilder.columnNames(columnNames.toArray(new String[0])); - WriteRows rows = WriteRows.newBuilder(tableSchemaBuilder.build()).build(); - try { - long now = System.currentTimeMillis(); - Object[] values = new Object[3 + fieldsList.size()]; - values[0] = monitorId; - values[2] = now; - for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { - Map labels = new HashMap<>(8); - for (int i = 0; i < fieldsList.size(); i++) { - if (!CommonConstants.NULL_VALUE.equals(valueRow.getColumns(i))) { - CollectRep.Field field = fieldsList.get(i); - if (field.getType() == CommonConstants.TYPE_NUMBER) { - values[3 + i] = Double.parseDouble(valueRow.getColumns(i)); - } else if (field.getType() == CommonConstants.TYPE_STRING) { - values[3 + i] = valueRow.getColumns(i); - } - if (field.getLabel()) { - labels.put(field.getName(), String.valueOf(values[3 + i])); - } - } else { - values[3 + i] = null; - } - } - values[1] = JsonUtil.toJson(labels); - rows.insert(values); - } - rows.finish(); - CompletableFuture> writeFuture = greptimeDb.write(rows); - try { - Result result = writeFuture.get(10, TimeUnit.SECONDS); - if (result.isOk()) { - log.debug("[warehouse greptime]-Write successful"); - } else { - log.warn("[warehouse greptime]--Write failed: {}", result.getErr().getFailedQl()); - } - } catch (Throwable throwable) { - log.error("[warehouse greptime]--Error occurred: {}", throwable.getMessage()); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - - @Override - public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, - String label, String history) { - Map> instanceValuesMap = new HashMap<>(8); - if (!isServerAvailable()) { - log.error("\n\t---------------Greptime Init Failed---------------\n" - + "\t--------------Please Config Greptime--------------\n" - + "\t----------Can Not Use Metric History Now----------\n"); - return instanceValuesMap; - } - long expireTime = getExpireTimeFromToken(history); - String table = app + "_" + metrics; - String selectSql = label == null - ? String.format(QUERY_HISTORY_SQL, metric, table, expireTime, monitorId) - : String.format(QUERY_HISTORY_WITH_INSTANCE_SQL, metric, table, expireTime, monitorId, label); - log.debug("selectSql: {}", selectSql); - QueryRequest request = QueryRequest.newBuilder() - .exprType(SelectExprType.Sql) - .databaseName(STORAGE_DATABASE) - .ql(selectSql) - .build(); - try { - CompletableFuture> future = greptimeDb.query(request); - Result result = future.get(); - if (result != null && result.isOk()) { - QueryOk queryOk = result.getOk(); - SelectRows rows = queryOk.getRows(); - List> maps = rows.collectToMaps(); - List valueList; - for (Map map : maps) { - String instanceValue = map.get("instance") == null ? "" : map.get("instance").toString(); - Object valueObj = map.get(metric); - if (valueObj == null) { - continue; - } - String strValue = new BigDecimal(valueObj.toString()).setScale(4, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(); - valueList = instanceValuesMap.computeIfAbsent(instanceValue, k -> new LinkedList<>()); - valueList.add(new Value(strValue, (long) map.get("ts"))); - } - } - } catch (FlightRuntimeException e) { - String msg = e.getMessage(); - if (msg != null && msg.contains(TABLE_NOT_EXIST)) { - List valueList = instanceValuesMap.computeIfAbsent(metric, k -> new LinkedList<>()); - valueList.add(new Value(null, System.currentTimeMillis())); - log.info("[warehouse greptime]-TABLE_NOT_EXIST: {}", table); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - } - return instanceValuesMap; - } - - private long getExpireTimeFromToken(String history) { - long expireTime; - try { - TemporalAmount temporalAmount = TimePeriodUtil.parseTokenTime(history); - ZonedDateTime dateTime = ZonedDateTime.now().minus(temporalAmount); - expireTime = dateTime.toEpochSecond() * 1000L; - } catch (Exception e) { - log.error("parse history time error: {}. use default: 6h", e.getMessage()); - ZonedDateTime dateTime = ZonedDateTime.now().minus(Duration.ofHours(6)); - expireTime = dateTime.toEpochSecond() * 1000L; - } - return expireTime; - } - - @Override - public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, - String metric, String label, String history) { - Map> instanceValuesMap = new HashMap<>(8); - if (!isServerAvailable()) { - log.error("\n\t---------------Greptime Init Failed---------------\n" - + "\t--------------Please Config Greptime--------------\n" - + "\t----------Can Not Use Metric History Now----------\n"); - return instanceValuesMap; - } - String table = app + "_" + metrics; - List instances = new LinkedList<>(); - if (label != null) { - instances.add(label); - } - if (instances.isEmpty()) { - String selectSql = String.format(QUERY_INSTANCE_SQL, table); - log.debug("selectSql: {}", selectSql); - QueryRequest request = QueryRequest.newBuilder() - .exprType(SelectExprType.Sql) - .databaseName(STORAGE_DATABASE) - .ql(selectSql) - .build(); - try { - CompletableFuture> future = greptimeDb.query(request); - Result result = future.get(); - if (result != null && result.isOk()) { - QueryOk queryOk = result.getOk(); - SelectRows rows = queryOk.getRows(); - while (rows.hasNext()) { - Row row = rows.next(); - if (row != null) { - List values = row.values(); - for (io.greptime.models.Value value : values) { - log.debug("value:{}", value.value()); - Object instanceValue = value.value(); - if (instanceValue == null || "".equals(instanceValue)) { - instances.add("''"); - } else { - instances.add(instanceValue.toString()); - } - } - } - - } - } - } catch (FlightRuntimeException e) { - String msg = e.getMessage(); - if (msg != null && msg.contains(TABLE_NOT_EXIST)) { - log.info("[warehouse greptime]-TABLE_NOT_EXIST: {}", table); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - // TODO 'greptime' did not find the proper SQL function processing, temporarily using code implementation, future 'greptime' update documents using SQL implementation - long endTime; - long startTime = getExpireTimeFromToken(history); - - Calendar cal = Calendar.getInstance(); - - long interval = System.currentTimeMillis() - startTime; - long fourHourCount = TimeUnit.MILLISECONDS.toHours(interval) / 4; - for (int i = 0; i < fourHourCount; i++) { - cal.clear(); - cal.setTimeInMillis(startTime); - cal.add(Calendar.HOUR_OF_DAY, 4); - endTime = cal.getTimeInMillis(); - - for (String instanceValue : instances) { - String selectSql = String.format(QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL, metric, table, monitorId, startTime, endTime, metric, metric, metric, table, startTime, endTime); - - log.debug("selectSql: {}", selectSql); - QueryRequest request = QueryRequest.newBuilder() - .exprType(SelectExprType.Sql) - .databaseName(STORAGE_DATABASE) - .ql(selectSql) - .build(); - List values = instanceValuesMap.computeIfAbsent(instanceValue, k -> new LinkedList<>()); - try { - CompletableFuture> future = greptimeDb.query(request); - Result result = future.get(); - log.debug("result:{}", result); - if (result != null && result.isOk()) { - QueryOk queryOk = result.getOk(); - SelectRows rows = queryOk.getRows(); - String[] col = new String[4]; - while (rows.hasNext()) { - Row row = rows.next(); - if (!row.values().isEmpty()) { - for (int j = 0; j < row.values().size(); j++) { - log.debug("value:{}", row.values().get(j)); - String colStr = new BigDecimal(row.values().get(j).value().toString()).setScale(4, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(); - col[j] = colStr; - } - Value valueBuild = Value.builder() - .origin(col[0]).mean(col[1]) - .min(col[2]).max(col[3]) - .time(System.currentTimeMillis()) - .build(); - values.add(valueBuild); - } - } - log.debug("[warehouse greptime] values:{}", values); - } - } catch (FlightRuntimeException e) { - String msg = e.getMessage(); - if (msg != null && msg.contains(TABLE_NOT_EXIST)) { - List valueList = instanceValuesMap.computeIfAbsent(metric, k -> new LinkedList<>()); - valueList.add(new Value(null, System.currentTimeMillis())); - log.info("[warehouse greptime]-TABLE_NOT_EXIST: {}", table); - } - } catch (Exception e) { - log.error(e.getMessage(), e); - } - } - startTime = endTime; - } - - return instanceValuesMap; - } - - @Override - public void destroy() { - if (this.greptimeDb != null) { - this.greptimeDb.shutdownGracefully(); - } - } -} diff --git a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeDbDataStorage.java b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeDbDataStorage.java new file mode 100644 index 00000000000..aefd45e0942 --- /dev/null +++ b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeDbDataStorage.java @@ -0,0 +1,430 @@ +/* + * 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.warehouse.store.history.greptime; + +import com.mysql.cj.jdbc.Driver; +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import io.greptime.GreptimeDB; +import io.greptime.models.AuthInfo; +import io.greptime.models.DataType; +import io.greptime.models.Err; +import io.greptime.models.Result; +import io.greptime.models.Table; +import io.greptime.models.TableSchema; +import io.greptime.models.WriteOk; +import io.greptime.options.GreptimeOptions; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.DriverPropertyInfo; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.hertzbeat.common.constants.CommonConstants; +import org.apache.hertzbeat.common.entity.dto.Value; +import org.apache.hertzbeat.common.entity.message.CollectRep; +import org.apache.hertzbeat.common.util.JsonUtil; +import org.apache.hertzbeat.warehouse.store.history.AbstractHistoryDataStorage; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Component; + +/** + * GreptimeDB data storage, only supports GreptimeDB version >= v0.5 + * + */ +@Component +@ConditionalOnProperty(prefix = "warehouse.store.greptime", name = "enabled", havingValue = "true") +@Slf4j +public class GreptimeDbDataStorage extends AbstractHistoryDataStorage { + + private static final String CONSTANT_DB_TTL = "30d"; + + private static final String QUERY_HISTORY_SQL = "SELECT CAST (ts AS Int64) ts, instance, `%s` FROM `%s` WHERE ts >= now() - interval '%s' and monitor_id = %s order by ts desc;"; + + @SuppressWarnings("checkstyle:LineLength") + private static final String QUERY_HISTORY_WITH_INSTANCE_SQL = "SELECT CAST (ts AS Int64) ts, instance, `%s` FROM `%s` WHERE ts >= now() - interval '%s' and monitor_id = %s and instance = '%s' order by ts desc;"; + + private static final String QUERY_INSTANCE_SQL = "SELECT DISTINCT instance FROM `%s` WHERE ts >= now() - interval '1 WEEK'"; + + @SuppressWarnings("checkstyle:LineLength") + private static final String QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL = "SELECT CAST (ts AS Int64) ts, first_value(`%s`) range '4h' first, avg(`%s`) range '4h' avg, min(`%s`) range '4h' min, max(`%s`) range '4h' max FROM `%s` WHERE instance = '%s' AND ts >= now() - interval '%s' ALIGN '4h'"; + + private static final String TABLE_NOT_EXIST = "not found"; + + private static final String CONSTANTS_CREATE_DATABASE = "CREATE DATABASE IF NOT EXISTS `%s` WITH(ttl='%s')"; + + private static final Runnable INSTANCE_EXCEPTION_PRINT = () -> { + if (log.isErrorEnabled()) { + log.error(""" + \t---------------GreptimeDB Init Failed--------------- + \t--------------Please Config GreptimeDB-------------- + t-----------Can Not Use Metric History Now----------- + """); + } + }; + + private HikariDataSource hikariDataSource; + + private GreptimeDB greptimeDb; + + public GreptimeDbDataStorage(GreptimeProperties greptimeProperties) { + if (greptimeProperties == null) { + log.error("init error, please config Warehouse GreptimeDB props in application.yml"); + throw new IllegalArgumentException("please config Warehouse GreptimeDB props"); + } + + serverAvailable = initGreptimeDbClient(greptimeProperties) && initGreptimeDbDataSource(greptimeProperties); + } + + private void initGreptimeDb(final GreptimeProperties greptimeProperties) throws SQLException { + final DriverPropertyInfo[] properties = new Driver().getPropertyInfo(greptimeProperties.url(), null); + final String host = ObjectUtils.requireNonEmpty(properties[0].value); + final String port = ObjectUtils.requireNonEmpty(properties[1].value); + final String dbName = ObjectUtils.requireNonEmpty(properties[2].value); + + String ttl = greptimeProperties.expireTime(); + if (ttl == null || "".equals(ttl.trim())) { + ttl = CONSTANT_DB_TTL; + } + + try (final Connection tempConnection = DriverManager.getConnection("jdbc:mysql://" + host + ":" + port, + greptimeProperties.username(), greptimeProperties.password()); + final PreparedStatement pstmt = tempConnection + .prepareStatement(String.format(CONSTANTS_CREATE_DATABASE, dbName, ttl))) { + log.info("[warehouse greptime] try to create database `{}` if not exists", dbName); + pstmt.execute(); + } + } + + private boolean initGreptimeDbClient(GreptimeProperties greptimeProperties) { + String endpoints = greptimeProperties.grpcEndpoints(); + try { + final DriverPropertyInfo[] properties = new Driver().getPropertyInfo(greptimeProperties.url(), null); + final String dbName = ObjectUtils.requireNonEmpty(properties[2].value); + + GreptimeOptions opts = GreptimeOptions.newBuilder(endpoints.split(","), dbName) // + .writeMaxRetries(3) // + .authInfo(new AuthInfo(greptimeProperties.username(), greptimeProperties.password())) + .routeTableRefreshPeriodSeconds(30) // + .build(); + + this.greptimeDb = GreptimeDB.create(opts); + } catch (Exception e) { + log.error("[warehouse greptime] Fail to start GreptimeDB client"); + return false; + } + + return true; + } + + private boolean initGreptimeDbDataSource(final GreptimeProperties greptimeProperties) { + try { + initGreptimeDb(greptimeProperties); + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error(e.getMessage(), e); + } + + INSTANCE_EXCEPTION_PRINT.run(); + return false; + } + + final HikariConfig config = new HikariConfig(); + // jdbc properties + config.setJdbcUrl(greptimeProperties.url()); + config.setUsername(greptimeProperties.username()); + config.setPassword(greptimeProperties.password()); + config.setDriverClassName(greptimeProperties.driverClassName()); + // minimum number of idle connection + config.setMinimumIdle(10); + // maximum number of connection in the pool + config.setMaximumPoolSize(10); + // maximum wait milliseconds for get connection from pool + config.setConnectionTimeout(30000); + // maximum lifetime for each connection + config.setMaxLifetime(0); + // max idle time for recycle idle connection + config.setIdleTimeout(0); + // validation query + config.setConnectionTestQuery("select 1"); + try { + this.hikariDataSource = new HikariDataSource(config); + } catch (Exception e) { + INSTANCE_EXCEPTION_PRINT.run(); + return false; + } + return true; + } + + @Override + public void saveData(CollectRep.MetricsData metricsData) { + if (!isServerAvailable() || metricsData.getCode() != CollectRep.Code.SUCCESS) { + return; + } + if (metricsData.getValuesList().isEmpty()) { + log.info("[warehouse greptime] flush metrics data {} is null, ignore.", metricsData.getId()); + return; + } + String monitorId = String.valueOf(metricsData.getId()); + String tableName = getTableName(metricsData.getApp(), metricsData.getMetrics()); + TableSchema.Builder tableSchemaBuilder = TableSchema.newBuilder(tableName); + + tableSchemaBuilder.addTag("monitor_id", DataType.String) // + .addTag("instance", DataType.String) // + .addTimestamp("ts", DataType.TimestampMillisecond); + + List fieldsList = metricsData.getFieldsList(); + for (CollectRep.Field field : fieldsList) { + // handle field type + if (field.getType() == CommonConstants.TYPE_NUMBER) { + tableSchemaBuilder.addField(field.getName(), DataType.Float64); + } else if (field.getType() == CommonConstants.TYPE_STRING) { + tableSchemaBuilder.addField(field.getName(), DataType.String); + } + } + Table table = Table.from(tableSchemaBuilder.build()); + + try { + long now = System.currentTimeMillis(); + Object[] values = new Object[3 + fieldsList.size()]; + values[0] = monitorId; + values[2] = now; + for (CollectRep.ValueRow valueRow : metricsData.getValuesList()) { + Map labels = new HashMap<>(8); + for (int i = 0; i < fieldsList.size(); i++) { + if (!CommonConstants.NULL_VALUE.equals(valueRow.getColumns(i))) { + CollectRep.Field field = fieldsList.get(i); + if (field.getType() == CommonConstants.TYPE_NUMBER) { + values[3 + i] = Double.parseDouble(valueRow.getColumns(i)); + } else if (field.getType() == CommonConstants.TYPE_STRING) { + values[3 + i] = valueRow.getColumns(i); + } + if (field.getLabel()) { + labels.put(field.getName(), String.valueOf(values[3 + i])); + } + } else { + values[3 + i] = null; + } + } + values[1] = JsonUtil.toJson(labels); + table.addRow(values); + } + + CompletableFuture> writeFuture = greptimeDb.write(table); + try { + Result result = writeFuture.get(10, TimeUnit.SECONDS); + if (result.isOk()) { + log.debug("[warehouse greptime]-Write successful"); + } else { + log.warn("[warehouse greptime]--Write failed: {}", result.getErr()); + } + } catch (Throwable throwable) { + log.error("[warehouse greptime]--Error occurred: {}", throwable.getMessage()); + } + } catch (Exception e) { + log.error("[warehouse greptime]--Error: {}", e.getMessage(), e); + } + } + + @Override + public Map> getHistoryMetricData(Long monitorId, String app, String metrics, String metric, + String label, String history) { + Map> instanceValuesMap = new HashMap<>(8); + if (!isServerAvailable()) { + INSTANCE_EXCEPTION_PRINT.run(); + return instanceValuesMap; + } + + String table = getTableName(app, metrics); + + String interval = history2interval(history); + String selectSql = label == null ? String.format(QUERY_HISTORY_SQL, metric, table, interval, monitorId) + : String.format(QUERY_HISTORY_WITH_INSTANCE_SQL, metric, table, interval, monitorId, label); + + if (log.isDebugEnabled()) { + log.debug("[warehouse greptime] getHistoryMetricData SQL: {}", selectSql); + } + + try (Connection connection = hikariDataSource.getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectSql)) { + while (resultSet.next()) { + long ts = resultSet.getLong(1); + if (ts == 0) { + if (log.isErrorEnabled()) { + log.error("[warehouse greptime] getHistoryMetricData query result timestamp is 0, ignore. {}.", + selectSql); + } + continue; + } + String instanceValue = resultSet.getString(2); + if (instanceValue == null || "".equals(instanceValue)) { + instanceValue = ""; + } + double value = resultSet.getDouble(3); + String strValue = double2decimalString(value); + + List valueList = instanceValuesMap.computeIfAbsent(instanceValue, k -> new LinkedList<>()); + valueList.add(new Value(strValue, ts)); + } + return instanceValuesMap; + } catch (SQLException sqlException) { + String msg = sqlException.getMessage(); + if (msg != null && !msg.contains(TABLE_NOT_EXIST)) { + if (log.isWarnEnabled()) { + log.warn("[warehouse greptime] failed to getHistoryMetricData: " + sqlException.getMessage()); + } + } + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error("[warehouse greptime] failed to getHistoryMetricData:" + e.getMessage(), e); + } + } + return instanceValuesMap; + } + + private String getTableName(String app, String metrics) { + return app + "_" + metrics; + } + + @Override + public Map> getHistoryIntervalMetricData(Long monitorId, String app, String metrics, + String metric, String label, String history) { + if (!isServerAvailable()) { + INSTANCE_EXCEPTION_PRINT.run(); + return Collections.emptyMap(); + } + String table = getTableName(app, metrics); + List instances = new LinkedList<>(); + if (label != null && !"".equals(label)) { + instances.add(label); + } + if (instances.isEmpty()) { + String selectSql = String.format(QUERY_INSTANCE_SQL, table); + if (log.isDebugEnabled()) { + log.debug("[warehouse greptime] getHistoryIntervalMetricData sql: {}", selectSql); + } + + try (Connection connection = hikariDataSource.getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectSql)) { + while (resultSet.next()) { + String instanceValue = resultSet.getString(1); + if (instanceValue == null || "".equals(instanceValue)) { + instances.add("''"); + } else { + instances.add(instanceValue); + } + } + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error("[warehouse greptime] failed to query instances" + e.getMessage(), e); + } + } + } + + Map> instanceValuesMap = new HashMap<>(instances.size()); + for (String instanceValue : instances) { + String selectSql = String.format(QUERY_HISTORY_INTERVAL_WITH_INSTANCE_SQL, metric, metric, metric, metric, + table, instanceValue, history2interval(history)); + + if (log.isDebugEnabled()) { + log.debug("[warehouse greptime] getHistoryIntervalMetricData sql: {}", selectSql); + } + + List values = instanceValuesMap.computeIfAbsent(instanceValue, k -> new LinkedList<>()); + try (Connection connection = hikariDataSource.getConnection(); + Statement statement = connection.createStatement(); + ResultSet resultSet = statement.executeQuery(selectSql);) { + while (resultSet.next()) { + long ts = resultSet.getLong(1); + if (ts == 0) { + if (log.isErrorEnabled()) { + log.error( + "[warehouse greptime] getHistoryIntervalMetricData query result timestamp is 0, ignore. {}.", + selectSql); + } + continue; + } + double origin = resultSet.getDouble(2); + String originStr = double2decimalString(origin); + double avg = resultSet.getDouble(3); + String avgStr = double2decimalString(avg); + double min = resultSet.getDouble(4); + String minStr = double2decimalString(min); + double max = resultSet.getDouble(5); + String maxStr = double2decimalString(max); + Value value = Value.builder().origin(originStr).mean(avgStr).min(minStr).max(maxStr).time(ts) + .build(); + values.add(value); + } + resultSet.close(); + } catch (Exception e) { + if (log.isErrorEnabled()) { + log.error("[warehouse greptime] failed to getHistoryIntervalMetricData: " + e.getMessage(), e); + } + } + } + return instanceValuesMap; + } + + // TODO(dennis): we can remove it when + // https://github.com/GreptimeTeam/greptimedb/issues/4168 is fixed. + // default 6h-6 hours: s-seconds, M-minutes, h-hours, d-days, w-weeks + private String history2interval(String history) { + if (history == null) { + return null; + } + history = history.trim().toLowerCase(); + + // Be careful, the order matters. + return history.replaceAll("d", " day") // + .replaceAll("s", " second") // + .replaceAll("w", " week") // + .replaceAll("h", " hour")// + .replaceAll("m", " minute"); + } + + private String double2decimalString(double d) { + return BigDecimal.valueOf(d).setScale(4, RoundingMode.HALF_UP).stripTrailingZeros().toPlainString(); + } + + @Override + public void destroy() { + if (this.greptimeDb != null) { + this.greptimeDb.shutdownGracefully(); + this.greptimeDb = null; + } + if (this.hikariDataSource != null) { + this.hikariDataSource.close(); + hikariDataSource = null; + } + } +} diff --git a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeProperties.java b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeProperties.java index 0561af78d9c..bd02be75c92 100644 --- a/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeProperties.java +++ b/warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/greptime/GreptimeProperties.java @@ -25,7 +25,9 @@ */ @ConfigurationProperties(prefix = "warehouse.store.greptime") public record GreptimeProperties(@DefaultValue("false") boolean enabled, - @DefaultValue("127.0.0.1:4001") String endpoint, - String username, - String password) { + @DefaultValue("127.0.0.1:4001") String grpcEndpoints, + @DefaultValue("jdbc:mysql://127.0.0.1:4002/hertzbeat?connectionTimeZone=Asia/Shanghai&forceConnectionTimeZoneToSession=true") String url, + @DefaultValue("com.mysql.cj.jdbc.Driver") String driverClassName, String username, String password, + // Database TTL, default is 30 days. + @DefaultValue("30d") String expireTime) { } diff --git a/web-app/angular.json b/web-app/angular.json index 37b4541cdcf..bca121a4244 100644 --- a/web-app/angular.json +++ b/web-app/angular.json @@ -20,6 +20,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { + "preserveSymlinks": true, "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", @@ -99,14 +100,15 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "hertzbeat-web-app:build" + "proxyConfig": "proxy.conf.json", + "buildTarget": "hertzbeat-web-app:build" }, "configurations": { "production": { - "browserTarget": "hertzbeat-web-app:build:production" + "buildTarget": "hertzbeat-web-app:build:production" }, "development": { - "browserTarget": "hertzbeat-web-app:build:development" + "buildTarget": "hertzbeat-web-app:build:development" } }, "defaultConfiguration": "development" @@ -114,7 +116,7 @@ "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "hertzbeat-web-app:build" + "buildTarget": "hertzbeat-web-app:build" } }, "test": { diff --git a/web-app/package.json b/web-app/package.json index 844648b5d7f..8df6a7640ae 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -20,7 +20,7 @@ ], "scripts": { "ng": "ng", - "start": "ng s -o", + "start": "ng serve --proxy-config proxy.conf.json", "build": "npm run ng-high-memory build", "watch": "ng build --watch --configuration development", "test": "ng test", @@ -40,54 +40,54 @@ }, "private": true, "dependencies": { - "@angular/animations": "15.2.10", - "@angular/common": "15.2.10", - "@angular/compiler": "15.2.10", - "@angular/core": "15.2.10", - "@angular/forms": "15.2.10", - "@angular/platform-browser": "15.2.10", - "@angular/platform-browser-dynamic": "15.2.10", - "@angular/router": "15.2.10", - "@delon/abc": "15.2.1", - "@delon/acl": "15.2.1", - "@delon/auth": "15.2.1", - "@delon/cache": "15.2.1", - "@delon/form": "15.2.1", - "@delon/mock": "15.2.1", - "@delon/theme": "15.2.1", - "@delon/util": "15.2.1", + "@angular/animations": "17.3.10", + "@angular/common": "17.3.10", + "@angular/compiler": "17.3.10", + "@angular/core": "17.3.10", + "@angular/forms": "17.3.10", + "@angular/platform-browser": "17.3.10", + "@angular/platform-browser-dynamic": "17.3.10", + "@angular/router": "17.3.10", + "@delon/abc": "17.0.5", + "@delon/acl": "17.3.1", + "@delon/auth": "17.3.1", + "@delon/cache": "17.3.1", + "@delon/form": "17.3.1", + "@delon/mock": "17.3.1", + "@delon/theme": "17.3.1", + "@delon/util": "17.3.1", "ajv": "8.12.0", "ajv-formats": "2.1.1", - "angular-tag-cloud-module": "15.0.0", + "angular-tag-cloud-module": "17.0.1", "echarts": "5.4.3", "jquery": "3.7.1", "monaco-editor": "0.36.1", - "ng-zorro-antd": "15.1.0", - "ngx-color-picker": "12.0.1", - "ngx-echarts": "15.0.3", - "ngx-slick-carousel": "15.0.0", + "ng-zorro-antd": "17.4.1", + "ngx-color-picker": "16.0.0", + "ngx-echarts": "17.2.0", + "ngx-slick-carousel": "17.0.0", "rxjs": "7.8.1", "screenfull": "6.0.2", "slick-carousel": "1.8.1", "tslib": "2.6.2", - "zone.js": "0.11.8" + "zone.js": "0.14.5" }, "devDependencies": { - "@angular-devkit/build-angular": "15.2.10", - "@angular-eslint/builder": "15.2.1", - "@angular-eslint/eslint-plugin": "15.2.1", - "@angular-eslint/eslint-plugin-template": "15.2.1", - "@angular-eslint/schematics": "15.2.1", - "@angular-eslint/template-parser": "15.2.1", - "@angular/cli": "15.2.10", - "@angular/compiler-cli": "15.2.10", - "@angular/language-service": "15.2.10", - "@delon/testing": "15.2.1", - "@types/jasmine": "4.0.3", - "@types/jasminewd2": "2.0.12", - "@types/node": "12.20.55", - "@typescript-eslint/eslint-plugin": "5.49.0", - "@typescript-eslint/parser": "5.49.0", + "@angular-devkit/build-angular": "17.3.8", + "@angular-eslint/builder": "17.5.2", + "@angular-eslint/eslint-plugin": "17.5.2", + "@angular-eslint/eslint-plugin-template": "17.5.2", + "@angular-eslint/schematics": "17.5.2", + "@angular-eslint/template-parser": "17.5.2", + "@angular/cli": "17.3.8", + "@angular/compiler-cli": "17.3.10", + "@angular/language-service": "17.3.10", + "@delon/testing": "17.3.1", + "@types/jasmine": "5.1.4", + "@types/jasminewd2": "2.0.13", + "@types/node": "20.12.11", + "@typescript-eslint/eslint-plugin": "7.8.0", + "@typescript-eslint/parser": "7.8.0", "eslint": "8.51.0", "eslint-config-prettier": "8.6.0", "eslint-plugin-deprecation": "1.3.3", @@ -104,7 +104,7 @@ "karma-jasmine": "5.1.0", "karma-jasmine-html-reporter": "2.0.0", "lint-staged": "13.3.0", - "ng-alain": "15.2.1", + "ng-alain": "17.3.1", "node-fetch": "2.7.0", "prettier": "2.8.8", "protractor": "7.0.0", @@ -116,7 +116,7 @@ "stylelint-declaration-block-no-ignored-properties": "2.7.0", "stylelint-order": "5.0.0", "ts-node": "10.9.1", - "typescript": "4.9.5" + "typescript": "5.3.3" }, "lint-staged": { "(src)/**/*.{html,ts}": [ diff --git a/web-app/proxy.conf.json b/web-app/proxy.conf.json new file mode 100644 index 00000000000..3d83136d01e --- /dev/null +++ b/web-app/proxy.conf.json @@ -0,0 +1,8 @@ +{ + "/api/*": { + "target": "http://localhost:1157", + "secure": false, + "changeOrigin": true, + "logLevel": "debug" + } +} diff --git a/web-app/src/app/global-config.module.ts b/web-app/src/app/global-config.module.ts index 4a99b5f7eaa..c4c6f1be36e 100644 --- a/web-app/src/app/global-config.module.ts +++ b/web-app/src/app/global-config.module.ts @@ -8,7 +8,7 @@ import { throwIfAlreadyLoaded } from '@core'; import { environment } from '@env/environment'; -const alainModules: any[] = [AlainThemeModule.forRoot(), DelonACLModule.forRoot()]; +const alainModules: any[] = [AlainThemeModule.forRoot(), DelonACLModule]; import { NzConfig, NZ_CONFIG } from 'ng-zorro-antd/core/config'; const ngZorroConfig: NzConfig = {}; diff --git a/web-app/src/app/layout/basic/basic.component.ts b/web-app/src/app/layout/basic/basic.component.ts index 9b2ab111ff3..11095fa1fce 100644 --- a/web-app/src/app/layout/basic/basic.component.ts +++ b/web-app/src/app/layout/basic/basic.component.ts @@ -58,7 +58,7 @@ import { CONSTANTS } from '../../shared/constants'; -
+
diff --git a/web-app/src/app/layout/layout.module.ts b/web-app/src/app/layout/layout.module.ts index bf2c2df7912..7906dfcd603 100644 --- a/web-app/src/app/layout/layout.module.ts +++ b/web-app/src/app/layout/layout.module.ts @@ -4,7 +4,6 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { GlobalFooterModule } from '@delon/abc/global-footer'; -import { NoticeIconModule } from '@delon/abc/notice-icon'; import { AlainThemeModule } from '@delon/theme'; import { LayoutDefaultModule } from '@delon/theme/layout-default'; import { SettingDrawerModule } from '@delon/theme/setting-drawer'; @@ -43,6 +42,8 @@ import { LayoutPassportComponent } from './passport/passport.component'; import { NzModalModule } from 'ng-zorro-antd/modal'; import { NzTagModule } from 'ng-zorro-antd/tag'; import { NzDividerModule } from 'ng-zorro-antd/divider'; +import { NzListComponent, NzListItemComponent, NzListItemMetaComponent } from 'ng-zorro-antd/list'; +import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet'; const PASSPORT = [LayoutPassportComponent]; @NgModule({ @@ -54,7 +55,6 @@ const PASSPORT = [LayoutPassportComponent]; ThemeBtnModule, SettingDrawerModule, LayoutDefaultModule, - NoticeIconModule, GlobalFooterModule, NzDropDownModule, NzInputModule, @@ -67,7 +67,11 @@ const PASSPORT = [LayoutPassportComponent]; NzIconModule, NzModalModule, NzTagModule, - NzDividerModule + NzDividerModule, + NzListComponent, + NzListItemComponent, + NzListItemMetaComponent, + NzStringTemplateOutletDirective ], declarations: [...COMPONENTS, ...HEADER_COMPONENTS, ...PASSPORT], exports: [...COMPONENTS, ...PASSPORT] diff --git a/web-app/src/app/pojo/Collector.ts b/web-app/src/app/pojo/Collector.ts index d255e87c6ba..5b27cd902b9 100644 --- a/web-app/src/app/pojo/Collector.ts +++ b/web-app/src/app/pojo/Collector.ts @@ -21,6 +21,7 @@ export class Collector { id!: number; name!: string; ip!: string; + version!: string; // public or private mode!: string; // collector status: 0-online 1-offline diff --git a/web-app/src/app/pojo/NoticeReceiver.ts b/web-app/src/app/pojo/NoticeReceiver.ts index 18bda19da78..abbf88e27d8 100644 --- a/web-app/src/app/pojo/NoticeReceiver.ts +++ b/web-app/src/app/pojo/NoticeReceiver.ts @@ -27,6 +27,7 @@ export class NoticeReceiver { email!: string; tgBotToken!: string; tgUserId!: string; + userId!: string; slackWebHookUrl!: string; discordChannelId!: string; discordBotToken!: string; diff --git a/web-app/src/app/routes/alert/alert-center/alert-center.component.html b/web-app/src/app/routes/alert/alert-center/alert-center.component.html index f85a68787e3..84203ac8ba3 100644 --- a/web-app/src/app/routes/alert/alert-center/alert-center.component.html +++ b/web-app/src/app/routes/alert/alert-center/alert-center.component.html @@ -17,74 +17,72 @@ ~ under the License. --> - - +> -
- + - - - - + + + - - - - - - - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + + @@ -172,37 +170,39 @@ - - - +
+ + + +
diff --git a/web-app/src/app/routes/alert/alert-center/alert-center.component.ts b/web-app/src/app/routes/alert/alert-center/alert-center.component.ts index 46021a40cc1..18ddd785ccb 100644 --- a/web-app/src/app/routes/alert/alert-center/alert-center.component.ts +++ b/web-app/src/app/routes/alert/alert-center/alert-center.component.ts @@ -48,8 +48,8 @@ export class AlertCenterComponent implements OnInit { tableLoading: boolean = false; checkedAlertIds = new Set(); // 搜索过滤相关属性 - filterStatus: number | undefined; - filterPriority: number | undefined; + filterStatus: number = 9; + filterPriority: number = 9; filterContent: string | undefined; ngOnInit(): void { diff --git a/web-app/src/app/routes/alert/alert-converge/alert-converge.component.html b/web-app/src/app/routes/alert/alert-converge/alert-converge.component.html index bf6999e4d5c..a7a86cc73c3 100644 --- a/web-app/src/app/routes/alert/alert-converge/alert-converge.component.html +++ b/web-app/src/app/routes/alert/alert-converge/alert-converge.component.html @@ -17,38 +17,38 @@ ~ under the License. --> - +> + -
- - - - - -
+ + + + + + + + + + + @@ -103,25 +103,27 @@ {{ (data.gmtUpdate ? data.gmtUpdate : data.gmtCreate) | date : 'YYYY-MM-dd HH:mm:ss' }} - - +
+ + +
@@ -166,7 +168,7 @@ nzShowSearch nzMode="multiple" nzAllowClear - nzPlaceHolder="Select Tags" + [nzPlaceHolder]="'alert.notice.rule.tag.placeholder' | i18n" required name="tags" id="tags" @@ -184,7 +186,7 @@ nzShowSearch nzMode="multiple" nzAllowClear - nzPlaceHolder="Select Priorities" + [nzPlaceHolder]="'alert.notice.rule.priority.placeholder' | i18n" required name="priorities" id="priorities" diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html index af6b5b62b60..92ecad47c31 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html @@ -17,33 +17,31 @@ ~ under the License. --> - +> + + -
- + + + - -
- + + + + {{ 'alert.notice.receiver.people' | i18n }} @@ -134,50 +132,48 @@ {{ (data.gmtUpdate ? data.gmtUpdate : data.gmtCreate) | date : 'YYYY-MM-dd HH:mm:ss' }} - - +
+ + +
-
- + + + - -
+ + + - + {{ 'alert.notice.rule.name' | i18n }} @@ -211,46 +207,50 @@ {{ (data.gmtUpdate ? data.gmtUpdate : data.gmtCreate) | date : 'YYYY-MM-dd HH:mm:ss' }} - - +
+ + +
-
- - -
+ + + + + + @@ -325,7 +325,7 @@ {{ (data.gmtUpdate ? data.gmtUpdate : data.gmtCreate) | date : 'YYYY-MM-dd HH:mm:ss' }} - +
- - +
+
- +
@@ -393,7 +393,7 @@ nzMode="multiple" id="receiver" name="receiver" - nzPlaceHolder="Select a receiver" + [nzPlaceHolder]="'alert.notice.receiver.people.placeholder' | i18n" nzShowSearch required > @@ -409,7 +409,7 @@ [nzOptions]="templatesOption" id="templates" name="templates" - nzPlaceHolder="Select a template" + [nzPlaceHolder]="'alert.notice.template.placeholder' | i18n" nzShowSearch nzAllowClear > @@ -435,7 +435,7 @@ name="tags" nzAllowClear nzMode="multiple" - nzPlaceHolder="Select Tags" + [nzPlaceHolder]="'alert.notice.rule.tag.placeholder' | i18n" nzShowSearch required > @@ -453,7 +453,7 @@ name="priorities" nzAllowClear nzMode="multiple" - nzPlaceHolder="Select Priorities" + [nzPlaceHolder]="'alert.notice.rule.priority.placeholder' | i18n" nzShowSearch required > @@ -526,7 +526,14 @@ {{ 'alert.notice.receiver.type' | i18n }} - + @@ -587,13 +594,13 @@ {{ 'alert.notice.type.phone' | i18n }} - + - {{ 'alert.notice.type.wework-userId' | i18n }} + {{ 'alert.notice.type.userId' | i18n }} - + @@ -611,21 +618,39 @@ /> + + {{ 'alert.notice.type.phone' | i18n }} + + + + + + {{ 'alert.notice.type.userId' | i18n }} + + + + - {{ + {{ 'alert.notice.type.fei-shu-key' | i18n }} + + {{ 'alert.notice.type.userId' | i18n }} + + + + {{ 'alert.notice.type.telegram-bot-token' | i18n @@ -779,7 +804,14 @@ {{ 'alert.notice.receiver.type' | i18n }} - + diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts index 1049d7075e6..2014dafbfed 100644 --- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts +++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.ts @@ -300,10 +300,10 @@ export class AlertNoticeComponent implements OnInit { } break; case 6: - if (this.receiver?.wechatId) { - index = this.receiver.wechatId.indexOf('hook'); + if (this.receiver?.accessToken) { + index = this.receiver.accessToken.indexOf('hook'); if (index > 0) { - this.receiver.wechatId = this.receiver.wechatId.substring(index + 5); + this.receiver.accessToken = this.receiver.accessToken.substring(index + 5); } } break; @@ -354,13 +354,17 @@ export class AlertNoticeComponent implements OnInit { onManageReceiverModalOk() { if (this.receiverForm?.invalid) { + let isWaring = false; Object.values(this.receiverForm.controls).forEach(control => { - if (control.invalid) { + if (control.invalid && !(Object.keys(control?.errors || {}).length === 0)) { + isWaring = true; control.markAsDirty(); control.updateValueAndValidity({ onlySelf: true }); } }); - return; + if (isWaring) { + return; + } } this.isManageReceiverModalOkLoading = true; if (this.isManageReceiverModalAdd) { diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html old mode 100644 new mode 100755 index 929a732a4ec..b25c9978b1d --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html @@ -17,61 +17,60 @@ ~ under the License. --> - +> + -
- - - - - -
    -
  • - -
  • -
  • - - + + + + + +
      +
    • + - -
    • -
    -
    - - -
+ +
  • + + + +
  • + + + + + + + @@ -139,35 +138,37 @@ - - - +
    + + + +
    @@ -203,211 +204,211 @@
    - - - - - - - - - - - - {{ item.value }} : - {{ - item.value == item.label - ? i == 0 - ? ('alert.setting.target.tip' | i18n) - : ('alert.setting.target.other' | i18n) - : item.label - }} - - - {{ item.type === 0 ? ('alert.setting.number' | i18n) : ('alert.setting.string' | i18n) }} - - - - - {{ 'alert.setting.operator' | i18n }} : equals(str1,str2), contains(str1,str2), exists(keyName), matches(str,regex), ==, - <, <=, >, >=, !=, ( ), +, -, &&, || - - - - - - - - - - {{ 'alert.setting.rule' | i18n }} - - - - - - - - {{ 'alert.setting.rule' | i18n }} -
    -
    - - - {{ item.label ? item.label : item.value }} - - {{ - item.type === 0 - ? ('alert.setting.number' | i18n) - : item.type === 3 - ? ('alert.setting.time' | i18n) - : ('alert.setting.string' | i18n) - }} - - - {{ item.unit }} - - - - - - - - - - - - - - - - - - - - + + + +
    + + + + + + + + + {{ item.value }} : + {{ + item.value == item.label + ? i == 0 + ? ('alert.setting.target.tip' | i18n) + : ('alert.setting.target.other' | i18n) + : item.label + }} + + + {{ item.type === 0 ? ('alert.setting.number' | i18n) : ('alert.setting.string' | i18n) }} + + + + + {{ 'alert.setting.operator' | i18n }} : equals(str1,str2), contains(str1,str2), exists(keyName), matches(str,regex), + ==, <, <=, >, >=, !=, ( ), +, -, &&, || + + + + + +
    +
    +
    +
    + + + {{ item.label ? item.label : item.value }} + + {{ + item.type === 0 + ? ('alert.setting.number' | i18n) + : item.type === 3 + ? ('alert.setting.time' | i18n) + : ('alert.setting.string' | i18n) + }} + + + {{ item.unit }} + + + + + + + + + + + + + + + + + + + + + + +
    @@ -429,7 +430,12 @@ {{ 'alert.priority' | i18n }} - + @@ -446,8 +452,23 @@ - - + + {{ 'alert.setting.template' | i18n }} + + + + + + @@ -472,48 +493,18 @@ - - - - - {{ 'alert.setting.template' | i18n }} - - - - - - - - - - {{ 'tag.bind' | i18n }} - - - - {{ sliceTagName(tag) }} - - - - - {{ 'tag.new' | i18n }} - - + {{ 'alert.setting.default' | i18n }} @@ -547,52 +538,6 @@
    - - -
    - - - - - - - {{ 'tag' | i18n }} - - - - - - - {{ data.name }} - - {{ data.name + ':' + data.tagValue }} - - - - - -
    -
    - item !== tag); - } - } - - sliceTagName(tag: TagItem): string { - if (tag.value != undefined && tag.value.trim() != '') { - return `${tag.name}:${tag.value}`; - } else { - return tag.name; - } - } - // end 新增修改告警定义model - // start Tag model - isTagManageModalVisible = false; - isTagManageModalOkLoading = false; - tagCheckedAll: boolean = false; - tagTableLoading = false; - tagSearch!: string; - tags!: Tag[]; - checkedTags = new Set(); - loadTagsTable() { - this.tagTableLoading = true; - let tagsReq$ = this.tagSvc.loadTags(this.tagSearch, 1, 0, 1000).subscribe( - message => { - this.tagTableLoading = false; - this.tagCheckedAll = false; - this.checkedTags.clear(); - if (message.code === 0) { - let page = message.data; - this.tags = page.content; - } else { - console.warn(message.msg); - } - tagsReq$.unsubscribe(); - }, - error => { - this.tagTableLoading = false; - tagsReq$.unsubscribe(); - } - ); - } - onShowTagsModal() { - this.isTagManageModalVisible = true; - this.loadTagsTable(); - } - onTagManageModalCancel() { - this.isTagManageModalVisible = false; - } - onTagManageModalOk() { - this.isTagManageModalOkLoading = true; - this.checkedTags.forEach(item => { - if (this.define.tags.find(tag => tag.name == item.name && tag.value == item.tagValue) == undefined) { - this.define.tags.push({ name: item.name, value: item.tagValue }); - } - }); - this.isTagManageModalOkLoading = false; - this.isTagManageModalVisible = false; - } - onTagAllChecked(checked: boolean) { - if (checked) { - this.tags.forEach(tag => this.checkedTags.add(tag)); - } else { - this.checkedTags.clear(); - } - } - onTagItemChecked(tag: Tag, checked: boolean) { - if (checked) { - this.checkedTags.add(tag); - } else { - this.checkedTags.delete(tag); - } - } - // end tag model - // start 告警定义与监控关联model isConnectModalVisible = false; isConnectModalOkLoading = false; diff --git a/web-app/src/app/routes/alert/alert-silence/alert-silence.component.html b/web-app/src/app/routes/alert/alert-silence/alert-silence.component.html old mode 100644 new mode 100755 index efcfae28d34..728c9e8b26a --- a/web-app/src/app/routes/alert/alert-silence/alert-silence.component.html +++ b/web-app/src/app/routes/alert/alert-silence/alert-silence.component.html @@ -17,39 +17,38 @@ ~ under the License. --> - +> + -
    - - - - - -
    + + + + + + + + + + @@ -113,19 +112,27 @@ - - +
    + + +
    @@ -170,7 +177,7 @@ nzShowSearch nzMode="multiple" nzAllowClear - nzPlaceHolder="Select Tags" + [nzPlaceHolder]="'alert.notice.rule.tag.placeholder' | i18n" required name="tags" id="tags" @@ -188,7 +195,7 @@ nzShowSearch nzMode="multiple" nzAllowClear - nzPlaceHolder="Select Priorities" + [nzPlaceHolder]="'alert.notice.rule.priority.placeholder' | i18n" required name="priorities" id="priorities" diff --git a/web-app/src/app/routes/dashboard/dashboard.component.html b/web-app/src/app/routes/dashboard/dashboard.component.html index cb293ecf151..f5ca85ae1d8 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.html +++ b/web-app/src/app/routes/dashboard/dashboard.component.html @@ -290,131 +290,142 @@
    - - + + + +
    -
    + +
    +
    -
    - - - - -
    - - {{ - item.collector.status == 0 ? ('monitor.collector.status.online' | i18n) : ('monitor.collector.status.offline' | i18n) - }} - -
    -
    - -
    - - {{ item.pinMonitorNum + item.dispatchMonitorNum }} - -
    - {{ 'collector.pinned' | i18n }}: {{ item.pinMonitorNum }} - {{ 'collector.dispatched' | i18n }}: {{ item.dispatchMonitorNum }} -
    -
    - -
    - {{ - (item.collector.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss')?.trim() - }} -
    -
    - -
    - {{ item.collector.ip }} -
    -
    - -
    - {{ item.collector.name }} -
    -
    -
    -
    - - - - {{ 'collector' | i18n }} : {{ item.collector.name }} - - -
    -
    + +
    + + + + +
    + + {{ + item.collector.status == 0 ? ('monitor.collector.status.online' | i18n) : ('monitor.collector.status.offline' | i18n) + }} + +
    +
    + +
    + + {{ item.pinMonitorNum + item.dispatchMonitorNum }} + +
    + {{ 'collector.pinned' | i18n }}: {{ item.pinMonitorNum }} + {{ 'collector.dispatched' | i18n }}: {{ item.dispatchMonitorNum }} +
    +
    + +
    + {{ + (item.collector.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss')?.trim() + }} +
    +
    + +
    + {{ item.collector.ip }} +
    +
    + +
    + {{ item.collector.name }} +
    +
    +
    +
    + + + + {{ 'collector' | i18n }} : {{ item.collector.name }} + + +
    +
    +
    -
    - - - -

    - - - {{ 'alert.priority.0' | i18n }} - - - - {{ 'alert.priority.1' | i18n }} - - - - {{ 'alert.priority.2' | i18n }} - - [{{ alert.tags.monitorName }}] - {{ alert.content }} -

    -
    -
    -
    +
    + + + + +

    + + + {{ 'alert.priority.0' | i18n }} + + + + {{ 'alert.priority.1' | i18n }} + + + + {{ 'alert.priority.2' | i18n }} + + [{{ alert.tags.monitorName }}] + {{ alert.content }} +

    +
    +
    +
    +
    -
    + +
    +
    diff --git a/web-app/src/app/routes/dashboard/dashboard.component.less b/web-app/src/app/routes/dashboard/dashboard.component.less index 17b7e2a49be..1d2eadd30b7 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.less +++ b/web-app/src/app/routes/dashboard/dashboard.component.less @@ -42,7 +42,28 @@ .ant-timeline-item { padding-bottom: 10px; } + .tag-animation-delay { + cursor: pointer; } + .ant-spin-nested-loading, .ant-spin-container { + height: 100%; + } + .timeline-card { + .ant-card { + display: flex; + flex-direction: column; + cursor: default!important; + .ant-card-head { + flex-shrink: 0; + } + .ant-card-body { + flex: 1; + overflow-y: auto; + margin-bottom: 12px; + } + } + } +} [data-theme='dark'] { :host ::ng-deep { diff --git a/web-app/src/app/routes/dashboard/dashboard.component.ts b/web-app/src/app/routes/dashboard/dashboard.component.ts index c7595104228..08f72c9d8a8 100644 --- a/web-app/src/app/routes/dashboard/dashboard.component.ts +++ b/web-app/src/app/routes/dashboard/dashboard.component.ts @@ -25,6 +25,7 @@ import { CloudData } from 'angular-tag-cloud-module'; import { EChartsOption } from 'echarts'; import { NzMessageService } from 'ng-zorro-antd/message'; import { fromEvent } from 'rxjs'; +import { finalize } from 'rxjs/operators'; import { Alert } from '../../pojo/Alert'; import { AppCount } from '../../pojo/AppCount'; @@ -55,6 +56,7 @@ export class DashboardComponent implements OnInit, OnDestroy { // Tag Word Cloud wordCloudData: CloudData[] = []; + wordCloudDataLoading: boolean = false; defaultWordCloudData: CloudData[] = [ { text: 'HertzBeat', weight: 5 }, { text: 'Env:Prod', weight: 8 }, @@ -77,34 +79,38 @@ export class DashboardComponent implements OnInit, OnDestroy { ]; refreshWordCloudContent(): void { - let tagsInit$ = this.tagSvc.loadTags(undefined, 1, 0, 10000).subscribe( - message => { - if (message.code === 0) { - let page = message.data; - let tags = page.content; - if (tags != null && tags.length != 0) { - let tmpData: CloudData[] = []; - tags.forEach(item => { - tmpData.push({ - text: formatTagName(item), - weight: Math.random() * (10 - 5) + 5 + this.wordCloudDataLoading = true; + let tagsInit$ = this.tagSvc + .loadTags(undefined, 1, 0, 10000) + .pipe(finalize(() => (this.wordCloudDataLoading = false))) + .subscribe( + message => { + if (message.code === 0) { + let page = message.data; + let tags = page.content; + if (tags != null && tags.length != 0) { + let tmpData: CloudData[] = []; + tags.forEach(item => { + tmpData.push({ + text: formatTagName(item), + weight: Math.random() * (10 - 5) + 5 + }); }); - }); - this.wordCloudData = tmpData; + this.wordCloudData = tmpData; + } else { + this.wordCloudData = this.defaultWordCloudData; + } + this.cdr.detectChanges(); } else { - this.wordCloudData = this.defaultWordCloudData; + console.warn(message.msg); } - this.cdr.detectChanges(); - } else { - console.warn(message.msg); + tagsInit$.unsubscribe(); + }, + error => { + tagsInit$.unsubscribe(); + console.error(error.msg); } - tagsInit$.unsubscribe(); - }, - error => { - tagsInit$.unsubscribe(); - console.error(error.msg); - } - ); + ); } onTagCloudClick(data: CloudData): void { @@ -163,10 +169,12 @@ export class DashboardComponent implements OnInit, OnDestroy { pageResize$!: any; // collector list + collectorsLoading: boolean = false; collectors!: CollectorSummary[]; // 告警列表 alerts!: Alert[]; + alertContentLoading: boolean = false; ngOnInit(): void { this.appsCountTheme = { @@ -559,40 +567,48 @@ export class DashboardComponent implements OnInit, OnDestroy { alertsDealLoading: boolean = true; refreshAlertContentList(): void { - let alertsInit$ = this.alertSvc.loadAlerts(undefined, undefined, undefined, 0, 10).subscribe( - message => { - if (message.code === 0) { - let page = message.data; - this.alerts = page.content; - this.cdr.detectChanges(); - } else { - console.warn(message.msg); + this.alertContentLoading = true; + let alertsInit$ = this.alertSvc + .loadAlerts(undefined, undefined, undefined, 0, 10) + .pipe(finalize(() => (this.alertContentLoading = false))) + .subscribe( + message => { + if (message.code === 0) { + let page = message.data; + this.alerts = page.content; + this.cdr.detectChanges(); + } else { + console.warn(message.msg); + } + alertsInit$.unsubscribe(); + }, + error => { + alertsInit$.unsubscribe(); + console.error(error.msg); } - alertsInit$.unsubscribe(); - }, - error => { - alertsInit$.unsubscribe(); - console.error(error.msg); - } - ); + ); } refreshCollectorContentList(): void { - let collectorInit$ = this.collectorSvc.getCollectors().subscribe( - message => { - if (message.code === 0) { - this.collectors = message.data.content; - this.cdr.detectChanges(); - } else { - console.warn(message.msg); + this.collectorsLoading = true; + let collectorInit$ = this.collectorSvc + .getCollectors() + .pipe(finalize(() => (this.collectorsLoading = false))) + .subscribe( + message => { + if (message.code === 0) { + this.collectors = message.data.content; + this.cdr.detectChanges(); + } else { + console.warn(message.msg); + } + collectorInit$.unsubscribe(); + }, + error => { + collectorInit$.unsubscribe(); + console.error(error.msg); } - collectorInit$.unsubscribe(); - }, - error => { - collectorInit$.unsubscribe(); - console.error(error.msg); - } - ); + ); } refreshAlertSummary(): void { diff --git a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html index 37f87fc8db7..019ef5535a2 100644 --- a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html +++ b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.html @@ -18,13 +18,105 @@ --> - +
    +
    +

    ID

    +

    {{ monitorId }}

    +
    +
    +

    {{ 'monitors.detail.name' | i18n }}

    +

    {{ monitor.name }}

    +
    +
    +

    HOST

    +

    {{ monitor.host }}

    +
    +
    +

    {{ 'monitors.detail.port' | i18n }}

    +

    {{ port }}

    +
    +
    +

    {{ 'monitors.detail.description' | i18n }}

    +

    {{ monitor.description }}

    +
    +
    +

    {{ 'monitors.detail.status' | i18n }}

    +
    + + + {{ 'monitor.status.paused' | i18n }} + + + + {{ 'monitor.status.up' | i18n }} + + + + {{ 'monitor.status.down' | i18n }} + +
    +
    +
    +

    {{ 'monitor.intervals' | i18n }}

    +

    {{ monitor.intervals }}s

    +
    +
    +

    {{ 'common.new-time' | i18n }}

    +

    {{ monitor.gmtCreate | date : 'YYYY-MM-dd HH:mm:ss' }}

    +
    +
    +

    {{ 'common.edit-time' | i18n }}

    +

    {{ monitor.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss' }}

    +
    +
    + @@ -42,16 +134,15 @@ -
    - - - + {{ 'common.name' | i18n }} @@ -73,16 +164,21 @@ - -

    - {{ 'monitor.app.' + app + '.metrics.' + metrics | i18nElse : metrics }} + +

    + {{ !monitor ? ('monitor.app.' + app + '.metrics.' + metrics | i18nElse : metrics) : ('monitors.detail.basic' | i18n) }}

    -
    - - + + + + + + + +
    + - {{ 'monitors.collect.time' | i18n }}:{{ time | _date : 'HH:mm:ss' }} + {{ 'monitors.collect.time' | i18n }}: {{ time | _date : 'HH:mm:ss' }}
    diff --git a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.less b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.less index d089cc2ace6..7cc3fe6fafd 100644 --- a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.less +++ b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.less @@ -8,10 +8,10 @@ p { // :host 表示选择当前的组件## // ::ng-deep 可以忽略中间className的嵌套层级关系。直接找到你要修改的className## :host ::ng-deep { - .ant-card-head { - padding: 0 4px 0 4px; - } .ant-card-head-title { padding: 16px 0 4px 0; } + .ant-table-body { + overflow-y: auto!important; + } } diff --git a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.ts b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.ts index dcde3150376..d416c5c3df2 100644 --- a/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.ts +++ b/web-app/src/app/routes/monitor/monitor-data-table/monitor-data-table.component.ts @@ -17,8 +17,9 @@ * under the License. */ -import { Component, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { NzNotificationService } from 'ng-zorro-antd/notification'; +import { finalize } from 'rxjs/operators'; import { MonitorService } from '../../../service/monitor.service'; @@ -27,52 +28,70 @@ import { MonitorService } from '../../../service/monitor.service'; templateUrl: './monitor-data-table.component.html', styleUrls: ['./monitor-data-table.component.less'] }) -export class MonitorDataTableComponent { +export class MonitorDataTableComponent implements OnInit { @Input() get monitorId(): number { return this._monitorId; } set monitorId(monitorId: number) { this._monitorId = monitorId; - // 需将monitorId作为输入参数的最后一个 这样在执行loadData时其它入参才有值 - this.loadData(); + if (this._monitorId && this.metrics) { + // 需将monitorId作为输入参数的最后一个 这样在执行loadData时其它入参才有值 + this.loadData(); + } } private _monitorId!: number; @Input() app!: string; @Input() + port!: number | undefined; + @Input() + monitor!: any; + @Input() metrics!: string; + @Input() + height: string = '100%'; time!: any; fields!: any[]; valueRows!: any[]; rowValues!: any[]; isTable: boolean = true; + scrollY: string = '100%'; + loading: boolean = false; constructor(private monitorSvc: MonitorService, private notifySvc: NzNotificationService) {} + ngOnInit(): void { + this.scrollY = `calc(${this.height} - 130px)`; + } + loadData() { + this.loading = true; // 读取实时指标数据 - let metricData$ = this.monitorSvc.getMonitorMetricsData(this.monitorId, this.metrics).subscribe( - message => { - metricData$.unsubscribe(); - if (message.code === 0 && message.data) { - this.time = message.data.time; - this.fields = message.data.fields; - this.valueRows = message.data.valueRows; - if (this.valueRows.length == 1) { - this.isTable = false; - this.rowValues = this.valueRows[0].values; + let metricData$ = this.monitorSvc + .getMonitorMetricsData(this.monitorId, this.metrics) + .pipe(finalize(() => (this.loading = false))) + .subscribe( + message => { + metricData$.unsubscribe(); + if (message.code === 0 && message.data) { + this.time = message.data.time; + this.fields = message.data.fields; + this.valueRows = message.data.valueRows; + if (this.valueRows.length == 1) { + this.isTable = false; + this.rowValues = this.valueRows[0].values; + } + } else if (message.code !== 0) { + this.notifySvc.warning(`${this.metrics}:${message.msg}`, ''); + console.info(`${this.metrics}:${message.msg}`); } - } else if (message.code !== 0) { - this.notifySvc.warning(`${this.metrics}:${message.msg}`, ''); - console.info(`${this.metrics}:${message.msg}`); + }, + error => { + console.error(error.msg); + metricData$.unsubscribe(); } - }, - error => { - console.error(error.msg); - metricData$.unsubscribe(); - } - ); + ); } } diff --git a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html old mode 100644 new mode 100755 index 71e9ddfbef8..03cf5e9b86e --- a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html +++ b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.html @@ -34,19 +34,16 @@ {{ 'monitors.detail' | i18n }} + + - + {{ 'monitor.app.' + app | i18n }} - - - + @@ -55,100 +52,21 @@ - + {{ 'monitors.detail.realtime' | i18n }} -
    -
    - -
    -

    ID

    -

    {{ monitorId }}

    -
    -
    -

    {{ 'monitors.detail.name' | i18n }}

    -

    {{ monitor.name }}

    -
    -
    -

    HOST

    -

    {{ monitor.host }}

    -
    -
    -

    {{ 'monitors.detail.port' | i18n }}

    -

    {{ port }}

    -
    -
    -

    {{ 'monitors.detail.description' | i18n }}

    -

    {{ monitor.description }}

    -
    -
    -

    {{ 'monitors.detail.status' | i18n }}

    -
    - - - {{ 'monitor.status.paused' | i18n }} - - - - {{ 'monitor.status.up' | i18n }} - - - - {{ 'monitor.status.down' | i18n }} - -
    -
    -
    -

    {{ 'monitor.intervals' | i18n }}

    -

    {{ monitor.intervals }}s

    -
    -
    -

    {{ 'common.new-time' | i18n }}

    -

    {{ monitor.gmtCreate | date : 'YYYY-MM-dd HH:mm:ss' }}

    -
    -
    -

    {{ 'common.edit-time' | i18n }}

    -

    {{ monitor.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss' }}

    -
    -
    -
    +
    + - + {{ 'monitors.detail.history' | i18n }} -
    +
    - -

    {{ 'monitors.detail.basic' | i18n }}

    -
    - - - - - + + +
      diff --git a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.less b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.less index 603fcabe688..0c5c082b575 100644 --- a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.less +++ b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.less @@ -31,3 +31,16 @@ p { } } } + +.cards { + gap: 8px; + margin: 8px; + display: flex; + flex-wrap: wrap; + justify-content: flex-start; + + .card { + width: calc(50% - 4px); + height: 400px; + } +} diff --git a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts index 31f8c08f199..228557ecbb0 100644 --- a/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts +++ b/web-app/src/app/routes/monitor/monitor-detail/monitor-detail.component.ts @@ -61,9 +61,8 @@ export class MonitorDetailComponent implements OnInit, OnDestroy { showBasic = true; ngOnInit(): void { - this.loadRealTimeMetric(); this.countDownTime = this.deadline; - this.interval$ = setInterval(this.countDown.bind(this), 1000); + this.loadRealTimeMetric(); } loadMetricChart() { @@ -157,6 +156,9 @@ export class MonitorDetailComponent implements OnInit, OnDestroy { } else { console.warn(message.msg); } + if (this.interval$ === undefined) { + this.interval$ = setInterval(this.countDown.bind(this), 1000); + } this.isSpinning = false; }, error => { @@ -166,10 +168,6 @@ export class MonitorDetailComponent implements OnInit, OnDestroy { ); } - showBasicStatus(show: boolean) { - this.showBasic = show; - } - countDown() { if (this.deadline > 0) { this.countDownTime = Math.max(0, this.countDownTime - 1); diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html index 46b72127867..8660943796f 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html @@ -17,475 +17,27 @@ ~ under the License. --> - - - - -
      -
      - - - {{ hostName ? hostName : ('monitor.host' | i18n) }} - - - - - - - - {{ 'monitor.name' | i18n }} - - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - - - - - {{ paramDefine.name }} - - - - +> - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - {{ paramDefine.name }} - - - - - - - - - - - - - - - {{ 'monitor.collector' | i18n }} - - - - - {{ 'monitor.collector.system.default' | i18n }} - {{ 'collector.mode.public' | i18n }} - - - {{ - item.status == 0 ? ('monitor.collector.status.online' | i18n) : ('monitor.collector.status.offline' | i18n) - }} - - {{ item.name }} - {{ item.ip }} - - {{ item.mode == 'private' ? ('collector.mode.private' | i18n) : ('collector.mode.public' | i18n) }} - - - - - {{ selected.nzLabel }} - - - - - - - {{ 'monitor.intervals' | i18n }} - - - - - {{ 'common.time.unit.second' | i18n }} - - - - - - {{ 'tag.bind' | i18n }} - - - - {{ sliceTagName(tag) }} - - - - - {{ 'tag.new' | i18n }} - - - - - - - - {{ 'monitor.description' | i18n }} - - - - - - - - -
      -
      - - - -
      -
      -
      -
      -
      + - - -
      - - - - - - - {{ 'tag' | i18n }} - - - - - - - {{ data.name }} - - {{ data.name + ':' + data.tagValue }} - - - - - -
      -
      + diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts index 6101a214202..72ff1bebe18 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts @@ -24,18 +24,16 @@ import { I18NService } from '@core'; import { ALAIN_I18N_TOKEN, TitleService } from '@delon/theme'; import { NzNotificationService } from 'ng-zorro-antd/notification'; import { throwError } from 'rxjs'; -import { finalize, switchMap } from 'rxjs/operators'; +import { switchMap } from 'rxjs/operators'; import { Collector } from '../../../pojo/Collector'; import { Message } from '../../../pojo/Message'; import { Monitor } from '../../../pojo/Monitor'; import { Param } from '../../../pojo/Param'; import { ParamDefine } from '../../../pojo/ParamDefine'; -import { Tag } from '../../../pojo/Tag'; import { AppDefineService } from '../../../service/app-define.service'; import { CollectorService } from '../../../service/collector.service'; import { MonitorService } from '../../../service/monitor.service'; -import { TagService } from '../../../service/tag.service'; @Component({ selector: 'app-monitor-modify', @@ -50,7 +48,6 @@ export class MonitorEditComponent implements OnInit { private router: Router, private titleSvc: TitleService, private notifySvc: NzNotificationService, - private tagSvc: TagService, private collectorSvc: CollectorService, @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService ) {} @@ -64,9 +61,7 @@ export class MonitorEditComponent implements OnInit { monitor = new Monitor(); collectors!: Collector[]; collector: string = ''; - profileForm: FormGroup = new FormGroup({}); detected: boolean = false; - passwordVisible: boolean = false; isSpinning: boolean = false; spinningTip: string = 'Loading...'; @@ -75,7 +70,6 @@ export class MonitorEditComponent implements OnInit { .pipe( switchMap((paramMap: ParamMap) => { this.isSpinning = true; - this.passwordVisible = false; let id = paramMap.get('monitorId'); this.monitor.id = Number(id); // 查询监控信息 @@ -205,21 +199,6 @@ export class MonitorEditComponent implements OnInit { }); } - onParamBooleanChanged(booleanValue: boolean, field: string) { - // 对SSL的端口联动处理, 不开启SSL默认80端口,开启SSL默认443 - if (field === 'ssl') { - this.params.forEach(param => { - if (param.field === 'port') { - if (booleanValue) { - param.paramValue = '443'; - } else { - param.paramValue = '80'; - } - } - }); - } - } - onDependChanged(dependValue: string, dependField: string) { this.paramDefines.forEach((paramDefine, index) => { if (paramDefine.depend) { @@ -245,37 +224,12 @@ export class MonitorEditComponent implements OnInit { }); } - onSubmit(formGroup: FormGroup) { - if (formGroup.invalid) { - Object.values(formGroup.controls).forEach(control => { - if (control.invalid) { - control.markAsDirty(); - control.updateValueAndValidity({ onlySelf: true }); - } - }); - return; - } - this.monitor.host = this.monitor.host.trim(); - this.monitor.name = this.monitor.name.trim(); - // todo 暂时单独设置host属性值 - this.params.forEach(param => { - if (param.field === 'host') { - param.paramValue = this.monitor.host; - } - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); - this.advancedParams.forEach(param => { - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); + onSubmit(info: any) { let addMonitor = { detected: this.detected, - monitor: this.monitor, + monitor: info.monitor, collector: this.collector, - params: this.params.concat(this.advancedParams) + params: info.params.concat(info.advancedParams) }; if (this.detected) { this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting'); @@ -288,7 +242,7 @@ export class MonitorEditComponent implements OnInit { this.isSpinning = false; if (message.code === 0) { this.notifySvc.success(this.i18nSvc.fanyi('monitors.edit.success'), ''); - this.router.navigateByUrl(`/monitors?app=${this.monitor.app}`); + this.router.navigateByUrl(`/monitors?app=${info.monitor.app}`); } else { this.notifySvc.error(this.i18nSvc.fanyi('monitors.edit.failed'), message.msg); } @@ -300,37 +254,12 @@ export class MonitorEditComponent implements OnInit { ); } - onDetect(formGroup: FormGroup) { - if (formGroup.invalid) { - Object.values(formGroup.controls).forEach(control => { - if (control.invalid) { - control.markAsDirty(); - control.updateValueAndValidity({ onlySelf: true }); - } - }); - return; - } - this.monitor.host = this.monitor.host.trim(); - this.monitor.name = this.monitor.name.trim(); - // todo 暂时单独设置host属性值 - this.params.forEach(param => { - if (param.field === 'host') { - param.paramValue = this.monitor.host; - } - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); - this.advancedParams.forEach(param => { - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); + onDetect(info: any) { let detectMonitor = { detected: this.detected, - monitor: this.monitor, + monitor: info.monitor, collector: this.collector, - params: this.params.concat(this.advancedParams) + params: info.params.concat(info.advancedParams) }; this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting'); this.isSpinning = true; @@ -355,80 +284,4 @@ export class MonitorEditComponent implements OnInit { app = app ? app : ''; this.router.navigateByUrl(`/monitors?app=${app}`); } - - onRemoveTag(tag: Tag) { - if (this.monitor != undefined && this.monitor.tags != undefined) { - this.monitor.tags = this.monitor.tags.filter(item => item !== tag); - } - } - - sliceTagName(tag: Tag): string { - if (tag.tagValue != undefined && tag.tagValue.trim() != '') { - return `${tag.name}:${tag.tagValue}`; - } else { - return tag.name; - } - } - - // start Tag model - isManageModalVisible = false; - isManageModalOkLoading = false; - tagCheckedAll: boolean = false; - tagTableLoading = false; - tagSearch!: string; - tags!: Tag[]; - checkedTags = new Set(); - loadTagsTable() { - this.tagTableLoading = true; - let tagsReq$ = this.tagSvc.loadTags(this.tagSearch, 1, 0, 1000).subscribe( - message => { - this.tagTableLoading = false; - this.tagCheckedAll = false; - this.checkedTags.clear(); - if (message.code === 0) { - let page = message.data; - this.tags = page.content; - } else { - console.warn(message.msg); - } - tagsReq$.unsubscribe(); - }, - error => { - this.tagTableLoading = false; - tagsReq$.unsubscribe(); - } - ); - } - onShowTagsModal() { - this.isManageModalVisible = true; - this.loadTagsTable(); - } - onManageModalCancel() { - this.isManageModalVisible = false; - } - onManageModalOk() { - this.isManageModalOkLoading = true; - this.checkedTags.forEach(item => { - if (this.monitor.tags.find(tag => tag.id == item.id) == undefined) { - this.monitor.tags.push(item); - } - }); - this.isManageModalOkLoading = false; - this.isManageModalVisible = false; - } - onAllChecked(checked: boolean) { - if (checked) { - this.tags.forEach(tag => this.checkedTags.add(tag)); - } else { - this.checkedTags.clear(); - } - } - onItemChecked(tag: Tag, checked: boolean) { - if (checked) { - this.checkedTags.add(tag); - } else { - this.checkedTags.delete(tag); - } - } - // end tag model } diff --git a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html new file mode 100644 index 00000000000..33351b86b45 --- /dev/null +++ b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.html @@ -0,0 +1,139 @@ + + + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +
      + + + +
      +
      + +
      +
      diff --git a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.less b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.less new file mode 100644 index 00000000000..a4d26c668b4 --- /dev/null +++ b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.less @@ -0,0 +1,11 @@ +:host { + ::ng-deep { + .ant-collapse-content-box { + :last-child { + .ant-form-item { + margin-bottom: 0!important; + } + } + } + } +} diff --git a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.spec.ts b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.spec.ts new file mode 100644 index 00000000000..9a3dbd6e288 --- /dev/null +++ b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.spec.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { MonitorFormComponent } from './monitor-form.component'; + +describe('MonitorFormComponent', () => { + let component: MonitorFormComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [MonitorFormComponent] + }).compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(MonitorFormComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts new file mode 100644 index 00000000000..45906dd013a --- /dev/null +++ b/web-app/src/app/routes/monitor/monitor-form/monitor-form.component.ts @@ -0,0 +1,156 @@ +/* + * 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. + */ + +import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { FormGroup } from '@angular/forms'; + +import { Collector } from '../../../pojo/Collector'; +import { Param } from '../../../pojo/Param'; +import { ParamDefine } from '../../../pojo/ParamDefine'; + +@Component({ + selector: 'app-monitor-form', + templateUrl: './monitor-form.component.html', + styleUrls: ['./monitor-form.component.less'] +}) +export class MonitorFormComponent { + @Input() monitor!: any; + @Input() loading!: boolean; + @Input() loadingTip!: string; + @Input() hostName!: string; + @Input() collector!: string; + @Input() collectors!: Collector[]; + @Input() params!: Param[]; + @Input() advancedParams!: Param[]; + @Input() paramDefines!: ParamDefine[]; + @Input() advancedParamDefines!: ParamDefine[]; + + @Output() readonly formSubmit = new EventEmitter(); + @Output() readonly formCancel = new EventEmitter(); + @Output() readonly formDetect = new EventEmitter(); + @Output() readonly hostChange = new EventEmitter(); + + constructor() {} + + onDetect(formGroup: FormGroup) { + if (formGroup.invalid) { + Object.values(formGroup.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + return; + } + this.monitor.host = this.monitor.host.trim(); + this.monitor.name = this.monitor.name.trim(); + // todo 暂时单独设置host属性值 + this.params.forEach(param => { + if (param.field === 'host') { + param.paramValue = this.monitor.host; + } + if (param.paramValue != null && typeof param.paramValue == 'string') { + param.paramValue = (param.paramValue as string).trim(); + } + }); + this.advancedParams.forEach(param => { + if (param.paramValue != null && typeof param.paramValue == 'string') { + param.paramValue = (param.paramValue as string).trim(); + } + }); + this.formDetect.emit({ monitor: this.monitor, params: this.params, advancedParams: this.advancedParams }); + } + + onSubmit(formGroup: FormGroup) { + if (formGroup.invalid) { + Object.values(formGroup.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + return; + } + this.monitor.host = this.monitor.host.trim(); + this.monitor.name = this.monitor.name.trim(); + // todo 暂时单独设置host属性值 + this.params.forEach(param => { + if (param.field === 'host') { + param.paramValue = this.monitor.host; + } + if (param.paramValue != null && typeof param.paramValue == 'string') { + param.paramValue = (param.paramValue as string).trim(); + } + }); + this.advancedParams.forEach(param => { + if (param.paramValue != null && typeof param.paramValue == 'string') { + param.paramValue = (param.paramValue as string).trim(); + } + }); + this.formSubmit.emit({ monitor: this.monitor, params: this.params, advancedParams: this.advancedParams }); + } + + onCancel() { + this.formCancel.emit(); + } + + onHostChange(host: string) { + this.hostChange.emit(host); + } + + onParamBooleanChanged(booleanValue: boolean, field: string) { + // 对SSL的端口联动处理, 不开启SSL默认80端口,开启SSL默认443 + if (field === 'ssl') { + this.params.forEach(param => { + if (param.field === 'port') { + if (booleanValue) { + param.paramValue = '443'; + } else { + param.paramValue = '80'; + } + } + }); + } + } + + onDependChanged(dependValue: string, dependField: string) { + this.paramDefines.forEach((paramDefine, index) => { + if (paramDefine.depend) { + let fieldValues = new Map(Object.entries(paramDefine.depend)).get(dependField); + if (fieldValues) { + this.params[index].display = false; + if (fieldValues.map(String).includes(dependValue)) { + this.params[index].display = true; + } + } + } + }); + this.advancedParamDefines.forEach((advancedParamDefine, index) => { + if (advancedParamDefine.depend) { + let fieldValues = new Map(Object.entries(advancedParamDefine.depend)).get(dependField); + if (fieldValues) { + this.advancedParams[index].display = false; + if (fieldValues.map(String).includes(dependValue)) { + this.advancedParams[index].display = true; + } + } + } + }); + } +} diff --git a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html old mode 100644 new mode 100755 index 15c36bc1461..449a059d37c --- a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html +++ b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.html @@ -17,111 +17,107 @@ ~ under the License. --> - - + +> + -
      - - + + + + - - - -
        -
      • - -
      • -
      • - -
      • -
      • - -
      • -
      • - -
      • -
      • - - + + +
          +
        • + +
        • +
        • + +
        • +
        • + - -
        • -
        -
        - - - - - - - - - -
      + +
    • + +
    • +
    • + + + +
    • +
    +
    +
    + + + + + + + + + + + @@ -204,64 +200,66 @@ {{ (data.gmtUpdate ? data.gmtUpdate : data.gmtCreate) | date : 'YYYY-MM-dd HH:mm:ss' }} - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    +
    + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    @@ -303,48 +301,23 @@ (nzOnCancel)="onAppSwitchModalCancel()" nzClosable="false" nzWidth="30%" + nzWrapClassName="monitor-select-menu-modal" [nzOkText]="null" [nzCancelText]="null" [nzOkLoading]="appSearchLoading" >
    -
    - - - - - + + + -
    -
    - - - - - - - - - -
    + +
    diff --git a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.less b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.less index f0173dd150f..667151641e4 100644 --- a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.less +++ b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.less @@ -1,8 +1,8 @@ -@import "~src/styles/theme"; - -.switch-app { - border-radius: 6px; -} -.switch-app:hover { - background-color: @primary-color; +::ng-deep { + .monitor-select-menu-modal { + .ant-spin-container { + max-height: 80vh; + overflow: hidden; + } + } } diff --git a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts index ddbf05b4aaa..266d498aa37 100644 --- a/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts +++ b/web-app/src/app/routes/monitor/monitor-list/monitor-list.component.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Component, Inject, OnInit } from '@angular/core'; +import { Component, Inject, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { I18NService } from '@core'; import { ALAIN_I18N_TOKEN } from '@delon/theme'; @@ -40,7 +40,7 @@ import { formatTagName } from '../../../shared/utils/common-util'; templateUrl: './monitor-list.component.html', styleUrls: ['./monitor-list.component.less'] }) -export class MonitorListComponent implements OnInit { +export class MonitorListComponent implements OnInit, OnDestroy { constructor( private route: ActivatedRoute, private router: Router, @@ -70,10 +70,9 @@ export class MonitorListComponent implements OnInit { filterStatus: number = 9; // app type search filter appSwitchModalVisible = false; - appSearchContent = ''; appSearchOrigin: any[] = []; - appSearchResult: any[] = []; appSearchLoading = false; + intervalId: any; switchExportTypeModalFooter: ModalButtonOptions[] = [ { label: this.i18nSvc.fanyi('common.button.cancel'), type: 'default', onClick: () => (this.isSwitchExportTypeModalVisible = false) } @@ -99,6 +98,24 @@ export class MonitorListComponent implements OnInit { this.tableLoading = true; this.loadMonitorTable(); }); + // Set up an interval to refresh the table every 2 minutes + this.intervalId = setInterval(() => { + this.sync(); + }, 12000); // 120000 ms = 2 minutes + } + + ngOnDestroy(): void { + if (this.intervalId) { + clearInterval(this.intervalId); + } + } + + onTagChanged(): void { + this.router.navigate([], { + relativeTo: this.route, + queryParams: { ...this.route.snapshot.queryParams, tag: this.tag }, + queryParamsHandling: 'merge' + }); } onFilterSearchMonitors() { @@ -132,10 +149,6 @@ export class MonitorListComponent implements OnInit { this.loadMonitorTable(); } - clearCurrentTag() { - this.router.navigateByUrl(`/monitors`); - } - getAppIconName(app: string | undefined): string { let hierarchy: any[] = this.storageSvc.getData('hierarchy'); let find = hierarchy.find((item: { category: string; value: string }) => { @@ -499,17 +512,24 @@ export class MonitorListComponent implements OnInit { .subscribe( message => { if (message.code === 0) { - this.appSearchOrigin = []; - this.appSearchResult = []; + let appMenus: Record = {}; message.data.forEach((app: any) => { - app.categoryLabel = this.i18nSvc.fanyi(`monitor.category.${app.category}`); - if (app.categoryLabel == `monitor.category.${app.category}`) { - app.categoryLabel = this.i18nSvc.fanyi('monitor.category.custom'); + let menus = appMenus[app.category]; + app.categoryLabel = this.i18nSvc.fanyi(`menu.monitor.${app.category}`); + if (app.categoryLabel == `menu.monitor.${app.category}`) { + app.categoryLabel = app.category.toUpperCase(); } - this.appSearchOrigin.push(app); + if (menus == undefined) { + menus = { label: app.categoryLabel, child: [app] }; + } else { + menus.child.push(app); + } + appMenus[app.category] = menus; + }); + this.appSearchOrigin = Object.entries(appMenus); + this.appSearchOrigin.sort((a, b) => { + return b[1].length - a[1].length; }); - this.appSearchOrigin = this.appSearchOrigin.sort((a, b) => a.category?.localeCompare(b.category)); - this.appSearchResult = this.appSearchOrigin; } else { console.warn(message.msg); } @@ -528,20 +548,6 @@ export class MonitorListComponent implements OnInit { this.router.navigateByUrl(`/monitors/new?app=${app}`); } - searchSwitchApp() { - if (this.appSearchContent === '' || this.appSearchContent == null) { - this.appSearchResult = this.appSearchOrigin; - } else { - this.appSearchResult = this.appSearchOrigin.filter( - app => - app.label.toLowerCase().includes(this.appSearchContent.toLowerCase()) || - app.categoryLabel.toLowerCase().includes(this.appSearchContent.toLowerCase()) || - app.value.toLowerCase().includes(this.appSearchContent.toLowerCase()) || - app.category.toLowerCase().includes(this.appSearchContent.toLowerCase()) - ); - } - } - // end: app type search filter protected readonly sliceTagName = formatTagName; diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html index 6c085d8b87c..6e0c211cef5 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html @@ -17,484 +17,28 @@ ~ under the License. --> - - - - -
    -
    - - - {{ hostName ? hostName : ('monitor.host' | i18n) }} - - - - - - - - {{ 'monitor.name' | i18n }} - - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - - - - - {{ paramDefine.name }} - - - - +> - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - {{ paramDefine.name }} - - - - - - - - {{ paramDefine.name }} - - - - - - - - - - - - - - - {{ 'monitor.collector' | i18n }} - - - - - {{ 'monitor.collector.system.default' | i18n }} - {{ 'collector.mode.public' | i18n }} - - - {{ - item.status == 0 ? ('monitor.collector.status.online' | i18n) : ('monitor.collector.status.offline' | i18n) - }} - - {{ item.name }} - {{ item.ip }} - - {{ item.mode == 'private' ? ('collector.mode.private' | i18n) : ('collector.mode.public' | i18n) }} - - - - - {{ selected.nzLabel }} - - - - - - - {{ 'monitor.intervals' | i18n }} - - - - - {{ 'common.time.unit.second' | i18n }} - - - - - - {{ 'tag.bind' | i18n }} - - - - {{ sliceTagName(tag) }} - - - - - {{ 'tag.new' | i18n }} - - - - - - - - {{ 'monitor.description' | i18n }} - - - - - - - - -
    -
    - - - -
    -
    -
    -
    -
    + - - -
    - - - - - - - {{ 'tag' | i18n }} - - - - - - - {{ data.name }} - - {{ data.name + ':' + data.tagValue }} - - - - - -
    -
    + diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts index 3a684eee609..3b3ff37b9dc 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts @@ -17,12 +17,11 @@ * under the License. */ -import { ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { Component, Inject, OnInit } from '@angular/core'; +import { FormGroup } from '@angular/forms'; import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { I18NService } from '@core'; import { ALAIN_I18N_TOKEN, TitleService } from '@delon/theme'; -import { List } from 'echarts'; import { NzNotificationService } from 'ng-zorro-antd/notification'; import { switchMap } from 'rxjs/operators'; @@ -31,11 +30,9 @@ import { Message } from '../../../pojo/Message'; import { Monitor } from '../../../pojo/Monitor'; import { Param } from '../../../pojo/Param'; import { ParamDefine } from '../../../pojo/ParamDefine'; -import { Tag } from '../../../pojo/Tag'; import { AppDefineService } from '../../../service/app-define.service'; import { CollectorService } from '../../../service/collector.service'; import { MonitorService } from '../../../service/monitor.service'; -import { TagService } from '../../../service/tag.service'; @Component({ selector: 'app-monitor-add', @@ -52,7 +49,6 @@ export class MonitorNewComponent implements OnInit { collectors!: Collector[]; collector: string = ''; detected: boolean = false; - passwordVisible: boolean = false; // 是否显示加载中 isSpinning: boolean = false; spinningTip: string = 'Loading...'; @@ -62,12 +58,9 @@ export class MonitorNewComponent implements OnInit { private route: ActivatedRoute, private router: Router, private notifySvc: NzNotificationService, - private cdr: ChangeDetectorRef, @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService, private titleSvc: TitleService, - private tagSvc: TagService, - private collectorSvc: CollectorService, - private formBuilder: FormBuilder + private collectorSvc: CollectorService ) { this.monitor = new Monitor(); this.monitor.tags = []; @@ -83,7 +76,6 @@ export class MonitorNewComponent implements OnInit { } this.titleSvc.setTitleByI18n(`monitor.app.${this.monitor.app}`); this.detected = false; - this.passwordVisible = false; this.isSpinning = true; return this.appDefineSvc.getAppParamsDefine(this.monitor.app); }) @@ -165,77 +157,12 @@ export class MonitorNewComponent implements OnInit { } } - onParamBooleanChanged(booleanValue: boolean, field: string) { - // 对SSL的端口联动处理, 不开启SSL默认80端口,开启SSL默认443 - if (field === 'ssl') { - this.params.forEach(param => { - if (param.field === 'port') { - if (booleanValue) { - param.paramValue = '443'; - } else { - param.paramValue = '80'; - } - } - }); - } - } - - onDependChanged(dependValue: string, dependField: string) { - this.paramDefines.forEach((paramDefine, index) => { - if (paramDefine.depend) { - let fieldValues = new Map(Object.entries(paramDefine.depend)).get(dependField); - if (fieldValues) { - this.params[index].display = false; - if (fieldValues.map(String).includes(dependValue)) { - this.params[index].display = true; - } - } - } - }); - this.advancedParamDefines.forEach((advancedParamDefine, index) => { - if (advancedParamDefine.depend) { - let fieldValues = new Map(Object.entries(advancedParamDefine.depend)).get(dependField); - if (fieldValues) { - this.advancedParams[index].display = false; - if (fieldValues.map(String).includes(dependValue)) { - this.advancedParams[index].display = true; - } - } - } - }); - } - - onSubmit(formGroup: FormGroup) { - if (formGroup.invalid) { - Object.values(formGroup.controls).forEach(control => { - if (control.invalid) { - control.markAsDirty(); - control.updateValueAndValidity({ onlySelf: true }); - } - }); - return; - } - this.monitor.host = this.monitor.host.trim(); - this.monitor.name = this.monitor.name.trim(); - // todo 暂时单独设置host属性值 - this.params.forEach(param => { - if (param.field === 'host') { - param.paramValue = this.monitor.host; - } - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); - this.advancedParams.forEach(param => { - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); + onSubmit(info: any) { let addMonitor = { detected: this.detected, + monitor: info.monitor, collector: this.collector, - monitor: this.monitor, - params: this.params.concat(this.advancedParams) + params: info.params.concat(info.advancedParams) }; if (this.detected) { this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting'); @@ -248,7 +175,7 @@ export class MonitorNewComponent implements OnInit { this.isSpinning = false; if (message.code === 0) { this.notifySvc.success(this.i18nSvc.fanyi('monitors.new.success'), ''); - this.router.navigateByUrl(`/monitors?app=${this.monitor.app}`); + this.router.navigateByUrl(`/monitors?app=${info.monitor.app}`); } else { this.notifySvc.error(this.i18nSvc.fanyi('monitors.new.failed'), message.msg); } @@ -260,37 +187,12 @@ export class MonitorNewComponent implements OnInit { ); } - onDetect(formGroup: FormGroup) { - if (formGroup.invalid) { - Object.values(formGroup.controls).forEach(control => { - if (control.invalid) { - control.markAsDirty(); - control.updateValueAndValidity({ onlySelf: true }); - } - }); - return; - } - this.monitor.host = this.monitor.host.trim(); - this.monitor.name = this.monitor.name.trim(); - // todo 暂时单独设置host属性值 - this.params.forEach(param => { - if (param.field === 'host') { - param.paramValue = this.monitor.host; - } - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); - this.advancedParams.forEach(param => { - if (param.paramValue != null && typeof param.paramValue == 'string') { - param.paramValue = (param.paramValue as string).trim(); - } - }); + onDetect(info: any) { let detectMonitor = { detected: true, + monitor: info.monitor, collector: this.collector, - monitor: this.monitor, - params: this.params.concat(this.advancedParams) + params: info.params.concat(info.advancedParams) }; this.spinningTip = this.i18nSvc.fanyi('monitors.spinning-tip.detecting'); this.isSpinning = true; @@ -315,88 +217,4 @@ export class MonitorNewComponent implements OnInit { app = app ? app : ''; this.router.navigateByUrl(`/monitors?app=${app}`); } - - onRemoveTag(tag: Tag) { - if (this.monitor != undefined && this.monitor.tags != undefined) { - this.monitor.tags = this.monitor.tags.filter(item => item !== tag); - } - } - - sliceTagName(tag: Tag): string { - if (tag.tagValue != undefined && tag.tagValue.trim() != '') { - return `${tag.name}:${tag.tagValue}`; - } else { - return tag.name; - } - } - - // start Tag model - isManageModalVisible = false; - isManageModalOkLoading = false; - tagCheckedAll: boolean = false; - tagTableLoading = false; - tagSearch!: string; - tags!: Tag[]; - checkedTags = new Set(); - loadTagsTable() { - this.tagTableLoading = true; - let tagsReq$ = this.tagSvc.loadTags(this.tagSearch, 1, 0, 1000).subscribe( - message => { - this.tagTableLoading = false; - this.tagCheckedAll = false; - this.checkedTags.clear(); - if (message.code === 0) { - let page = message.data; - this.tags = page.content; - } else { - console.warn(message.msg); - } - tagsReq$.unsubscribe(); - }, - error => { - this.tagTableLoading = false; - tagsReq$.unsubscribe(); - } - ); - } - onShowTagsModal() { - this.isManageModalVisible = true; - this.loadTagsTable(); - } - onManageModalCancel() { - this.isManageModalVisible = false; - } - onManageModalOk() { - this.isManageModalOkLoading = true; - this.checkedTags.forEach(item => { - if (this.monitor.tags.find(tag => tag.id == item.id) == undefined) { - this.monitor.tags.push(item); - } - }); - this.isManageModalOkLoading = false; - this.isManageModalVisible = false; - } - onAllChecked(checked: boolean) { - if (checked) { - this.tags.forEach(tag => this.checkedTags.add(tag)); - } else { - this.checkedTags.clear(); - } - } - onItemChecked(tag: Tag, checked: boolean) { - if (checked) { - this.checkedTags.add(tag); - } else { - this.checkedTags.delete(tag); - } - } - - getNumber(rangeString: string, index: number): number | undefined { - if (rangeString == undefined || rangeString == '' || rangeString.length <= index) { - return undefined; - } - const rangeArray = JSON.parse(rangeString); - return rangeArray[index]; - } - // end tag model } diff --git a/web-app/src/app/routes/monitor/monitor.module.ts b/web-app/src/app/routes/monitor/monitor.module.ts index af3794bad42..abef9b4cfea 100644 --- a/web-app/src/app/routes/monitor/monitor.module.ts +++ b/web-app/src/app/routes/monitor/monitor.module.ts @@ -36,6 +36,7 @@ import { MonitorDataChartComponent } from './monitor-data-chart/monitor-data-cha import { MonitorDataTableComponent } from './monitor-data-table/monitor-data-table.component'; import { MonitorDetailComponent } from './monitor-detail/monitor-detail.component'; import { MonitorEditComponent } from './monitor-edit/monitor-edit.component'; +import { MonitorFormComponent } from './monitor-form/monitor-form.component'; import { MonitorListComponent } from './monitor-list/monitor-list.component'; import { MonitorNewComponent } from './monitor-new/monitor-new.component'; import { MonitorRoutingModule } from './monitor-routing.module'; @@ -43,6 +44,7 @@ import { MonitorRoutingModule } from './monitor-routing.module'; const COMPONENTS: Array> = [ MonitorNewComponent, MonitorEditComponent, + MonitorFormComponent, MonitorListComponent, MonitorDetailComponent, MonitorDataTableComponent, diff --git a/web-app/src/app/routes/passport/lock/lock.component.html b/web-app/src/app/routes/passport/lock/lock.component.html old mode 100644 new mode 100755 index f7f197a2b60..2fc6460e5fb --- a/web-app/src/app/routes/passport/lock/lock.component.html +++ b/web-app/src/app/routes/passport/lock/lock.component.html @@ -17,7 +17,7 @@ ~ under the License. --> -
    +
    @@ -25,9 +25,7 @@
    - - - + diff --git a/web-app/src/app/routes/passport/login/login.component.html b/web-app/src/app/routes/passport/login/login.component.html index f5809bc6d9c..e3f96309719 100644 --- a/web-app/src/app/routes/passport/login/login.component.html +++ b/web-app/src/app/routes/passport/login/login.component.html @@ -17,23 +17,30 @@ ~ under the License. --> -
    +
    - - - + - - - + --> - + diff --git a/web-app/src/app/routes/setting/collector/collector.component.html b/web-app/src/app/routes/setting/collector/collector.component.html index 2a824afc73a..b2db37b778b 100644 --- a/web-app/src/app/routes/setting/collector/collector.component.html +++ b/web-app/src/app/routes/setting/collector/collector.component.html @@ -17,53 +17,51 @@ ~ under the License. --> - - +> -
    - + - + + + - + - + - + - - -
    + + + + + + @@ -90,6 +88,7 @@ {{ 'collector.pinned' | i18n }} {{ 'collector.dispatched' | i18n }} {{ 'collector.ip' | i18n }} + {{ 'collector.version' | i18n }} {{ 'collector.start-time' | i18n }} {{ 'common.edit' | i18n }} @@ -130,43 +129,46 @@ {{ data.collector.ip }} + {{ data.collector.version }} {{ (data.collector.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss')?.trim() }} - - - +
    + + + +
    @@ -240,7 +242,7 @@
    -
    +
    {{ 'collector.deploy.package.github' | i18n }} -
    +
    - +> + - - -
      -
    • - + + + + + + + + -
    • -
    • -
        -
      • - - - -
      • -
      -
    • -
    -
    - - -
    - - - - + + -
    -
    - -
    -
    -
    + + +
    + +
    +
    diff --git a/web-app/src/app/routes/setting/define/define.component.ts b/web-app/src/app/routes/setting/define/define.component.ts index 6b5975a8c5c..7d80f056862 100644 --- a/web-app/src/app/routes/setting/define/define.component.ts +++ b/web-app/src/app/routes/setting/define/define.component.ts @@ -43,10 +43,13 @@ export class DefineComponent implements OnInit { private modal: NzModalService, private startUpSvc: StartupService, private route: ActivatedRoute, + private router: Router, @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService ) {} + menuLoading: boolean = false; appMenusArr: any[][] = []; + appMenusArrByFilter: any[][] = []; appLabel: Record = {}; loading = false; code: string = ''; @@ -69,28 +72,30 @@ export class DefineComponent implements OnInit { } loadMenus() { + this.menuLoading = true; + this.appMenusArrByFilter = []; const getHierarchy$ = this.appDefineSvc .getAppHierarchy(this.i18nSvc.defaultLang) .pipe( finalize(() => { getHierarchy$.unsubscribe(); + this.menuLoading = false; }) ) .subscribe( message => { if (message.code === 0) { - let appMenus: Record = {}; + let appMenus: Record = {}; message.data.forEach((app: any) => { if (app.value == 'prometheus') { return; } - app.selected = this.currentApp != null && this.currentApp === app.value; this.appLabel[app.value] = app.label; let menus = appMenus[app.category]; if (menus == undefined) { - menus = [app]; + menus = { label: this.renderCategoryName(app.category), child: [app] }; } else { - menus.push(app); + menus.child.push(app); } appMenus[app.category] = menus; }); @@ -108,6 +113,10 @@ export class DefineComponent implements OnInit { ); } + onMenuSelectedChanged(selected: string) { + this.router.navigateByUrl(`/setting/define?app=${selected}`); + } + loadAppDefineContent(app: any) { this.loading = true; this.currentApp = app; @@ -181,6 +190,7 @@ export class DefineComponent implements OnInit { this.code = `${this.i18nSvc.fanyi('define.new.code')}\n\n\n\n\n`; this.originalCode = this.i18nSvc.fanyi('define.new.code'); } + saveAndApply() { this.saveLoading = true; const saveDefine$ = this.appDefineSvc diff --git a/web-app/src/app/routes/setting/status/status.component.html b/web-app/src/app/routes/setting/status/status.component.html index bc662f73b86..51733fa5564 100644 --- a/web-app/src/app/routes/setting/status/status.component.html +++ b/web-app/src/app/routes/setting/status/status.component.html @@ -17,12 +17,12 @@ ~ under the License. --> - +> @@ -34,7 +34,7 @@ @@ -140,30 +140,27 @@ + -
    - - - -
    - + + + + + + + + {{ 'status.component.name' | i18n }} @@ -205,52 +202,56 @@ {{ data.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss' }} - - +
    + + +
    -
    - - - -
    + + + + + + + @@ -289,25 +290,27 @@ {{ data.startTime | date : 'YYYY-MM-dd HH:mm:ss' }} - - +
    + + +
    @@ -326,7 +329,7 @@ [nzOkLoading]="currentComponentLoading" >
    - + {{ 'status.component.name' | i18n }} @@ -370,7 +373,7 @@ - {{ + {{ 'status.component.tag' | i18n }} @@ -381,7 +384,7 @@ [nzMaxTagCount]="5" [nzDropdownMatchSelectWidth]="false" nzShowSearch - nzPlaceHolder="Select Tag" + [nzPlaceHolder]="'alert.notice.rule.tag.placeholder' | i18n" required name="tag" id="tag" diff --git a/web-app/src/app/routes/setting/status/status.component.ts b/web-app/src/app/routes/setting/status/status.component.ts index d864dfa48ca..1258c2c00f1 100644 --- a/web-app/src/app/routes/setting/status/status.component.ts +++ b/web-app/src/app/routes/setting/status/status.component.ts @@ -17,8 +17,8 @@ * under the License. */ -import { Component, Inject, OnInit } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { Component, Inject, OnInit, ViewChild } from '@angular/core'; +import { FormGroup, NgForm } from '@angular/forms'; import { I18NService } from '@core'; import { ALAIN_I18N_TOKEN } from '@delon/theme'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -48,7 +48,10 @@ export class StatusComponent implements OnInit { @Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService ) {} + @ViewChild('incidentForm') incidentForm!: NgForm; + @ViewChild('componentForm') componentForm!: NgForm; statusOrg: StatusPageOrg = new StatusPageOrg(); + statusOrgForEdit: StatusPageOrg = new StatusPageOrg(); statusComponents!: StatusPageComponent[]; statusIncidences!: StatusPageIncident[]; loading: boolean = false; @@ -82,25 +85,6 @@ export class StatusComponent implements OnInit { this.loadIncidenceInfo(); } - loadOrgInfo() { - this.orgLoading = true; - let orgLoad$ = this.statusPageService.getStatusPageOrg().subscribe( - message => { - if (message.code === 0) { - this.statusOrg = message.data; - } else { - console.log(message.msg); - } - this.orgLoading = false; - orgLoad$.unsubscribe(); - }, - error => { - this.orgLoading = false; - orgLoad$.unsubscribe(); - } - ); - } - loadComponentInfo() { this.currentComponentLoading = true; let componentLoad$ = this.statusPageService.getStatusPageComponents().subscribe( @@ -151,6 +135,7 @@ export class StatusComponent implements OnInit { this.statusOrg = new StatusPageOrg(); console.log(message.msg); } + this.statusOrgForEdit = { ...this.statusOrg }; return this.statusPageService.getStatusPageComponents(); }) ) @@ -177,7 +162,7 @@ export class StatusComponent implements OnInit { }); return; } - let saveStatus$ = this.statusPageService.saveStatusPageOrg(this.statusOrg).subscribe( + let saveStatus$ = this.statusPageService.saveStatusPageOrg(this.statusOrgForEdit).subscribe( (message: Message) => { if (message.code === 0) { this.statusOrg = message.data; @@ -234,7 +219,7 @@ export class StatusComponent implements OnInit { onEditOneComponent(data: StatusPageComponent) { this.isComponentModalAdd = false; - this.currentStatusComponent = data; + this.currentStatusComponent = { ...data }; if (this.currentStatusComponent.tag != undefined) { this.matchTag = this.sliceTagName(this.currentStatusComponent.tag); this.tagsOption.push({ @@ -310,6 +295,15 @@ export class StatusComponent implements OnInit { } onComponentModalOk() { + if (this.componentForm.invalid) { + Object.values(this.componentForm.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + return; + } if (this.matchTag != undefined && this.matchTag.trim() != '') { let tmp: string[] = this.matchTag.split(':'); let tagItem = new TagItem(); @@ -364,6 +358,15 @@ export class StatusComponent implements OnInit { this.notifySvc.warning(this.i18nSvc.fanyi('status.component.notify.need-org'), ''); return; } + if (this.incidentForm.invalid) { + Object.values(this.incidentForm.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + return; + } // incident message content if (this.currentStatusIncident.contents == undefined) { this.currentStatusIncident.contents = []; diff --git a/web-app/src/app/routes/setting/tags/tags.component.html b/web-app/src/app/routes/setting/tags/tags.component.html index e4099bab1fa..3c7d26eed88 100644 --- a/web-app/src/app/routes/setting/tags/tags.component.html +++ b/web-app/src/app/routes/setting/tags/tags.component.html @@ -17,42 +17,40 @@ ~ under the License. --> - - +> -
    - - + - + + + + - - -
    + + + + + + @@ -85,7 +83,7 @@ - + {{ formatTagName(data) }} @@ -95,12 +93,14 @@ {{ data.description }} {{ data.gmtUpdate | date : 'YYYY-MM-dd HH:mm:ss' }} - - +
    + + +
    @@ -141,7 +141,8 @@ cpOutputFormat="hex" [style.background]="tag.color" required - style="border-radius: 5px; width: 100%" + style="width: 100%" + class="br-4" name="color" id="color" /> diff --git a/web-app/src/app/routes/setting/tags/tags.component.ts b/web-app/src/app/routes/setting/tags/tags.component.ts index f9dfb8ede05..215eaf1d9c7 100644 --- a/web-app/src/app/routes/setting/tags/tags.component.ts +++ b/web-app/src/app/routes/setting/tags/tags.component.ts @@ -17,7 +17,8 @@ * under the License. */ -import { Component, Inject, OnInit } from '@angular/core'; +import { Component, Inject, OnInit, ViewChild } from '@angular/core'; +import { NgForm } from '@angular/forms'; import { I18NService } from '@core'; import { ALAIN_I18N_TOKEN } from '@delon/theme'; import { NzModalService } from 'ng-zorro-antd/modal'; @@ -34,6 +35,8 @@ import { formatTagName } from '../../../shared/utils/common-util'; templateUrl: './tags.component.html' }) export class SettingTagsComponent implements OnInit { + @ViewChild('tagForm', { static: false }) tagForm: NgForm | undefined; + constructor( private notifySvc: NzNotificationService, private modal: NzModalService, @@ -183,6 +186,15 @@ export class SettingTagsComponent implements OnInit { this.isManageModalVisible = false; } onManageModalOk() { + if (this.tagForm?.invalid) { + Object.values(this.tagForm.controls).forEach(control => { + if (control.invalid) { + control.markAsDirty(); + control.updateValueAndValidity({ onlySelf: true }); + } + }); + return; + } this.isManageModalOkLoading = true; this.tag.name = this.tag.name.trim(); if (this.tag.tagValue != undefined) { diff --git a/web-app/src/app/routes/status-public/status-public.component.html b/web-app/src/app/routes/status-public/status-public.component.html old mode 100644 new mode 100755 index 5786b262e0d..a9ac2b7acf1 --- a/web-app/src/app/routes/status-public/status-public.component.html +++ b/web-app/src/app/routes/status-public/status-public.component.html @@ -18,7 +18,7 @@ --> -
    + -
    +
    {{ 'status.public.org.state.0' | i18n }} @@ -50,7 +54,11 @@ Updated {{ statusOrg.gmtUpdate | elapsedTime }}
    -
    +
    {{ 'status.public.org.state.1' | i18n }} @@ -59,7 +67,7 @@ Updated {{ statusOrg.gmtUpdate | elapsedTime }}
    -
    +
    {{ 'status.public.org.state.2' | i18n }} @@ -69,7 +77,7 @@
    -
    +
    {{ component.info.name }} @@ -99,8 +107,8 @@
    -
    +
    {{ 'status.public.org.state.0' | i18n }} @@ -147,7 +159,11 @@ Updated {{ statusOrg.gmtUpdate | elapsedTime }}
    -
    +
    {{ 'status.public.org.state.1' | i18n }} @@ -156,7 +172,7 @@ Updated {{ statusOrg.gmtUpdate | elapsedTime }}
    -
    +
    {{ 'status.public.org.state.2' | i18n }} @@ -170,7 +186,8 @@
    @@ -194,10 +211,7 @@
    -
    +
    {{ incident.name }} diff --git a/web-app/src/app/routes/status-public/status-public.component.less b/web-app/src/app/routes/status-public/status-public.component.less index dfa94b51107..7949a3d93be 100644 --- a/web-app/src/app/routes/status-public/status-public.component.less +++ b/web-app/src/app/routes/status-public/status-public.component.less @@ -29,7 +29,6 @@ font-size: 1.5rem; line-height: 2.0rem; border: 4px; - border-radius: 5px; padding: 0.75rem 1.25rem; margin: 0 auto; } @@ -38,7 +37,6 @@ width: 60%; margin: 10px auto; border: 1px dotted gray; - border-radius: 3px; } .history_block { diff --git a/web-app/src/app/shared/components/form-item/form-item.component.html b/web-app/src/app/shared/components/form-item/form-item.component.html new file mode 100644 index 00000000000..934d6286dac --- /dev/null +++ b/web-app/src/app/shared/components/form-item/form-item.component.html @@ -0,0 +1,286 @@ + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + + + {{ item.name }} + + + + + {{ 'monitor.collector.system.default' | i18n }} + {{ 'collector.mode.public' | i18n }} + + + {{ + item.status == 0 ? ('monitor.collector.status.online' | i18n) : ('monitor.collector.status.offline' | i18n) + }} + + {{ item.name }} + {{ item.ip }} + + {{ item.mode == 'private' ? ('collector.mode.private' | i18n) : ('collector.mode.public' | i18n) }} + + + + + {{ selected.nzLabel }} + + + + + + {{ item.name }} + + + + + {{ 'common.time.unit.second' | i18n }} + + + + + {{ item.name }} + + + + {{ sliceTagName(tag) }} + + + + + {{ 'tag.new' | i18n }} + + + + + + + {{ item.name }} + + + + + + + + + + +
    + + + + + + + + + + + + + {{ 'tag' | i18n }} + + + + + + + {{ data.name }} + + {{ data.name + ':' + data.tagValue }} + + + + + +
    +
    diff --git a/web-app/src/app/shared/components/form-item/form-item.component.less b/web-app/src/app/shared/components/form-item/form-item.component.less new file mode 100644 index 00000000000..e69de29bb2d diff --git a/web-app/src/app/shared/components/form-item/form-item.component.spec.ts b/web-app/src/app/shared/components/form-item/form-item.component.spec.ts new file mode 100644 index 00000000000..581e39d34ec --- /dev/null +++ b/web-app/src/app/shared/components/form-item/form-item.component.spec.ts @@ -0,0 +1,43 @@ +/* + * 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. + */ + +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { FormItemComponent } from './form-item.component'; + +describe('FormItemComponent', () => { + let component: FormItemComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [FormItemComponent] + }).compileComponents(); + }); + + beforeEach(() => { + fixture = TestBed.createComponent(FormItemComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/web-app/src/app/shared/components/form-item/form-item.component.ts b/web-app/src/app/shared/components/form-item/form-item.component.ts new file mode 100644 index 00000000000..18fbe33e830 --- /dev/null +++ b/web-app/src/app/shared/components/form-item/form-item.component.ts @@ -0,0 +1,123 @@ +/* + * 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. + */ + +import { Component, EventEmitter, Input, Output } from '@angular/core'; + +import { TagItem } from '../../../pojo/NoticeRule'; +import { Tag } from '../../../pojo/Tag'; +import { TagService } from '../../../service/tag.service'; + +@Component({ + selector: 'app-form-item', + templateUrl: './form-item.component.html', + styleUrls: ['./form-item.component.less'] +}) +export class FormItemComponent { + constructor(private tagSvc: TagService) {} + @Input() item!: any; + @Input() value!: any; + @Input() extra: any = {}; + @Output() readonly valueChange = new EventEmitter(); + + isManageModalVisible = false; + isManageModalOkLoading = false; + checkedTags = new Set(); + tagTableLoading = false; + tagCheckedAll: boolean = false; + tagSearch!: string; + tags!: Tag[]; + + loadTagsTable() { + this.tagTableLoading = true; + let tagsReq$ = this.tagSvc.loadTags(this.tagSearch, 1, 0, 1000).subscribe( + message => { + this.tagTableLoading = false; + this.tagCheckedAll = false; + this.checkedTags.clear(); + if (message.code === 0) { + let page = message.data; + this.tags = page.content; + } else { + console.warn(message.msg); + } + tagsReq$.unsubscribe(); + }, + error => { + this.tagTableLoading = false; + tagsReq$.unsubscribe(); + } + ); + } + + onChange(value: any) { + this.valueChange.emit(value); + } + + onRemoveTag(tag: TagItem) { + if (this.value != undefined) { + this.onChange(this.value.filter((item: TagItem) => item !== tag)); + } + } + + sliceTagName(tag: any): string { + if (tag.value != undefined && tag.value.trim() != '') { + return `${tag.name}:${tag.value}`; + } else { + return tag.name; + } + } + + onShowTagsModal() { + this.isManageModalVisible = true; + this.loadTagsTable(); + } + + onManageModalCancel() { + this.isManageModalVisible = false; + } + + onManageModalOk() { + this.isManageModalOkLoading = true; + let value = this.value == undefined ? [] : this.value; + this.checkedTags.forEach(item => { + if (this.value.find((tag: { id: number }) => tag.id == item.id) == undefined) { + value.push(item); + } + }); + this.onChange(value); + this.isManageModalOkLoading = false; + this.isManageModalVisible = false; + } + + onAllChecked(checked: boolean) { + if (checked) { + this.tags.forEach(tag => this.checkedTags.add(tag)); + } else { + this.checkedTags.clear(); + } + } + + onItemChecked(tag: Tag, checked: boolean) { + if (checked) { + this.checkedTags.add(tag); + } else { + this.checkedTags.delete(tag); + } + } +} diff --git a/web-app/src/app/shared/components/help-massage-show/help-massage-show.component.html b/web-app/src/app/shared/components/help-message-show/help-message-show.component.html similarity index 84% rename from web-app/src/app/shared/components/help-massage-show/help-massage-show.component.html rename to web-app/src/app/shared/components/help-message-show/help-message-show.component.html index 2ca617e41d4..787b4e7d7ff 100644 --- a/web-app/src/app/shared/components/help-massage-show/help-massage-show.component.html +++ b/web-app/src/app/shared/components/help-message-show/help-message-show.component.html @@ -17,18 +17,18 @@ ~ under the License. --> -
    +
    -
    - + -
    -
    -
    +
    +