{"action":"created","comment":{"url":"https://api.github.com/repos/uber/jaeger-client-java/pulls/comments/92951482","pull_request_review_id":13472768,"id":92951482,"diff_hunk":"@@ -86,36 +88,31 @@ private void updateSampler() {\n       return;\n     }\n \n-    Sampler newSampler;\n-    try {\n-      newSampler = extractSampler(response);\n-    } catch (UnknownSamplingStrategyException e) {\n-      metrics.samplerParsingFailure.inc(1);\n-      return; // sampler updateGauge without a new sampler\n-    }\n+    Sampler oldSampler = sampler;\n \n-    if (!this.sampler.equals(newSampler)) {\n-      synchronized (this) {\n-        this.sampler = newSampler;\n-        metrics.samplerUpdated.inc(1);\n+    if (response.getOperationSampling() != null) {\n+      OperationSamplingParameters samplingParameters = response.getOperationSampling();\n+      if (sampler instanceof PerOperationSampler) {\n+        if (((PerOperationSampler) sampler).update(samplingParameters)) {\n+          metrics.samplerUpdated.inc(1);\n+        }\n+      } else {\n+        sampler = new PerOperationSampler(maxOperations, response.getOperationSampling());\n       }\n-    }\n-  }\n-\n-  private Sampler extractSampler(SamplingStrategyResponse response)\n-      throws UnknownSamplingStrategyException {\n-    if (SamplingStrategyType.PROBABILISTIC.equals(response.getStrategyType())) {\n+    } else if (response.getProbabilisticSampling() != null) {\n       ProbabilisticSamplingStrategy strategy = response.getProbabilisticSampling();\n-      return new ProbabilisticSampler(strategy.getSamplingRate());\n-    }\n-\n-    if (SamplingStrategyType.RATE_LIMITING.equals(response.getStrategyType())) {\n+      sampler = new ProbabilisticSampler(strategy.getSamplingRate());\n+    } else if (response.getRateLimitingSampling() != null) {\n       RateLimitingSamplingStrategy strategy = response.getRateLimitingSampling();\n-      return new RateLimitingSampler(strategy.getMaxTracesPerSecond());\n+      sampler = new RateLimitingSampler(strategy.getMaxTracesPerSecond());\n+    } else {\n+      metrics.samplerParsingFailure.inc(1);\n+      log.info(\"No strategy present in response.\");\n     }\n \n-    throw new UnknownSamplingStrategyException(\n-        String.format(\"Unsupported sampling strategy type %s\", response.getStrategyType()));\n+    if (!oldSampler.equals(sampler)) {","path":"jaeger-core/src/main/java/com/uber/jaeger/samplers/RemoteControlledSampler.java","position":86,"original_position":86,"commit_id":"7c5b4b0abd999593cfddfde97bd4dc1e9c303df8","original_commit_id":"7c5b4b0abd999593cfddfde97bd4dc1e9c303df8","user":{"login":"vprithvi","id":833009,"avatar_url":"https://avatars.githubusercontent.com/u/833009?v=3","gravatar_id":"","url":"https://api.github.com/users/vprithvi","html_url":"https://github.com/vprithvi","followers_url":"https://api.github.com/users/vprithvi/followers","following_url":"https://api.github.com/users/vprithvi/following{/other_user}","gists_url":"https://api.github.com/users/vprithvi/gists{/gist_id}","starred_url":"https://api.github.com/users/vprithvi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vprithvi/subscriptions","organizations_url":"https://api.github.com/users/vprithvi/orgs","repos_url":"https://api.github.com/users/vprithvi/repos","events_url":"https://api.github.com/users/vprithvi/events{/privacy}","received_events_url":"https://api.github.com/users/vprithvi/received_events","type":"User","site_admin":false},"body":"will refactor","created_at":"2016-12-18T21:51:05Z","updated_at":"2016-12-18T21:51:21Z","html_url":"https://github.com/uber/jaeger-client-java/pull/112#discussion_r92951482","pull_request_url":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/uber/jaeger-client-java/pulls/comments/92951482"},"html":{"href":"https://github.com/uber/jaeger-client-java/pull/112#discussion_r92951482"},"pull_request":{"href":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112","id":98022984,"html_url":"https://github.com/uber/jaeger-client-java/pull/112","diff_url":"https://github.com/uber/jaeger-client-java/pull/112.diff","patch_url":"https://github.com/uber/jaeger-client-java/pull/112.patch","issue_url":"https://api.github.com/repos/uber/jaeger-client-java/issues/112","number":112,"state":"open","locked":false,"title":"Support per operation sampling","user":{"login":"vprithvi","id":833009,"avatar_url":"https://avatars.githubusercontent.com/u/833009?v=3","gravatar_id":"","url":"https://api.github.com/users/vprithvi","html_url":"https://github.com/vprithvi","followers_url":"https://api.github.com/users/vprithvi/followers","following_url":"https://api.github.com/users/vprithvi/following{/other_user}","gists_url":"https://api.github.com/users/vprithvi/gists{/gist_id}","starred_url":"https://api.github.com/users/vprithvi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vprithvi/subscriptions","organizations_url":"https://api.github.com/users/vprithvi/orgs","repos_url":"https://api.github.com/users/vprithvi/repos","events_url":"https://api.github.com/users/vprithvi/events{/privacy}","received_events_url":"https://api.github.com/users/vprithvi/received_events","type":"User","site_admin":false},"body":"Add a PerOperationSampler that maintains a sampling probability for every operation","created_at":"2016-12-14T19:50:42Z","updated_at":"2016-12-18T21:51:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4077010e6ca1e421823b8a64d91dffdb75c755e2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112/commits","review_comments_url":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112/comments","review_comment_url":"https://api.github.com/repos/uber/jaeger-client-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/uber/jaeger-client-java/issues/112/comments","statuses_url":"https://api.github.com/repos/uber/jaeger-client-java/statuses/7c5b4b0abd999593cfddfde97bd4dc1e9c303df8","head":{"label":"uber:adaptive_sampling_3","ref":"adaptive_sampling_3","sha":"7c5b4b0abd999593cfddfde97bd4dc1e9c303df8","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":56551000,"name":"jaeger-client-java","full_name":"uber/jaeger-client-java","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/jaeger-client-java","description":"Jaeger Bindings for Java OpenTracing API","fork":false,"url":"https://api.github.com/repos/uber/jaeger-client-java","forks_url":"https://api.github.com/repos/uber/jaeger-client-java/forks","keys_url":"https://api.github.com/repos/uber/jaeger-client-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/jaeger-client-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/jaeger-client-java/teams","hooks_url":"https://api.github.com/repos/uber/jaeger-client-java/hooks","issue_events_url":"https://api.github.com/repos/uber/jaeger-client-java/issues/events{/number}","events_url":"https://api.github.com/repos/uber/jaeger-client-java/events","assignees_url":"https://api.github.com/repos/uber/jaeger-client-java/assignees{/user}","branches_url":"https://api.github.com/repos/uber/jaeger-client-java/branches{/branch}","tags_url":"https://api.github.com/repos/uber/jaeger-client-java/tags","blobs_url":"https://api.github.com/repos/uber/jaeger-client-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/jaeger-client-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/jaeger-client-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/jaeger-client-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/jaeger-client-java/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/jaeger-client-java/languages","stargazers_url":"https://api.github.com/repos/uber/jaeger-client-java/stargazers","contributors_url":"https://api.github.com/repos/uber/jaeger-client-java/contributors","subscribers_url":"https://api.github.com/repos/uber/jaeger-client-java/subscribers","subscription_url":"https://api.github.com/repos/uber/jaeger-client-java/subscription","commits_url":"https://api.github.com/repos/uber/jaeger-client-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/jaeger-client-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/jaeger-client-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/jaeger-client-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/jaeger-client-java/contents/{+path}","compare_url":"https://api.github.com/repos/uber/jaeger-client-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/jaeger-client-java/merges","archive_url":"https://api.github.com/repos/uber/jaeger-client-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/jaeger-client-java/downloads","issues_url":"https://api.github.com/repos/uber/jaeger-client-java/issues{/number}","pulls_url":"https://api.github.com/repos/uber/jaeger-client-java/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/jaeger-client-java/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/jaeger-client-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/jaeger-client-java/labels{/name}","releases_url":"https://api.github.com/repos/uber/jaeger-client-java/releases{/id}","deployments_url":"https://api.github.com/repos/uber/jaeger-client-java/deployments","created_at":"2016-04-19T00:10:02Z","updated_at":"2016-12-08T10:16:20Z","pushed_at":"2016-12-16T22:18:57Z","git_url":"git://github.com/uber/jaeger-client-java.git","ssh_url":"git@github.com:uber/jaeger-client-java.git","clone_url":"https://github.com/uber/jaeger-client-java.git","svn_url":"https://github.com/uber/jaeger-client-java","homepage":"http://uber.github.io/jaeger/","size":538,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":20,"forks":7,"open_issues":20,"watchers":13,"default_branch":"master"}},"base":{"label":"uber:master","ref":"master","sha":"d2d7ded057d52e3df733091ff5a597afcbbb1efb","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":56551000,"name":"jaeger-client-java","full_name":"uber/jaeger-client-java","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/jaeger-client-java","description":"Jaeger Bindings for Java OpenTracing API","fork":false,"url":"https://api.github.com/repos/uber/jaeger-client-java","forks_url":"https://api.github.com/repos/uber/jaeger-client-java/forks","keys_url":"https://api.github.com/repos/uber/jaeger-client-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uber/jaeger-client-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uber/jaeger-client-java/teams","hooks_url":"https://api.github.com/repos/uber/jaeger-client-java/hooks","issue_events_url":"https://api.github.com/repos/uber/jaeger-client-java/issues/events{/number}","events_url":"https://api.github.com/repos/uber/jaeger-client-java/events","assignees_url":"https://api.github.com/repos/uber/jaeger-client-java/assignees{/user}","branches_url":"https://api.github.com/repos/uber/jaeger-client-java/branches{/branch}","tags_url":"https://api.github.com/repos/uber/jaeger-client-java/tags","blobs_url":"https://api.github.com/repos/uber/jaeger-client-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uber/jaeger-client-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uber/jaeger-client-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/uber/jaeger-client-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uber/jaeger-client-java/statuses/{sha}","languages_url":"https://api.github.com/repos/uber/jaeger-client-java/languages","stargazers_url":"https://api.github.com/repos/uber/jaeger-client-java/stargazers","contributors_url":"https://api.github.com/repos/uber/jaeger-client-java/contributors","subscribers_url":"https://api.github.com/repos/uber/jaeger-client-java/subscribers","subscription_url":"https://api.github.com/repos/uber/jaeger-client-java/subscription","commits_url":"https://api.github.com/repos/uber/jaeger-client-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/uber/jaeger-client-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/uber/jaeger-client-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/uber/jaeger-client-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/uber/jaeger-client-java/contents/{+path}","compare_url":"https://api.github.com/repos/uber/jaeger-client-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uber/jaeger-client-java/merges","archive_url":"https://api.github.com/repos/uber/jaeger-client-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uber/jaeger-client-java/downloads","issues_url":"https://api.github.com/repos/uber/jaeger-client-java/issues{/number}","pulls_url":"https://api.github.com/repos/uber/jaeger-client-java/pulls{/number}","milestones_url":"https://api.github.com/repos/uber/jaeger-client-java/milestones{/number}","notifications_url":"https://api.github.com/repos/uber/jaeger-client-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uber/jaeger-client-java/labels{/name}","releases_url":"https://api.github.com/repos/uber/jaeger-client-java/releases{/id}","deployments_url":"https://api.github.com/repos/uber/jaeger-client-java/deployments","created_at":"2016-04-19T00:10:02Z","updated_at":"2016-12-08T10:16:20Z","pushed_at":"2016-12-16T22:18:57Z","git_url":"git://github.com/uber/jaeger-client-java.git","ssh_url":"git@github.com:uber/jaeger-client-java.git","clone_url":"https://github.com/uber/jaeger-client-java.git","svn_url":"https://github.com/uber/jaeger-client-java","homepage":"http://uber.github.io/jaeger/","size":538,"stargazers_count":13,"watchers_count":13,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":20,"forks":7,"open_issues":20,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112"},"html":{"href":"https://github.com/uber/jaeger-client-java/pull/112"},"issue":{"href":"https://api.github.com/repos/uber/jaeger-client-java/issues/112"},"comments":{"href":"https://api.github.com/repos/uber/jaeger-client-java/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/uber/jaeger-client-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/uber/jaeger-client-java/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/uber/jaeger-client-java/statuses/7c5b4b0abd999593cfddfde97bd4dc1e9c303df8"}}}}
{"actor":{"display_login":"vprithvi"}}