From 2aec4f768219f651a26784a6089a206605b22652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=BF=E4=BA=BA=E6=98=93?= Date: Fri, 20 Sep 2024 09:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=BC=82=E5=B8=B8=E5=9F=8B?= =?UTF-8?q?=E7=82=B9=E8=AE=B0=E5=BD=95=EF=BC=9BAppTracer.TraceItems=20?= =?UTF-8?q?=E6=9C=89=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E9=A3=8E=E9=99=A9?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E8=A7=A3=E8=80=A6=E4=B8=BAICache?= =?UTF-8?q?=EF=BC=8C=E7=89=B9=E5=88=AB=E6=98=AFweb=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E8=A2=AB=E6=89=AB=E6=8F=8F=E6=97=B6=EF=BC=8C=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E5=8D=95=E4=B8=AA=E5=BA=94=E7=94=A8=E4=BA=A7=E7=94=9F10?= =?UTF-8?q?=E4=B8=87=E4=B8=AATraceItem=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stardust.Server/Controllers/TraceController.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Stardust.Server/Controllers/TraceController.cs b/Stardust.Server/Controllers/TraceController.cs index 5ad701c..3c346cb 100644 --- a/Stardust.Server/Controllers/TraceController.cs +++ b/Stardust.Server/Controllers/TraceController.cs @@ -196,7 +196,7 @@ private void ProcessData(AppTracer app, TraceModel model, Int32 nodeId, String i try { // 排除项 - var excludes = app.Excludes.Split(",", ";") ?? new String[0]; + var excludes = app.Excludes.Split(",", ";") ?? []; //var timeoutExcludes = app.TimeoutExcludes.Split(",", ";") ?? new String[0]; var now = DateTime.Now; @@ -213,13 +213,13 @@ private void ProcessData(AppTracer app, TraceModel model, Int32 nodeId, String i var rule = TraceRule.Match(item.Name); if (rule != null && !rule.IsWhite) { - using var span = _tracer?.NewSpan("trace:BlackList", new { item.Name, rule.Rule }); + using var span = _tracer?.NewSpan("trace:BlackList", new { item.Name, rule.Rule, ip }); continue; } if (excludes != null && excludes.Any(e => e.IsMatch(item.Name, StringComparison.OrdinalIgnoreCase))) { - using var span = _tracer?.NewSpan("trace:Exclude", item.Name); + using var span = _tracer?.NewSpan("trace:Exclude", new { item.Name, ip }); continue; } //if (item.Name.EndsWithIgnoreCase("/Trace/Report")) continue; @@ -228,14 +228,14 @@ private void ProcessData(AppTracer app, TraceModel model, Int32 nodeId, String i var timestamp = item.StartTime.ToDateTime().ToLocalTime(); if (timestamp < startTime || timestamp > endTime) { - using var span = _tracer?.NewSpan("trace:ErrorTime", $"{item.Name}-{timestamp.ToFullString()}"); + using var span = _tracer?.NewSpan("trace:ErrorTime", new { item.Name, timestamp, ip }); continue; } // 拒收超长项 if (item.Name.Length > TraceData._.Name.Length) { - using var span = _tracer?.NewSpan("trace:LongName", item.Name); + using var span = _tracer?.NewSpan("trace:LongName", new { item.Name, ip }); continue; }