From 726f6b603f383a620a7f3be4f2de2b38522f6f04 Mon Sep 17 00:00:00 2001 From: steden <1470804@qq.com> Date: Sun, 14 Jul 2024 18:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E9=93=BE=E8=B7=AF=E5=88=97=E8=A1=A8=E6=B2=A1=E6=9C=89=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=EF=BC=8C=E4=B8=94=E4=B8=8D=E6=98=AFWebApi=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- saveTraceContextConsumer.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/saveTraceContextConsumer.go b/saveTraceContextConsumer.go index 7f77b36..9b0a5ca 100644 --- a/saveTraceContextConsumer.go +++ b/saveTraceContextConsumer.go @@ -12,6 +12,7 @@ import ( "github.com/farseer-go/fs/exception" "github.com/farseer-go/fs/parse" "github.com/farseer-go/fs/trace" + "github.com/farseer-go/linkTrace/eumTraceType" "net/http" ) @@ -27,6 +28,9 @@ func SaveTraceContextConsumer(subscribeName string, lstMessage collections.ListA lstMessage.Foreach(func(item *any) { // 上下文 dto := (*item).(TraceContext) + if len(dto.List) == 0 && dto.TraceType != eumTraceType.WebApi { + return + } lstTraceContext.Add(dto) }) if err := uploadTrace(lstTraceContext); err != nil {