Slide 6
Slide 6 text
© 2024 Wantedly, Inc.
ͭͳ͛ํ
1. OpenCensus ͱ ddtrace ͷτϨʔεΛܨ͛Δ
Go (dd-trace-go) ͷྫ
// ϑΥʔϚοτΛ͑Δ
carrier := tracer.TextMapCarrier{
tracer.DefaultTraceIDHeader:
strconv.FormatUint(binary.BigEndian.Uint64(traceID[8:]), 10),
tracer.DefaultParentIDHeader:
strconv.FormatUint(binary.BigEndian.Uint64(spanID[:]), 10),
}
// ίϯςΩετͷੜ
sctx, _ := tracer.Extract(carrier)
// εύϯͷੜ
span, ctx := tracer.StartSpanFromContext(ctx, "op1", tracer.ChildOf(sctx))
// ctx ΛͬͯଞͷεύϯΛੜ
span, ctx := tracer.StartSpanFromContext(ctx, "op2", tracer.ChildOf(sctx))