Class OpencensusTracerFactory

java.lang.Object
com.google.api.gax.tracing.BaseApiTracerFactory
com.google.api.gax.tracing.OpencensusTracerFactory
All Implemented Interfaces:
ApiTracerFactory

@InternalApi("For google-cloud-java client use only") public final class OpencensusTracerFactory extends BaseApiTracerFactory
A ApiTracerFactory to build instances of OpencensusTracer.

This class wraps the Tracer provided by Opencensus in Tracing.getTracer(). It will be used to create new spans and wrap them in OpencensusTracer defined in gax.

This class is thread safe.

  • Constructor Details

    • OpencensusTracerFactory

      public OpencensusTracerFactory()
      Instantiates a new instance capturing the Tracer in Tracing.getTracer.
    • OpencensusTracerFactory

      public OpencensusTracerFactory(Map<String,String> spanAttributes)
      Instantiates a new instance capturing the Tracer in Tracing.getTracer. It will also override the service name of the grpc stub with a custom client name. This is useful disambiguate spans created outer manual written wrappers and around generated gapic spans.
      Parameters:
      spanAttributes - the attributes to stamp on every span. Should include things like library version.
  • Method Details