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);