Skip to content

Commit b56886f

Browse files
authored
Merge pull request #6 from runloopai/dines/fix-parent-id
Fix parent id for traces
2 parents c8c1ae8 + d728446 commit b56886f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

cmd/overlaybd-snapshotter/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func requestIDInterceptor(ctx context.Context, req interface{}, info *grpc.Unary
5151
requestID := tracing.GetRequestID(ctx)
5252
if requestID == "" {
5353
requestID = mylog.GenerateRequestID()
54+
ctx = tracing.SetRequestID(ctx, requestID)
5455
}
5556

5657
ctx = mylog.WithRequestID(ctx, requestID)
@@ -143,7 +144,7 @@ func main() {
143144
tracing.WithServerTracing(),
144145
grpc.UnaryInterceptor(requestIDInterceptor),
145146
)
146-
snapshotsapi.RegisterSnapshotsServer(srv, snapshotservice.FromSnapshotter(sn))
147+
snapshotsapi.RegisterSnapshotsServer(srv, tracing.WithTracing(snapshotservice.FromSnapshotter(sn)))
147148

148149
address := strings.TrimSpace(pconfig.Address)
149150

pkg/convertor/convertor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ func (c *overlaybdConvertor) applyOCIV1LayerInObd(
678678
afterApply func(root string) error, // do something after apply tar stream
679679
) (string, error) {
680680
startTime := time.Now()
681+
681682
ctx, span := tracer.Start(ctx, "applyOCIV1LayerInObd",
682683
trace.WithAttributes(
683684
attribute.String("parent_id", parentID),

0 commit comments

Comments
 (0)