Skip to content
  • Quang-Minh Nguyen's avatar
    feat: implement tracing sampling status checker · 52e6553e
    Quang-Minh Nguyen authored
    Most implementations support checking this status. Unfortunately, we hide the
    tracing implementations behind unified opentracing interfaces. The single
    input is an opentracing.Span interface. As a result, we need to type-cast it
    back to all supported implementations.
    
    This status is particularly useful when a span is not free to collect, or
    has to turn on some special configs. One example is Git Trace2. It's a
    built-in observability tool that provides a deeper look into Git processes.
    Enabling this feature is not expensive, but not cheap either. We don't want
    to enable it for all Git processes. So, it makes sense to collect such data
    when the parent span is sampled.
    
    Some implementations follow opentracing. Labkit doesn't need to convert.
    Some others, such as stackdriver, implement opentracing wrappers. Those
    wrappers are internal, and conditional built when receiving corresponding
    build tag. As a result, such wrappers are not available for casting in
    the checker. To overcome this, the context wrappers must implement a simple
    samplingChecker interface.
    
    Changelog: added
    Issue: gitaly#4805
    52e6553e