Class CensusHttpModule (2.31.0)

public final class CensusHttpModule

Provides utilities for Open Census to record http stats/trace information and propagate tracing context.

Inheritance

java.lang.Object > CensusHttpModule

Constructors

CensusHttpModule(Tracer tracer, boolean isRecordEvents)

public CensusHttpModule(Tracer tracer, boolean isRecordEvents)

Creates a CensusHttpModule with given parameters.

Parameters
NameDescription
tracerio.opencensus.trace.Tracer

the OpenCensus Tracer.

isRecordEventsboolean

whether spans are stored locally.

Methods

getHttpRequestInitializer(HttpRequestInitializer initializer)

public HttpRequestInitializer getHttpRequestInitializer(HttpRequestInitializer initializer)

Returns the HttpExecuteInterceptor used when initializing the HttpRequest.

Parameter
NameDescription
initializercom.google.api.client.http.HttpRequestInitializer

the original initializer which will be executed before this initializer.

Returns
TypeDescription
com.google.api.client.http.HttpRequestInitializer

the HttpExecuteInterceptor.

getTracer()

public Tracer getTracer()

Returns the tracing component of OpenCensus.

Returns
TypeDescription
io.opencensus.trace.Tracer

the tracing component of OpenCensus.

isRecordEvents()

public boolean isRecordEvents()

Returns whether spans are stored locally.

Returns
TypeDescription
boolean

whether spans are stored locally.