{"action":"created","comment":{"url":"https://api.github.com/repos/opentracing/api-java/pulls/comments/49925623","id":49925623,"diff_hunk":"@@ -0,0 +1,51 @@\n+/**\n+ * Copyright 2016 The OpenTracing Authors\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n+ * in compliance with the License. You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software distributed under the License\n+ * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n+ * or implied. See the License for the specific language governing permissions and limitations under\n+ * the License.\n+ */\n+package opentracing;\n+\n+/**\n+ * Represents the identity of a given Span and Trace Attributes. The span identity is embedded in\n+ * this context in implementation-specific format. The contents are serialized on the wire during\n+ * inter-process calls. Trace Attributes can be added to the context and will be available to all\n+ * future children of this span, but will not propagate up the call tree. The more attributes are\n+ * added to the context, the heavier it makes the requests on the wire, so it must be used with\n+ * caution.\n+ */\n+public interface TraceContext {\n+\n+  /**\n+   * Stores Trace Attribute in the context as a key/value pair. Enables powerful distributed context\n+   * propagation functionality where arbitrary application data can be carried along the full path\n+   * of request execution throughout the system.\n+   *\n+   * <p>Note 1: attributes are only propagated to the future children of the current trace context.\n+   *\n+   * <p>Note 2: attributes are sent in-band with every subsequent local and remote calls, so this\n+   * feature must be used with care.\n+   *\n+   * <p>Note 3: keys are case-insensitive, to allow propagation via HTTP headers. Keys must match\n+   * regex {@code (?i:[a-z0-9][-a-z0-9]*)}\n+   *\n+   * @param key attribute key, matching regex {@code (?i:[a-z0-9][-a-z0-9]*)}\n+   * @param value value associated with the key.\n+   */\n+  TraceContext setAttribute(String key, String value);","path":"opentracing/src/main/java/opentracing/TraceContext.java","position":42,"original_position":42,"commit_id":"c71903217e7560c37fe97bd624634862fb4da88b","original_commit_id":"c71903217e7560c37fe97bd624634862fb4da88b","user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"body":">\n> > +  TraceContext setAttribute(String key, String value);\n>\n> @bensigelman <https://github.com/bensigelman> [image: :+1:] to forbidding\n> deletion. I can't think of a reason to support deletion given the\n> immutability of parent contexts; it's always possible to not add the thing\n> you'd otherwise delete.\n>\nIn finagle, there's a flags propagation field, which includes debug. This\ncan be changed on a hop. Not necessarily in tracing, but I've seen other\nside-channels which propagate TTL-style data, either hop count or deadline.\nSince this isn't a general purpose context, we can punt such a feature I\nsuspect.\n","created_at":"2016-01-16T02:28:15Z","updated_at":"2016-01-16T02:28:15Z","html_url":"https://github.com/opentracing/api-java/pull/4#discussion_r49925623","pull_request_url":"https://api.github.com/repos/opentracing/api-java/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/opentracing/api-java/pulls/comments/49925623"},"html":{"href":"https://github.com/opentracing/api-java/pull/4#discussion_r49925623"},"pull_request":{"href":"https://api.github.com/repos/opentracing/api-java/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/opentracing/api-java/pulls/4","id":56144121,"html_url":"https://github.com/opentracing/api-java/pull/4","diff_url":"https://github.com/opentracing/api-java/pull/4.diff","patch_url":"https://github.com/opentracing/api-java/pull/4.patch","issue_url":"https://api.github.com/repos/opentracing/api-java/issues/4","number":4,"state":"open","locked":false,"title":"Adds initial interfaces based on api-python","user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"body":"This is mostly a port from python, except for a couple notes.\r\n* Adds an IllegalArgumentException to `fromXXX`, if the input is malformed.\r\n* Adds `EncodedTraceContext` type as Java cannot return multiple results.\r\n\r\nAny other changes are unintentional.\r\n\r\nSee https://github.com/opentracing/api-python/tree/master/opentracing","created_at":"2016-01-15T08:52:53Z","updated_at":"2016-01-16T02:28:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"977b4f2175152029b3e9a9fdc9e134a24156ce0f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opentracing/api-java/pulls/4/commits","review_comments_url":"https://api.github.com/repos/opentracing/api-java/pulls/4/comments","review_comment_url":"https://api.github.com/repos/opentracing/api-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentracing/api-java/issues/4/comments","statuses_url":"https://api.github.com/repos/opentracing/api-java/statuses/c71903217e7560c37fe97bd624634862fb4da88b","head":{"label":"opentracing:interfaces","ref":"interfaces","sha":"c71903217e7560c37fe97bd624634862fb4da88b","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":48295629,"name":"api-java","full_name":"opentracing/api-java","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/api-java","description":"","fork":false,"url":"https://api.github.com/repos/opentracing/api-java","forks_url":"https://api.github.com/repos/opentracing/api-java/forks","keys_url":"https://api.github.com/repos/opentracing/api-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing/api-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing/api-java/teams","hooks_url":"https://api.github.com/repos/opentracing/api-java/hooks","issue_events_url":"https://api.github.com/repos/opentracing/api-java/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing/api-java/events","assignees_url":"https://api.github.com/repos/opentracing/api-java/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing/api-java/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing/api-java/tags","blobs_url":"https://api.github.com/repos/opentracing/api-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing/api-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing/api-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing/api-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing/api-java/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing/api-java/languages","stargazers_url":"https://api.github.com/repos/opentracing/api-java/stargazers","contributors_url":"https://api.github.com/repos/opentracing/api-java/contributors","subscribers_url":"https://api.github.com/repos/opentracing/api-java/subscribers","subscription_url":"https://api.github.com/repos/opentracing/api-java/subscription","commits_url":"https://api.github.com/repos/opentracing/api-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing/api-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing/api-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing/api-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing/api-java/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing/api-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing/api-java/merges","archive_url":"https://api.github.com/repos/opentracing/api-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing/api-java/downloads","issues_url":"https://api.github.com/repos/opentracing/api-java/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing/api-java/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing/api-java/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing/api-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing/api-java/labels{/name}","releases_url":"https://api.github.com/repos/opentracing/api-java/releases{/id}","created_at":"2015-12-19T20:07:30Z","updated_at":"2016-01-12T14:56:55Z","pushed_at":"2016-01-15T08:52:53Z","git_url":"git://github.com/opentracing/api-java.git","ssh_url":"git@github.com:opentracing/api-java.git","clone_url":"https://github.com/opentracing/api-java.git","svn_url":"https://github.com/opentracing/api-java","homepage":null,"size":88,"stargazers_count":3,"watchers_count":3,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"opentracing:master","ref":"master","sha":"c9868bc1fc8afe996c734f71ec2761e037876f9d","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":48295629,"name":"api-java","full_name":"opentracing/api-java","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/api-java","description":"","fork":false,"url":"https://api.github.com/repos/opentracing/api-java","forks_url":"https://api.github.com/repos/opentracing/api-java/forks","keys_url":"https://api.github.com/repos/opentracing/api-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing/api-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing/api-java/teams","hooks_url":"https://api.github.com/repos/opentracing/api-java/hooks","issue_events_url":"https://api.github.com/repos/opentracing/api-java/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing/api-java/events","assignees_url":"https://api.github.com/repos/opentracing/api-java/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing/api-java/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing/api-java/tags","blobs_url":"https://api.github.com/repos/opentracing/api-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing/api-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing/api-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing/api-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing/api-java/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing/api-java/languages","stargazers_url":"https://api.github.com/repos/opentracing/api-java/stargazers","contributors_url":"https://api.github.com/repos/opentracing/api-java/contributors","subscribers_url":"https://api.github.com/repos/opentracing/api-java/subscribers","subscription_url":"https://api.github.com/repos/opentracing/api-java/subscription","commits_url":"https://api.github.com/repos/opentracing/api-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing/api-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing/api-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing/api-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing/api-java/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing/api-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing/api-java/merges","archive_url":"https://api.github.com/repos/opentracing/api-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing/api-java/downloads","issues_url":"https://api.github.com/repos/opentracing/api-java/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing/api-java/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing/api-java/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing/api-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing/api-java/labels{/name}","releases_url":"https://api.github.com/repos/opentracing/api-java/releases{/id}","created_at":"2015-12-19T20:07:30Z","updated_at":"2016-01-12T14:56:55Z","pushed_at":"2016-01-15T08:52:53Z","git_url":"git://github.com/opentracing/api-java.git","ssh_url":"git@github.com:opentracing/api-java.git","clone_url":"https://github.com/opentracing/api-java.git","svn_url":"https://github.com/opentracing/api-java","homepage":null,"size":88,"stargazers_count":3,"watchers_count":3,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":2,"forks":1,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opentracing/api-java/pulls/4"},"html":{"href":"https://github.com/opentracing/api-java/pull/4"},"issue":{"href":"https://api.github.com/repos/opentracing/api-java/issues/4"},"comments":{"href":"https://api.github.com/repos/opentracing/api-java/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/opentracing/api-java/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/opentracing/api-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentracing/api-java/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/opentracing/api-java/statuses/c71903217e7560c37fe97bd624634862fb4da88b"}}}}