chore: reformat code (#2925)

This commit is contained in:
Kevin Wan
2023-02-26 09:35:59 +08:00
committed by GitHub
parent 3bc40d9eaf
commit a5e5f04bcf
4 changed files with 21 additions and 30 deletions

View File

@@ -14,11 +14,7 @@ var mongoCmdAttributeKey = attribute.Key("mongo.cmd")
func startSpan(ctx context.Context, cmd string) (context.Context, oteltrace.Span) {
tracer := trace.TracerFromContext(ctx)
ctx, span := tracer.Start(ctx,
spanName,
oteltrace.WithSpanKind(oteltrace.SpanKindClient),
)
ctx, span := tracer.Start(ctx, spanName, oteltrace.WithSpanKind(oteltrace.SpanKindClient))
span.SetAttributes(mongoCmdAttributeKey.String(cmd))
return ctx, span

View File

@@ -14,7 +14,6 @@ import (
"github.com/zeromicro/go-zero/core/mapping"
"github.com/zeromicro/go-zero/core/timex"
"github.com/zeromicro/go-zero/core/trace"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
oteltrace "go.opentelemetry.io/otel/trace"

View File

@@ -14,11 +14,7 @@ var sqlAttributeKey = attribute.Key("sql.method")
func startSpan(ctx context.Context, method string) (context.Context, oteltrace.Span) {
tracer := trace.TracerFromContext(ctx)
start, span := tracer.Start(ctx,
spanName,
oteltrace.WithSpanKind(oteltrace.SpanKindClient),
)
start, span := tracer.Start(ctx, spanName, oteltrace.WithSpanKind(oteltrace.SpanKindClient))
span.SetAttributes(sqlAttributeKey.String(method))
return start, span