fix(config): monitor config key error when args_check is False (#362)

* add monitor switch

* add switch to light monitor

* fix alert_address is empty

* fix light monitor heartbeat

* init light_monitor on rank_log only

* add comments to the monitoring config

* optimize config

* fix monitor config key error when args_check is False
pull/320/head
jiaopenglong 2023-09-25 17:30:36 +08:00 committed by GitHub
parent 26a7397752
commit 064965527b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -468,13 +468,14 @@ def initialize_distributed_env(
args_sanity_check() args_sanity_check()
# init light monitor client # init light monitor client
alert_config = gpc.config.monitor.alert if gpc.config.get("monitor") and gpc.config.monitor.get("alert"):
if alert_config.enable_feishu_alert and gpc.is_rank_for_log(): alert_config = gpc.config.monitor.alert
light_monitor_address = alert_config.light_monitor_address if alert_config.enable_feishu_alert and gpc.is_rank_for_log():
if light_monitor_address: light_monitor_address = alert_config.light_monitor_address
initialize_light_monitor(light_monitor_address) if light_monitor_address:
else: initialize_light_monitor(light_monitor_address)
logger.warning("monitor address is none, monitor could not be used!") else:
logger.warning("monitor address is none, monitor could not be used!")
def get_config_value(config, key, defalut): def get_config_value(config, key, defalut):