Class CensusHttpModule (2.47.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
Name Description
tracer io.opencensus.trace.Tracer

the OpenCensus Tracer.

isRecordEvents boolean

whether spans are stored locally.

Methods

getHttpRequestInitializer(HttpRequestInitializer initializer)

public HttpRequestInitializer getHttpRequestInitializer(HttpRequestInitializer initializer)

Returns the HttpExecuteInterceptor used when initializing the HttpRequest.

Parameter
Name Description
initializer com.google.api.client.http.HttpRequestInitializer

the original initializer which will be executed before this initializer.

Returns
Type Description
com.google.api.client.http.HttpRequestInitializer

the HttpExecuteInterceptor.

getTracer()

public Tracer getTracer()

Returns the tracing component of OpenCensus.

Returns
Type Description
io.opencensus.trace.Tracer

the tracing component of OpenCensus.

isRecordEvents()

public boolean isRecordEvents()

Returns whether spans are stored locally.

Returns
Type Description
boolean

whether spans are stored locally.