XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.0
    • api, core
    • None
    • 4.0

    Description

      De-globalize Tracer.java.

      Currently, Tracer is a Singleton managed by TracerHolder. Instead, Tracer objects should be created by each process or library that needs to use HTrace. This enables a few things:

      • When the Tracer object is created, we can give it a name. Then we can use this name in the "process id" of all spans created by that tracer, rather than trying to scrape the JVM name using "questionable" methods.
      • SpanReceivers can be shared between multiple Tracer objects in the same process. The span receivers are reference counted. This should eliminate the "double tracing" issues we have had when tracing client libraries inside processes which also want tracing.
      • Tracers can be closed by calling Tracer#close. If the Tracer being closed is the last tracer in the process, it will close all the span receivers.
      • We will have a TracerFactory that takes care of the details of creating the right span receivers based on the configuration. This removes some boilerplate that is currently needed to enable HTrace in an application or library. We can also make SpanReceiverFactory package-private since it will no longer need to be publicly visible.

      Attachments

        1. HTRACE-214.008.patch
          162 kB
          Colin McCabe
        2. HTRACE-214.007.patch
          146 kB
          Masatake Iwasaki
        3. HTRACE-214.006.patch
          146 kB
          Masatake Iwasaki
        4. HTRACE-214.005.patch
          152 kB
          Colin McCabe
        5. HTRACE-214.004.patch
          145 kB
          Colin McCabe
        6. HTRACE-214.003.patch
          142 kB
          Colin McCabe
        7. HTRACE-214.002.patch
          129 kB
          Colin McCabe
        8. HTRACE-214.001.patch
          127 kB
          Colin McCabe

        Issue Links

          Activity

            People

              cmccabe Colin McCabe
              cmccabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: