Skip to content

Commit a0c84fe

Browse files
authored
Merge branch 'feat/new_monitor_apigw' into feat/monitor_apigateway_compatibility/#1010158081123701143
2 parents 6d3611a + 2bc0ce2 commit a0c84fe

File tree

5 files changed

+7
-12
lines changed

5 files changed

+7
-12
lines changed

bklog/apps/api/modules/monitor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
from apps.api.base import DataAPI # noqa
3030
from apps.api.modules.utils import add_esb_info_before_request # noqa
31-
from config.domains import MONITOR_APIGATEWAY_ROOT, MONITOR_APIGATEWAY_ROOT_NEW # noqa
31+
from config.domains import MONITOR_APIGATEWAY_ROOT # noqa
3232

3333

3434
class _MonitorApi(object):

bklog/apps/api/modules/transfer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
from apps.api.base import DataAPI
2929
from apps.api.modules.utils import add_esb_info_before_request
30-
from config.domains import MONITOR_APIGATEWAY_ROOT, MONITOR_APIGATEWAY_ROOT_NEW
30+
from config.domains import MONITOR_APIGATEWAY_ROOT
3131

3232

3333
def get_cluster_info_after(response_result):

bklog/apps/log_clustering/handlers/clustering_monitor.py

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
DEFAULT_LABEL,
3939
DEFAULT_METRIC_CLUSTERING,
4040
DEFAULT_NO_DATA_CONFIG,
41-
DEFAULT_NOTICE_WAY,
4241
DEFAULT_PATTERN_MONITOR_MSG,
4342
DEFAULT_SCENARIO,
4443
ITEM_NAME_CLUSTERING,
@@ -447,9 +446,7 @@ def save_pattern_strategy(self, table_id, params):
447446
group = MonitorUtils.save_notice_group(
448447
bk_biz_id=self.bk_biz_id,
449448
name=group_name,
450-
message="",
451449
notice_receiver=[{"type": "user", "id": name} for name in remark_obj.owners],
452-
notice_way=DEFAULT_NOTICE_WAY,
453450
)
454451
user_groups = [group["id"]]
455452
remark_obj.notice_group_id = group["id"]

bklog/apps/log_clustering/utils/monitor.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ def save_notice_group(cls, bk_biz_id: int, name: str, notice_way: dict, notice_r
5151
params = {
5252
"bk_biz_id": bk_biz_id,
5353
"name": name,
54-
"message": message,
55-
"notice_way": notice_way,
56-
"notice_receiver": notice_receiver,
54+
"duty_arranges": [{"users": notice_receiver}],
55+
"mention_list": DEFAULT_MENTION_LIST,
56+
"alert_notice": DEFAULT_ALERT_NOTICE,
57+
"action_notice": DEFAULT_ACTION_NOTICE,
5758
}
5859
return MonitorApi.save_notice_group(params=params)
5960

@@ -72,9 +73,7 @@ def get_or_create_notice_group(cls, log_index_set_id, bk_biz_id):
7273
group = cls.save_notice_group(
7374
bk_biz_id=bk_biz_id,
7475
name=_("{}_{}聚类告警组").format(log_index_set_id, log_index_set.index_set_name),
75-
message="",
7676
notice_receiver=notice_receiver,
77-
notice_way=DEFAULT_NOTICE_WAY,
7877
)
7978
NoticeGroup.objects.get_or_create(
8079
index_set_id=log_index_set_id, notice_group_id=group["id"], bk_biz_id=bk_biz_id

bklog/config/domains.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"GSE_APIGATEWAY_ROOT_V2",
3535
"GSE_APIGATEWAY_ROOT_V3",
3636
"MONITOR_APIGATEWAY_ROOT",
37-
"MONITOR_APIGATEWAY_ROOT_NEW",
3837
"BCS_CC_APIGATEWAY_ROOT",
3938
"USER_MANAGE_APIGATEWAY_ROOT",
4039
# 数据平台模块域名
@@ -71,7 +70,7 @@
7170
# Wework api
7271
"WEWORK_APIGATEWAY_ROOT",
7372
# UNIFY QUERY
74-
"UNIFYQUERY_APIGATEWAY_ROOT"
73+
"UNIFYQUERY_APIGATEWAY_ROOT",
7574
]
7675

7776
env_domains = load_domains(settings)

0 commit comments

Comments
 (0)