mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[Improve] migrate to apache(#1724)
Signed-off-by: tomsun28 <tomsun28@outlook.com> Co-authored-by: tomsun28 <tomsun28@outlook.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
github:
|
||||
description: HertzBeat is a real-time monitoring system with agentless, performance cluster, prometheus-compatible, custom monitoring and status page building capabilities.
|
||||
homepage: https://hertzbeat.apache.org/
|
||||
labels:
|
||||
- monitoring
|
||||
- monitor
|
||||
- self-hosted
|
||||
- status
|
||||
- prometheus
|
||||
- uptime-monitoring
|
||||
- status-page
|
||||
enabled_merge_buttons:
|
||||
squash: true
|
||||
merge: false
|
||||
rebase: false
|
||||
protected_branches:
|
||||
master:
|
||||
required_status_checks:
|
||||
strict: true
|
||||
required_pull_request_reviews:
|
||||
dismiss_stale_reviews: true
|
||||
required_approving_review_count: 1
|
||||
notifications:
|
||||
commits: notifications@hertzbeat.apache.org
|
||||
issues: notifications@hertzbeat.apache.org
|
||||
pullrequests: notifications@hertzbeat.apache.org
|
||||
jobs: notifications@hertzbeat.apache.org
|
||||
discussions: dev@hertzbeat.apache.org
|
||||
+1
-1
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at gongchao@apache.org. All
|
||||
reported by contacting the project team at dev@hertzbeat.apache.org. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate for the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ Even small corrections to typos are very welcome :)
|
||||
|
||||
1. Requires `maven3+`, `java17` and `lombok` environments
|
||||
2. (Optional) Modify the configuration file-`manager/src/main/resources/application.yml`
|
||||
3. Start `springboot manager` service `manager/src/main/java/org/dromara/hertzbeat/manager/Manager.java`
|
||||
3. Start `springboot manager` service `manager/src/main/java/org/apache/hertzbeat/manager/Manager.java`
|
||||
|
||||
- Front-web start
|
||||
|
||||
@@ -170,7 +170,7 @@ Add WeChat account `tan-cloud` to pull you into the WeChat group.
|
||||
|
||||
1. 需要`maven3+`, `java17`和`lombok`环境
|
||||
2. (可选)修改配置文件配置信息-`manager/src/main/resources/application.yml`
|
||||
3. 启动`springboot manager`服务 `manager/src/main/java/org/dromara/hertzbeat/manager/Manager.java`
|
||||
3. 启动`springboot manager`服务 `manager/src/main/java/org/apache/hertzbeat/manager/Manager.java`
|
||||
|
||||
- 前端启动
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
### Alerter
|
||||
|
||||
Processing data according to threshold rules to determine alarms, and alarm distribution functions.
|
||||
根据告警规则配置信息,处理指标数据判断告警,告警分发。
|
||||
+2
-2
@@ -20,7 +20,7 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hertzbeat</artifactId>
|
||||
<groupId>org.dromara.hertzbeat</groupId>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -34,7 +34,7 @@
|
||||
<dependencies>
|
||||
<!-- common -->
|
||||
<dependency>
|
||||
<groupId>org.dromara.hertzbeat</groupId>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<artifactId>hertzbeat-common</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert;
|
||||
package org.apache.hertzbeat.alert;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -24,7 +24,6 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* alerter prop config
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "alerter")
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert;
|
||||
package org.apache.hertzbeat.alert;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -29,7 +29,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* alarm module thread pool
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
+23
-24
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.calculate;
|
||||
package org.apache.hertzbeat.alert.calculate;
|
||||
|
||||
import com.googlecode.aviator.AviatorEvaluator;
|
||||
import com.googlecode.aviator.Expression;
|
||||
@@ -24,23 +24,23 @@ import com.googlecode.aviator.exception.ExpressionRuntimeException;
|
||||
import com.googlecode.aviator.exception.ExpressionSyntaxErrorException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.hertzbeat.alert.AlerterWorkerPool;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertMonitorDao;
|
||||
import org.dromara.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.dromara.hertzbeat.alert.service.AlertService;
|
||||
import org.dromara.hertzbeat.alert.util.AlertTemplateUtil;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.dromara.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.queue.CommonDataQueue;
|
||||
import org.dromara.hertzbeat.common.support.event.MonitorDeletedEvent;
|
||||
import org.dromara.hertzbeat.common.support.event.SystemConfigChangeEvent;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.dromara.hertzbeat.common.util.ResourceBundleUtil;
|
||||
import org.apache.hertzbeat.alert.AlerterWorkerPool;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.alert.dao.AlertMonitorDao;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.service.AlertService;
|
||||
import org.apache.hertzbeat.alert.util.AlertTemplateUtil;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.apache.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.queue.CommonDataQueue;
|
||||
import org.apache.hertzbeat.common.support.event.MonitorDeletedEvent;
|
||||
import org.apache.hertzbeat.common.support.event.SystemConfigChangeEvent;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.common.util.ResourceBundleUtil;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -51,11 +51,10 @@ import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.dromara.hertzbeat.common.constants.CommonConstants.*;
|
||||
import static org.apache.hertzbeat.common.constants.CommonConstants.*;
|
||||
|
||||
/**
|
||||
* Calculate alarms based on the alarm definition rules and collected data
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@@ -283,8 +282,8 @@ public class CalculateAlarm {
|
||||
fieldValueMap.put(TAG_METRICS, metrics);
|
||||
fieldValueMap.put(TAG_METRIC, define.getField());
|
||||
Map<String, String> tags = new HashMap<>(8);
|
||||
tags.put(CommonConstants.TAG_MONITOR_ID, String.valueOf(monitorId));
|
||||
tags.put(CommonConstants.TAG_MONITOR_APP, app);
|
||||
tags.put(TAG_MONITOR_ID, String.valueOf(monitorId));
|
||||
tags.put(TAG_MONITOR_APP, app);
|
||||
tags.put(CommonConstants.TAG_THRESHOLD_ID, String.valueOf(define.getId()));
|
||||
if (!CollectionUtils.isEmpty(define.getTags())) {
|
||||
for (TagItem tagItem : define.getTags()) {
|
||||
@@ -351,8 +350,8 @@ public class CalculateAlarm {
|
||||
if (metricsData.getCode() != CollectRep.Code.SUCCESS) {
|
||||
Alert preAlert = triggeredAlertMap.get(String.valueOf(monitorId));
|
||||
Map<String, String> tags = new HashMap<>(6);
|
||||
tags.put(CommonConstants.TAG_MONITOR_ID, String.valueOf(monitorId));
|
||||
tags.put(CommonConstants.TAG_MONITOR_APP, app);
|
||||
tags.put(TAG_MONITOR_ID, String.valueOf(monitorId));
|
||||
tags.put(TAG_MONITOR_APP, app);
|
||||
tags.put(CommonConstants.TAG_THRESHOLD_ID, String.valueOf(avaAlertDefine.getId()));
|
||||
tags.put(TAG_METRICS, CommonConstants.AVAILABILITY);
|
||||
tags.put(TAG_CODE, metricsData.getCode().name());
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.config;
|
||||
package org.apache.hertzbeat.alert.config;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
@@ -23,6 +23,6 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
* Alert auto configuration.
|
||||
* @version 2.1
|
||||
*/
|
||||
@ComponentScan(basePackages = "org.dromara.hertzbeat.alert")
|
||||
@ComponentScan(basePackages = "org.apache.hertzbeat.alert")
|
||||
public class AlerterAutoConfiguration {
|
||||
}
|
||||
+5
-6
@@ -15,26 +15,25 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.dromara.hertzbeat.alert.service.AlertConvergeService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.alert.service.AlertConvergeService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import static org.dromara.hertzbeat.common.constants.CommonConstants.MONITOR_NOT_EXIST_CODE;
|
||||
import static org.apache.hertzbeat.common.constants.CommonConstants.MONITOR_NOT_EXIST_CODE;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Alarm Converge management API
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alert Converge API | 告警收敛管理API")
|
||||
@RestController
|
||||
+4
-5
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.dromara.hertzbeat.alert.service.AlertConvergeService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.alert.service.AlertConvergeService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -42,7 +42,6 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Converge the batch API for alarms
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alert Converge Batch API | 告警收敛管理API")
|
||||
@RestController
|
||||
+6
-7
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -40,12 +40,11 @@ import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.dromara.hertzbeat.common.constants.CommonConstants.MONITOR_NOT_EXIST_CODE;
|
||||
import static org.apache.hertzbeat.common.constants.CommonConstants.MONITOR_NOT_EXIST_CODE;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Alarm definition management API
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alert Define API | 告警定义管理API")
|
||||
@RestController
|
||||
+4
-5
@@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -44,7 +44,6 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Define the batch API for alarms
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alert Define Batch API | 告警定义管理API")
|
||||
@RestController
|
||||
+8
-9
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.hertzbeat.alert.dto.CloudAlertReportAbstract;
|
||||
import org.dromara.hertzbeat.alert.dto.GeneralCloudAlertReport;
|
||||
import org.dromara.hertzbeat.alert.enums.CloudServiceAlarmInformationEnum;
|
||||
import org.dromara.hertzbeat.alert.service.AlertService;
|
||||
import org.dromara.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.alert.dto.CloudAlertReportAbstract;
|
||||
import org.apache.hertzbeat.alert.dto.GeneralCloudAlertReport;
|
||||
import org.apache.hertzbeat.alert.enums.CloudServiceAlarmInformationEnum;
|
||||
import org.apache.hertzbeat.alert.service.AlertService;
|
||||
import org.apache.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -38,7 +38,6 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Extern Alarm Manage API
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Extern Alarm Manage API | 第三方告警管理API")
|
||||
@RestController
|
||||
+5
-6
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.dromara.hertzbeat.alert.service.AlertSilenceService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.alert.service.AlertSilenceService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -30,12 +30,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
|
||||
import static org.dromara.hertzbeat.common.constants.CommonConstants.MONITOR_NOT_EXIST_CODE;
|
||||
import static org.apache.hertzbeat.common.constants.CommonConstants.MONITOR_NOT_EXIST_CODE;
|
||||
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Alarm Silence management API
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alert Silence API | 告警静默管理API")
|
||||
@RestController
|
||||
+4
-5
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.dromara.hertzbeat.alert.service.AlertSilenceService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.alert.service.AlertSilenceService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -42,7 +42,6 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Silence the batch API for alarms
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alert Silence Batch API | 告警静默管理API")
|
||||
@RestController
|
||||
+5
-7
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.alert.service.AlertService;
|
||||
import org.dromara.hertzbeat.common.entity.dto.Message;
|
||||
import org.apache.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.alert.service.AlertService;
|
||||
import org.apache.hertzbeat.common.entity.dto.Message;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -42,8 +42,6 @@ import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
|
||||
|
||||
/**
|
||||
* Alarm Management API
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Tag(name = "Alarm Manage Batch API | 告警批量管理API")
|
||||
@RestController
|
||||
+2
-5
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dao;
|
||||
package org.apache.hertzbeat.alert.dao;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
@@ -26,14 +26,11 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* AlertConverge Dao
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface AlertConvergeDao extends JpaRepository<AlertConverge, Long>, JpaSpecificationExecutor<AlertConverge> {
|
||||
|
||||
/**
|
||||
* Delete alarm converge based on the ID list
|
||||
*
|
||||
* @param convergeIds alert converge id list
|
||||
*/
|
||||
@Modifying
|
||||
+4
-5
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dao;
|
||||
package org.apache.hertzbeat.alert.dao;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dto.AlertPriorityNum;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.alert.dto.AlertPriorityNum;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
@@ -30,7 +30,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* Alert Database Operations
|
||||
*
|
||||
*/
|
||||
public interface AlertDao extends JpaRepository<Alert, Long>, JpaSpecificationExecutor<Alert> {
|
||||
|
||||
@@ -54,6 +53,6 @@ public interface AlertDao extends JpaRepository<Alert, Long>, JpaSpecificationEx
|
||||
* 查询各个告警级别的未处理告警数量
|
||||
* @return List of alerts num
|
||||
*/
|
||||
@Query("select new org.dromara.hertzbeat.alert.dto.AlertPriorityNum(mo.priority, count(mo.id)) from Alert mo where mo.status = 0 group by mo.priority")
|
||||
@Query("select new org.apache.hertzbeat.alert.dto.AlertPriorityNum(mo.priority, count(mo.id)) from Alert mo where mo.status = 0 group by mo.priority")
|
||||
List<AlertPriorityNum> findAlertPriorityNum();
|
||||
}
|
||||
+2
-3
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dao;
|
||||
package org.apache.hertzbeat.alert.dao;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* AlertDefineBind database operations
|
||||
*
|
||||
*/
|
||||
public interface AlertDefineBindDao extends JpaRepository<AlertDefineMonitorBind, Long>, JpaSpecificationExecutor<AlertDefineMonitorBind> {
|
||||
|
||||
+2
-3
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dao;
|
||||
package org.apache.hertzbeat.alert.dao;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
@@ -28,7 +28,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* AlertDefine Dao
|
||||
*
|
||||
*/
|
||||
public interface AlertDefineDao extends JpaRepository<AlertDefine, Long>, JpaSpecificationExecutor<AlertDefine> {
|
||||
|
||||
+3
-4
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dao;
|
||||
package org.apache.hertzbeat.alert.dao;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.dromara.hertzbeat.common.entity.manager.Tag;
|
||||
import org.apache.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.apache.hertzbeat.common.entity.manager.Tag;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
@@ -28,7 +28,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Alert Monitor Dao
|
||||
*
|
||||
*/
|
||||
public interface AlertMonitorDao extends JpaRepository<Monitor, Long>, JpaSpecificationExecutor<Monitor> {
|
||||
|
||||
+2
-4
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dao;
|
||||
package org.apache.hertzbeat.alert.dao;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
@@ -26,8 +26,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* AlertSilence Dao
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface AlertSilenceDao extends JpaRepository<AlertSilence, Long>, JpaSpecificationExecutor<AlertSilence> {
|
||||
|
||||
+1
-2
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dto;
|
||||
package org.apache.hertzbeat.alert.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Number of monitoring level alarms
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dto;
|
||||
package org.apache.hertzbeat.alert.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -27,7 +27,6 @@ import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY;
|
||||
|
||||
/**
|
||||
* Alarm Statistics Information
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
+3
-2
@@ -15,15 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dto;
|
||||
package org.apache.hertzbeat.alert.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import org.apache.hertzbeat.common.entity.dto.AlertReport;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Abstract parent of cloud service alarm information
|
||||
* {@link org.dromara.hertzbeat.common.entity.dto.AlertReport} - The method corresponds to the parameter of this class one by one. For details about the method, see this class
|
||||
* {@link AlertReport} - The method corresponds to the parameter of this class one by one. For details about the method, see this class
|
||||
*/
|
||||
public abstract class CloudAlertReportAbstract {
|
||||
|
||||
+3
-3
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dto;
|
||||
package org.apache.hertzbeat.alert.dto;
|
||||
|
||||
import lombok.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.hertzbeat.alert.util.DateUtil;
|
||||
import org.dromara.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.apache.hertzbeat.alert.util.DateUtil;
|
||||
import org.apache.hertzbeat.common.entity.dto.AlertReport;
|
||||
|
||||
/**
|
||||
* Generic cloud alarm entity class
|
||||
+2
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.dto;
|
||||
package org.apache.hertzbeat.alert.dto;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
@@ -24,7 +24,7 @@ import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.dromara.hertzbeat.alert.util.DateUtil;
|
||||
import org.apache.hertzbeat.alert.util.DateUtil;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
+3
-3
@@ -15,12 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.enums;
|
||||
package org.apache.hertzbeat.alert.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.dromara.hertzbeat.alert.dto.CloudAlertReportAbstract;
|
||||
import org.dromara.hertzbeat.alert.dto.TenCloudAlertReport;
|
||||
import org.apache.hertzbeat.alert.dto.CloudAlertReportAbstract;
|
||||
import org.apache.hertzbeat.alert.dto.TenCloudAlertReport;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
+6
-8
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.reduce;
|
||||
package org.apache.hertzbeat.alert.reduce;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertMonitorDao;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.common.entity.manager.Tag;
|
||||
import org.dromara.hertzbeat.common.queue.CommonDataQueue;
|
||||
import org.apache.hertzbeat.alert.dao.AlertMonitorDao;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.common.entity.manager.Tag;
|
||||
import org.apache.hertzbeat.common.queue.CommonDataQueue;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -32,8 +32,6 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* reduce alarm and send alert data
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
+8
-10
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.reduce;
|
||||
package org.apache.hertzbeat.alert.reduce;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dao.AlertConvergeDao;
|
||||
import org.dromara.hertzbeat.common.cache.CacheFactory;
|
||||
import org.dromara.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.dromara.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.apache.hertzbeat.alert.dao.AlertConvergeDao;
|
||||
import org.apache.hertzbeat.common.cache.CacheFactory;
|
||||
import org.apache.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.apache.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -34,8 +34,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* alarm converge
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class AlarmConvergeReduce {
|
||||
+8
-11
@@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.reduce;
|
||||
package org.apache.hertzbeat.alert.reduce;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertSilenceDao;
|
||||
import org.dromara.hertzbeat.common.cache.CacheFactory;
|
||||
import org.dromara.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.dromara.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.apache.hertzbeat.alert.dao.AlertSilenceDao;
|
||||
import org.apache.hertzbeat.common.cache.CacheFactory;
|
||||
import org.apache.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.apache.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@@ -35,8 +35,6 @@ import java.util.Optional;
|
||||
|
||||
/**
|
||||
* silence alarm
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@@ -46,7 +44,6 @@ public class AlarmSilenceReduce {
|
||||
|
||||
/**
|
||||
* alert silence filter data
|
||||
*
|
||||
* @param alert alert
|
||||
* @return true when not filter
|
||||
*/
|
||||
+2
-10
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
@@ -26,13 +26,10 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* management interface service for alert converge
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface AlertConvergeService {
|
||||
/**
|
||||
* Verify the correctness of the request data parameters
|
||||
*
|
||||
* @param alertConverge AlertConverge
|
||||
* @param isModify whether modify
|
||||
* @throws IllegalArgumentException A checksum parameter error is thrown
|
||||
@@ -41,7 +38,6 @@ public interface AlertConvergeService {
|
||||
|
||||
/**
|
||||
* New AlertConverge
|
||||
*
|
||||
* @param alertConverge AlertConverge Entity
|
||||
* @throws RuntimeException Added procedure exception throwing
|
||||
*/
|
||||
@@ -49,7 +45,6 @@ public interface AlertConvergeService {
|
||||
|
||||
/**
|
||||
* Modifying an AlertConverge
|
||||
*
|
||||
* @param alertConverge Alarm definition Entity
|
||||
* @throws RuntimeException Exception thrown during modification
|
||||
*/
|
||||
@@ -57,7 +52,6 @@ public interface AlertConvergeService {
|
||||
|
||||
/**
|
||||
* Obtain AlertConverge information
|
||||
*
|
||||
* @param convergeId AlertConverge ID
|
||||
* @return AlertConverge
|
||||
* @throws RuntimeException An exception was thrown during the query
|
||||
@@ -67,7 +61,6 @@ public interface AlertConvergeService {
|
||||
|
||||
/**
|
||||
* Delete AlertConverge in batches
|
||||
*
|
||||
* @param convergeIds AlertConverge IDs
|
||||
* @throws RuntimeException Exception thrown during deletion
|
||||
*/
|
||||
@@ -75,7 +68,6 @@ public interface AlertConvergeService {
|
||||
|
||||
/**
|
||||
* Dynamic conditional query
|
||||
*
|
||||
* @param specification Query conditions
|
||||
* @param pageRequest Paging parameters
|
||||
* @return The query results
|
||||
+1
-9
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@@ -24,16 +24,11 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Configuration Import Export
|
||||
* 配置导入导出
|
||||
*
|
||||
*
|
||||
* Created by a-little-fool on 2023/12/25
|
||||
*/
|
||||
public interface AlertDefineImExportService {
|
||||
/**
|
||||
* Import Configuration
|
||||
* 导入配置
|
||||
*
|
||||
* @param is 输入流
|
||||
*/
|
||||
void importConfig(InputStream is);
|
||||
@@ -41,7 +36,6 @@ public interface AlertDefineImExportService {
|
||||
/**
|
||||
* Export Configuration
|
||||
* 导出配置
|
||||
*
|
||||
* @param os 输出流
|
||||
* @param configList 配置列表
|
||||
*/
|
||||
@@ -50,7 +44,6 @@ public interface AlertDefineImExportService {
|
||||
/**
|
||||
* Export file type
|
||||
* 导出文件类型
|
||||
*
|
||||
* @return 文件类型
|
||||
*/
|
||||
String type();
|
||||
@@ -58,7 +51,6 @@ public interface AlertDefineImExportService {
|
||||
/**
|
||||
* Get Export File Name
|
||||
* 获取导出文件名
|
||||
*
|
||||
* @return 文件名
|
||||
*/
|
||||
String getFileName();
|
||||
+3
-4
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
@@ -31,7 +31,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* Alarm define manager service
|
||||
*
|
||||
*/
|
||||
public interface AlertDefineService {
|
||||
|
||||
+4
-5
@@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.apache.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
@@ -29,7 +29,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Alarm information management interface
|
||||
*
|
||||
*/
|
||||
public interface AlertService {
|
||||
|
||||
+2
-10
@@ -15,9 +15,9 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
@@ -26,13 +26,10 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* management interface service for alert silence
|
||||
*
|
||||
*
|
||||
*/
|
||||
public interface AlertSilenceService {
|
||||
/**
|
||||
* Verify the correctness of the request data parameters
|
||||
*
|
||||
* @param alertSilence AlertSilence
|
||||
* @param isModify whether modify
|
||||
* @throws IllegalArgumentException A checksum parameter error is thrown
|
||||
@@ -41,7 +38,6 @@ public interface AlertSilenceService {
|
||||
|
||||
/**
|
||||
* New AlertSilence
|
||||
*
|
||||
* @param alertSilence AlertSilence Entity
|
||||
* @throws RuntimeException Added procedure exception throwing
|
||||
*/
|
||||
@@ -49,7 +45,6 @@ public interface AlertSilenceService {
|
||||
|
||||
/**
|
||||
* Modifying an AlertSilence
|
||||
*
|
||||
* @param alertSilence Alarm definition Entity
|
||||
* @throws RuntimeException Exception thrown during modification
|
||||
*/
|
||||
@@ -57,7 +52,6 @@ public interface AlertSilenceService {
|
||||
|
||||
/**
|
||||
* Obtain AlertSilence information
|
||||
*
|
||||
* @param silenceId AlertSilence ID
|
||||
* @return AlertSilence
|
||||
* @throws RuntimeException An exception was thrown during the query
|
||||
@@ -67,7 +61,6 @@ public interface AlertSilenceService {
|
||||
|
||||
/**
|
||||
* Delete AlertSilence in batches
|
||||
*
|
||||
* @param silenceIds AlertSilence IDs
|
||||
* @throws RuntimeException Exception thrown during deletion
|
||||
*/
|
||||
@@ -75,7 +68,6 @@ public interface AlertSilenceService {
|
||||
|
||||
/**
|
||||
* Dynamic conditional query
|
||||
*
|
||||
* @param specification Query conditions
|
||||
* @param pageRequest Paging parameters
|
||||
* @return The query results
|
||||
+7
-8
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertConvergeDao;
|
||||
import org.dromara.hertzbeat.alert.service.AlertConvergeService;
|
||||
import org.dromara.hertzbeat.common.cache.CacheFactory;
|
||||
import org.dromara.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.apache.hertzbeat.alert.dao.AlertConvergeDao;
|
||||
import org.apache.hertzbeat.alert.service.AlertConvergeService;
|
||||
import org.apache.hertzbeat.common.cache.CacheFactory;
|
||||
import org.apache.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertConverge;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -35,7 +35,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* implement for alert converge service
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
+5
-11
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
@@ -24,10 +24,10 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineImExportService;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.manager.TagItem;
|
||||
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.manager.TagItem;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -41,10 +41,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Configuration Import Export
|
||||
* 配置导入导出
|
||||
*
|
||||
*
|
||||
* Created by a-little-fool on 2023/12/25
|
||||
*/
|
||||
@Slf4j
|
||||
public abstract class AlertDefineAbstractImExportServiceImpl implements AlertDefineImExportService {
|
||||
@@ -87,8 +83,6 @@ public abstract class AlertDefineAbstractImExportServiceImpl implements AlertDef
|
||||
|
||||
/**
|
||||
* Export Configuration to Output Stream
|
||||
* 导出配置到输出流
|
||||
*
|
||||
* @param exportAlertDefineList 配置列表
|
||||
* @param os 输出流
|
||||
*/
|
||||
+3
-15
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.dromara.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.common.entity.manager.TagItem;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -33,10 +33,6 @@ import java.util.*;
|
||||
|
||||
/**
|
||||
* Configure the import and export EXCEL format
|
||||
* 配置导入导出 EXCEL格式
|
||||
*
|
||||
*
|
||||
* Created by a-little-fool on 2023/12/25
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@@ -46,8 +42,6 @@ public class AlertDefineExcelImExportServiceImpl extends AlertDefineAbstractImEx
|
||||
|
||||
/**
|
||||
* Export file type
|
||||
* 导出文件类型
|
||||
*
|
||||
* @return 文件类型
|
||||
*/
|
||||
@Override
|
||||
@@ -57,8 +51,6 @@ public class AlertDefineExcelImExportServiceImpl extends AlertDefineAbstractImEx
|
||||
|
||||
/**
|
||||
* Get Export File Name
|
||||
* 获取导出文件名
|
||||
*
|
||||
* @return 文件名
|
||||
*/
|
||||
@Override
|
||||
@@ -69,8 +61,6 @@ public class AlertDefineExcelImExportServiceImpl extends AlertDefineAbstractImEx
|
||||
|
||||
/**
|
||||
* Parsing an input stream into a form
|
||||
* 将输入流解析为表单
|
||||
*
|
||||
* @param is 输入流
|
||||
* @return 表单
|
||||
*/
|
||||
@@ -184,8 +174,6 @@ public class AlertDefineExcelImExportServiceImpl extends AlertDefineAbstractImEx
|
||||
|
||||
/**
|
||||
* Export Configuration to Output Stream
|
||||
* 导出配置到输出流
|
||||
*
|
||||
* @param exportAlertDefineList 配置列表
|
||||
* @param os 输出流
|
||||
*/
|
||||
+1
-5
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
@@ -32,10 +32,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Configure the import and export JSON format
|
||||
* 配置导入导出 JSON格式
|
||||
*
|
||||
*
|
||||
* Created by a-little-fool on 2023/12/25
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
+7
-8
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import com.googlecode.aviator.AviatorEvaluator;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertDefineBindDao;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertDefineDao;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineImExportService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.alert.dao.AlertDefineBindDao;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineImExportService;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.alert.dao.AlertDefineDao;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -43,7 +43,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Alarm definition management interface implementation
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
+1
-5
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -32,10 +32,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Configure the import and export Yaml format
|
||||
* 配置导入导出 Yaml格式
|
||||
*
|
||||
*
|
||||
* Created by a-little-fool on 2023/12/25
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
+9
-10
@@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import org.dromara.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertDao;
|
||||
import org.dromara.hertzbeat.alert.dto.AlertPriorityNum;
|
||||
import org.dromara.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.alert.service.AlertService;
|
||||
import org.dromara.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.alert.dao.AlertDao;
|
||||
import org.apache.hertzbeat.alert.reduce.AlarmCommonReduce;
|
||||
import org.apache.hertzbeat.alert.dto.AlertPriorityNum;
|
||||
import org.apache.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.alert.service.AlertService;
|
||||
import org.apache.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -44,7 +44,6 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* Realization of Alarm Information Service
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
+7
-9
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service.impl;
|
||||
package org.apache.hertzbeat.alert.service.impl;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertSilenceDao;
|
||||
import org.dromara.hertzbeat.alert.service.AlertSilenceService;
|
||||
import org.dromara.hertzbeat.common.cache.CacheFactory;
|
||||
import org.dromara.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.apache.hertzbeat.alert.dao.AlertSilenceDao;
|
||||
import org.apache.hertzbeat.alert.service.AlertSilenceService;
|
||||
import org.apache.hertzbeat.common.cache.CacheFactory;
|
||||
import org.apache.hertzbeat.common.cache.CommonCacheService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertSilence;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -36,8 +36,6 @@ import java.util.Set;
|
||||
|
||||
/**
|
||||
* management interface service implement for alert silence
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.util;
|
||||
package org.apache.hertzbeat.alert.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* Alarm template keyword matching replacement engine tool
|
||||
* 告警模版关键字匹配替换引擎工具
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class AlertTemplateUtil {
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.util;
|
||||
package org.apache.hertzbeat.alert.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
# limitations under the License.
|
||||
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
org.dromara.hertzbeat.alert.config.AlerterAutoConfiguration
|
||||
org.apache.hertzbeat.alert.config.AlerterAutoConfiguration
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert;
|
||||
package org.apache.hertzbeat.alert;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
+7
-7
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.alert.service.impl.AlertDefineServiceImpl;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.dromara.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.alert.service.impl.AlertDefineServiceImpl;
|
||||
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.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
+5
-8
@@ -15,25 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.alert.service.AlertDefineService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.ArgumentMatcher;
|
||||
import org.mockito.InjectMocks;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.Mockito;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
+6
-6
@@ -15,13 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dto.GeneralCloudAlertReport;
|
||||
import org.dromara.hertzbeat.alert.dto.TenCloudAlertReport;
|
||||
import org.dromara.hertzbeat.alert.service.AlertService;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.alert.dto.GeneralCloudAlertReport;
|
||||
import org.apache.hertzbeat.alert.dto.TenCloudAlertReport;
|
||||
import org.apache.hertzbeat.alert.service.AlertService;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
+5
-8
@@ -15,14 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.controller;
|
||||
package org.apache.hertzbeat.alert.controller;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.dromara.hertzbeat.alert.service.AlertService;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.dromara.hertzbeat.common.entity.dto.AlertReport;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.alert.dto.AlertSummary;
|
||||
import org.apache.hertzbeat.alert.service.AlertService;
|
||||
import org.apache.hertzbeat.common.entity.alerter.Alert;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
@@ -35,7 +33,6 @@ import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
|
||||
+7
-7
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.dromara.hertzbeat.alert.dao.AlertDefineBindDao;
|
||||
import org.dromara.hertzbeat.alert.dao.AlertDefineDao;
|
||||
import org.dromara.hertzbeat.alert.service.impl.AlertDefineServiceImpl;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefine;
|
||||
import org.dromara.hertzbeat.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.dromara.hertzbeat.common.entity.manager.Monitor;
|
||||
import org.apache.hertzbeat.alert.dao.AlertDefineBindDao;
|
||||
import org.apache.hertzbeat.alert.dao.AlertDefineDao;
|
||||
import org.apache.hertzbeat.alert.service.impl.AlertDefineServiceImpl;
|
||||
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.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.service;
|
||||
package org.apache.hertzbeat.alert.service;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.alert.util;
|
||||
package org.apache.hertzbeat.alert.util;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@@ -1,56 +0,0 @@
|
||||
### Collector
|
||||
|
||||
Collect Metrics Data from peer-to-peer machine by common protocols.
|
||||
使用通用协议远程采集获取对端指标数据。
|
||||
|
||||
support protocols:http/https, jdbc, ssh, telnet, jmx, ping, prometheus...
|
||||
|
||||
## Supported
|
||||
|
||||
> We define all monitoring collection types such as `mysql`, `jvm`, and `k8s` as `YML` monitoring templates, allowing users to import them to support corresponding types of monitoring.
|
||||
> Welcome everyone to contribute your customized general monitoring type YML template during use.
|
||||
|
||||
|
||||
- [Website](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-website.yml), [Port Telnet](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-port.yml),
|
||||
[Http Api](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-api.yml), [Ping Connect](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-ping.yml),
|
||||
[Jvm](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-jvm.yml), [SiteMap](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-fullsite.yml),
|
||||
[Ssl Certificate](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-ssl_cert.yml), [SpringBoot2](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-springboot2.yml),
|
||||
[FTP Server](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-ftp.yml), [SpringBoot3](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-springboot3.yml)
|
||||
- [Mysql](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-mysql.yml), [PostgreSQL](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-postgresql.yml),
|
||||
[MariaDB](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-mariadb.yml), [Redis](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-redis.yml),
|
||||
[ElasticSearch](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-elasticsearch.yml), [SqlServer](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-sqlserver.yml),
|
||||
[Oracle](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-oracle.yml), [MongoDB](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-mongodb.yml),
|
||||
[DM](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-dm.yml), [OpenGauss](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-opengauss.yml),
|
||||
[ClickHouse](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-clickhouse.yml), [IoTDB](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-iotdb.yml),
|
||||
[Redis Cluster](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-redis_cluster.yml), [Redis Sentinel](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-redis_sentinel.yml)
|
||||
- [Linux](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-linux.yml), [Ubuntu](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-ubuntu.yml),
|
||||
[CentOS](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-centos.yml), [Windows](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-windows.yml),
|
||||
[EulerOS](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-euleros.yml), [Fedora CoreOS](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-coreos.yml),
|
||||
[OpenSUSE](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-opensuse.yml), [Rocky Linux](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-rockylinux.yml),
|
||||
[Red Hat](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-redhat.yml), [FreeBSD](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-freebsd.yml),
|
||||
[AlmaLinux](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-almalinux.yml), [Debian Linux](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-debian.yml)
|
||||
- [Tomcat](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-tomcat.yml), [Nacos](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-nacos.yml),
|
||||
[Zookeeper](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-zookeeper.yml), [RabbitMQ](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-rabbitmq.yml),
|
||||
[Flink](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-flink.yml), [Kafka](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-kafka.yml),
|
||||
[ShenYu](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-shenyu.yml), [DynamicTp](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-dynamic_tp.yml),
|
||||
[Jetty](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-jetty.yml), [ActiveMQ](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-activemq.yml)
|
||||
- [Kubernetes](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-kubernetes.yml), [Docker](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-docker.yml)
|
||||
- [CiscoSwitch](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-cisco_switch.yml), [HpeSwitch](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-hpe_switch.yml),
|
||||
[HuaweiSwitch](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-huawei_switch.yml), [TpLinkSwitch](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-tplink_switch.yml),
|
||||
[H3cSwitch](https://raw.githubusercontent.com/dromara/hertzbeat/master/manager/src/main/resources/define/app-h3c_switch.yml)
|
||||
- And More Your Custom Template.
|
||||
- Notified Support `Discord` `Slack` `Telegram` `Email` `DingDing` `WeChat` `FeiShu` `Webhook` `SMS`.
|
||||
|
||||
## Build HertzBeat Collector Install Package
|
||||
|
||||
1. Execute command in root
|
||||
|
||||
```mvn clean install```
|
||||
|
||||
2. Execute command in collector module
|
||||
|
||||
```shell
|
||||
cd collector
|
||||
|
||||
mvn clean package -Pcluster
|
||||
```
|
||||
+4
-4
@@ -19,7 +19,7 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>hertzbeat</artifactId>
|
||||
<groupId>org.dromara.hertzbeat</groupId>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
@@ -51,12 +51,12 @@
|
||||
</dependency>
|
||||
<!-- common -->
|
||||
<dependency>
|
||||
<groupId>org.dromara.hertzbeat</groupId>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<artifactId>hertzbeat-common</artifactId>
|
||||
</dependency>
|
||||
<!-- remoting -->
|
||||
<dependency>
|
||||
<groupId>org.dromara.hertzbeat</groupId>
|
||||
<groupId>org.apache.hertzbeat</groupId>
|
||||
<artifactId>hertzbeat-remoting</artifactId>
|
||||
</dependency>
|
||||
<!-- validation -->
|
||||
@@ -263,7 +263,7 @@
|
||||
<addMavenDescriptor>false</addMavenDescriptor>
|
||||
<manifest>
|
||||
<!--项目启动类-->
|
||||
<mainClass>org.dromara.hertzbeat.collector.Collector</mainClass>
|
||||
<mainClass>org.apache.hertzbeat.collector.Collector</mainClass>
|
||||
<useUniqueVersions>false</useUniqueVersions>
|
||||
<!--第三方JAR加入类构建的路径maven-dependency-plugin-->
|
||||
<addClasspath>true</addClasspath>
|
||||
|
||||
+3
-4
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector;
|
||||
package org.apache.hertzbeat.collector;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@@ -26,10 +26,9 @@ import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* collector startup
|
||||
*
|
||||
*/
|
||||
@ComponentScan(basePackages = {"org.dromara.hertzbeat"})
|
||||
@ConfigurationPropertiesScan(basePackages = {"org.dromara.hertzbeat"})
|
||||
@ComponentScan(basePackages = {"org.apache.hertzbeat"})
|
||||
@ConfigurationPropertiesScan(basePackages = {"org.apache.hertzbeat"})
|
||||
@SpringBootApplication
|
||||
public class Collector {
|
||||
public static void main(String[] args) {
|
||||
+3
-4
@@ -15,15 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect;
|
||||
package org.apache.hertzbeat.collector.collect;
|
||||
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
|
||||
/**
|
||||
* Specific metrics collection implementation abstract class
|
||||
*
|
||||
*/
|
||||
public abstract class AbstractCollect {
|
||||
|
||||
+1
-2
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
/**
|
||||
* resource in cache remove callback
|
||||
*
|
||||
*/
|
||||
public interface CacheCloseable {
|
||||
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -24,7 +24,6 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* resource identifier in cache
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
+1
-3
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
@@ -28,8 +28,6 @@ import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
* lru common resource cache for client-server connection
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class ConnectionCommonCache {
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.sql.Connection;
|
||||
|
||||
/**
|
||||
* jdbc common connection
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class JdbcConnect implements CacheCloseable {
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -23,7 +23,6 @@ import javax.management.remote.JMXConnector;
|
||||
|
||||
/**
|
||||
* jmx connect object
|
||||
*
|
||||
**/
|
||||
@Slf4j
|
||||
public class JmxConnect implements CacheCloseable {
|
||||
+1
-2
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
import com.mongodb.client.MongoClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* mongodb connect client
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class MongodbConnect implements CacheCloseable {
|
||||
+1
-2
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
import io.lettuce.core.api.StatefulConnection;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* redis connection
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class RedisConnect implements CacheCloseable {
|
||||
+1
-2
@@ -15,14 +15,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.cache;
|
||||
package org.apache.hertzbeat.collector.collect.common.cache;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.sshd.client.session.ClientSession;
|
||||
|
||||
/**
|
||||
* ssh connection holder
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class SshConnect implements CacheCloseable {
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.http;
|
||||
package org.apache.hertzbeat.collector.collect.common.http;
|
||||
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -45,7 +45,6 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* common http client
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class CommonHttpClient {
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.common.ssh;
|
||||
package org.apache.hertzbeat.collector.collect.common.ssh;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.sshd.client.ClientBuilder;
|
||||
@@ -29,7 +29,6 @@ import org.apache.sshd.core.CoreModuleProperties;
|
||||
|
||||
/**
|
||||
* common ssh pool client
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class CommonSshClient {
|
||||
+13
-14
@@ -15,20 +15,20 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.database;
|
||||
package org.apache.hertzbeat.collector.collect.database;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.CacheIdentifier;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.ConnectionCommonCache;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.JdbcConnect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.collector.util.CollectUtil;
|
||||
import org.dromara.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.JdbcProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.CacheIdentifier;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.ConnectionCommonCache;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.JdbcConnect;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.util.CollectUtil;
|
||||
import org.apache.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.JdbcProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.postgresql.util.PSQLException;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
@@ -47,7 +47,6 @@ import java.util.Optional;
|
||||
|
||||
/**
|
||||
* common query for database query
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class JdbcCommonCollect extends AbstractCollect {
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.database;
|
||||
package org.apache.hertzbeat.collector.collect.database;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
@@ -25,7 +25,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* load the jdbc driver first to avoid spi concurrent deadlock
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
+8
-9
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.dns;
|
||||
package org.apache.hertzbeat.collector.collect.dns;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -25,13 +25,13 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.DnsProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
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;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.springframework.util.StopWatch;
|
||||
import org.xbill.DNS.DClass;
|
||||
import org.xbill.DNS.Message;
|
||||
@@ -55,7 +55,6 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* dns protocol collection implementation
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class DnsCollectImpl extends AbstractCollect {
|
||||
+8
-9
@@ -15,15 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.ftp;
|
||||
package org.apache.hertzbeat.collector.collect.ftp;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.FtpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.FtpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.net.ftp.FTPClient;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -35,7 +35,6 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* ftp protocol collection implementation
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class FtpCollectImpl extends AbstractCollect {
|
||||
+18
-20
@@ -15,28 +15,28 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http;
|
||||
package org.apache.hertzbeat.collector.collect.http;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.collect.common.http.CommonHttpClient;
|
||||
import org.dromara.hertzbeat.collector.collect.http.promethus.exporter.ExporterParser;
|
||||
import org.dromara.hertzbeat.collector.collect.http.promethus.exporter.MetricFamily;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.collector.util.CollectUtil;
|
||||
import org.dromara.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.dromara.hertzbeat.collector.util.JsonPathParser;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.dromara.hertzbeat.common.util.IpDomainUtil;
|
||||
import org.dromara.hertzbeat.collector.collect.http.promethus.AbstractPrometheusParse;
|
||||
import org.dromara.hertzbeat.collector.collect.http.promethus.PrometheusParseCreater;
|
||||
import org.apache.hertzbeat.collector.collect.common.http.CommonHttpClient;
|
||||
import org.apache.hertzbeat.collector.collect.http.promethus.AbstractPrometheusParse;
|
||||
import org.apache.hertzbeat.collector.collect.http.promethus.PrometheusParseCreater;
|
||||
import org.apache.hertzbeat.collector.collect.http.promethus.exporter.ExporterParser;
|
||||
import org.apache.hertzbeat.collector.collect.http.promethus.exporter.MetricFamily;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.collector.util.CollectUtil;
|
||||
import org.apache.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.apache.hertzbeat.collector.util.JsonPathParser;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.common.util.IpDomainUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.net.util.Base64;
|
||||
import org.apache.http.HttpHeaders;
|
||||
@@ -81,13 +81,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.dromara.hertzbeat.common.constants.SignConstants.RIGHT_DASH;
|
||||
import static org.apache.hertzbeat.common.constants.SignConstants.RIGHT_DASH;
|
||||
|
||||
|
||||
/**
|
||||
* http https collect
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class HttpCollectImpl extends AbstractCollect {
|
||||
+11
-12
@@ -15,17 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http;
|
||||
package org.apache.hertzbeat.collector.collect.http;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.dromara.hertzbeat.common.util.IpDomainUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.common.util.IpDomainUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
@@ -40,12 +40,11 @@ import java.security.cert.Certificate;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.Date;
|
||||
|
||||
import static org.dromara.hertzbeat.common.constants.SignConstants.RIGHT_DASH;
|
||||
import static org.apache.hertzbeat.common.constants.SignConstants.RIGHT_DASH;
|
||||
|
||||
|
||||
/**
|
||||
* ssl Certificate
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class SslCertificateCollectImpl extends AbstractCollect {
|
||||
+3
-3
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+1
-2
@@ -15,11 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus;
|
||||
|
||||
/**
|
||||
* Parse Exception
|
||||
*
|
||||
*/
|
||||
public class ParseException extends RuntimeException {
|
||||
|
||||
+4
-5
@@ -15,11 +15,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* Prometheus Last Parser
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@NoArgsConstructor
|
||||
+8
-10
@@ -15,24 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.collector.util.CollectUtil;
|
||||
import org.dromara.hertzbeat.common.entity.dto.PromVectorOrMatrix;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.util.CollectUtil;
|
||||
import org.apache.hertzbeat.common.entity.dto.PromVectorOrMatrix;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Processing prometheus returns a response format of type "matrix"
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@@ -23,7 +23,6 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* prometheus parse creater
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
+8
-10
@@ -15,24 +15,22 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.collector.util.CollectUtil;
|
||||
import org.dromara.hertzbeat.common.entity.dto.PromVectorOrMatrix;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.JsonUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.util.CollectUtil;
|
||||
import org.apache.hertzbeat.common.entity.dto.PromVectorOrMatrix;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.JsonUtil;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Processing prometheus returns a response format of type "vector"
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
+3
-5
@@ -15,10 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus.exporter;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus.exporter;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.http.promethus.ParseException;
|
||||
import org.dromara.hertzbeat.common.util.StrBuffer;
|
||||
import org.apache.hertzbeat.collector.collect.http.promethus.ParseException;
|
||||
import org.apache.hertzbeat.common.util.StrBuffer;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -31,8 +31,6 @@ import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Resolves the data passed by prometheus's exporter interface http:xxx/metrics
|
||||
* Reference: prometheus text_parse.go code, entry: TextToMetricFamilies
|
||||
*/
|
||||
+1
-2
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus.exporter;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus.exporter;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -24,7 +24,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
+1
-3
@@ -15,12 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.http.promethus.exporter;
|
||||
package org.apache.hertzbeat.collector.collect.http.promethus.exporter;
|
||||
|
||||
/**
|
||||
* prometheus metrics type
|
||||
*
|
||||
*
|
||||
*/
|
||||
public enum MetricType {
|
||||
// for string metric info
|
||||
+12
-13
@@ -1,26 +1,25 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd;
|
||||
|
||||
import com.ecwid.consul.transport.TransportException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClient;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClientManagement;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ServerInfo;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClient;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClientManagement;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ServerInfo;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
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.HttpsdProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* http_sd protocol collection implementation
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class HttpsdImpl extends AbstractCollect {
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.constant;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.constant;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Discovery Client Instance Name For Httpsd monitor
|
||||
*
|
||||
*/
|
||||
public enum DiscoveryClientInstance {
|
||||
CONSUL("Consul"),
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery;
|
||||
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.constant.DiscoveryClientInstance;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.impl.ConsulDiscoveryClient;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.impl.NacosDiscoveryClient;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.impl.ConsulDiscoveryClient;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.impl.NacosDiscoveryClient;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.constant.DiscoveryClientInstance;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery.impl;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery.impl;
|
||||
|
||||
import com.ecwid.consul.v1.ConsulClient;
|
||||
import com.ecwid.consul.v1.agent.model.Check;
|
||||
@@ -6,11 +6,11 @@ import com.ecwid.consul.v1.agent.model.Self;
|
||||
import com.ecwid.consul.v1.agent.model.Service;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ConnectConfig;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClient;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ServerInfo;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ServiceInstance;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ConnectConfig;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClient;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ServerInfo;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ServiceInstance;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
+6
-6
@@ -1,14 +1,14 @@
|
||||
package org.dromara.hertzbeat.collector.collect.httpsd.discovery.impl;
|
||||
package org.apache.hertzbeat.collector.collect.httpsd.discovery.impl;
|
||||
|
||||
import com.alibaba.nacos.api.exception.NacosException;
|
||||
import com.alibaba.nacos.api.naming.NamingFactory;
|
||||
import com.alibaba.nacos.api.naming.NamingService;
|
||||
import com.google.common.collect.Lists;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ConnectConfig;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClient;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ServerInfo;
|
||||
import org.dromara.hertzbeat.collector.collect.httpsd.discovery.ServiceInstance;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ConnectConfig;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.DiscoveryClient;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ServerInfo;
|
||||
import org.apache.hertzbeat.collector.collect.httpsd.discovery.ServiceInstance;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.HttpsdProtocol;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
+9
-10
@@ -15,16 +15,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.icmp;
|
||||
package org.apache.hertzbeat.collector.collect.icmp;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.IcmpProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.IcmpProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -33,7 +33,6 @@ import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* icmp ping collect
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class IcmpCollectImpl extends AbstractCollect {
|
||||
+11
-12
@@ -15,18 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.jmx;
|
||||
package org.apache.hertzbeat.collector.collect.jmx;
|
||||
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.CacheIdentifier;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.ConnectionCommonCache;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.JmxConnect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.JmxProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.CacheIdentifier;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.ConnectionCommonCache;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.JmxConnect;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.JmxProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@@ -44,7 +44,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* jmx protocol acquisition implementation
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
public class JmxCollectImpl extends AbstractCollect {
|
||||
+9
-9
@@ -15,17 +15,17 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.memcached;
|
||||
package org.apache.hertzbeat.collector.collect.memcached;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CollectorConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.MemcachedProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
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.MemcachedProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
+11
-13
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.mongodb;
|
||||
package org.apache.hertzbeat.collector.collect.mongodb;
|
||||
|
||||
import com.mongodb.ConnectionString;
|
||||
import com.mongodb.MongoClientSettings;
|
||||
@@ -26,17 +26,17 @@ import com.mongodb.client.MongoClient;
|
||||
import com.mongodb.client.MongoClients;
|
||||
import com.mongodb.client.MongoDatabase;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.bson.Document;
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.CacheIdentifier;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.ConnectionCommonCache;
|
||||
import org.dromara.hertzbeat.collector.collect.common.cache.MongodbConnect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.MongodbProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.CacheIdentifier;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.ConnectionCommonCache;
|
||||
import org.apache.hertzbeat.collector.collect.common.cache.MongodbConnect;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.MongodbProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
@@ -48,8 +48,6 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
|
||||
/**
|
||||
* Mongodb single collect
|
||||
* <p>
|
||||
* <p>
|
||||
* see also https://www.mongodb.com/languages/java,
|
||||
* https://www.mongodb.com/docs/manual/reference/command/serverStatus/#metrics
|
||||
*/
|
||||
+1
-3
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.mq;
|
||||
package org.apache.hertzbeat.collector.collect.mq;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -24,8 +24,6 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* rocketmq collect data
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class RocketmqCollectData {
|
||||
+9
-12
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.dromara.hertzbeat.collector.collect.mq;
|
||||
package org.apache.hertzbeat.collector.collect.mq;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -23,6 +23,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.apache.rocketmq.acl.common.AclClientRPCHook;
|
||||
import org.apache.rocketmq.acl.common.SessionCredentials;
|
||||
import org.apache.rocketmq.common.MixAll;
|
||||
@@ -36,14 +37,13 @@ import org.apache.rocketmq.common.protocol.route.BrokerData;
|
||||
import org.apache.rocketmq.common.utils.ThreadUtils;
|
||||
import org.apache.rocketmq.remoting.RPCHook;
|
||||
import org.apache.rocketmq.tools.admin.DefaultMQAdminExt;
|
||||
import org.dromara.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.dromara.hertzbeat.collector.dispatch.DispatchConstants;
|
||||
import org.dromara.hertzbeat.collector.util.JsonPathParser;
|
||||
import org.dromara.hertzbeat.common.constants.CommonConstants;
|
||||
import org.dromara.hertzbeat.common.entity.job.Metrics;
|
||||
import org.dromara.hertzbeat.common.entity.job.protocol.RocketmqProtocol;
|
||||
import org.dromara.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.dromara.hertzbeat.common.util.CommonUtil;
|
||||
import org.apache.hertzbeat.collector.collect.AbstractCollect;
|
||||
import org.apache.hertzbeat.collector.util.JsonPathParser;
|
||||
import org.apache.hertzbeat.common.constants.CommonConstants;
|
||||
import org.apache.hertzbeat.common.entity.job.Metrics;
|
||||
import org.apache.hertzbeat.common.entity.job.protocol.RocketmqProtocol;
|
||||
import org.apache.hertzbeat.common.entity.message.CollectRep;
|
||||
import org.apache.hertzbeat.common.util.CommonUtil;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -64,9 +64,6 @@ import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* rocketmq collect
|
||||
*
|
||||
*
|
||||
* @since 5/6/2023
|
||||
*/
|
||||
@Slf4j
|
||||
public class RocketmqSingleCollectImpl extends AbstractCollect implements DisposableBean {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user