cmd/uplink: exclude unnecessary spans from distributed tracing

We have a special method to exclude methods (which are called to frequently) from distributed traces.

https://github.com/storj/common/blob/main/tracing/excluded.go

But this works only, if we define the exclusion function during the initialization.

Let's do it in this patch.

Change-Id: Icf12202bd7213b5c0009332ce2755b267f2bdbae
This commit is contained in:
Márton Elek 2023-05-31 10:19:43 +02:00
parent 08a63fa5d1
commit 61ad5751f6
No known key found for this signature in database

View File

@ -28,6 +28,7 @@ import (
"storj.io/common/experiment"
"storj.io/common/rpc/rpctracing"
"storj.io/common/tracing"
jaeger "storj.io/monkit-jaeger"
"storj.io/private/version"
)
@ -309,7 +310,12 @@ func (ex *external) Wrap(ctx context.Context, cmd clingy.Command) (err error) {
defer tracked(ctx, collector.Run)()
cancel := jaeger.RegisterJaeger(monkit.Default, collector, jaeger.Options{Fraction: ex.tracing.sample})
cancel := jaeger.RegisterJaeger(monkit.Default, collector,
jaeger.Options{
Fraction: ex.tracing.sample,
Excluded: tracing.IsExcluded,
},
)
defer cancel()
if ex.tracing.traceID == 0 {