Modifier and Type | Field and Description |
---|---|
static String |
SPAN_NAME_HTTP_REQUEST_EXECUTE
Span name for tracing
HttpRequest.execute() . |
Modifier and Type | Method and Description |
---|---|
static io.opencensus.trace.EndSpanOptions |
getEndSpanOptions(Integer statusCode)
Returns an
EndSpanOptions to end a http span according to the status code. |
static io.opencensus.trace.Tracer |
getTracer()
Returns the tracing component of OpenCensus.
|
static boolean |
isRecordEvent()
Returns whether spans should be recorded locally.
|
static void |
propagateTracingContext(io.opencensus.trace.Span span,
HttpHeaders headers)
Propagate information of current tracing context.
|
static void |
recordReceivedMessageEvent(io.opencensus.trace.Span span,
long size)
Records a new message event which contains the size of the response content.
|
static void |
recordSentMessageEvent(io.opencensus.trace.Span span,
long size)
Records a new message event which contains the size of the request content.
|
static void |
setIsRecordEvent(boolean recordEvent)
Sets whether spans should be recorded locally.
|
static void |
setPropagationTextFormat(io.opencensus.trace.propagation.TextFormat textFormat)
Sets the
TextFormat used in context propagation. |
static void |
setPropagationTextFormatSetter(io.opencensus.trace.propagation.TextFormat.Setter textFormatSetter)
Sets the
TextFormat.Setter used in context propagation. |
public static final String SPAN_NAME_HTTP_REQUEST_EXECUTE
HttpRequest.execute()
.public static void setPropagationTextFormat(@Nullable io.opencensus.trace.propagation.TextFormat textFormat)
TextFormat
used in context propagation.
This API allows users of google-http-client to specify other text format, or disable context
propagation by setting it to null
. It should be used along with setPropagationTextFormatSetter(io.opencensus.trace.propagation.TextFormat.Setter)
for setting purpose.
textFormat
- the text format.public static void setPropagationTextFormatSetter(@Nullable io.opencensus.trace.propagation.TextFormat.Setter textFormatSetter)
TextFormat.Setter
used in context propagation.
This API allows users of google-http-client to specify other text format setter, or disable
context propagation by setting it to null
. It should be used along with setPropagationTextFormat(io.opencensus.trace.propagation.TextFormat)
for setting purpose.
textFormatSetter
- the TextFormat.Setter
for the text format.public static void setIsRecordEvent(boolean recordEvent)
This API allows users of google-http-client to turn on/off local span collection.
recordEvent
- record span locally if true.public static io.opencensus.trace.Tracer getTracer()
public static boolean isRecordEvent()
public static void propagateTracingContext(io.opencensus.trace.Span span, HttpHeaders headers)
span
- the span to be propagated.headers
- the headers used in propagation.public static io.opencensus.trace.EndSpanOptions getEndSpanOptions(@Nullable Integer statusCode)
EndSpanOptions
to end a http span according to the status code.statusCode
- the status code, can be null to represent no valid response is returned.EndSpanOptions
that best suits the status code.public static void recordSentMessageEvent(io.opencensus.trace.Span span, long size)
span
- The span
in which the send event occurs.size
- Size of the request.public static void recordReceivedMessageEvent(io.opencensus.trace.Span span, long size)
span
- The span
in which the receive event occurs.size
- Size of the response.Copyright © 2011–2022 Google. All rights reserved.