{"action":"created","comment":{"url":"https://api.github.com/repos/uber/tchannel-go/pulls/comments/73194542","id":73194542,"diff_hunk":"@@ -0,0 +1,103 @@\n+// Copyright (c) 2015 Uber Technologies, Inc.\n+\n+// Permission is hereby granted, free of charge, to any person obtaining a copy\n+// of this software and associated documentation files (the \"Software\"), to deal\n+// in the Software without restriction, including without limitation the rights\n+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+// copies of the Software, and to permit persons to whom the Software is\n+// furnished to do so, subject to the following conditions:\n+//\n+// The above copyright notice and this permission notice shall be included in\n+// all copies or substantial portions of the Software.\n+//\n+// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+// THE SOFTWARE.\n+\n+package tchannel\n+\n+import (\n+\t\"strings\"\n+\t\"sync\"\n+)\n+\n+// tracingKeyPrefix is used to prefix all keys used by the OpenTracing Tracer to represent\n+// its trace context and baggage. The prefixing is done in order to distinguish tracing\n+// headers from the actual application headers and to hide the former from the user code.\n+const tracingKeyPrefix = \"$tracing$\"","path":"tracing_keys.go","position":31,"original_position":31,"commit_id":"fcca9003044f5de17eb4395c62e6462d21eaa0ee","original_commit_id":"fcca9003044f5de17eb4395c62e6462d21eaa0ee","user":{"login":"yurishkuro","id":3523016,"avatar_url":"https://avatars.githubusercontent.com/u/3523016?v=3","gravatar_id":"","url":"https://api.github.com/users/yurishkuro","html_url":"https://github.com/yurishkuro","followers_url":"https://api.github.com/users/yurishkuro/followers","following_url":"https://api.github.com/users/yurishkuro/following{/other_user}","gists_url":"https://api.github.com/users/yurishkuro/gists{/gist_id}","starred_url":"https://api.github.com/users/yurishkuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurishkuro/subscriptions","organizations_url":"https://api.github.com/users/yurishkuro/orgs","repos_url":"https://api.github.com/users/yurishkuro/repos","events_url":"https://api.github.com/users/yurishkuro/events{/privacy}","received_events_url":"https://api.github.com/users/yurishkuro/received_events","type":"User","site_admin":false},"body":"@prashantv ok to use this prefix?","created_at":"2016-08-02T16:58:34Z","updated_at":"2016-08-02T16:58:34Z","html_url":"https://github.com/uber/tchannel-go/pull/426#discussion_r73194542","pull_request_url":"https://api.github.com/repos/uber/tchannel-go/pulls/426","_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-go/pulls/comments/73194542"},"html":{"href":"https://github.com/uber/tchannel-go/pull/426#discussion_r73194542"},"pull_request":{"href":"https://api.github.com/repos/uber/tchannel-go/pulls/426"}}},"pull_request":{"url":"https://api.github.com/repos/uber/tchannel-go/pulls/426","id":75180634,"html_url":"https://github.com/uber/tchannel-go/pull/426","diff_url":"https://github.com/uber/tchannel-go/pull/426.diff","patch_url":"https://github.com/uber/tchannel-go/pull/426.patch","issue_url":"https://api.github.com/repos/uber/tchannel-go/issues/426","number":426,"state":"open","locked":false,"title":"Integrate OpenTracing","user":{"login":"yurishkuro","id":3523016,"avatar_url":"https://avatars.githubusercontent.com/u/3523016?v=3","gravatar_id":"","url":"https://api.github.com/users/yurishkuro","html_url":"https://github.com/yurishkuro","followers_url":"https://api.github.com/users/yurishkuro/followers","following_url":"https://api.github.com/users/yurishkuro/following{/other_user}","gists_url":"https://api.github.com/users/yurishkuro/gists{/gist_id}","starred_url":"https://api.github.com/users/yurishkuro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurishkuro/subscriptions","organizations_url":"https://api.github.com/users/yurishkuro/orgs","repos_url":"https://api.github.com/users/yurishkuro/repos","events_url":"https://api.github.com/users/yurishkuro/events{/privacy}","received_events_url":"https://api.github.com/users/yurishkuro/received_events","type":"User","site_admin":false},"body":"Ready for review\r\n\r\nChanges:\r\n* internal span reporting completely removed and replaced with OpenTracing\r\n* span context and baggage are propagated via application headers (json only atm, thrift next)\r\n* channel can be configured with `opentracing.Tracer`, otherwise it defaults to `opentracing.GlobalTracer()` (which is no-op by default)\r\n* outbound calls tracing\r\n  * span is started in `(c *Connection) beginCall`\r\n  * if tracer understands \"zipkin\" format, then the tracing fields are populated in `callReq`\r\n  * the actual span/baggage info is injected in `json/call.go`\r\n  * span is stored in `Response` and finished in a couple of places in `outbound.go`\r\n* inbound requests tracing\r\n  * if tracer understands \"zipkin\" format, the span is started in `inbound.go` and baggage is added in the encoding handler\r\n  * otherwise span is started in the encoding handler only\r\n  * finished generically in completion callbacks in `inbound.go`\r\n\r\nTODO:\r\n * [x] ~~avoid duplicating trace IDs in the headers and in the frame~~\r\n * [x] support thrift\r\n * [x] support raw\r\n * [x] support for disabling tracing by instructing Tracer to not sample spans\r\n * [x] generate random IDs for native `Span` if tracer is not zipkin-compatible\r\n","created_at":"2016-06-24T22:10:13Z","updated_at":"2016-08-02T16:58:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"40c006b3819a5eff94a84815e7efbc3ae6fbdf63","assignee":{"login":"prashantv","id":140159,"avatar_url":"https://avatars.githubusercontent.com/u/140159?v=3","gravatar_id":"","url":"https://api.github.com/users/prashantv","html_url":"https://github.com/prashantv","followers_url":"https://api.github.com/users/prashantv/followers","following_url":"https://api.github.com/users/prashantv/following{/other_user}","gists_url":"https://api.github.com/users/prashantv/gists{/gist_id}","starred_url":"https://api.github.com/users/prashantv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prashantv/subscriptions","organizations_url":"https://api.github.com/users/prashantv/orgs","repos_url":"https://api.github.com/users/prashantv/repos","events_url":"https://api.github.com/users/prashantv/events{/privacy}","received_events_url":"https://api.github.com/users/prashantv/received_events","type":"User","site_admin":false},"assignees":[{"login":"prashantv","id":140159,"avatar_url":"https://avatars.githubusercontent.com/u/140159?v=3","gravatar_id":"","url":"https://api.github.com/users/prashantv","html_url":"https://github.com/prashantv","followers_url":"https://api.github.com/users/prashantv/followers","following_url":"https://api.github.com/users/prashantv/following{/other_user}","gists_url":"https://api.github.com/users/prashantv/gists{/gist_id}","starred_url":"https://api.github.com/users/prashantv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prashantv/subscriptions","organizations_url":"https://api.github.com/users/prashantv/orgs","repos_url":"https://api.github.com/users/prashantv/repos","events_url":"https://api.github.com/users/prashantv/events{/privacy}","received_events_url":"https://api.github.com/users/prashantv/received_events","type":"User","site_admin":false},{"login":"breerly","id":263587,"avatar_url":"https://avatars.githubusercontent.com/u/263587?v=3","gravatar_id":"","url":"https://api.github.com/users/breerly","html_url":"https://github.com/breerly","followers_url":"https://api.github.com/users/breerly/followers","following_url":"https://api.github.com/users/breerly/following{/other_user}","gists_url":"https://api.github.com/users/breerly/gists{/gist_id}","starred_url":"https://api.github.com/users/breerly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/breerly/subscriptions","organizations_url":"https://api.github.com/users/breerly/orgs","repos_url":"https://api.github.com/users/breerly/repos","events_url":"https://api.github.com/users/breerly/events{/privacy}","received_events_url":"https://api.github.com/users/breerly/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/uber/tchannel-go/pulls/426/commits","review_comments_url":"https://api.github.com/repos/uber/tchannel-go/pulls/426/comments","review_comment_url":"https://api.github.com/repos/uber/tchannel-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/tchannel-go/issues/426/comments","statuses_url":"https://api.github.com/repos/uber/tchannel-go/statuses/fcca9003044f5de17eb4395c62e6462d21eaa0ee","head":{"label":"uber:integrate-opentracing","ref":"integrate-opentracing","sha":"fcca9003044f5de17eb4395c62e6462d21eaa0ee","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":42740141,"name":"tchannel-go","full_name":"uber/tchannel-go","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-go","description":"Go implementation of a multiplexing and framing protocol for RPC calls","fork":false,"url":"https://api.github.com/repos/uber/tchannel-go","forks_url":"https://api.github.com/repos/uber/tchannel-go/forks","keys_url":"https://api.github.com/repos/uber/tchannel-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-go/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-go/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-go/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-go/events","assignees_url":"https://api.github.com/repos/uber/tchannel-go/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-go/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-go/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-go/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-go/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-go/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-go/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-go/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-go/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-go/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-go/merges","archive_url":"https://api.github.com/repos/uber/tchannel-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-go/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-go/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-go/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-go/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-go/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-go/releases{/id}","deployments_url":"https://api.github.com/repos/uber/tchannel-go/deployments","created_at":"2015-09-18T18:28:15Z","updated_at":"2016-08-02T10:57:41Z","pushed_at":"2016-08-02T00:44:28Z","git_url":"git://github.com/uber/tchannel-go.git","ssh_url":"git@github.com:uber/tchannel-go.git","clone_url":"https://github.com/uber/tchannel-go.git","svn_url":"https://github.com/uber/tchannel-go","homepage":"http://uber.github.io/tchannel/","size":2694,"stargazers_count":145,"watchers_count":145,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":31,"forks":17,"open_issues":31,"watchers":145,"default_branch":"dev"}},"base":{"label":"uber:dev","ref":"dev","sha":"4006710b9a6e8aaa8e02d7d6d1e6a51253e9257f","user":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"repo":{"id":42740141,"name":"tchannel-go","full_name":"uber/tchannel-go","owner":{"login":"uber","id":538264,"avatar_url":"https://avatars.githubusercontent.com/u/538264?v=3","gravatar_id":"","url":"https://api.github.com/users/uber","html_url":"https://github.com/uber","followers_url":"https://api.github.com/users/uber/followers","following_url":"https://api.github.com/users/uber/following{/other_user}","gists_url":"https://api.github.com/users/uber/gists{/gist_id}","starred_url":"https://api.github.com/users/uber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uber/subscriptions","organizations_url":"https://api.github.com/users/uber/orgs","repos_url":"https://api.github.com/users/uber/repos","events_url":"https://api.github.com/users/uber/events{/privacy}","received_events_url":"https://api.github.com/users/uber/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uber/tchannel-go","description":"Go implementation of a multiplexing and framing protocol for RPC calls","fork":false,"url":"https://api.github.com/repos/uber/tchannel-go","forks_url":"https://api.github.com/repos/uber/tchannel-go/forks","keys_url":"https://api.github.com/repos/uber/tchannel-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/tchannel-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/tchannel-go/teams","hooks_url":"https://api.github.com/repos/uber/tchannel-go/hooks","issue_events_url":"https://api.github.com/repos/uber/tchannel-go/issues/events{/number}","events_url":"https://api.github.com/repos/uber/tchannel-go/events","assignees_url":"https://api.github.com/repos/uber/tchannel-go/assignees{/user}","branches_url":"https://api.github.com/repos/uber/tchannel-go/branches{/branch}","tags_url":"https://api.github.com/repos/uber/tchannel-go/tags","blobs_url":"https://api.github.com/repos/uber/tchannel-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/tchannel-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/tchannel-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/tchannel-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/tchannel-go/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/tchannel-go/languages","stargazers_url":"https://api.github.com/repos/uber/tchannel-go/stargazers","contributors_url":"https://api.github.com/repos/uber/tchannel-go/contributors","subscribers_url":"https://api.github.com/repos/uber/tchannel-go/subscribers","subscription_url":"https://api.github.com/repos/uber/tchannel-go/subscription","commits_url":"https://api.github.com/repos/uber/tchannel-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/tchannel-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/tchannel-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/tchannel-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/tchannel-go/contents/{+path}","compare_url":"https://api.github.com/repos/uber/tchannel-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/tchannel-go/merges","archive_url":"https://api.github.com/repos/uber/tchannel-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/tchannel-go/downloads","issues_url":"https://api.github.com/repos/uber/tchannel-go/issues{/number}","pulls_url":"https://api.github.com/repos/uber/tchannel-go/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/tchannel-go/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/tchannel-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/tchannel-go/labels{/name}","releases_url":"https://api.github.com/repos/uber/tchannel-go/releases{/id}","deployments_url":"https://api.github.com/repos/uber/tchannel-go/deployments","created_at":"2015-09-18T18:28:15Z","updated_at":"2016-08-02T10:57:41Z","pushed_at":"2016-08-02T00:44:28Z","git_url":"git://github.com/uber/tchannel-go.git","ssh_url":"git@github.com:uber/tchannel-go.git","clone_url":"https://github.com/uber/tchannel-go.git","svn_url":"https://github.com/uber/tchannel-go","homepage":"http://uber.github.io/tchannel/","size":2694,"stargazers_count":145,"watchers_count":145,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":31,"forks":17,"open_issues":31,"watchers":145,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/tchannel-go/pulls/426"},"html":{"href":"https://github.com/uber/tchannel-go/pull/426"},"issue":{"href":"https://api.github.com/repos/uber/tchannel-go/issues/426"},"comments":{"href":"https://api.github.com/repos/uber/tchannel-go/issues/426/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/tchannel-go/pulls/426/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/tchannel-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/tchannel-go/pulls/426/commits"},"statuses":{"href":"https://api.github.com/repos/uber/tchannel-go/statuses/fcca9003044f5de17eb4395c62e6462d21eaa0ee"}}}}
{"actor":{"display_login":"yurishkuro"}}