{"action":"created","comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/comments/69576924","id":69576924,"diff_hunk":"@@ -166,33 +154,75 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo\n \t\t\t// Add headers before filter chain in case one of the filters flushes the\n \t\t\t// response...\n \t\t\tfilterChain.doFilter(request, response);\n-\t\t}\n-\t\tcatch (Throwable e) {\n+\t\t} catch (Throwable e) {\n \t\t\texception = e;\n \t\t\tthrow e;\n-\t\t}\n-\t\tfinally {\n+\t\t} finally {\n \t\t\tif (isAsyncStarted(request) || request.isAsyncStarted()) {\n \t\t\t\tif (log.isDebugEnabled()) {\n-\t\t\t\t\tlog.debug(\"Detaching the span \" + spanFromRequest + \" since the request is asynchronous\");\n+\t\t\t\t\tlog.debug(\"The span \" + spanFromRequest + \" will get detached by a HandleInterceptor\");\n \t\t\t\t}\n-\t\t\t\tthis.tracer.detach(spanFromRequest);\n \t\t\t\t// TODO: how to deal with response annotations and async?\n \t\t\t\treturn;\n \t\t\t}\n+\t\t\tspanFromRequest = createSpanIfRequestNotHandled(request, spanFromRequest, name, skip);\n \t\t\taddToResponseIfNotPresent(response, Span.SAMPLED_NAME, skip ? Span.SPAN_NOT_SAMPLED : Span.SPAN_SAMPLED);\n \t\t\tdetachOrCloseSpans(request, response, spanFromRequest, exception);\n \t\t}\n \t}\n \n+\tprivate void processErrorRequest(FilterChain filterChain, HttpServletRequest request,\n+\t\t\tHttpServletResponse response, Span spanFromRequest)\n+\t\t\tthrows IOException, ServletException {\n+\t\tif (log.isDebugEnabled()) {\n+\t\t\tlog.debug(\"The span was already detached once and we're processing an error\");","path":"spring-cloud-sleuth-core/src/main/java/org/springframework/cloud/sleuth/instrument/web/TraceFilter.java","position":60,"original_position":60,"commit_id":"f71ceb1c6e56abd207f2bb0f929bc86fcf2a415b","original_commit_id":"f71ceb1c6e56abd207f2bb0f929bc86fcf2a415b","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":"maybe add the span discussed to the debug message?","created_at":"2016-07-05T14:52:36Z","updated_at":"2016-07-05T14:52:36Z","html_url":"https://github.com/spring-cloud/spring-cloud-sleuth/pull/322#discussion_r69576924","pull_request_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322","_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/comments/69576924"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-sleuth/pull/322#discussion_r69576924"},"pull_request":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322"}}},"pull_request":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322","id":76187342,"html_url":"https://github.com/spring-cloud/spring-cloud-sleuth/pull/322","diff_url":"https://github.com/spring-cloud/spring-cloud-sleuth/pull/322.diff","patch_url":"https://github.com/spring-cloud/spring-cloud-sleuth/pull/322.patch","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/322","number":322,"state":"open","locked":false,"title":"Re-added missing server side span","user":{"login":"marcingrzejszczak","id":3297437,"avatar_url":"https://avatars.githubusercontent.com/u/3297437?v=3","gravatar_id":"","url":"https://api.github.com/users/marcingrzejszczak","html_url":"https://github.com/marcingrzejszczak","followers_url":"https://api.github.com/users/marcingrzejszczak/followers","following_url":"https://api.github.com/users/marcingrzejszczak/following{/other_user}","gists_url":"https://api.github.com/users/marcingrzejszczak/gists{/gist_id}","starred_url":"https://api.github.com/users/marcingrzejszczak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcingrzejszczak/subscriptions","organizations_url":"https://api.github.com/users/marcingrzejszczak/orgs","repos_url":"https://api.github.com/users/marcingrzejszczak/repos","events_url":"https://api.github.com/users/marcingrzejszczak/events{/privacy}","received_events_url":"https://api.github.com/users/marcingrzejszczak/received_events","type":"User","site_admin":false},"body":"with this change\r\n\r\n- HandlerInterceptor is responsible for wrapping requests in spans\r\n- it will not wrap error controller related requests with spans\r\n- tests have been changed to ensure that ALWAYS there is at least one span on the server side (that way it will show up in Zipkin)\r\n- \"fallback\" mechanism has been added that if a HandlerInterceptor hasn't been used then we are forcing creation of a Span at the server side\r\n\r\nfixes #321\r\n\r\ncc @dsyer @spencergibb @adriancole ","created_at":"2016-07-04T17:02:12Z","updated_at":"2016-07-05T14:52:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3549d8e8e4800ee178aa70bf8c0c16ac17ee8689","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/milestones/10","html_url":"https://github.com/spring-cloud/spring-cloud-sleuth/milestones/1.0.3","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/milestones/10/labels","id":1863625,"number":10,"title":"1.0.3","description":null,"creator":{"login":"marcingrzejszczak","id":3297437,"avatar_url":"https://avatars.githubusercontent.com/u/3297437?v=3","gravatar_id":"","url":"https://api.github.com/users/marcingrzejszczak","html_url":"https://github.com/marcingrzejszczak","followers_url":"https://api.github.com/users/marcingrzejszczak/followers","following_url":"https://api.github.com/users/marcingrzejszczak/following{/other_user}","gists_url":"https://api.github.com/users/marcingrzejszczak/gists{/gist_id}","starred_url":"https://api.github.com/users/marcingrzejszczak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcingrzejszczak/subscriptions","organizations_url":"https://api.github.com/users/marcingrzejszczak/orgs","repos_url":"https://api.github.com/users/marcingrzejszczak/repos","events_url":"https://api.github.com/users/marcingrzejszczak/events{/privacy}","received_events_url":"https://api.github.com/users/marcingrzejszczak/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-07-04T17:02:19Z","updated_at":"2016-07-04T17:02:19Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322/commits","review_comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322/comments","review_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/322/comments","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/statuses/f71ceb1c6e56abd207f2bb0f929bc86fcf2a415b","head":{"label":"spring-cloud:issues_321_missing_span","ref":"issues_321_missing_span","sha":"f71ceb1c6e56abd207f2bb0f929bc86fcf2a415b","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":31788540,"name":"spring-cloud-sleuth","full_name":"spring-cloud/spring-cloud-sleuth","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-sleuth","description":"Distributed tracing for spring cloud","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/releases{/id}","deployments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/deployments","created_at":"2015-03-06T20:51:47Z","updated_at":"2016-07-05T14:25:28Z","pushed_at":"2016-07-05T14:18:19Z","git_url":"git://github.com/spring-cloud/spring-cloud-sleuth.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-sleuth.git","clone_url":"https://github.com/spring-cloud/spring-cloud-sleuth.git","svn_url":"https://github.com/spring-cloud/spring-cloud-sleuth","homepage":"http://cloud.spring.io","size":4773,"stargazers_count":127,"watchers_count":127,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":60,"mirror_url":null,"open_issues_count":20,"forks":60,"open_issues":20,"watchers":127,"default_branch":"master"}},"base":{"label":"spring-cloud:1.0.x","ref":"1.0.x","sha":"fbefa81d52c5beacdab2ce10cfc22c12ce678e2d","user":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"repo":{"id":31788540,"name":"spring-cloud-sleuth","full_name":"spring-cloud/spring-cloud-sleuth","owner":{"login":"spring-cloud","id":7815877,"avatar_url":"https://avatars.githubusercontent.com/u/7815877?v=3","gravatar_id":"","url":"https://api.github.com/users/spring-cloud","html_url":"https://github.com/spring-cloud","followers_url":"https://api.github.com/users/spring-cloud/followers","following_url":"https://api.github.com/users/spring-cloud/following{/other_user}","gists_url":"https://api.github.com/users/spring-cloud/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-cloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-cloud/subscriptions","organizations_url":"https://api.github.com/users/spring-cloud/orgs","repos_url":"https://api.github.com/users/spring-cloud/repos","events_url":"https://api.github.com/users/spring-cloud/events{/privacy}","received_events_url":"https://api.github.com/users/spring-cloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-cloud/spring-cloud-sleuth","description":"Distributed tracing for spring cloud","fork":false,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth","forks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/forks","keys_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/teams","hooks_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/hooks","issue_events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/events{/number}","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/events","assignees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/assignees{/user}","branches_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/branches{/branch}","tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/tags","blobs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/languages","stargazers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/stargazers","contributors_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/contributors","subscribers_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/subscribers","subscription_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/subscription","commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/contents/{+path}","compare_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/merges","archive_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/downloads","issues_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues{/number}","pulls_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/labels{/name}","releases_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/releases{/id}","deployments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/deployments","created_at":"2015-03-06T20:51:47Z","updated_at":"2016-07-05T14:25:28Z","pushed_at":"2016-07-05T14:18:19Z","git_url":"git://github.com/spring-cloud/spring-cloud-sleuth.git","ssh_url":"git@github.com:spring-cloud/spring-cloud-sleuth.git","clone_url":"https://github.com/spring-cloud/spring-cloud-sleuth.git","svn_url":"https://github.com/spring-cloud/spring-cloud-sleuth","homepage":"http://cloud.spring.io","size":4773,"stargazers_count":127,"watchers_count":127,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":60,"mirror_url":null,"open_issues_count":20,"forks":60,"open_issues":20,"watchers":127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322"},"html":{"href":"https://github.com/spring-cloud/spring-cloud-sleuth/pull/322"},"issue":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/322"},"comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/322/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/pulls/322/commits"},"statuses":{"href":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/statuses/f71ceb1c6e56abd207f2bb0f929bc86fcf2a415b"}}}}
{"actor":{"display_login":"adriancole"}}