fix: fixed the bug that old trace instances may be fetched
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/trace"
|
||||
"go.opentelemetry.io/otel"
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
"go.opentelemetry.io/otel/codes"
|
||||
oteltrace "go.opentelemetry.io/otel/trace"
|
||||
@@ -14,7 +13,8 @@ import (
|
||||
var sqlAttributeKey = attribute.Key("sql.method")
|
||||
|
||||
func startSpan(ctx context.Context, method string) (context.Context, oteltrace.Span) {
|
||||
tracer := otel.Tracer(trace.TraceName)
|
||||
tracer := trace.TracerFromContext(ctx)
|
||||
|
||||
start, span := tracer.Start(ctx,
|
||||
spanName,
|
||||
oteltrace.WithSpanKind(oteltrace.SpanKindClient),
|
||||
|
||||
Reference in New Issue
Block a user