Skip to content

Commit

Permalink
fix(responsemanager): remove uninformative span flags
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed Dec 11, 2021
1 parent 1c3d63a commit eff0a0a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
8 changes: 0 additions & 8 deletions impl/graphsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,6 @@ func TestGraphsyncRoundTrip(t *testing.T) {
"request(0)->terminateRequest(0)",
}, tracing.TracesToStrings())
processUpdateSpan := tracing.FindSpanByTraceString("response(0)")
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isUpdate").AsBool())
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isCancel").AsBool())
require.Equal(t, int64(0), testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "priority").AsInt64())
require.Equal(t, []string{string(td.extensionName)}, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "extensions").AsStringSlice())
}
Expand Down Expand Up @@ -818,9 +816,6 @@ func TestPauseResumeViaUpdate(t *testing.T) {
}, tracing.TracesToStrings())
// make sure the attributes are what we expect
processUpdateSpan := tracing.FindSpanByTraceString("response(0)->processUpdate(0)")
require.True(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isUpdate").AsBool())
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isCancel").AsBool())
require.Equal(t, int64(0), testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "priority").AsInt64())
require.Equal(t, []string{string(td.extensionName)}, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "extensions").AsStringSlice())
// pause recorded
tracing.SingleExceptionEvent(t, "response(0)->executeTask(0)", "github.com/ipfs/go-graphsync/responsemanager/hooks.ErrPaused", hooks.ErrPaused{}.Error(), false)
Expand Down Expand Up @@ -904,9 +899,6 @@ func TestPauseResumeViaUpdateOnBlockHook(t *testing.T) {
}, tracing.TracesToStrings())
// make sure the attributes are what we expect
processUpdateSpan := tracing.FindSpanByTraceString("response(0)->processUpdate(0)")
require.True(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isUpdate").AsBool())
require.False(t, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "isCancel").AsBool())
require.Equal(t, int64(0), testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "priority").AsInt64())
require.Equal(t, []string{string(td.extensionName)}, testutil.AttributeValueInTraceSpan(t, *processUpdateSpan, "extensions").AsStringSlice())
// pause recorded
tracing.SingleExceptionEvent(t, "response(0)->executeTask(0)", "github.com/ipfs/go-graphsync/responsemanager/hooks.ErrPaused", hooks.ErrPaused{}.Error(), false)
Expand Down
6 changes: 0 additions & 6 deletions responsemanager/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func (rm *ResponseManager) processUpdate(key responseKey, update gsmsg.GraphSync

_, span := otel.Tracer("graphsync").Start(trace.ContextWithSpan(rm.ctx, response.span), "processUpdate", trace.WithAttributes(
attribute.Int("id", int(update.ID())),
attribute.Int("priority", int(update.Priority())),
attribute.String("root", update.Root().String()),
attribute.Bool("isCancel", update.IsCancel()),
attribute.Bool("isUpdate", update.IsUpdate()),
attribute.StringSlice("extensions", update.ExtensionNames()),
))
defer span.End()
Expand Down Expand Up @@ -186,8 +182,6 @@ func (rm *ResponseManager) processRequests(p peer.ID, requests []gsmsg.GraphSync
attribute.Int("id", int(request.ID())),
attribute.Int("priority", int(request.Priority())),
attribute.String("root", request.Root().String()),
attribute.Bool("isCancel", request.IsCancel()),
attribute.Bool("isUpdate", request.IsUpdate()),
attribute.StringSlice("extensions", request.ExtensionNames()),
))
rm.connManager.Protect(p, request.ID().Tag())
Expand Down

0 comments on commit eff0a0a

Please sign in to comment.