{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/comments/260840881","pull_request_review_id":208637280,"id":260840881,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MDg0MDg4MQ==","diff_hunk":"@@ -0,0 +1,99 @@\n+package datadog.trace.instrumentation.jaxrs;\n+\n+import static datadog.trace.bootstrap.WeakMap.Provider.newWeakMap;\n+\n+import datadog.trace.agent.decorator.BaseDecorator;\n+import datadog.trace.api.DDTags;\n+import datadog.trace.bootstrap.WeakMap;\n+import io.opentracing.Scope;\n+import io.opentracing.Span;\n+import io.opentracing.tag.Tags;\n+import java.lang.annotation.Annotation;\n+import java.lang.reflect.Method;\n+import java.util.LinkedList;\n+import java.util.Map;\n+import java.util.concurrent.ConcurrentHashMap;\n+import javax.ws.rs.HttpMethod;\n+import javax.ws.rs.Path;\n+\n+public class JaxRsAnnotationsDecorator extends BaseDecorator {\n+  public static JaxRsAnnotationsDecorator DECORATE = new JaxRsAnnotationsDecorator();\n+\n+  private final WeakMap<Class, Map<String, String>> resourceNames = newWeakMap();\n+\n+  @Override\n+  protected String[] instrumentationNames() {\n+    return new String[0];\n+  }\n+\n+  @Override\n+  protected String spanType() {\n+    return null;\n+  }\n+\n+  @Override\n+  protected String component() {\n+    return \"jax-rs-controller\";\n+  }\n+\n+  public void updateParent(final Scope scope, final Method method) {\n+    if (scope == null) {\n+      return;\n+    }\n+    final Span span = scope.span();\n+    Tags.COMPONENT.set(span, \"jax-rs\");\n+\n+    Class<?> target = method.getDeclaringClass();\n+    Map<String, String> classMap = resourceNames.get(target);\n+\n+    if (classMap == null) {\n+      resourceNames.putIfAbsent(target, new ConcurrentHashMap<String, String>());\n+      classMap = resourceNames.get(target);\n+    }\n+\n+    final String methodName = method.toString();\n+    String resourceName = classMap.get(methodName);","path":"dd-java-agent/instrumentation/jax-rs-annotations/src/main/java/datadog/trace/instrumentation/jaxrs/JaxRsAnnotationsDecorator.java","position":55,"original_position":55,"commit_id":"e3941a4b4c20ba4c5eaa317a98ce689c4fcb108e","original_commit_id":"e3941a4b4c20ba4c5eaa317a98ce689c4fcb108e","user":{"login":"tylerbenson","id":734411,"node_id":"MDQ6VXNlcjczNDQxMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/734411?v=4","gravatar_id":"","url":"https://api.github.com/users/tylerbenson","html_url":"https://github.com/tylerbenson","followers_url":"https://api.github.com/users/tylerbenson/followers","following_url":"https://api.github.com/users/tylerbenson/following{/other_user}","gists_url":"https://api.github.com/users/tylerbenson/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerbenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerbenson/subscriptions","organizations_url":"https://api.github.com/users/tylerbenson/orgs","repos_url":"https://api.github.com/users/tylerbenson/repos","events_url":"https://api.github.com/users/tylerbenson/events{/privacy}","received_events_url":"https://api.github.com/users/tylerbenson/received_events","type":"User","site_admin":false},"body":"I tried that, but it failed the caching test I wrote.  I don't think the method instances are reused between calls, and it uses the default `Object.hashcode()` implementation.","created_at":"2019-02-27T16:47:05Z","updated_at":"2019-02-27T16:47:05Z","html_url":"https://github.com/DataDog/dd-trace-java/pull/737#discussion_r260840881","pull_request_url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/comments/260840881"},"html":{"href":"https://github.com/DataDog/dd-trace-java/pull/737#discussion_r260840881"},"pull_request":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737"}},"in_reply_to_id":260801322},"pull_request":{"url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737","id":256497100,"node_id":"MDExOlB1bGxSZXF1ZXN0MjU2NDk3MTAw","html_url":"https://github.com/DataDog/dd-trace-java/pull/737","diff_url":"https://github.com/DataDog/dd-trace-java/pull/737.diff","patch_url":"https://github.com/DataDog/dd-trace-java/pull/737.patch","issue_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues/737","number":737,"state":"open","locked":false,"title":"Tracing instrumentation migrate to Decorator","user":{"login":"tylerbenson","id":734411,"node_id":"MDQ6VXNlcjczNDQxMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/734411?v=4","gravatar_id":"","url":"https://api.github.com/users/tylerbenson","html_url":"https://github.com/tylerbenson","followers_url":"https://api.github.com/users/tylerbenson/followers","following_url":"https://api.github.com/users/tylerbenson/following{/other_user}","gists_url":"https://api.github.com/users/tylerbenson/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerbenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerbenson/subscriptions","organizations_url":"https://api.github.com/users/tylerbenson/orgs","repos_url":"https://api.github.com/users/tylerbenson/repos","events_url":"https://api.github.com/users/tylerbenson/events{/privacy}","received_events_url":"https://api.github.com/users/tylerbenson/received_events","type":"User","site_admin":false},"body":"Includes `@Trace`, Hystrix, and Jax-rs","created_at":"2019-02-27T00:27:54Z","updated_at":"2019-02-27T16:47:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc35c7a8209adf4fc43afc0d4ae1d10ba701952f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/DataDog/dd-trace-java/milestones/38","html_url":"https://github.com/DataDog/dd-trace-java/milestone/38","labels_url":"https://api.github.com/repos/DataDog/dd-trace-java/milestones/38/labels","id":4076582,"node_id":"MDk6TWlsZXN0b25lNDA3NjU4Mg==","number":38,"title":"0.25.0","description":"","creator":{"login":"tylerbenson","id":734411,"node_id":"MDQ6VXNlcjczNDQxMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/734411?v=4","gravatar_id":"","url":"https://api.github.com/users/tylerbenson","html_url":"https://github.com/tylerbenson","followers_url":"https://api.github.com/users/tylerbenson/followers","following_url":"https://api.github.com/users/tylerbenson/following{/other_user}","gists_url":"https://api.github.com/users/tylerbenson/gists{/gist_id}","starred_url":"https://api.github.com/users/tylerbenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tylerbenson/subscriptions","organizations_url":"https://api.github.com/users/tylerbenson/orgs","repos_url":"https://api.github.com/users/tylerbenson/repos","events_url":"https://api.github.com/users/tylerbenson/events{/privacy}","received_events_url":"https://api.github.com/users/tylerbenson/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":13,"state":"open","created_at":"2019-02-21T16:46:05Z","updated_at":"2019-02-27T00:27:54Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737/commits","review_comments_url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737/comments","review_comment_url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues/737/comments","statuses_url":"https://api.github.com/repos/DataDog/dd-trace-java/statuses/e3941a4b4c20ba4c5eaa317a98ce689c4fcb108e","head":{"label":"DataDog:tyler/trace-jax-decorator","ref":"tyler/trace-jax-decorator","sha":"e3941a4b4c20ba4c5eaa317a98ce689c4fcb108e","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":89221572,"node_id":"MDEwOlJlcG9zaXRvcnk4OTIyMTU3Mg==","name":"dd-trace-java","full_name":"DataDog/dd-trace-java","private":false,"owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DataDog/dd-trace-java","description":"Datadog APM client for Java","fork":false,"url":"https://api.github.com/repos/DataDog/dd-trace-java","forks_url":"https://api.github.com/repos/DataDog/dd-trace-java/forks","keys_url":"https://api.github.com/repos/DataDog/dd-trace-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-trace-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-trace-java/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-trace-java/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-trace-java/events","assignees_url":"https://api.github.com/repos/DataDog/dd-trace-java/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-trace-java/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-trace-java/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-trace-java/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-trace-java/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-trace-java/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-trace-java/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-trace-java/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-trace-java/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-trace-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-trace-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-trace-java/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-trace-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-trace-java/merges","archive_url":"https://api.github.com/repos/DataDog/dd-trace-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-trace-java/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-trace-java/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-trace-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-trace-java/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-trace-java/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/dd-trace-java/deployments","created_at":"2017-04-24T09:24:40Z","updated_at":"2019-02-26T19:55:58Z","pushed_at":"2019-02-27T16:41:45Z","git_url":"git://github.com/DataDog/dd-trace-java.git","ssh_url":"git@github.com:DataDog/dd-trace-java.git","clone_url":"https://github.com/DataDog/dd-trace-java.git","svn_url":"https://github.com/DataDog/dd-trace-java","homepage":"https://docs.datadoghq.com/tracing/languages/java","size":124255,"stargazers_count":75,"watchers_count":75,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":33,"open_issues":36,"watchers":75,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"1a1943788532dc010e7634d12951e5439debc1f2","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":89221572,"node_id":"MDEwOlJlcG9zaXRvcnk4OTIyMTU3Mg==","name":"dd-trace-java","full_name":"DataDog/dd-trace-java","private":false,"owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DataDog/dd-trace-java","description":"Datadog APM client for Java","fork":false,"url":"https://api.github.com/repos/DataDog/dd-trace-java","forks_url":"https://api.github.com/repos/DataDog/dd-trace-java/forks","keys_url":"https://api.github.com/repos/DataDog/dd-trace-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/dd-trace-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/dd-trace-java/teams","hooks_url":"https://api.github.com/repos/DataDog/dd-trace-java/hooks","issue_events_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/dd-trace-java/events","assignees_url":"https://api.github.com/repos/DataDog/dd-trace-java/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/dd-trace-java/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/dd-trace-java/tags","blobs_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/dd-trace-java/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/dd-trace-java/languages","stargazers_url":"https://api.github.com/repos/DataDog/dd-trace-java/stargazers","contributors_url":"https://api.github.com/repos/DataDog/dd-trace-java/contributors","subscribers_url":"https://api.github.com/repos/DataDog/dd-trace-java/subscribers","subscription_url":"https://api.github.com/repos/DataDog/dd-trace-java/subscription","commits_url":"https://api.github.com/repos/DataDog/dd-trace-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/dd-trace-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/dd-trace-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/dd-trace-java/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/dd-trace-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/dd-trace-java/merges","archive_url":"https://api.github.com/repos/DataDog/dd-trace-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/dd-trace-java/downloads","issues_url":"https://api.github.com/repos/DataDog/dd-trace-java/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/dd-trace-java/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/dd-trace-java/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/dd-trace-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/dd-trace-java/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/dd-trace-java/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/dd-trace-java/deployments","created_at":"2017-04-24T09:24:40Z","updated_at":"2019-02-26T19:55:58Z","pushed_at":"2019-02-27T16:41:45Z","git_url":"git://github.com/DataDog/dd-trace-java.git","ssh_url":"git@github.com:DataDog/dd-trace-java.git","clone_url":"https://github.com/DataDog/dd-trace-java.git","svn_url":"https://github.com/DataDog/dd-trace-java","homepage":"https://docs.datadoghq.com/tracing/languages/java","size":124255,"stargazers_count":75,"watchers_count":75,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":33,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":33,"open_issues":36,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737"},"html":{"href":"https://github.com/DataDog/dd-trace-java/pull/737"},"issue":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/issues/737"},"comments":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/issues/737/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/pulls/737/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/dd-trace-java/statuses/e3941a4b4c20ba4c5eaa317a98ce689c4fcb108e"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"tylerbenson"}}