fix(otelTrace): 移除不必要的 trace.WithNewRoot 调用

- 删除 middleware.go 中创建追踪时的 trace.WithNewRoot 参数
- 保持原有的 span 种类为服务器端服务器类型
- 避免因新根追踪产生的潜在追踪链断裂问题
This commit is contained in:
danial
2025-11-30 14:28:18 +08:00
parent db1ba53ccf
commit 275bbac1da

View File

@@ -52,7 +52,6 @@ func Middleware(ctx *beecontext.Context, next web.FilterFunc) {
attribute.String("peer.hostname", req.Host),
attribute.String("net.peer.ip", getClientIP(req)),
),
trace.WithNewRoot(),
trace.WithSpanKind(trace.SpanKindServer),
)
if parentSpan.IsRecording() && parentSpan.SpanContext().IsSampled() {