mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
add monitor_system_integrate_with_self file
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 589 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 652 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 511 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 672 KiB |
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# 夜莺监控集成
|
# 监控系统集成——夜莺
|
||||||
|
|
||||||
- `Kafka-Manager`通过将 监控的数据 以及 监控的规则 都提交给夜莺,然后依赖夜莺的监控系统从而实现监控告警功能。
|
- `Kafka-Manager`通过将 监控的数据 以及 监控的规则 都提交给夜莺,然后依赖夜莺的监控系统从而实现监控告警功能。
|
||||||
|
|
||||||
|
|||||||
54
docs/dev_guide/monitor_system_integrate_with_self.md
Normal file
54
docs/dev_guide/monitor_system_integrate_with_self.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**一站式`Apache Kafka`集群指标监控与运维管控平台**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 监控系统集成
|
||||||
|
|
||||||
|
- 监控系统默认与 [夜莺] (https://github.com/didi/nightingale) 进行集成;
|
||||||
|
- 对接自有的监控系统需要进行简单的二次开发,即实现部分监控告警模块的相关接口即可;
|
||||||
|
- 集成会有两块内容,一个是指标数据上报的集成,还有一个是监控告警规则的集成;
|
||||||
|
|
||||||
|
## 1、指标数据上报集成
|
||||||
|
|
||||||
|
仅完成这一步的集成之后,即可将监控数据上报到监控系统中,此时已能够在自己的监控系统进行监控告警规则的配置了。
|
||||||
|
|
||||||
|
**步骤一:实现指标上报的接口**
|
||||||
|
|
||||||
|
- 按照自己内部监控系统的数据格式要求,将数据进行组装成符合自己内部监控系统要求的数据进行上报,具体的可以参考夜莺集成的实现代码。
|
||||||
|
- 至于会上报哪些指标,可以查看有哪些地方调用了该接口。
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**步骤二:相关配置修改**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**步骤三:开启上报任务**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## 2、监控告警规则集成
|
||||||
|
|
||||||
|
完成**1、指标数据上报集成**之后,即可在自己的监控系统进行监控告警规则的配置了。完成该步骤的集成之后,可以在`Logi-KafkaManager`中进行监控告警规则的增删改查等等。
|
||||||
|
|
||||||
|
大体上和**1、指标数据上报集成**一致,
|
||||||
|
|
||||||
|
**步骤一:实现相关接口**
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
实现完成步骤一之后,接下来的步骤和**1、指标数据上报集成**中的步骤二、步骤三一致,都需要进行相关配置的修改即可。
|
||||||
|
|
||||||
|
|
||||||
|
## 3、总结
|
||||||
|
|
||||||
|
简单介绍了一下监控告警的集成,嫌麻烦的同学可以仅做 **1、指标数据上报集成** 这一节的内容即可满足一定场景下的需求。
|
||||||
|
|
||||||
|
|
||||||
|
**集成过程中,有任何觉得文档没有说清楚的地方或者建议,欢迎入群交流,也欢迎贡献代码,觉得好也辛苦给个star。**
|
||||||
@@ -14,37 +14,119 @@ import com.xiaojukeji.kafka.manager.common.entity.pojo.MonitorRuleDO;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 监控系统接口
|
||||||
* @author zengqiao
|
* @author zengqiao
|
||||||
* @date 20/5/21
|
* @date 20/5/21
|
||||||
*/
|
*/
|
||||||
public interface MonitorService {
|
public interface MonitorService {
|
||||||
|
/**
|
||||||
|
* 创建告警规则
|
||||||
|
* @param monitorDTO 告警规则
|
||||||
|
* @param operator 操作人
|
||||||
|
* @return 操作状态结果
|
||||||
|
*/
|
||||||
ResultStatus createMonitorRule(MonitorRuleDTO monitorDTO, String operator);
|
ResultStatus createMonitorRule(MonitorRuleDTO monitorDTO, String operator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除告警规则
|
||||||
|
* @param id 告警ID
|
||||||
|
* @param operator 操作人
|
||||||
|
* @return 操作状态结果
|
||||||
|
*/
|
||||||
ResultStatus deleteMonitorRule(Long id, String operator);
|
ResultStatus deleteMonitorRule(Long id, String operator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改告警规则
|
||||||
|
* @param monitorDTO 告警规则
|
||||||
|
* @param operator 操作人
|
||||||
|
* @return 操作状态结果
|
||||||
|
*/
|
||||||
ResultStatus modifyMonitorRule(MonitorRuleDTO monitorDTO, String operator);
|
ResultStatus modifyMonitorRule(MonitorRuleDTO monitorDTO, String operator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取告警规则
|
||||||
|
* @param operator 操作人
|
||||||
|
* @return 监控告警规则概要信息
|
||||||
|
*/
|
||||||
List<MonitorRuleSummary> getMonitorRules(String operator);
|
List<MonitorRuleSummary> getMonitorRules(String operator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取监控告警规则的详情信息
|
||||||
|
* @param monitorRuleDO 本地存储的监控告警规则概要信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Result<MonitorRuleDTO> getMonitorRuleDetail(MonitorRuleDO monitorRuleDO);
|
Result<MonitorRuleDTO> getMonitorRuleDetail(MonitorRuleDO monitorRuleDO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 依据主键ID, 获取存储于MySQL中的监控告警规则基本信息
|
||||||
|
* @param id 本地监控告警规则ID
|
||||||
|
* @return 本地监控告警规则信息
|
||||||
|
*/
|
||||||
MonitorRuleDO getById(Long id);
|
MonitorRuleDO getById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 依据策略ID, 获取存储于MySQL中的监控告警规则基本信息
|
||||||
|
* @param strategyId 策略ID
|
||||||
|
* @return 本地监控告警规则信息
|
||||||
|
*/
|
||||||
MonitorRuleDO getByStrategyId(Long strategyId);
|
MonitorRuleDO getByStrategyId(Long strategyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取告警历史
|
||||||
|
* @param id 告警ID
|
||||||
|
* @param startTime 查询的起始时间
|
||||||
|
* @param endTime 查询的截止时间
|
||||||
|
* @return 告警历史
|
||||||
|
*/
|
||||||
Result<List<Alert>> getMonitorAlertHistory(Long id, Long startTime, Long endTime);
|
Result<List<Alert>> getMonitorAlertHistory(Long id, Long startTime, Long endTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询告警详情
|
||||||
|
* @param alertId 告警ID
|
||||||
|
* @return 告警详情
|
||||||
|
*/
|
||||||
Result<MonitorAlertDetail> getMonitorAlertDetail(Long alertId);
|
Result<MonitorAlertDetail> getMonitorAlertDetail(Long alertId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 屏蔽告警
|
||||||
|
* @param monitorSilenceDTO 屏蔽的信息
|
||||||
|
* @param operator 操作人
|
||||||
|
* @return 屏蔽操作的结果
|
||||||
|
*/
|
||||||
Result createSilence(MonitorSilenceDTO monitorSilenceDTO, String operator);
|
Result createSilence(MonitorSilenceDTO monitorSilenceDTO, String operator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除屏蔽策略
|
||||||
|
* @param silenceId 屏蔽ID
|
||||||
|
* @return 删除屏蔽告警的操作结果
|
||||||
|
*/
|
||||||
Boolean releaseSilence(Long silenceId);
|
Boolean releaseSilence(Long silenceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改屏蔽告警的规则
|
||||||
|
* @param monitorSilenceDTO 屏蔽告警的信息
|
||||||
|
* @param operator 操作人
|
||||||
|
* @return 操作结果
|
||||||
|
*/
|
||||||
Result modifySilence(MonitorSilenceDTO monitorSilenceDTO, String operator);
|
Result modifySilence(MonitorSilenceDTO monitorSilenceDTO, String operator);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取屏蔽策略
|
||||||
|
* @param strategyId 告警策略ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Result<List<Silence>> getSilences(Long strategyId);
|
Result<List<Silence>> getSilences(Long strategyId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取屏蔽详情
|
||||||
|
* @param silenceId 屏蔽ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
Silence getSilenceById(Long silenceId);
|
Silence getSilenceById(Long silenceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取告警接收组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<NotifyGroup> getNotifyGroups();
|
List<NotifyGroup> getNotifyGroups();
|
||||||
}
|
}
|
||||||
@@ -14,44 +14,34 @@ public abstract class AbstractMonitorService {
|
|||||||
* 监控策略的增删改查
|
* 监控策略的增删改查
|
||||||
*/
|
*/
|
||||||
public abstract Integer createStrategy(Strategy strategy);
|
public abstract Integer createStrategy(Strategy strategy);
|
||||||
|
|
||||||
public abstract Boolean deleteStrategyById(Long strategyId);
|
public abstract Boolean deleteStrategyById(Long strategyId);
|
||||||
|
|
||||||
public abstract Boolean modifyStrategy(Strategy strategy);
|
public abstract Boolean modifyStrategy(Strategy strategy);
|
||||||
|
|
||||||
public abstract List<Strategy> getStrategies();
|
public abstract List<Strategy> getStrategies();
|
||||||
|
|
||||||
public abstract Strategy getStrategyById(Long strategyId);
|
public abstract Strategy getStrategyById(Long strategyId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 告警的查
|
* 告警被触发后, 告警信息的查询
|
||||||
*/
|
*/
|
||||||
public abstract List<Alert> getAlerts(Long strategyId, Long startTime, Long endTime);
|
public abstract List<Alert> getAlerts(Long strategyId, Long startTime, Long endTime);
|
||||||
|
|
||||||
public abstract Alert getAlertById(Long alertId);
|
public abstract Alert getAlertById(Long alertId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 屏蔽的增删改查
|
* 告警被触发之后, 进行屏蔽时, 屏蔽策略的增删改查
|
||||||
*/
|
*/
|
||||||
public abstract Boolean createSilence(Silence silence);
|
public abstract Boolean createSilence(Silence silence);
|
||||||
|
|
||||||
public abstract Boolean releaseSilence(Long silenceId);
|
public abstract Boolean releaseSilence(Long silenceId);
|
||||||
|
|
||||||
public abstract Boolean modifySilence(Silence silence);
|
public abstract Boolean modifySilence(Silence silence);
|
||||||
|
|
||||||
public abstract List<Silence> getSilences(Long strategyId);
|
public abstract List<Silence> getSilences(Long strategyId);
|
||||||
|
|
||||||
public abstract Silence getSilenceById(Long silenceId);
|
public abstract Silence getSilenceById(Long silenceId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 指标的上报和查询
|
* 告警组获取
|
||||||
*/
|
|
||||||
public abstract Boolean sinkMetrics(List<MetricSinkPoint> pointList);
|
|
||||||
|
|
||||||
public abstract Metric getMetrics(String metric, Long startTime, Long endTime, Integer step, Properties tags);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 告警组
|
|
||||||
*/
|
*/
|
||||||
public abstract List<NotifyGroup> getNotifyGroups();
|
public abstract List<NotifyGroup> getNotifyGroups();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监控指标的上报和查询
|
||||||
|
*/
|
||||||
|
public abstract Boolean sinkMetrics(List<MetricSinkPoint> pointList);
|
||||||
|
public abstract Metric getMetrics(String metric, Long startTime, Long endTime, Integer step, Properties tags);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user