Class CensusHttpModule


  • public final class CensusHttpModule
    extends Object
    Provides utilities for Open Census to record http stats/trace information and propagate tracing context.
    • Constructor Detail

      • CensusHttpModule

        public CensusHttpModule​(io.opencensus.trace.Tracer tracer,
                                boolean isRecordEvents)
        Creates a CensusHttpModule with given parameters.
        Parameters:
        tracer - the OpenCensus Tracer.
        isRecordEvents - whether spans are stored locally.
    • Method Detail

      • getTracer

        public io.opencensus.trace.Tracer getTracer()
        Returns the tracing component of OpenCensus.
        Returns:
        the tracing component of OpenCensus.
      • isRecordEvents

        public boolean isRecordEvents()
        Returns whether spans are stored locally.
        Returns:
        whether spans are stored locally.
      • getHttpRequestInitializer

        public com.google.api.client.http.HttpRequestInitializer getHttpRequestInitializer​(com.google.api.client.http.HttpRequestInitializer initializer)
        Returns the HttpExecuteInterceptor used when initializing the HttpRequest.
        Parameters:
        initializer - the original initializer which will be executed before this initializer.
        Returns:
        the HttpExecuteInterceptor.