Tracing: properly overwrite context so that spans can be correctly attributed (#11012)

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Preston Van Loon
2022-07-14 12:00:33 -05:00
committed by GitHub
parent 96aba590b5
commit 5722a5793c
51 changed files with 133 additions and 133 deletions

View File

@@ -13,7 +13,7 @@ import (
)
func decode(ctx context.Context, data []byte, dst proto.Message) error {
_, span := trace.StartSpan(ctx, "BeaconDB.decode")
ctx, span := trace.StartSpan(ctx, "BeaconDB.decode")
defer span.End()
data, err := snappy.Decode(nil, data)
@@ -27,7 +27,7 @@ func decode(ctx context.Context, data []byte, dst proto.Message) error {
}
func encode(ctx context.Context, msg proto.Message) ([]byte, error) {
_, span := trace.StartSpan(ctx, "BeaconDB.encode")
ctx, span := trace.StartSpan(ctx, "BeaconDB.encode")
defer span.End()
if msg == nil || reflect.ValueOf(msg).IsNil() {