public static final class TraceSpan.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder> implements TraceSpanOrBuilder
A span represents a single timed event within a trace. Spans can be nested and form a trace tree. Often, a trace contains a root span that describes the end-to-end latency of an operation and, optionally, one or more subspans for its suboperations. Spans do not need to be contiguous. There may be gaps between spans in a trace.Protobuf type
google.devtools.cloudtrace.v1.TraceSpan| Modifier and Type | Method and Description |
|---|---|
TraceSpan.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) |
TraceSpan |
build() |
TraceSpan |
buildPartial() |
TraceSpan.Builder |
clear() |
TraceSpan.Builder |
clearEndTime()
End time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
TraceSpan.Builder |
clearKind()
Distinguishes between spans generated in a particular context.
|
TraceSpan.Builder |
clearLabels() |
TraceSpan.Builder |
clearName()
Name of the trace.
|
TraceSpan.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
TraceSpan.Builder |
clearParentSpanId()
ID of the parent span, if any.
|
TraceSpan.Builder |
clearSpanId()
Identifier for the span.
|
TraceSpan.Builder |
clearStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
clone() |
boolean |
containsLabels(java.lang.String key)
Collection of labels associated with the span.
|
TraceSpan |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
com.google.protobuf.Timestamp |
getEndTime()
End time of the span in nanoseconds from the UNIX epoch.
|
com.google.protobuf.Timestamp.Builder |
getEndTimeBuilder()
End time of the span in nanoseconds from the UNIX epoch.
|
com.google.protobuf.TimestampOrBuilder |
getEndTimeOrBuilder()
End time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.SpanKind |
getKind()
Distinguishes between spans generated in a particular context.
|
int |
getKindValue()
Distinguishes between spans generated in a particular context.
|
java.util.Map<java.lang.String,java.lang.String> |
getLabels()
Deprecated.
|
int |
getLabelsCount()
Collection of labels associated with the span.
|
java.util.Map<java.lang.String,java.lang.String> |
getLabelsMap()
Collection of labels associated with the span.
|
java.lang.String |
getLabelsOrDefault(java.lang.String key,
java.lang.String defaultValue)
Collection of labels associated with the span.
|
java.lang.String |
getLabelsOrThrow(java.lang.String key)
Collection of labels associated with the span.
|
java.util.Map<java.lang.String,java.lang.String> |
getMutableLabels()
Deprecated.
|
java.lang.String |
getName()
Name of the trace.
|
com.google.protobuf.ByteString |
getNameBytes()
Name of the trace.
|
long |
getParentSpanId()
ID of the parent span, if any.
|
long |
getSpanId()
Identifier for the span.
|
com.google.protobuf.Timestamp |
getStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
|
com.google.protobuf.Timestamp.Builder |
getStartTimeBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
|
com.google.protobuf.TimestampOrBuilder |
getStartTimeOrBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
|
boolean |
hasEndTime()
End time of the span in nanoseconds from the UNIX epoch.
|
boolean |
hasStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
protected com.google.protobuf.MapField |
internalGetMutableMapField(int number) |
boolean |
isInitialized() |
TraceSpan.Builder |
mergeEndTime(com.google.protobuf.Timestamp value)
End time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
TraceSpan.Builder |
mergeFrom(com.google.protobuf.Message other) |
TraceSpan.Builder |
mergeFrom(TraceSpan other) |
TraceSpan.Builder |
mergeStartTime(com.google.protobuf.Timestamp value)
Start time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
TraceSpan.Builder |
putAllLabels(java.util.Map<java.lang.String,java.lang.String> values)
Collection of labels associated with the span.
|
TraceSpan.Builder |
putLabels(java.lang.String key,
java.lang.String value)
Collection of labels associated with the span.
|
TraceSpan.Builder |
removeLabels(java.lang.String key)
Collection of labels associated with the span.
|
TraceSpan.Builder |
setEndTime(com.google.protobuf.Timestamp.Builder builderForValue)
End time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
setEndTime(com.google.protobuf.Timestamp value)
End time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) |
TraceSpan.Builder |
setKind(TraceSpan.SpanKind value)
Distinguishes between spans generated in a particular context.
|
TraceSpan.Builder |
setKindValue(int value)
Distinguishes between spans generated in a particular context.
|
TraceSpan.Builder |
setName(java.lang.String value)
Name of the trace.
|
TraceSpan.Builder |
setNameBytes(com.google.protobuf.ByteString value)
Name of the trace.
|
TraceSpan.Builder |
setParentSpanId(long value)
ID of the parent span, if any.
|
TraceSpan.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) |
TraceSpan.Builder |
setSpanId(long value)
Identifier for the span.
|
TraceSpan.Builder |
setStartTime(com.google.protobuf.Timestamp.Builder builderForValue)
Start time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
setStartTime(com.google.protobuf.Timestamp value)
Start time of the span in nanoseconds from the UNIX epoch.
|
TraceSpan.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, isClean, markClean, newBuilderForField, onBuilt, onChanged, parseUnknownFieldfindInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapField internalGetMapField(int number)
internalGetMapField in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>protected com.google.protobuf.MapField internalGetMutableMapField(int number)
internalGetMutableMapField in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic TraceSpan build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic TraceSpan buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic TraceSpan.Builder clone()
clone in interface com.google.protobuf.Message.Builderclone in interface com.google.protobuf.MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
setField in interface com.google.protobuf.Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField in interface com.google.protobuf.Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof in interface com.google.protobuf.Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)
setRepeatedField in interface com.google.protobuf.Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)
addRepeatedField in interface com.google.protobuf.Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<TraceSpan.Builder>public TraceSpan.Builder mergeFrom(TraceSpan other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public TraceSpan.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<TraceSpan.Builder>java.io.IOExceptionpublic long getSpanId()
Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.
optional fixed64 span_id = 1;getSpanId in interface TraceSpanOrBuilderpublic TraceSpan.Builder setSpanId(long value)
Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.
optional fixed64 span_id = 1;public TraceSpan.Builder clearSpanId()
Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.
optional fixed64 span_id = 1;public int getKindValue()
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated with the span.
optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;getKindValue in interface TraceSpanOrBuilderpublic TraceSpan.Builder setKindValue(int value)
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated with the span.
optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;public TraceSpan.SpanKind getKind()
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated with the span.
optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;getKind in interface TraceSpanOrBuilderpublic TraceSpan.Builder setKind(TraceSpan.SpanKind value)
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated with the span.
optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;public TraceSpan.Builder clearKind()
Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated with the span.
optional .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;public java.lang.String getName()
Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.
optional string name = 3;getName in interface TraceSpanOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.
optional string name = 3;getNameBytes in interface TraceSpanOrBuilderpublic TraceSpan.Builder setName(java.lang.String value)
Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.
optional string name = 3;public TraceSpan.Builder clearName()
Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.
optional string name = 3;public TraceSpan.Builder setNameBytes(com.google.protobuf.ByteString value)
Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.
optional string name = 3;public boolean hasStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;hasStartTime in interface TraceSpanOrBuilderpublic com.google.protobuf.Timestamp getStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;getStartTime in interface TraceSpanOrBuilderpublic TraceSpan.Builder setStartTime(com.google.protobuf.Timestamp value)
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;public TraceSpan.Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue)
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;public TraceSpan.Builder mergeStartTime(com.google.protobuf.Timestamp value)
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;public TraceSpan.Builder clearStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;public com.google.protobuf.Timestamp.Builder getStartTimeBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp start_time = 4;getStartTimeOrBuilder in interface TraceSpanOrBuilderpublic boolean hasEndTime()
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;hasEndTime in interface TraceSpanOrBuilderpublic com.google.protobuf.Timestamp getEndTime()
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;getEndTime in interface TraceSpanOrBuilderpublic TraceSpan.Builder setEndTime(com.google.protobuf.Timestamp value)
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;public TraceSpan.Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue)
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;public TraceSpan.Builder mergeEndTime(com.google.protobuf.Timestamp value)
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;public TraceSpan.Builder clearEndTime()
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;public com.google.protobuf.Timestamp.Builder getEndTimeBuilder()
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder()
End time of the span in nanoseconds from the UNIX epoch.
optional .google.protobuf.Timestamp end_time = 5;getEndTimeOrBuilder in interface TraceSpanOrBuilderpublic long getParentSpanId()
ID of the parent span, if any. Optional.
optional fixed64 parent_span_id = 6;getParentSpanId in interface TraceSpanOrBuilderpublic TraceSpan.Builder setParentSpanId(long value)
ID of the parent span, if any. Optional.
optional fixed64 parent_span_id = 6;public TraceSpan.Builder clearParentSpanId()
ID of the parent span, if any. Optional.
optional fixed64 parent_span_id = 6;public int getLabelsCount()
TraceSpanOrBuilderCollection of labels associated with the span.
map<string, string> labels = 7;getLabelsCount in interface TraceSpanOrBuilderpublic boolean containsLabels(java.lang.String key)
Collection of labels associated with the span.
map<string, string> labels = 7;containsLabels in interface TraceSpanOrBuilder@Deprecated public java.util.Map<java.lang.String,java.lang.String> getLabels()
getLabelsMap() instead.getLabels in interface TraceSpanOrBuilderpublic java.util.Map<java.lang.String,java.lang.String> getLabelsMap()
Collection of labels associated with the span.
map<string, string> labels = 7;getLabelsMap in interface TraceSpanOrBuilderpublic java.lang.String getLabelsOrDefault(java.lang.String key,
java.lang.String defaultValue)
Collection of labels associated with the span.
map<string, string> labels = 7;getLabelsOrDefault in interface TraceSpanOrBuilderpublic java.lang.String getLabelsOrThrow(java.lang.String key)
Collection of labels associated with the span.
map<string, string> labels = 7;getLabelsOrThrow in interface TraceSpanOrBuilderpublic TraceSpan.Builder clearLabels()
public TraceSpan.Builder removeLabels(java.lang.String key)
Collection of labels associated with the span.
map<string, string> labels = 7;@Deprecated public java.util.Map<java.lang.String,java.lang.String> getMutableLabels()
public TraceSpan.Builder putLabels(java.lang.String key, java.lang.String value)
Collection of labels associated with the span.
map<string, string> labels = 7;public TraceSpan.Builder putAllLabels(java.util.Map<java.lang.String,java.lang.String> values)
Collection of labels associated with the span.
map<string, string> labels = 7;public final TraceSpan.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields in interface com.google.protobuf.Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>public final TraceSpan.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields in interface com.google.protobuf.Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TraceSpan.Builder>