{"action":"created","comment":{"url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/comments/223500209","pull_request_review_id":162643355,"id":223500209,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzUwMDIwOQ==","diff_hunk":"@@ -287,8 +287,17 @@ declare namespace zipkin {\n     letContext<V>(ctx: TraceId, callback: () => V): V;\n   }\n \n+  type RequestZipkinHeaders<T = any, H = any> = T & {\n+    headers: H & {\n+      ['X-B3-TraceId']: string;\n+      ['X-B3-SpanId']: string;\n+      ['X-B3-ParentSpanId']?: string;\n+      ['X-B3-Sampled']?: '1' | '0';","path":"packages/zipkin/index.d.ts","position":9,"original_position":9,"commit_id":"9ca24d264851ac3450b0429a5de10bb66e170e28","original_commit_id":"9ca24d264851ac3450b0429a5de10bb66e170e28","user":{"login":"sonybinhle","id":8733931,"node_id":"MDQ6VXNlcjg3MzM5MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/8733931?v=4","gravatar_id":"","url":"https://api.github.com/users/sonybinhle","html_url":"https://github.com/sonybinhle","followers_url":"https://api.github.com/users/sonybinhle/followers","following_url":"https://api.github.com/users/sonybinhle/following{/other_user}","gists_url":"https://api.github.com/users/sonybinhle/gists{/gist_id}","starred_url":"https://api.github.com/users/sonybinhle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonybinhle/subscriptions","organizations_url":"https://api.github.com/users/sonybinhle/orgs","repos_url":"https://api.github.com/users/sonybinhle/repos","events_url":"https://api.github.com/users/sonybinhle/events{/privacy}","received_events_url":"https://api.github.com/users/sonybinhle/received_events","type":"User","site_admin":false},"body":"Hi @adriancole, nice to meet you, thank you very much for your suggestions. I paste the content of the current **request.js** file below:\r\n```\r\nconst HttpHeaders = require('./httpHeaders');\r\n\r\nfunction appendZipkinHeaders(req, traceId) {\r\n  const headers = req.headers || {};\r\n  headers[HttpHeaders.TraceId] = traceId.traceId;\r\n  headers[HttpHeaders.SpanId] = traceId.spanId;\r\n\r\n  traceId._parentId.ifPresent(psid => {\r\n    headers[HttpHeaders.ParentSpanId] = psid;\r\n  });\r\n  traceId.sampled.ifPresent(sampled => {\r\n    headers[HttpHeaders.Sampled] = sampled ? '1' : '0';\r\n  });\r\n\r\n  return headers;\r\n}\r\n\r\nfunction addZipkinHeaders(req, traceId) {\r\n  const headers = appendZipkinHeaders(req, traceId);\r\n  return Object.assign({}, req, {headers});\r\n}\r\n\r\nmodule.exports = {\r\n  addZipkinHeaders\r\n};\r\n```\r\nWhen I read the code above, I saw only HttpHeaders.TraceId, HttpHeaders.SpanId, HttpHeaders.ParentSpanId, HttpHeaders.Sampled and headers[HttpHeaders.Sampled] is either '1' or '0'.\r\n\r\n> we often leniently parse 'true' and 'false' for old clients, as they used to send this.\r\nIt might not affect old clients, because the index.d.ts file is only for typescript projects to use type inference at compile time, so it does not influence old-clients runtime.\r\n\r\n>  I think this is missing ['X-B3-Flags']?: '1' | '0';\r\nI couldn't find ['X-B3-Flags'] on the source code above, but if it is **optional(with ?)** and not presented on the source code, we might ignore it.\r\n\r\nMy response is only based on my limited knowledge about the project; please clarify me if I miss-understood something.\r\n\r\n\r\n\r\n\r\n","created_at":"2018-10-08T21:18:45Z","updated_at":"2018-10-08T21:18:45Z","html_url":"https://github.com/openzipkin/zipkin-js/pull/264#discussion_r223500209","pull_request_url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/comments/223500209"},"html":{"href":"https://github.com/openzipkin/zipkin-js/pull/264#discussion_r223500209"},"pull_request":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264"}},"in_reply_to_id":223233127},"pull_request":{"url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264","id":217287691,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3Mjg3Njkx","html_url":"https://github.com/openzipkin/zipkin-js/pull/264","diff_url":"https://github.com/openzipkin/zipkin-js/pull/264.diff","patch_url":"https://github.com/openzipkin/zipkin-js/pull/264.patch","issue_url":"https://api.github.com/repos/openzipkin/zipkin-js/issues/264","number":264,"state":"closed","locked":false,"title":"#263: Change return type of addZipkinHeaders to RequestZipkinHeaders","user":{"login":"sonybinhle","id":8733931,"node_id":"MDQ6VXNlcjg3MzM5MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/8733931?v=4","gravatar_id":"","url":"https://api.github.com/users/sonybinhle","html_url":"https://github.com/sonybinhle","followers_url":"https://api.github.com/users/sonybinhle/followers","following_url":"https://api.github.com/users/sonybinhle/following{/other_user}","gists_url":"https://api.github.com/users/sonybinhle/gists{/gist_id}","starred_url":"https://api.github.com/users/sonybinhle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonybinhle/subscriptions","organizations_url":"https://api.github.com/users/sonybinhle/orgs","repos_url":"https://api.github.com/users/sonybinhle/repos","events_url":"https://api.github.com/users/sonybinhle/events{/privacy}","received_events_url":"https://api.github.com/users/sonybinhle/received_events","type":"User","site_admin":false},"body":"I tried to find the coding convention for implementing the fix but it may be not available. Please give me feedback so I could modify my PR.","created_at":"2018-09-21T13:40:29Z","updated_at":"2018-10-08T21:18:45Z","closed_at":"2018-10-07T17:27:57Z","merged_at":"2018-10-07T17:27:57Z","merge_commit_sha":"eab2190f9c9a85ddea4fa59ea777ac391571ed58","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264/commits","review_comments_url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264/comments","review_comment_url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openzipkin/zipkin-js/issues/264/comments","statuses_url":"https://api.github.com/repos/openzipkin/zipkin-js/statuses/9ca24d264851ac3450b0429a5de10bb66e170e28","head":{"label":"sonybinhle:feature/issue-263","ref":"feature/issue-263","sha":"9ca24d264851ac3450b0429a5de10bb66e170e28","user":{"login":"sonybinhle","id":8733931,"node_id":"MDQ6VXNlcjg3MzM5MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/8733931?v=4","gravatar_id":"","url":"https://api.github.com/users/sonybinhle","html_url":"https://github.com/sonybinhle","followers_url":"https://api.github.com/users/sonybinhle/followers","following_url":"https://api.github.com/users/sonybinhle/following{/other_user}","gists_url":"https://api.github.com/users/sonybinhle/gists{/gist_id}","starred_url":"https://api.github.com/users/sonybinhle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonybinhle/subscriptions","organizations_url":"https://api.github.com/users/sonybinhle/orgs","repos_url":"https://api.github.com/users/sonybinhle/repos","events_url":"https://api.github.com/users/sonybinhle/events{/privacy}","received_events_url":"https://api.github.com/users/sonybinhle/received_events","type":"User","site_admin":false},"repo":{"id":149765266,"node_id":"MDEwOlJlcG9zaXRvcnkxNDk3NjUyNjY=","name":"zipkin-js","full_name":"sonybinhle/zipkin-js","private":false,"owner":{"login":"sonybinhle","id":8733931,"node_id":"MDQ6VXNlcjg3MzM5MzE=","avatar_url":"https://avatars0.githubusercontent.com/u/8733931?v=4","gravatar_id":"","url":"https://api.github.com/users/sonybinhle","html_url":"https://github.com/sonybinhle","followers_url":"https://api.github.com/users/sonybinhle/followers","following_url":"https://api.github.com/users/sonybinhle/following{/other_user}","gists_url":"https://api.github.com/users/sonybinhle/gists{/gist_id}","starred_url":"https://api.github.com/users/sonybinhle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonybinhle/subscriptions","organizations_url":"https://api.github.com/users/sonybinhle/orgs","repos_url":"https://api.github.com/users/sonybinhle/repos","events_url":"https://api.github.com/users/sonybinhle/events{/privacy}","received_events_url":"https://api.github.com/users/sonybinhle/received_events","type":"User","site_admin":false},"html_url":"https://github.com/sonybinhle/zipkin-js","description":"Zipkin instrumentation for Node.js and browsers","fork":true,"url":"https://api.github.com/repos/sonybinhle/zipkin-js","forks_url":"https://api.github.com/repos/sonybinhle/zipkin-js/forks","keys_url":"https://api.github.com/repos/sonybinhle/zipkin-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonybinhle/zipkin-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonybinhle/zipkin-js/teams","hooks_url":"https://api.github.com/repos/sonybinhle/zipkin-js/hooks","issue_events_url":"https://api.github.com/repos/sonybinhle/zipkin-js/issues/events{/number}","events_url":"https://api.github.com/repos/sonybinhle/zipkin-js/events","assignees_url":"https://api.github.com/repos/sonybinhle/zipkin-js/assignees{/user}","branches_url":"https://api.github.com/repos/sonybinhle/zipkin-js/branches{/branch}","tags_url":"https://api.github.com/repos/sonybinhle/zipkin-js/tags","blobs_url":"https://api.github.com/repos/sonybinhle/zipkin-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonybinhle/zipkin-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonybinhle/zipkin-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonybinhle/zipkin-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonybinhle/zipkin-js/statuses/{sha}","languages_url":"https://api.github.com/repos/sonybinhle/zipkin-js/languages","stargazers_url":"https://api.github.com/repos/sonybinhle/zipkin-js/stargazers","contributors_url":"https://api.github.com/repos/sonybinhle/zipkin-js/contributors","subscribers_url":"https://api.github.com/repos/sonybinhle/zipkin-js/subscribers","subscription_url":"https://api.github.com/repos/sonybinhle/zipkin-js/subscription","commits_url":"https://api.github.com/repos/sonybinhle/zipkin-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonybinhle/zipkin-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonybinhle/zipkin-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonybinhle/zipkin-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonybinhle/zipkin-js/contents/{+path}","compare_url":"https://api.github.com/repos/sonybinhle/zipkin-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonybinhle/zipkin-js/merges","archive_url":"https://api.github.com/repos/sonybinhle/zipkin-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonybinhle/zipkin-js/downloads","issues_url":"https://api.github.com/repos/sonybinhle/zipkin-js/issues{/number}","pulls_url":"https://api.github.com/repos/sonybinhle/zipkin-js/pulls{/number}","milestones_url":"https://api.github.com/repos/sonybinhle/zipkin-js/milestones{/number}","notifications_url":"https://api.github.com/repos/sonybinhle/zipkin-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonybinhle/zipkin-js/labels{/name}","releases_url":"https://api.github.com/repos/sonybinhle/zipkin-js/releases{/id}","deployments_url":"https://api.github.com/repos/sonybinhle/zipkin-js/deployments","created_at":"2018-09-21T13:10:24Z","updated_at":"2018-09-27T13:40:13Z","pushed_at":"2018-10-07T17:14:17Z","git_url":"git://github.com/sonybinhle/zipkin-js.git","ssh_url":"git@github.com:sonybinhle/zipkin-js.git","clone_url":"https://github.com/sonybinhle/zipkin-js.git","svn_url":"https://github.com/sonybinhle/zipkin-js","homepage":"","size":792,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openzipkin:master","ref":"master","sha":"ccb5eda5c68e10950b9a9022815e7752ac4f0204","user":{"login":"openzipkin","id":11860887,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODYwODg3","avatar_url":"https://avatars3.githubusercontent.com/u/11860887?v=4","gravatar_id":"","url":"https://api.github.com/users/openzipkin","html_url":"https://github.com/openzipkin","followers_url":"https://api.github.com/users/openzipkin/followers","following_url":"https://api.github.com/users/openzipkin/following{/other_user}","gists_url":"https://api.github.com/users/openzipkin/gists{/gist_id}","starred_url":"https://api.github.com/users/openzipkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzipkin/subscriptions","organizations_url":"https://api.github.com/users/openzipkin/orgs","repos_url":"https://api.github.com/users/openzipkin/repos","events_url":"https://api.github.com/users/openzipkin/events{/privacy}","received_events_url":"https://api.github.com/users/openzipkin/received_events","type":"Organization","site_admin":false},"repo":{"id":58535548,"node_id":"MDEwOlJlcG9zaXRvcnk1ODUzNTU0OA==","name":"zipkin-js","full_name":"openzipkin/zipkin-js","private":false,"owner":{"login":"openzipkin","id":11860887,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODYwODg3","avatar_url":"https://avatars3.githubusercontent.com/u/11860887?v=4","gravatar_id":"","url":"https://api.github.com/users/openzipkin","html_url":"https://github.com/openzipkin","followers_url":"https://api.github.com/users/openzipkin/followers","following_url":"https://api.github.com/users/openzipkin/following{/other_user}","gists_url":"https://api.github.com/users/openzipkin/gists{/gist_id}","starred_url":"https://api.github.com/users/openzipkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openzipkin/subscriptions","organizations_url":"https://api.github.com/users/openzipkin/orgs","repos_url":"https://api.github.com/users/openzipkin/repos","events_url":"https://api.github.com/users/openzipkin/events{/privacy}","received_events_url":"https://api.github.com/users/openzipkin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/openzipkin/zipkin-js","description":"Zipkin instrumentation for Node.js and browsers","fork":false,"url":"https://api.github.com/repos/openzipkin/zipkin-js","forks_url":"https://api.github.com/repos/openzipkin/zipkin-js/forks","keys_url":"https://api.github.com/repos/openzipkin/zipkin-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openzipkin/zipkin-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openzipkin/zipkin-js/teams","hooks_url":"https://api.github.com/repos/openzipkin/zipkin-js/hooks","issue_events_url":"https://api.github.com/repos/openzipkin/zipkin-js/issues/events{/number}","events_url":"https://api.github.com/repos/openzipkin/zipkin-js/events","assignees_url":"https://api.github.com/repos/openzipkin/zipkin-js/assignees{/user}","branches_url":"https://api.github.com/repos/openzipkin/zipkin-js/branches{/branch}","tags_url":"https://api.github.com/repos/openzipkin/zipkin-js/tags","blobs_url":"https://api.github.com/repos/openzipkin/zipkin-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openzipkin/zipkin-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openzipkin/zipkin-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/openzipkin/zipkin-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openzipkin/zipkin-js/statuses/{sha}","languages_url":"https://api.github.com/repos/openzipkin/zipkin-js/languages","stargazers_url":"https://api.github.com/repos/openzipkin/zipkin-js/stargazers","contributors_url":"https://api.github.com/repos/openzipkin/zipkin-js/contributors","subscribers_url":"https://api.github.com/repos/openzipkin/zipkin-js/subscribers","subscription_url":"https://api.github.com/repos/openzipkin/zipkin-js/subscription","commits_url":"https://api.github.com/repos/openzipkin/zipkin-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/openzipkin/zipkin-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/openzipkin/zipkin-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/openzipkin/zipkin-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/openzipkin/zipkin-js/contents/{+path}","compare_url":"https://api.github.com/repos/openzipkin/zipkin-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openzipkin/zipkin-js/merges","archive_url":"https://api.github.com/repos/openzipkin/zipkin-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openzipkin/zipkin-js/downloads","issues_url":"https://api.github.com/repos/openzipkin/zipkin-js/issues{/number}","pulls_url":"https://api.github.com/repos/openzipkin/zipkin-js/pulls{/number}","milestones_url":"https://api.github.com/repos/openzipkin/zipkin-js/milestones{/number}","notifications_url":"https://api.github.com/repos/openzipkin/zipkin-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openzipkin/zipkin-js/labels{/name}","releases_url":"https://api.github.com/repos/openzipkin/zipkin-js/releases{/id}","deployments_url":"https://api.github.com/repos/openzipkin/zipkin-js/deployments","created_at":"2016-05-11T10:28:12Z","updated_at":"2018-10-08T09:11:29Z","pushed_at":"2018-10-07T17:27:57Z","git_url":"git://github.com/openzipkin/zipkin-js.git","ssh_url":"git@github.com:openzipkin/zipkin-js.git","clone_url":"https://github.com/openzipkin/zipkin-js.git","svn_url":"https://github.com/openzipkin/zipkin-js","homepage":"","size":793,"stargazers_count":253,"watchers_count":253,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":109,"mirror_url":null,"archived":false,"open_issues_count":62,"license":null,"forks":109,"open_issues":62,"watchers":253,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264"},"html":{"href":"https://github.com/openzipkin/zipkin-js/pull/264"},"issue":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/issues/264"},"comments":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/issues/264/comments"},"review_comments":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264/comments"},"review_comment":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/pulls/264/commits"},"statuses":{"href":"https://api.github.com/repos/openzipkin/zipkin-js/statuses/9ca24d264851ac3450b0429a5de10bb66e170e28"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"sonybinhle"}}