From 72eb8a699063c0ee11e00603fc98620aee384be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Sun, 1 Oct 2023 09:18:24 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E6=8D=95=E8=8E=B7=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=9B=A0=E4=B8=BA=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E9=A1=B9=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E6=95=B4=E4=BD=93?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stardust.Server/Controllers/TraceController.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Stardust.Server/Controllers/TraceController.cs b/Stardust.Server/Controllers/TraceController.cs index b3a934d0..5322aca6 100644 --- a/Stardust.Server/Controllers/TraceController.cs +++ b/Stardust.Server/Controllers/TraceController.cs @@ -241,7 +241,13 @@ private void ProcessData(AppTracer app, TraceModel model, Int32 nodeId, String i } // 检查跟踪项 - var ti = app.GetOrAddItem(item.Name, rule?.IsWhite); + TraceItem ti = null; + try + { + // 捕获异常,避免因为跟踪项错误导致整体跟踪失败 + ti = app.GetOrAddItem(item.Name, rule?.IsWhite); + } + catch { } if (ti == null) { using var span = _tracer?.NewSpan("trace:ErrorItem", item.Name);