From af1bd5a7f389f162699a8b918b3c51a281f4160e Mon Sep 17 00:00:00 2001 From: jiayuan929 <252461528@qq.com> Date: Fri, 13 Jan 2023 18:20:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20otel=20=E5=A2=9E=E5=BC=BA=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=85=BC=E5=AE=B9=E6=B2=A1=E6=9C=89=E7=A9=BA=E9=97=B4?= =?UTF-8?q?id=20=E7=9A=84=E6=83=85=E5=86=B5=20(#149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- svc-otel/svc_otel/vendor/render.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/svc-otel/svc_otel/vendor/render.py b/svc-otel/svc_otel/vendor/render.py index 8bca14e13b..b9f88275ad 100644 --- a/svc-otel/svc_otel/vendor/render.py +++ b/svc-otel/svc_otel/vendor/render.py @@ -32,9 +32,11 @@ def render_instance_data(request: HttpRequest, instance: ServiceInstance) -> Dic if settings.ENABLE_ADMIN: # NOTE: 签发管理页面的访问链接, 如果不提供管理入口, 去掉 `admin_url` 即可 - admin_url = "{}/?space_uid={}#/apm/application?filter-app_name={}".format( - settings.BK_MONITORV3_URL, config['bk_monitor_space_id'], config['app_name'] - ) - config["admin_url"] = admin_url + # 没有空间 ID 则不显示详情页面 + if bk_monitor_space_id := config.get('bk_monitor_space_id'): + admin_url = "{}/?space_uid={}#/apm/application?filter-app_name={}".format( + settings.BK_MONITORV3_URL, bk_monitor_space_id, config['app_name'] + ) + config["admin_url"] = admin_url return data