{"action":"created","comment":{"url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments/106888795","pull_request_review_id":27830429,"id":106888795,"diff_hunk":"@@ -0,0 +1,207 @@\n+/**\n+ * Copyright 2016-2017 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 io.opentracing.util;\n+\n+import io.opentracing.NoopTracerFactory;\n+import io.opentracing.SpanContext;\n+import io.opentracing.Tracer;\n+import io.opentracing.propagation.Format;\n+\n+import java.util.Iterator;\n+import java.util.ServiceLoader;\n+import java.util.concurrent.locks.Lock;\n+import java.util.concurrent.locks.ReentrantLock;\n+import java.util.logging.Level;\n+import java.util.logging.Logger;\n+\n+/**\n+ * Forwards all methods to another tracer that can be configured in one of two ways:\n+ * <ol>\n+ * <li>Explicitly, calling {@link #register(Tracer)} with a configured tracer, or:</li>\n+ * <li>Automatically using the Java {@link ServiceLoader} SPI mechanism to load a {@link Tracer} from the classpath.</li>\n+ * </ol>\n+ * <p>\n+ * When the tracer is needed it is lazily looked up using the following rules:","path":"opentracing-util/src/main/java/io/opentracing/util/GlobalTracer.java","position":35,"original_position":35,"commit_id":"d1e7b71ff4c2f3d397102eecd5046a7b0afc7111","original_commit_id":"d1e7b71ff4c2f3d397102eecd5046a7b0afc7111","user":{"login":"sjoerdtalsma","id":2930348,"avatar_url":"https://avatars0.githubusercontent.com/u/2930348?v=3","gravatar_id":"","url":"https://api.github.com/users/sjoerdtalsma","html_url":"https://github.com/sjoerdtalsma","followers_url":"https://api.github.com/users/sjoerdtalsma/followers","following_url":"https://api.github.com/users/sjoerdtalsma/following{/other_user}","gists_url":"https://api.github.com/users/sjoerdtalsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoerdtalsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoerdtalsma/subscriptions","organizations_url":"https://api.github.com/users/sjoerdtalsma/orgs","repos_url":"https://api.github.com/users/sjoerdtalsma/repos","events_url":"https://api.github.com/users/sjoerdtalsma/events{/privacy}","received_events_url":"https://api.github.com/users/sjoerdtalsma/received_events","type":"User","site_admin":false},"body":"@objectiser The corresponding PR https://github.com/opentracing-contrib/java-globaltracer/pull/8 has not been merged yet, so we're free to choose which issue we merge first.","created_at":"2017-03-20T12:32:20Z","updated_at":"2017-03-20T12:32:20Z","html_url":"https://github.com/opentracing/opentracing-java/pull/109#discussion_r106888795","pull_request_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109","_links":{"self":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments/106888795"},"html":{"href":"https://github.com/opentracing/opentracing-java/pull/109#discussion_r106888795"},"pull_request":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109"}}},"pull_request":{"url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109","id":111071305,"html_url":"https://github.com/opentracing/opentracing-java/pull/109","diff_url":"https://github.com/opentracing/opentracing-java/pull/109.diff","patch_url":"https://github.com/opentracing/opentracing-java/pull/109.patch","issue_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/109","number":109,"state":"open","locked":false,"title":"Move GlobalTracer from contrib to opentracing-java.","user":{"login":"sjoerdtalsma","id":2930348,"avatar_url":"https://avatars0.githubusercontent.com/u/2930348?v=3","gravatar_id":"","url":"https://api.github.com/users/sjoerdtalsma","html_url":"https://github.com/sjoerdtalsma","followers_url":"https://api.github.com/users/sjoerdtalsma/followers","following_url":"https://api.github.com/users/sjoerdtalsma/following{/other_user}","gists_url":"https://api.github.com/users/sjoerdtalsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoerdtalsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoerdtalsma/subscriptions","organizations_url":"https://api.github.com/users/sjoerdtalsma/orgs","repos_url":"https://api.github.com/users/sjoerdtalsma/repos","events_url":"https://api.github.com/users/sjoerdtalsma/events{/privacy}","received_events_url":"https://api.github.com/users/sjoerdtalsma/received_events","type":"User","site_admin":false},"body":"There seems to be general consensus on [gitter](https://gitter.im/opentracing/public) to move the Java `GlobalTracer` into the `opentracing-java` project.\r\n\r\nI took the liberty to use the version in https://github.com/opentracing-contrib/java-globaltracer/pull/8 for this PR as well. I propose to keep the discussion about that change confined to that PR as much as possible. I will make sure to keep them functionally aligned.\r\n\r\nDiscussion we could have here is:\r\n- Should this be a separate module?\r\n- Or should the `GlobalTracer` class be moved into the API module itself for even more exposure? \r\n\r\nGiven the tendency to move things like `no-op` out of the API, my initial choice was a separate module with the `io.opentracing:opentracing-globaltracer` groupId:artifact identity.\r\nThis allows migration of the current 'contrib' variant by publishing a new _deprecated + delegated_ variant.","created_at":"2017-03-16T13:48:12Z","updated_at":"2017-03-20T12:32:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed4f5a406dfc8f8b2c74762b4c25530391465e5c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109/commits","review_comments_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109/comments","review_comment_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/109/comments","statuses_url":"https://api.github.com/repos/opentracing/opentracing-java/statuses/d1e7b71ff4c2f3d397102eecd5046a7b0afc7111","head":{"label":"sjoerdtalsma:globaltracer","ref":"globaltracer","sha":"d1e7b71ff4c2f3d397102eecd5046a7b0afc7111","user":{"login":"sjoerdtalsma","id":2930348,"avatar_url":"https://avatars0.githubusercontent.com/u/2930348?v=3","gravatar_id":"","url":"https://api.github.com/users/sjoerdtalsma","html_url":"https://github.com/sjoerdtalsma","followers_url":"https://api.github.com/users/sjoerdtalsma/followers","following_url":"https://api.github.com/users/sjoerdtalsma/following{/other_user}","gists_url":"https://api.github.com/users/sjoerdtalsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoerdtalsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoerdtalsma/subscriptions","organizations_url":"https://api.github.com/users/sjoerdtalsma/orgs","repos_url":"https://api.github.com/users/sjoerdtalsma/repos","events_url":"https://api.github.com/users/sjoerdtalsma/events{/privacy}","received_events_url":"https://api.github.com/users/sjoerdtalsma/received_events","type":"User","site_admin":false},"repo":{"id":78622882,"name":"opentracing-java","full_name":"sjoerdtalsma/opentracing-java","owner":{"login":"sjoerdtalsma","id":2930348,"avatar_url":"https://avatars0.githubusercontent.com/u/2930348?v=3","gravatar_id":"","url":"https://api.github.com/users/sjoerdtalsma","html_url":"https://github.com/sjoerdtalsma","followers_url":"https://api.github.com/users/sjoerdtalsma/followers","following_url":"https://api.github.com/users/sjoerdtalsma/following{/other_user}","gists_url":"https://api.github.com/users/sjoerdtalsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sjoerdtalsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sjoerdtalsma/subscriptions","organizations_url":"https://api.github.com/users/sjoerdtalsma/orgs","repos_url":"https://api.github.com/users/sjoerdtalsma/repos","events_url":"https://api.github.com/users/sjoerdtalsma/events{/privacy}","received_events_url":"https://api.github.com/users/sjoerdtalsma/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sjoerdtalsma/opentracing-java","description":"OpenTracing API for Java","fork":true,"url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java","forks_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/forks","keys_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/teams","hooks_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/hooks","issue_events_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/issues/events{/number}","events_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/events","assignees_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/assignees{/user}","branches_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/branches{/branch}","tags_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/tags","blobs_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/statuses/{sha}","languages_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/languages","stargazers_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/stargazers","contributors_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/contributors","subscribers_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/subscribers","subscription_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/subscription","commits_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/contents/{+path}","compare_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/merges","archive_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/downloads","issues_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/issues{/number}","pulls_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/pulls{/number}","milestones_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/milestones{/number}","notifications_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/labels{/name}","releases_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/releases{/id}","deployments_url":"https://api.github.com/repos/sjoerdtalsma/opentracing-java/deployments","created_at":"2017-01-11T09:22:23Z","updated_at":"2017-01-11T09:22:27Z","pushed_at":"2017-03-17T10:58:31Z","git_url":"git://github.com/sjoerdtalsma/opentracing-java.git","ssh_url":"git@github.com:sjoerdtalsma/opentracing-java.git","clone_url":"https://github.com/sjoerdtalsma/opentracing-java.git","svn_url":"https://github.com/sjoerdtalsma/opentracing-java","homepage":"http://opentracing.io","size":368,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"opentracing:master","ref":"master","sha":"232f46e649f535fccafb41e02bb978c5ab218533","user":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars2.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":"opentracing-java","full_name":"opentracing/opentracing-java","owner":{"login":"opentracing","id":15482765,"avatar_url":"https://avatars2.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-java","description":"OpenTracing API for Java","fork":false,"url":"https://api.github.com/repos/opentracing/opentracing-java","forks_url":"https://api.github.com/repos/opentracing/opentracing-java/forks","keys_url":"https://api.github.com/repos/opentracing/opentracing-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentracing/opentracing-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentracing/opentracing-java/teams","hooks_url":"https://api.github.com/repos/opentracing/opentracing-java/hooks","issue_events_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/events{/number}","events_url":"https://api.github.com/repos/opentracing/opentracing-java/events","assignees_url":"https://api.github.com/repos/opentracing/opentracing-java/assignees{/user}","branches_url":"https://api.github.com/repos/opentracing/opentracing-java/branches{/branch}","tags_url":"https://api.github.com/repos/opentracing/opentracing-java/tags","blobs_url":"https://api.github.com/repos/opentracing/opentracing-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentracing/opentracing-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentracing/opentracing-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentracing/opentracing-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentracing/opentracing-java/statuses/{sha}","languages_url":"https://api.github.com/repos/opentracing/opentracing-java/languages","stargazers_url":"https://api.github.com/repos/opentracing/opentracing-java/stargazers","contributors_url":"https://api.github.com/repos/opentracing/opentracing-java/contributors","subscribers_url":"https://api.github.com/repos/opentracing/opentracing-java/subscribers","subscription_url":"https://api.github.com/repos/opentracing/opentracing-java/subscription","commits_url":"https://api.github.com/repos/opentracing/opentracing-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentracing/opentracing-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentracing/opentracing-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentracing/opentracing-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentracing/opentracing-java/contents/{+path}","compare_url":"https://api.github.com/repos/opentracing/opentracing-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentracing/opentracing-java/merges","archive_url":"https://api.github.com/repos/opentracing/opentracing-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentracing/opentracing-java/downloads","issues_url":"https://api.github.com/repos/opentracing/opentracing-java/issues{/number}","pulls_url":"https://api.github.com/repos/opentracing/opentracing-java/pulls{/number}","milestones_url":"https://api.github.com/repos/opentracing/opentracing-java/milestones{/number}","notifications_url":"https://api.github.com/repos/opentracing/opentracing-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentracing/opentracing-java/labels{/name}","releases_url":"https://api.github.com/repos/opentracing/opentracing-java/releases{/id}","deployments_url":"https://api.github.com/repos/opentracing/opentracing-java/deployments","created_at":"2015-12-19T20:07:30Z","updated_at":"2017-03-20T09:40:59Z","pushed_at":"2017-03-19T21:13:40Z","git_url":"git://github.com/opentracing/opentracing-java.git","ssh_url":"git@github.com:opentracing/opentracing-java.git","clone_url":"https://github.com/opentracing/opentracing-java.git","svn_url":"https://github.com/opentracing/opentracing-java","homepage":"http://opentracing.io","size":319,"stargazers_count":214,"watchers_count":214,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":54,"mirror_url":null,"open_issues_count":26,"forks":54,"open_issues":26,"watchers":214,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109"},"html":{"href":"https://github.com/opentracing/opentracing-java/pull/109"},"issue":{"href":"https://api.github.com/repos/opentracing/opentracing-java/issues/109"},"comments":{"href":"https://api.github.com/repos/opentracing/opentracing-java/issues/109/comments"},"review_comments":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109/comments"},"review_comment":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentracing/opentracing-java/pulls/109/commits"},"statuses":{"href":"https://api.github.com/repos/opentracing/opentracing-java/statuses/d1e7b71ff4c2f3d397102eecd5046a7b0afc7111"}}}}
{"actor":{"display_login":"sjoerdtalsma"}}