[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-1842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16002635#comment-16002635
 ] 

ASF GitHub Bot commented on HTTPCLIENT-1842:
--------------------------------------------

GitHub user pavolloffay opened a pull request:

    https://github.com/apache/httpclient/pull/76

    Allow to add exec interceptor as the first and the last

    Related to OpenTracing integration and 
https://issues.apache.org/jira/browse/HTTPCLIENT-1842?focusedCommentId=15996807&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15996807
 
    
    cc @ok2c 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pavolloffay/httpclient 
add-interceptor-fisrt-last

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/httpclient/pull/76.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #76
    
----
commit 91ebbac98e3b68eec20e8627af93804406103100
Author: Pavol Loffay <plof...@redhat.com>
Date:   2017-05-09T12:58:58Z

    Allow to add exec interceptor as the first and the last

----


> OpenTracing integration
> -----------------------
>
>                 Key: HTTPCLIENT-1842
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1842
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: HttpClient (async), HttpClient (classic)
>            Reporter: Pavol Loffay
>             Fix For: 5.0
>
>
> Hello, 
> I am working on OpenTracing [1] integraton for {{HttpClient}} client. My 
> current POC is in [2]. I have a couple of questions and suggestions for next 
> version to make the tracing integration better and cleaner.
> First I was using interceptors but response interceptor is not invoked on 
> exceptions e.g. {{UnknownHostException}}. 
> Now I decided to extend {{HttpClientBuilder}} and override 
> {{decorateProtocolExec}} but the problem is that {{RedirectExec}} is added 
> aftewards so tracing {{ClientExecChain}} gets called multiple times and 
> should be only one.  Note that tracing {{ClientExecChain}} requires access to 
> redirectStrategy/redirectCount/redirectDisabled to create only one span for 
> the whole request (this makes the integration quite nasty).
> In general there are these requirements to make the integration work properly:
> 1. for the whole invocation call request and response interceptor only once, 
> or be able to add tracing {{ClientExecChain}} as the last one in builder.
> 2. be able to access thread local variable from an 
> interceptor/ClientExecChain to connect client span with a server span
> 3. be able to intercept thrown exceptios e.g. {{UnknownHostException}}
> [1]: http://opentracing.io/
> [2]: https://github.com/pavolloffay/java-apache-httpcomponents



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to