{"action":"created","comment":{"url":"https://api.github.com/repos/opentracing/opentracing-go/pulls/comments/52114395","id":52114395,"diff_hunk":"@@ -0,0 +1,68 @@\n+package opentracing\n+\n+// WireEncoding identifies a WireInjector/WireExtractor pair.\n+type WireEncoding int\n+\n+const (\n+\t// WIRE_ENCODING_SPLIT_BINARY divides the encoded Span into two components:\n+\t//\n+\t//   1) The \"tracer state\" for the Span (for example, in Dapper this would\n+\t//      include a trace_id, a span_id, and a bitmask representing the\n+\t//      sampling status for the given trace)\n+\t//   2) Any Trace Attributes (per Span.SetTraceAttribute)\n+\t//\n+\t// The encoded data is separated in this way for a variety of reasons; the\n+\t// most important is to give OpenTracing users a portable way to opt out of\n+\t// Trace Attribute propagation entirely if they deem it a stability risk.\n+\t//\n+\t// The `carrier` for injection must be two pointers to `[]byte`s for the\n+\t// two components described above, each of which is represented as\n+\t// arbitrary binary data. The `carrier` for extraction must be two\n+\t// (non-pointer) `[]byte`s respectively.\n+\tWIRE_ENCODING_SPLIT_BINARY WireEncoding = iota\n+\n+\t// WIRE_ENCODING_SPLIT_TEXT divides the encoded Span into two components:\n+\t//\n+\t//   1) The \"tracer state\" for the Span (for example, in Dapper this would\n+\t//      include a trace_id, a span_id, and a bitmask representing the\n+\t//      sampling status for the given trace)\n+\t//   2) Any Trace Attributes (per Span.SetTraceAttribute)\n+\t//\n+\t// The encoded data is separated in this way for a variety of reasons; the\n+\t// most important is to give OpenTracing users a portable way to opt out of\n+\t// Trace Attribute propagation entirely if they deem it a stability risk.\n+\t//\n+\t// The `carrier` for injection must be two pointers to `map[string]string`s\n+\t// for the two components described above. The `carrier` for extraction\n+\t// must be two (non-pointer) `map[string]string`s respectively.\n+\tWIRE_ENCODING_SPLIT_TEXT\n+)\n+\n+// WireInjector is responsible for injecting Span instances in a manner suitable\n+// for propagation in an WireEncoding-specific \"carrier\" object or objects.\n+// Typically the injection will take place across an RPC boundary, but message\n+// queues and other IPC mechanisms are also reasonable places to use a\n+// WireInjector.\n+//\n+// The specific encoding for an injected Span depends on the WireEncoding.\n+// OpenTracing defines a common set of WireEncodings, and each has an expected\n+// carrier type and format. See the WireEncoding enum comments for details.\n+//\n+// See WireExtractor and Span.WireInjectorForEncoding.\n+type WireInjector interface {\n+\tInjectSpan(span Span, carrier ...interface{})","path":"wire.go","position":53,"original_position":53,"commit_id":"a6bb55b5cda43ef2c97b26ffbf736f55766d76af","original_commit_id":"a6bb55b5cda43ef2c97b26ffbf736f55766d76af","user":{"login":"michaelsembwever","id":559444,"avatar_url":"https://avatars.githubusercontent.com/u/559444?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelsembwever","html_url":"https://github.com/michaelsembwever","followers_url":"https://api.github.com/users/michaelsembwever/followers","following_url":"https://api.github.com/users/michaelsembwever/following{/other_user}","gists_url":"https://api.github.com/users/michaelsembwever/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelsembwever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelsembwever/subscriptions","organizations_url":"https://api.github.com/users/michaelsembwever/orgs","repos_url":"https://api.github.com/users/michaelsembwever/repos","events_url":"https://api.github.com/users/michaelsembwever/events{/privacy}","received_events_url":"https://api.github.com/users/michaelsembwever/received_events","type":"User","site_admin":false},"body":"\"Wire\" isn't helpful terminology here, all you need to care about is that this is injecting and extracting a span into another object.\r\n\r\nWhether that object is going to a wire or not, is irrelevant.\r\nTake for example an Extractor implementation that is extracting Spans line-by-line when parsing a log file.","created_at":"2016-02-07T08:24:41Z","updated_at":"2016-02-07T08:24:41Z","html_url":"https://github.com/opentracing/opentracing-go/pull/48#discussion_r52114395","pull_request_url":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48","_links":{"self":{"href":"https://api.github.com/repos/opentracing/opentracing-go/pulls/comments/52114395"},"html":{"href":"https://github.com/opentracing/opentracing-go/pull/48#discussion_r52114395"},"pull_request":{"href":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48"}}},"pull_request":{"url":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48","id":58531465,"html_url":"https://github.com/opentracing/opentracing-go/pull/48","diff_url":"https://github.com/opentracing/opentracing-go/pull/48.diff","patch_url":"https://github.com/opentracing/opentracing-go/pull/48.patch","issue_url":"https://api.github.com/repos/opentracing/opentracing-go/issues/48","number":48,"state":"open","locked":false,"title":"RFC for Injection/Extraction in Go","user":{"login":"bensigelman","id":2251553,"avatar_url":"https://avatars.githubusercontent.com/u/2251553?v=3","gravatar_id":"","url":"https://api.github.com/users/bensigelman","html_url":"https://github.com/bensigelman","followers_url":"https://api.github.com/users/bensigelman/followers","following_url":"https://api.github.com/users/bensigelman/following{/other_user}","gists_url":"https://api.github.com/users/bensigelman/gists{/gist_id}","starred_url":"https://api.github.com/users/bensigelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bensigelman/subscriptions","organizations_url":"https://api.github.com/users/bensigelman/orgs","repos_url":"https://api.github.com/users/bensigelman/repos","events_url":"https://api.github.com/users/bensigelman/events{/privacy}","received_events_url":"https://api.github.com/users/bensigelman/received_events","type":"User","site_admin":false},"body":"C.f. https://github.com/opentracing/opentracing.github.io/pull/45 and https://github.com/opentracing/opentracing.github.io/issues/44#issuecomment-179654948.\r\n\r\nThere are some good things and some less-good things here... I will add a few comments inline.\r\n\r\nI didn't adjust the standardtracer, noop.go, etc: just trying to illustrate the user-facing pieces of this.","created_at":"2016-02-06T21:57:25Z","updated_at":"2016-02-07T08:24:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1ddb2c14788e468ad8e03218bbe4c3e030b3bc3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48/commits","review_comments_url":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48/comments","review_comment_url":"https://api.github.com/repos/opentracing/opentracing-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentracing/opentracing-go/issues/48/comments","statuses_url":"https://api.github.com/repos/opentracing/opentracing-go/statuses/a6bb55b5cda43ef2c97b26ffbf736f55766d76af","head":{"label":"opentracing:wire_rfc","ref":"wire_rfc","sha":"a6bb55b5cda43ef2c97b26ffbf736f55766d76af","user":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars.githubusercontent.com/u/15482765?v=3","gravatar_id":"","url":"https://api.github.com/users/opentracing","html_url":"https://github.com/opentracing","followers_url":"https://api.github.com/users/opentracing/followers","following_url":"https://api.github.com/users/opentracing/following{/other_user}","gists_url":"https://api.github.com/users/opentracing/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing/subscriptions","organizations_url":"https://api.github.com/users/opentracing/orgs","repos_url":"https://api.github.com/users/opentracing/repos","events_url":"https://api.github.com/users/opentracing/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing/received_events","type":"Organization","site_admin":false},"repo":{"id":46904685,"name":"opentracing-go","full_name":"opentracing/opentracing-go","owner":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars.githubusercontent.com/u/15482765?v=3","gravatar_id":"","url":"https://api.github.com/users/opentracing","html_url":"https://github.com/opentracing","followers_url":"https://api.github.com/users/opentracing/followers","following_url":"https://api.github.com/users/opentracing/following{/other_user}","gists_url":"https://api.github.com/users/opentracing/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing/subscriptions","organizations_url":"https://api.github.com/users/opentracing/orgs","repos_url":"https://api.github.com/users/opentracing/repos","events_url":"https://api.github.com/users/opentracing/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentracing/opentracing-go","description":"Go implementation of Open Tracing API","fork":false,"url":"https://api.github.com/repos/opentracing/opentracing-go","forks_url":"https://api.github.com/repos/opentracing/opentracing-go/forks","keys_url":"https://api.github.com/repos/opentracing/opentracing-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing/opentracing-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing/opentracing-go/teams","hooks_url":"https://api.github.com/repos/opentracing/opentracing-go/hooks","issue_events_url":"https://api.github.com/repos/opentracing/opentracing-go/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing/opentracing-go/events","assignees_url":"https://api.github.com/repos/opentracing/opentracing-go/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing/opentracing-go/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing/opentracing-go/tags","blobs_url":"https://api.github.com/repos/opentracing/opentracing-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing/opentracing-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing/opentracing-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing/opentracing-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing/opentracing-go/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing/opentracing-go/languages","stargazers_url":"https://api.github.com/repos/opentracing/opentracing-go/stargazers","contributors_url":"https://api.github.com/repos/opentracing/opentracing-go/contributors","subscribers_url":"https://api.github.com/repos/opentracing/opentracing-go/subscribers","subscription_url":"https://api.github.com/repos/opentracing/opentracing-go/subscription","commits_url":"https://api.github.com/repos/opentracing/opentracing-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing/opentracing-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing/opentracing-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing/opentracing-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing/opentracing-go/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing/opentracing-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing/opentracing-go/merges","archive_url":"https://api.github.com/repos/opentracing/opentracing-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing/opentracing-go/downloads","issues_url":"https://api.github.com/repos/opentracing/opentracing-go/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing/opentracing-go/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing/opentracing-go/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing/opentracing-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing/opentracing-go/labels{/name}","releases_url":"https://api.github.com/repos/opentracing/opentracing-go/releases{/id}","deployments_url":"https://api.github.com/repos/opentracing/opentracing-go/deployments","created_at":"2015-11-26T04:52:54Z","updated_at":"2016-02-06T19:47:55Z","pushed_at":"2016-02-06T21:57:25Z","git_url":"git://github.com/opentracing/opentracing-go.git","ssh_url":"git@github.com:opentracing/opentracing-go.git","clone_url":"https://github.com/opentracing/opentracing-go.git","svn_url":"https://github.com/opentracing/opentracing-go","homepage":"","size":135,"stargazers_count":53,"watchers_count":53,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":53,"default_branch":"master"}},"base":{"label":"opentracing:master","ref":"master","sha":"bc83a422bc08c8d1b72f0f548faab0145e35bb54","user":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars.githubusercontent.com/u/15482765?v=3","gravatar_id":"","url":"https://api.github.com/users/opentracing","html_url":"https://github.com/opentracing","followers_url":"https://api.github.com/users/opentracing/followers","following_url":"https://api.github.com/users/opentracing/following{/other_user}","gists_url":"https://api.github.com/users/opentracing/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing/subscriptions","organizations_url":"https://api.github.com/users/opentracing/orgs","repos_url":"https://api.github.com/users/opentracing/repos","events_url":"https://api.github.com/users/opentracing/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing/received_events","type":"Organization","site_admin":false},"repo":{"id":46904685,"name":"opentracing-go","full_name":"opentracing/opentracing-go","owner":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars.githubusercontent.com/u/15482765?v=3","gravatar_id":"","url":"https://api.github.com/users/opentracing","html_url":"https://github.com/opentracing","followers_url":"https://api.github.com/users/opentracing/followers","following_url":"https://api.github.com/users/opentracing/following{/other_user}","gists_url":"https://api.github.com/users/opentracing/gists{/gist_id}","starred_url":"https://api.github.com/users/opentracing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentracing/subscriptions","organizations_url":"https://api.github.com/users/opentracing/orgs","repos_url":"https://api.github.com/users/opentracing/repos","events_url":"https://api.github.com/users/opentracing/events{/privacy}","received_events_url":"https://api.github.com/users/opentracing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentracing/opentracing-go","description":"Go implementation of Open Tracing API","fork":false,"url":"https://api.github.com/repos/opentracing/opentracing-go","forks_url":"https://api.github.com/repos/opentracing/opentracing-go/forks","keys_url":"https://api.github.com/repos/opentracing/opentracing-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing/opentracing-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing/opentracing-go/teams","hooks_url":"https://api.github.com/repos/opentracing/opentracing-go/hooks","issue_events_url":"https://api.github.com/repos/opentracing/opentracing-go/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing/opentracing-go/events","assignees_url":"https://api.github.com/repos/opentracing/opentracing-go/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing/opentracing-go/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing/opentracing-go/tags","blobs_url":"https://api.github.com/repos/opentracing/opentracing-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing/opentracing-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing/opentracing-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing/opentracing-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing/opentracing-go/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing/opentracing-go/languages","stargazers_url":"https://api.github.com/repos/opentracing/opentracing-go/stargazers","contributors_url":"https://api.github.com/repos/opentracing/opentracing-go/contributors","subscribers_url":"https://api.github.com/repos/opentracing/opentracing-go/subscribers","subscription_url":"https://api.github.com/repos/opentracing/opentracing-go/subscription","commits_url":"https://api.github.com/repos/opentracing/opentracing-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing/opentracing-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing/opentracing-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing/opentracing-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing/opentracing-go/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing/opentracing-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing/opentracing-go/merges","archive_url":"https://api.github.com/repos/opentracing/opentracing-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing/opentracing-go/downloads","issues_url":"https://api.github.com/repos/opentracing/opentracing-go/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing/opentracing-go/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing/opentracing-go/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing/opentracing-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing/opentracing-go/labels{/name}","releases_url":"https://api.github.com/repos/opentracing/opentracing-go/releases{/id}","deployments_url":"https://api.github.com/repos/opentracing/opentracing-go/deployments","created_at":"2015-11-26T04:52:54Z","updated_at":"2016-02-06T19:47:55Z","pushed_at":"2016-02-06T21:57:25Z","git_url":"git://github.com/opentracing/opentracing-go.git","ssh_url":"git@github.com:opentracing/opentracing-go.git","clone_url":"https://github.com/opentracing/opentracing-go.git","svn_url":"https://github.com/opentracing/opentracing-go","homepage":"","size":135,"stargazers_count":53,"watchers_count":53,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48"},"html":{"href":"https://github.com/opentracing/opentracing-go/pull/48"},"issue":{"href":"https://api.github.com/repos/opentracing/opentracing-go/issues/48"},"comments":{"href":"https://api.github.com/repos/opentracing/opentracing-go/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/opentracing/opentracing-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentracing/opentracing-go/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/opentracing/opentracing-go/statuses/a6bb55b5cda43ef2c97b26ffbf736f55766d76af"}}}}