Skip to content

Commit

Permalink
feat: 新增命令获取当前配置了监控目标,但未配置对应目标类型维度的监控策略的命令 #1010158081120983655
Browse files Browse the repository at this point in the history
  • Loading branch information
HACK-WU committed Dec 2, 2024
1 parent 7320e6f commit 698100c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bkmonitor/bkmonitor/management/commands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from core.drf_resource import api
from monitor_web.models import CollectorPluginMeta
from constants.strategy import TargetFieldType
from bkmonitor.models.strategy import default_target

target_biz_list = list(
map(
Expand Down Expand Up @@ -327,7 +326,7 @@ def parse_target_dimension_strategy():
items = ItemModel.objects.filter(id__in=item_ids).only("strategy_id", "target")
# 策略与监控目标类型映射
stra_target_type_map = {item.strategy_id: target_type_map.get(item.target[0][0]["field"]) for item in items
if item.target != default_target()}
if item.target and item.target != [[]]}

# step3: 获取目标策略
strategies = StrategyModel.objects.filter(id__in=stra_target_type_map.keys())
Expand Down

0 comments on commit 698100c

Please sign in to comment.