Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(backend): 监控策略维度问题 #6649 #6652

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_monitor/models/alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,9 @@ def patch_target_and_metric_id(details, db_type):
items = details["items"]
# 事件类告警,无需设置告警目标,否则要求上报的数据必须携带服务实例id(告警目标匹配依据)
for item in items:
# 更新监控目标为db_type对应的cmdb拓扑
# 更新监控目标为db_type对应的cmdb拓扑,其中 DBHA 的策略,无需添加目标
objs = AppMonitorTopo.get_set_by_dbtype(db_type=db_type)
if objs:
if objs and "DBHA_SWITCH" not in details["labels"]:
item["target"] = [
[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL Ext3 文件过大",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(ext3-check)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL Monitor 执行异常",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(monitor-internal-error)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL Routine Definer",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(routine-definer)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL Slave 同步异常",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -246,7 +246,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(slave-status)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL Trigger Definer",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(trigger-definer)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL View Definer",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(view-definer)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 存储引擎检查",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(engine)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 库字符集",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(character-consistency)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 日志监控-致命",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(mysql-err-critical)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 日志监控-预警",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(mysql-err-notice)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_monitor/tpls/alarm/mysql/MySQL 注入.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 注入",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(mysql-inject)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 连接失败",
"source": "dbm",
"scenario": "other_rt",
"scenario": "os",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -36,6 +36,7 @@
"instance_port",
"cluster_domain",
"bk_cloud_id",
"bk_target_ip",
"machine_type",
"instance_role",
"appid"
Expand Down Expand Up @@ -241,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(db-up)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 连接日志过多",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(mysql-connlog-size)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 配置异常",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(mysql-config-diff)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_monitor/tpls/alarm/mysql/MySQL 锁表.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "MySQL 锁表",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -222,7 +222,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(mysql-lock-dbm_report_channel)",
"version": 24,
"version": 25,
"alert_source": "event",
"custom_conditions": [],
"export_at": "2024-05-31T17:47:22+08:00"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@
},
"labels": [
"DBM",
"DBM_MYSQL"
"DBM_MYSQL",
"DBHA_SWITCH"
],
"app": "",
"path": "",
Expand All @@ -249,7 +250,7 @@
},
"is_enabled": true,
"monitor_indicator": "a",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,8 @@
},
"labels": [
"DBM",
"DBM_MYSQL"
"DBM_MYSQL",
"DBHA_SWITCH"
],
"app": "",
"path": "",
Expand All @@ -249,7 +250,7 @@
},
"is_enabled": true,
"monitor_indicator": "a",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
4 changes: 2 additions & 2 deletions dbm-ui/backend/db_monitor/tpls/alarm/mysql/Proxy 后端.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "Proxy 后端",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -242,7 +242,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(proxy-backend)",
"version": 22,
"version": 23,
"alert_source": "event",
"custom_conditions": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bk_biz_id": "",
"name": "Proxy 白名单",
"source": "dbm",
"scenario": "other_rt",
"scenario": "component",
"type": "monitor",
"items": [
{
Expand Down Expand Up @@ -212,7 +212,7 @@
},
"is_enabled": true,
"monitor_indicator": "COUNT(proxy-user-list-dbm_report_channel)",
"version": 24,
"version": 25,
"alert_source": "event",
"custom_conditions": [],
"export_at": "2024-05-31T17:47:22+08:00"
Expand Down
Loading
Loading