Tracing for get object #135

Merged
fyrchik merged 5 commits from dstepanov-yadro/frostfs-node:feat/OBJECT-3310 into master 2023-04-12 06:52:02 +00:00
  1. Tracing added to grpc client/server calls.
  2. Tracing added to object GET operation.

Most of the changes are related to pass context.

1. Tracing added to grpc client/server calls. 2. Tracing added to object GET operation. Most of the changes are related to pass context.
dstepanov-yadro force-pushed feat/OBJECT-3310 from 211b2de0ca to 26f98aa72f 2023-03-14 08:47:05 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 26f98aa72f to 3f6cc47cb8 2023-03-14 08:52:50 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 3f6cc47cb8 to 60371382b7 2023-03-14 09:06:07 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 60371382b7 to 99b799e130 2023-03-14 09:08:23 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 99b799e130 to d9c54c8b65 2023-03-14 09:11:52 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from d9c54c8b65 to ac971e27b2 2023-03-14 09:12:19 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from ac971e27b2 to 7a548c0749 2023-03-14 12:17:57 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from cd03516fd7 to d237b11cc5 2023-03-15 06:25:38 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from d237b11cc5 to 082f966ea1 2023-03-15 07:07:27 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 082f966ea1 to 92550a1980 2023-03-15 08:17:56 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 92550a1980 to a139742b3f 2023-03-15 08:32:47 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from a139742b3f to b98c046e9c 2023-03-15 09:02:58 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from b98c046e9c to bc14065ab0 2023-03-15 14:31:34 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from bc14065ab0 to 1c0581c7b2 2023-03-16 06:59:07 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 1c0581c7b2 to 270f41dab9 2023-03-22 13:21:55 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 270f41dab9 to 5b25e69c9b 2023-04-10 15:17:38 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 5b25e69c9b to 08edbe2250 2023-04-10 15:38:11 +00:00 Compare
dstepanov-yadro force-pushed feat/OBJECT-3310 from 08edbe2250 to 9b096a469e 2023-04-11 09:31:03 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2023-04-11 10:07:19 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-04-11 10:07:19 +00:00
dstepanov-yadro changed title from WIP: Tracing for get object to Tracing for get object 2023-04-11 10:09:36 +00:00
aarifullin reviewed 2023-04-11 11:20:19 +00:00
@ -23,3 +24,3 @@
}
opts := make([]grpc.DialOption, 1, 2)
opts := make([]grpc.DialOption, 3, 4)
Member

params 3, 4 seems a little bit inconvinient :). 3 is enough (keeping a room for grpc.DialOption doesn't make big profit)

How about to initialize it like that?

opts = []grpc.DialOption {  
     grpc.WithBlock(), 
     grpc.WithChainUnaryInterceptor(
		tracing.NewGRPCUnaryClientInteceptor(),
	 ),
     grpc.WithChainStreamInterceptor(
		tracing.NewGRPCStreamClientInterceptor(),
	),
}
params `3, 4` seems a little bit inconvinient :). `3` is enough (keeping a room for `grpc.DialOption` doesn't make big profit) How about to initialize it like that? ``` opts = []grpc.DialOption { grpc.WithBlock(), grpc.WithChainUnaryInterceptor( tracing.NewGRPCUnaryClientInteceptor(), ), grpc.WithChainStreamInterceptor( tracing.NewGRPCStreamClientInterceptor(), ), } ```
Author
Member

Agree, fixed. I hope it wasn't the most important optimization.

Agree, fixed. I hope it wasn't the most important optimization.
fyrchik approved these changes 2023-04-11 11:24:31 +00:00
@ -0,0 +22,4 @@
fn: func() {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()
err := tracing.Shutdown(ctx) //cfg context cancels before close
Owner

What is the comment about? Possible problems?

What is the comment about? Possible problems?
Author
Member

It's about using context.Background() for shutting down. If e use the main context of the application, then it will already be canceled at this point.

It's about using `context.Background()` for shutting down. If e use the main context of the application, then it will already be canceled at this point.
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed feat/OBJECT-3310 from 9b096a469e to 0f60ed02df 2023-04-11 11:59:27 +00:00 Compare
aarifullin approved these changes 2023-04-11 11:59:39 +00:00
dstepanov-yadro force-pushed feat/OBJECT-3310 from 0f60ed02df to 66970da98c 2023-04-11 12:13:52 +00:00 Compare
Author
Member

@aarifullin @fyrchik contextcheck linter violation for evacuate was fixed after review

@aarifullin @fyrchik `contextcheck` linter violation for evacuate was fixed after review
aarifullin approved these changes 2023-04-11 12:48:23 +00:00
dstepanov-yadro force-pushed feat/OBJECT-3310 from 66970da98c to ce7806f734 2023-04-11 14:03:45 +00:00 Compare
acid-ant approved these changes 2023-04-11 14:38:32 +00:00
dstepanov-yadro force-pushed feat/OBJECT-3310 from 02ce8e2728 to bec75d45dc 2023-04-11 15:28:56 +00:00 Compare
Author
Member

@fyrchik @aarifullin @acid-ant added two commits for acl and signature spans

@fyrchik @aarifullin @acid-ant added two commits for acl and signature spans
fyrchik approved these changes 2023-04-11 17:59:32 +00:00
@ -340,0 +352,4 @@
ctx, span := tracing.StartSpanFromContext(ctx, "FSTree.Get",
trace.WithAttributes(
attribute.Bool("raw", prm.Raw),
attribute.String("address", prm.Address.EncodeToString()),
Owner

Can we create a custom attributes for this? Like zap.Stringer.
When tracing is disabled it seems not worth doing this allocations.

Also, storage_id is not needed for FSTree.

Can we create a custom attributes for this? Like `zap.Stringer`. When tracing is disabled it seems not worth doing this allocations. Also, `storage_id` is not needed for FSTree.
Owner

Can we create a custom attributes for this? Like zap.Stringer.
When tracing is disabled it seems not worth doing this allocations.

Also, storage_id is not needed for FSTree.

Can we create a custom attributes for this? Like `zap.Stringer`. When tracing is disabled it seems not worth doing this allocations. Also, `storage_id` is not needed for FSTree.
Author
Member

Can we create a custom attributes for this? Like zap.Stringer.
When tracing is disabled it seems not worth doing this allocations.

WithAttributes receives KeyValue struct. attributes.Stringer already exists, but has such implementation:

// Stringer creates a new key-value pair with a passed name and a string
// value generated by the passed Stringer interface.
func Stringer(k string, v fmt.Stringer) KeyValue {
	return Key(k).String(v.String())
}
> Can we create a custom attributes for this? Like zap.Stringer. When tracing is disabled it seems not worth doing this allocations. `WithAttributes` receives `KeyValue` struct. `attributes.Stringer` already exists, but has such implementation: ``` // Stringer creates a new key-value pair with a passed name and a string // value generated by the passed Stringer interface. func Stringer(k string, v fmt.Stringer) KeyValue { return Key(k).String(v.String()) } ```
Author
Member

Also, storage_id is not needed for FSTree.

fixed

> Also, storage_id is not needed for FSTree. fixed
fyrchik marked this conversation as resolved
acid-ant approved these changes 2023-04-12 06:05:40 +00:00
dstepanov-yadro force-pushed feat/OBJECT-3310 from bec75d45dc to 166ebbb51e 2023-04-12 06:37:02 +00:00 Compare
fyrchik merged commit 5778980252 into master 2023-04-12 06:52:02 +00:00
fyrchik referenced this pull request from a commit 2023-04-12 06:52:02 +00:00
fyrchik referenced this pull request from a commit 2023-04-12 06:52:02 +00:00
fyrchik referenced this pull request from a commit 2023-04-12 06:52:02 +00:00
fyrchik referenced this pull request from a commit 2023-04-12 06:52:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#135
No description provided.