Skip to content

Commit eff0a0a

Browse files
committed
fix(responsemanager): remove uninformative span flags
1 parent 1c3d63a commit eff0a0a

File tree

2 files changed

+0
-14
lines changed

2 files changed

+0
-14
lines changed

impl/graphsync_test.go

-8
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,6 @@ func TestGraphsyncRoundTrip(t *testing.T) {
378378
"request(0)->terminateRequest(0)",
379379
}, tracing.TracesToStrings())
380380
processUpdateSpan := tracing.FindSpanByTraceString("response(0)")
381-
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isUpdate").AsBool())
382-
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isCancel").AsBool())
383381
require.Equal(t, int64(0), testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "priority").AsInt64())
384382
require.Equal(t, []string{string(td.extensionName)}, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "extensions").AsStringSlice())
385383
}
@@ -818,9 +816,6 @@ func TestPauseResumeViaUpdate(t *testing.T) {
818816
}, tracing.TracesToStrings())
819817
// make sure the attributes are what we expect
820818
processUpdateSpan := tracing.FindSpanByTraceString("response(0)->processUpdate(0)")
821-
require.True(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isUpdate").AsBool())
822-
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isCancel").AsBool())
823-
require.Equal(t, int64(0), testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "priority").AsInt64())
824819
require.Equal(t, []string{string(td.extensionName)}, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "extensions").AsStringSlice())
825820
// pause recorded
826821
tracing.SingleExceptionEvent(t, "response(0)->executeTask(0)", "github.com/ipfs/go-graphsync/responsemanager/hooks.ErrPaused", hooks.ErrPaused{}.Error(), false)
@@ -904,9 +899,6 @@ func TestPauseResumeViaUpdateOnBlockHook(t *testing.T) {
904899
}, tracing.TracesToStrings())
905900
// make sure the attributes are what we expect
906901
processUpdateSpan := tracing.FindSpanByTraceString("response(0)->processUpdate(0)")
907-
require.True(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isUpdate").AsBool())
908-
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isCancel").AsBool())
909-
require.Equal(t, int64(0), testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "priority").AsInt64())
910902
require.Equal(t, []string{string(td.extensionName)}, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "extensions").AsStringSlice())
911903
// pause recorded
912904
tracing.SingleExceptionEvent(t, "response(0)->executeTask(0)", "github.com/ipfs/go-graphsync/responsemanager/hooks.ErrPaused", hooks.ErrPaused{}.Error(), false)

responsemanager/server.go

-6
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ func (rm *ResponseManager) processUpdate(key responseKey, update gsmsg.GraphSync
6666

6767
_, span := otel.Tracer("graphsync").Start(trace.ContextWithSpan(rm.ctx, response.span), "processUpdate", trace.WithAttributes(
6868
attribute.Int("id", int(update.ID())),
69-
attribute.Int("priority", int(update.Priority())),
70-
attribute.String("root", update.Root().String()),
71-
attribute.Bool("isCancel", update.IsCancel()),
72-
attribute.Bool("isUpdate", update.IsUpdate()),
7369
attribute.StringSlice("extensions", update.ExtensionNames()),
7470
))
7571
defer span.End()
@@ -186,8 +182,6 @@ func (rm *ResponseManager) processRequests(p peer.ID, requests []gsmsg.GraphSync
186182
attribute.Int("id", int(request.ID())),
187183
attribute.Int("priority", int(request.Priority())),
188184
attribute.String("root", request.Root().String()),
189-
attribute.Bool("isCancel", request.IsCancel()),
190-
attribute.Bool("isUpdate", request.IsUpdate()),
191185
attribute.StringSlice("extensions", request.ExtensionNames()),
192186
))
193187
rm.connManager.Protect(p, request.ID().Tag())

0 commit comments

Comments
 (0)