Skip to content

Commit

Permalink
[fix] 捕获异常,避免因为跟踪项错误导致整体跟踪失败
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Oct 1, 2023
1 parent 259a694 commit 72eb8a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Stardust.Server/Controllers/TraceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 72eb8a6

Please sign in to comment.