mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
feat(trace): new span and context to run in background
. #1000201519 Signed-off-by: slasher <shenjie1@oppo.com>
This commit is contained in:
parent
5cf9f2aa4c
commit
cab906aff9
@ -169,6 +169,8 @@ func (h *Handler) Get(ctx context.Context, w io.Writer, location proto.Location,
|
||||
}
|
||||
}
|
||||
|
||||
_, ctx = trace.StartSpanFromContextWithTraceID(ctx, "", span.TraceID())
|
||||
|
||||
// data stream flow:
|
||||
// client <--copy-- pipeline <--swap-- readBlob <--copy-- blobnode
|
||||
//
|
||||
|
||||
@ -109,6 +109,8 @@ func (h *Handler) Put(ctx context.Context,
|
||||
ready <- struct{}{}
|
||||
}
|
||||
|
||||
_, ctx = trace.StartSpanFromContextWithTraceID(ctx, "", span.TraceID())
|
||||
|
||||
encoder := h.encoder[selectedCodeMode]
|
||||
tactic := selectedCodeMode.Tactic()
|
||||
for _, blob := range location.Spread() {
|
||||
|
||||
@ -88,6 +88,7 @@ func (c *cacher) GetDisk(ctx context.Context, args *proxy.CacheDiskArgs) (*clust
|
||||
}
|
||||
c.diskCache.Set(id, disk)
|
||||
|
||||
span, _ = trace.StartSpanFromContextWithTraceID(context.Background(), "diskkv", span.TraceID())
|
||||
go func() {
|
||||
key := diskvKeyDisk(id)
|
||||
fullPath := c.DiskvFilename(key)
|
||||
|
||||
@ -95,6 +95,7 @@ func (c *cacher) GetVolume(ctx context.Context, args *proxy.CacheVolumeArgs) (*p
|
||||
}
|
||||
c.volumeCache.Set(vid, vol)
|
||||
|
||||
span, _ = trace.StartSpanFromContextWithTraceID(context.Background(), "diskkv", span.TraceID())
|
||||
go func() {
|
||||
key := diskvKeyVolume(vid)
|
||||
fullPath := c.DiskvFilename(key)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user