[#1589] client: Add missing tracing spans

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-12-28 11:38:46 +03:00
parent defb9dc797
commit 6d3a0a75a6
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0

View file

@ -144,6 +144,9 @@ func (x GetObjectRes) Object() *objectSDK.Object {
//
// GetObject ignores the provided session if it is not related to the requested objectSDK.
func GetObject(ctx context.Context, prm GetObjectPrm) (*GetObjectRes, error) {
ctx, span := tracing.StartSpanFromContext(ctx, "client.HeadObject")
defer span.End()
select {
case <-ctx.Done():
return nil, ctx.Err()
@ -244,6 +247,9 @@ func (x HeadObjectRes) Header() *objectSDK.Object {
//
// HeadObject ignores the provided session if it is not related to the requested objectSDK.
func HeadObject(ctx context.Context, prm HeadObjectPrm) (*HeadObjectRes, error) {
ctx, span := tracing.StartSpanFromContext(ctx, "client.HeadObject")
defer span.End()
select {
case <-ctx.Done():
return nil, ctx.Err()
@ -345,6 +351,9 @@ const maxInitialBufferSize = 1024 * 1024 // 1 MiB
//
// PayloadRange ignores the provided session if it is not related to the requested objectSDK.
func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, error) {
ctx, span := tracing.StartSpanFromContext(ctx, "client.PayloadRange")
defer span.End()
select {
case <-ctx.Done():
return nil, ctx.Err()
@ -535,6 +544,9 @@ func (x SearchObjectsRes) IDList() []oid.ID {
//
// Returns any error which prevented the operation from completing correctly in error return.
func SearchObjects(ctx context.Context, prm SearchObjectsPrm) (*SearchObjectsRes, error) {
ctx, span := tracing.StartSpanFromContext(ctx, "client.SearchObjects")
defer span.End()
select {
case <-ctx.Done():
return nil, ctx.Err()