dlmarion opened a new pull request #2259:
URL: https://github.com/apache/accumulo/pull/2259


   This is a WIP view into the work I'm doing to replace HTrace with 
OpenTelemetry. The purpose here is to describe the approach that I'm taking to 
get early feedback and explain some differences. For reference, please review 
the OpenTelemetry [instrumentation 
guide](https://opentelemetry.io/docs/java/manual_instrumentation/).
   
   Here's an overview of the changes thus far:
   
   0. I removed `htrace` as a dependency in the poms. It is still a transitive 
dependency as it is still required by the version of Hadoop that we use.
   
   1. The `tracer` module contains code to set up an 
[autoconfigured](https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure)
 tracer implementation. The autoconfigured tracer uses system properties or 
environment variables to configure the tracer. The tracer has 
properties/variables to:
     * configure the export of traces (location / type)
     * batching of exports
     * trace sampler configuration
     * limits on spans
     
     NOTE: The autoconfigure tracer implementation is currently alpha.
   
   2. The TraceUtil class remains the main utility for trace related methods. 
The `getTracer` method uses `ServiceLoader` to find Tracer implementations on 
the classpath and returns the first one. If there is none, then the method 
returns a NoOp implementation. This means that the `tracer` jar is optional and 
we may want to *not* put it in the lib directory by default. I'm not sure what 
the performance impact of the NoOp tracer implementation is compared to the 
HTrace code that was there.
   
   3. I modified the TInfo thrift message such that it would hold the 
OpenTelemetry Context information. The Context information follows 
https://www.w3.org/TR/trace-context/, so TInfo is now a Map<String,String> of 
the trace context headers.
   
   4. `TraceUtil.wrapService` is used by the Accumulo server processes when 
setting up the Thrift server for handling client requests. `wrapService` takes 
the incoming TInfo object and creates a Context on the server side to continue 
the Trace information.
   
   5. I neutered, but did not remove, the Trace information in the Monitor.
   
   6. I made a first pass at changing the code in all places where HTrace was 
being used and modified it to use the OpenTelemetry Tracer. I think I need to 
go back and re-review all of the places as OpenTelemetry has the option to 
catch Exception information and I don't think I did that in all cases.
   
   Regarding testing this, I think it should be as simple as the following.
   
   1. Setup and run Jaeger or ZipKin
   2. Put the `tracer` jar on the classpath
   3. Add the appropriate system properties or environment variables
   
   resolves #2257 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to