{"action":"created","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/424","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/424/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/424/events","html_url":"https://github.com/spring-cloud/spring-cloud-sleuth/issues/424","id":183620874,"number":424,"title":"Not seeing traceids in the http response headers","user":{"login":"bijukunjummen","id":390605,"avatar_url":"https://avatars1.githubusercontent.com/u/390605?v=4","gravatar_id":"","url":"https://api.github.com/users/bijukunjummen","html_url":"https://github.com/bijukunjummen","followers_url":"https://api.github.com/users/bijukunjummen/followers","following_url":"https://api.github.com/users/bijukunjummen/following{/other_user}","gists_url":"https://api.github.com/users/bijukunjummen/gists{/gist_id}","starred_url":"https://api.github.com/users/bijukunjummen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bijukunjummen/subscriptions","organizations_url":"https://api.github.com/users/bijukunjummen/orgs","repos_url":"https://api.github.com/users/bijukunjummen/repos","events_url":"https://api.github.com/users/bijukunjummen/events{/privacy}","received_events_url":"https://api.github.com/users/bijukunjummen/received_events","type":"User","site_admin":false},"labels":[{"id":286026206,"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/labels/documentation","name":"documentation","color":"009800","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/milestones/17","html_url":"https://github.com/spring-cloud/spring-cloud-sleuth/milestone/17","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/milestones/17/labels","id":2077550,"number":17,"title":"1.0.11","description":null,"creator":{"login":"marcingrzejszczak","id":3297437,"avatar_url":"https://avatars0.githubusercontent.com/u/3297437?v=4","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":0,"closed_issues":16,"state":"closed","created_at":"2016-10-18T15:19:05Z","updated_at":"2016-11-24T11:37:34Z","due_on":null,"closed_at":"2016-11-24T11:37:34Z"},"comments":24,"created_at":"2016-10-18T08:27:44Z","updated_at":"2017-12-20T12:30:11Z","closed_at":"2016-10-27T11:59:50Z","author_association":"CONTRIBUTOR","body":"Hi, I can see from issue #327 that the HTTP response headers related to a trace is now removed from the response headers(the documentation still says that it should exist). I thought that this was very useful way to grab a traceid for user initiated request and then use it to go to zipkin and trace out the request. Is there a easier way to grab a traceid for a request initiated by a user. Sorry to open it as an issue, but felt that this is a useful feature to have\n"},"comment":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/comments/353050961","html_url":"https://github.com/spring-cloud/spring-cloud-sleuth/issues/424#issuecomment-353050961","issue_url":"https://api.github.com/repos/spring-cloud/spring-cloud-sleuth/issues/424","id":353050961,"user":{"login":"marvinrichter","id":4619764,"avatar_url":"https://avatars1.githubusercontent.com/u/4619764?v=4","gravatar_id":"","url":"https://api.github.com/users/marvinrichter","html_url":"https://github.com/marvinrichter","followers_url":"https://api.github.com/users/marvinrichter/followers","following_url":"https://api.github.com/users/marvinrichter/following{/other_user}","gists_url":"https://api.github.com/users/marvinrichter/gists{/gist_id}","starred_url":"https://api.github.com/users/marvinrichter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marvinrichter/subscriptions","organizations_url":"https://api.github.com/users/marvinrichter/orgs","repos_url":"https://api.github.com/users/marvinrichter/repos","events_url":"https://api.github.com/users/marvinrichter/events{/privacy}","received_events_url":"https://api.github.com/users/marvinrichter/received_events","type":"User","site_admin":false},"created_at":"2017-12-20T12:30:11Z","updated_at":"2017-12-20T12:30:11Z","author_association":"NONE","body":"Sure. Here is my custom filter implementation and the configuration.\r\n\r\n```java\r\npublic class CustomTraceFilter extends TraceFilter {\r\n\r\n    private static final String TRACE_HEADER_NAME = \"X-B3-TraceId\";\r\n    private final BeanFactory beanFactory;\r\n    private Tracer tracer;\r\n\r\n    public CustomTraceFilter(BeanFactory beanFactory) {\r\n        super(beanFactory);\r\n        this.beanFactory = beanFactory;\r\n    }\r\n\r\n    public CustomTraceFilter(BeanFactory beanFactory, Pattern skipPattern) {\r\n        super(beanFactory, skipPattern);\r\n        this.beanFactory = beanFactory;\r\n    }\r\n\r\n    @Override\r\n    protected void addResponseTags(HttpServletResponse response, Throwable e) {\r\n        super.addResponseTags(response, e);\r\n        Span currentSpan = tracer().getCurrentSpan();\r\n        response.addHeader(TRACE_HEADER_NAME, currentSpan.traceIdString());\r\n    }\r\n\r\n    private Tracer tracer() {\r\n        if (this.tracer == null) {\r\n            this.tracer = this.beanFactory.getBean(Tracer.class);\r\n        }\r\n        return this.tracer;\r\n    }\r\n}\r\n```\r\n\r\n```java\r\n@Configuration\r\npublic class TraceFilterConfig {\r\n\r\n    @Bean\r\n    public TraceFilter traceFilter(BeanFactory beanFactory) {\r\n        return new CustomTraceFilter(beanFactory);\r\n    }\r\n}\r\n```"}}
{"actor":{"display_login":"marvinrichter"}}