Github user adriancole commented on the issue:

    https://github.com/apache/httpclient/pull/74
  
    Oleg, thinking in general here.. I think one hook approach that would
    be nice to see in any instrumentation library is an interface like
    this..
    
    Scope newScope(Attributes attributes);
    
    which is used in try-finally form whenever user interceptors are invoked.
    
    try (Scope wa = newScope(attributes) {
      userInterceptorChain.invoke();
    }
    
    this approach was discussed here:
    https://github.com/openzipkin/brave/issues/166#issuecomment-277634798
    
    An implementation of this scope could be picking trace context out of
    the attributes and setting it in a thread local. closing the scope
    removes it. This is cheaper than trying to do the same with lambdas,
    and also keeps the call stack less complex
    
    As different users may pick different things, a composition of scopes
    would be inside the "newScope" method above. It might have to act like
    guava's Closer such that all scopes are closed even if one causes a
    problem.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to