feat: support ptr of ptr of ... in mapping (#2779)
* feat: support ptr of ptr of ... in mapping * feat: support ptr of ptr of time.Duration in mapping * feat: support ptr of ptr of json.Number in mapping * chore: improve setting in mapping * feat: support ptr of ptr encoding.TextUnmarshaler in mapping * chore: add more tests * fix: string ptr * chore: update tests
This commit is contained in:
@@ -14,12 +14,13 @@ import (
|
||||
var mongoCmdAttributeKey = attribute.Key("mongo.cmd")
|
||||
|
||||
func startSpan(ctx context.Context, cmd string) (context.Context, oteltrace.Span) {
|
||||
tracer := otel.GetTracerProvider().Tracer(trace.TraceName)
|
||||
tracer := otel.Tracer(trace.TraceName)
|
||||
ctx, span := tracer.Start(ctx,
|
||||
spanName,
|
||||
oteltrace.WithSpanKind(oteltrace.SpanKindClient),
|
||||
)
|
||||
span.SetAttributes(mongoCmdAttributeKey.String(cmd))
|
||||
|
||||
return ctx, span
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const spanName = "redis"
|
||||
|
||||
var (
|
||||
startTimeKey = contextKey("startTime")
|
||||
durationHook = hook{tracer: otel.GetTracerProvider().Tracer(trace.TraceName)}
|
||||
durationHook = hook{tracer: otel.Tracer(trace.TraceName)}
|
||||
redisCmdsAttributeKey = attribute.Key("redis.cmds")
|
||||
)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
var sqlAttributeKey = attribute.Key("sql.method")
|
||||
|
||||
func startSpan(ctx context.Context, method string) (context.Context, oteltrace.Span) {
|
||||
tracer := otel.GetTracerProvider().Tracer(trace.TraceName)
|
||||
tracer := otel.Tracer(trace.TraceName)
|
||||
start, span := tracer.Start(ctx,
|
||||
spanName,
|
||||
oteltrace.WithSpanKind(oteltrace.SpanKindClient),
|
||||
|
||||
Reference in New Issue
Block a user