@@ -4,8 +4,10 @@ import (
44	"context" 
55	"errors" 
66
7+ 	"github.com/filecoin-project/boost/tracing" 
78	blocks "github.com/ipfs/go-block-format" 
89	logging "github.com/ipfs/go-log/v2" 
10+ 	"go.opentelemetry.io/otel/attribute" 
911
1012	"github.com/ipfs/go-cid" 
1113	blockstore "github.com/ipfs/go-ipfs-blockstore" 
@@ -33,6 +35,10 @@ func NewRemoteBlockstore(api RemoteBlockstoreAPI) blockstore.Blockstore {
3335}
3436
3537func  (ro  * RemoteBlockstore ) Get (ctx  context.Context , c  cid.Cid ) (b  blocks.Block , err  error ) {
38+ 	ctx , span  :=  tracing .Tracer .Start (ctx , "rbls.get" )
39+ 	defer  span .End ()
40+ 	span .SetAttributes (attribute .String ("cid" , c .String ()))
41+ 
3642	log .Debugw ("Get" , "cid" , c )
3743	data , err  :=  ro .api .BlockstoreGet (ctx , c )
3844	log .Debugw ("Get response" , "cid" , c , "error" , err )
@@ -43,13 +49,21 @@ func (ro *RemoteBlockstore) Get(ctx context.Context, c cid.Cid) (b blocks.Block,
4349}
4450
4551func  (ro  * RemoteBlockstore ) Has (ctx  context.Context , c  cid.Cid ) (bool , error ) {
52+ 	ctx , span  :=  tracing .Tracer .Start (ctx , "rbls.has" )
53+ 	defer  span .End ()
54+ 	span .SetAttributes (attribute .String ("cid" , c .String ()))
55+ 
4656	log .Debugw ("Has" , "cid" , c )
4757	has , err  :=  ro .api .BlockstoreHas (ctx , c )
4858	log .Debugw ("Has response" , "cid" , c , "has" , has , "error" , err )
4959	return  has , err 
5060}
5161
5262func  (ro  * RemoteBlockstore ) GetSize (ctx  context.Context , c  cid.Cid ) (int , error ) {
63+ 	ctx , span  :=  tracing .Tracer .Start (ctx , "rbls.get_size" )
64+ 	defer  span .End ()
65+ 	span .SetAttributes (attribute .String ("cid" , c .String ()))
66+ 
5367	log .Debugw ("GetSize" , "cid" , c )
5468	size , err  :=  ro .api .BlockstoreGetSize (ctx , c )
5569	log .Debugw ("GetSize response" , "cid" , c , "size" , size , "error" , err )
0 commit comments