{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/59957882","id":59957882,"diff_hunk":"@@ -425,7 +425,15 @@ func (ds *DistSender) getDescriptors(\n func (ds *DistSender) sendSingleRange(\n \tctx context.Context, ba roachpb.BatchRequest, desc *roachpb.RangeDescriptor,\n ) (*roachpb.BatchResponse, *roachpb.Error) {\n-\tlog.Trace(ctx, fmt.Sprintf(\"sending RPC to [%s, %s)\", desc.StartKey, desc.EndKey))\n+\t// Hack: avoid formatting the message passed to Span.LogEvent for\n+\t// opentracing.noopSpans. We can't actually tell if we have a noopSpan, but\n+\t// we can see if the span as a NoopTracer. Note that this particular\n+\t// invocation is expensive because we're pretty-printing keys. This hack can\n+\t// go away when something like Span.LogEventf is added.\n+\tsp := opentracing.SpanFromContext(ctx)\n+\tif sp != nil && sp.Tracer() != (opentracing.NoopTracer{}) {\n+\t\tsp.LogEvent(fmt.Sprintf(\"sending RPC to [%s, %s)\", desc.StartKey, desc.EndKey))","path":"kv/dist_sender.go","position":null,"original_position":12,"commit_id":"2eeaddac2545ac8f32d4908c3c78a0f0e4791c78","original_commit_id":"496822fa26fe46630aff24f0d8dbef1e8dd6a3a7","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"body":"I'm pretty sure we've already asked for that upstream. I'm we can push them again. Or we could wrap the `opentracing` api with our own. For the time being I've added a `TODO`.","created_at":"2016-04-16T00:29:28Z","updated_at":"2016-04-16T00:29:28Z","html_url":"https://github.com/cockroachdb/cockroach/pull/6088#discussion_r59957882","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/59957882"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/6088#discussion_r59957882"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088","id":66711983,"html_url":"https://github.com/cockroachdb/cockroach/pull/6088","diff_url":"https://github.com/cockroachdb/cockroach/pull/6088.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/6088.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6088","number":6088,"state":"open","locked":false,"title":"kv: avoid pretty-printing keys during noop tracing","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"body":"Key pretty-printing involves a number of allocations and isn't\nparticularly fast.\n\n```\nname              old time/op    new time/op    delta\nKVScan1_Native-8    52.1µs ± 2%    45.3µs ± 2%  -12.91%  (p=0.000 n=10+10)\nKVScan1_SQL-8        184µs ± 1%     172µs ± 2%   -6.63%   (p=0.000 n=10+9)\n\nname              old alloc/op   new alloc/op   delta\nKVScan1_Native-8    7.39kB ± 0%    6.95kB ± 0%   -5.88%    (p=0.001 n=8+9)\nKVScan1_SQL-8       12.4kB ± 0%    12.0kB ± 0%   -3.49%   (p=0.000 n=9+10)\n\nname              old allocs/op  new allocs/op  delta\nKVScan1_Native-8       117 ± 0%       103 ± 0%  -11.97%  (p=0.000 n=10+10)\nKVScan1_SQL-8          229 ± 0%       215 ± 0%   -6.11%  (p=0.000 n=10+10)\n```\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/6088)\n<!-- Reviewable:end -->\n","created_at":"2016-04-15T22:10:20Z","updated_at":"2016-04-16T00:29:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ac425ad1360cb4f9872b4bbd1b2103304448e00d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6088/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/2eeaddac2545ac8f32d4908c3c78a0f0e4791c78","head":{"label":"petermattis:pmattis/dist-sender-span-log-event","ref":"pmattis/dist-sender-span-log-event","sha":"2eeaddac2545ac8f32d4908c3c78a0f0e4791c78","user":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"repo":{"id":49213713,"name":"cockroach","full_name":"petermattis/cockroach","owner":{"login":"petermattis","id":6201335,"avatar_url":"https://avatars.githubusercontent.com/u/6201335?v=3","gravatar_id":"","url":"https://api.github.com/users/petermattis","html_url":"https://github.com/petermattis","followers_url":"https://api.github.com/users/petermattis/followers","following_url":"https://api.github.com/users/petermattis/following{/other_user}","gists_url":"https://api.github.com/users/petermattis/gists{/gist_id}","starred_url":"https://api.github.com/users/petermattis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petermattis/subscriptions","organizations_url":"https://api.github.com/users/petermattis/orgs","repos_url":"https://api.github.com/users/petermattis/repos","events_url":"https://api.github.com/users/petermattis/events{/privacy}","received_events_url":"https://api.github.com/users/petermattis/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/petermattis/cockroach","description":"A Scalable, Survivable, Strongly-Consistent SQL Database","fork":true,"url":"https://api.github.com/repos/petermattis/cockroach","forks_url":"https://api.github.com/repos/petermattis/cockroach/forks","keys_url":"https://api.github.com/repos/petermattis/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/petermattis/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/petermattis/cockroach/teams","hooks_url":"https://api.github.com/repos/petermattis/cockroach/hooks","issue_events_url":"https://api.github.com/repos/petermattis/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/petermattis/cockroach/events","assignees_url":"https://api.github.com/repos/petermattis/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/petermattis/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/petermattis/cockroach/tags","blobs_url":"https://api.github.com/repos/petermattis/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/petermattis/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/petermattis/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/petermattis/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/petermattis/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/petermattis/cockroach/languages","stargazers_url":"https://api.github.com/repos/petermattis/cockroach/stargazers","contributors_url":"https://api.github.com/repos/petermattis/cockroach/contributors","subscribers_url":"https://api.github.com/repos/petermattis/cockroach/subscribers","subscription_url":"https://api.github.com/repos/petermattis/cockroach/subscription","commits_url":"https://api.github.com/repos/petermattis/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/petermattis/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/petermattis/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/petermattis/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/petermattis/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/petermattis/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/petermattis/cockroach/merges","archive_url":"https://api.github.com/repos/petermattis/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/petermattis/cockroach/downloads","issues_url":"https://api.github.com/repos/petermattis/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/petermattis/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/petermattis/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/petermattis/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/petermattis/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/petermattis/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/petermattis/cockroach/deployments","created_at":"2016-01-07T15:46:02Z","updated_at":"2016-01-15T20:14:05Z","pushed_at":"2016-04-16T00:20:50Z","git_url":"git://github.com/petermattis/cockroach.git","ssh_url":"git@github.com:petermattis/cockroach.git","clone_url":"https://github.com/petermattis/cockroach.git","svn_url":"https://github.com/petermattis/cockroach","homepage":"http://www.cockroachlabs.com","size":145813,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"2dd2f600f16a83ec44c5ba78b991e6bd3020d505","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Survivable, Strongly-Consistent SQL Database","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/cockroachdb/cockroach/deployments","created_at":"2014-02-06T00:18:47Z","updated_at":"2016-04-15T21:06:56Z","pushed_at":"2016-04-16T00:20:54Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":"https://www.cockroachlabs.com","size":191819,"stargazers_count":6688,"watchers_count":6688,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":637,"mirror_url":null,"open_issues_count":399,"forks":637,"open_issues":399,"watchers":6688,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/6088"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/6088"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/6088/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6088/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/2eeaddac2545ac8f32d4908c3c78a0f0e4791c78"}}}}