public final class TraceSpan extends com.google.protobuf.GeneratedMessageV3 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 | Class and Description |
|---|---|
static class |
TraceSpan.Builder
A span represents a single timed event within a trace.
|
static class |
TraceSpan.SpanKind
Type of span.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
END_TIME_FIELD_NUMBER |
static int |
KIND_FIELD_NUMBER |
static int |
LABELS_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
PARENT_SPAN_ID_FIELD_NUMBER |
static int |
SPAN_ID_FIELD_NUMBER |
static int |
START_TIME_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsLabels(java.lang.String key)
Collection of labels associated with the span.
|
boolean |
equals(java.lang.Object obj) |
static TraceSpan |
getDefaultInstance() |
TraceSpan |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Timestamp |
getEndTime()
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.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.
|
com.google.protobuf.Parser<TraceSpan> |
getParserForType() |
int |
getSerializedSize() |
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.TimestampOrBuilder |
getStartTimeOrBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
boolean |
hasEndTime()
End time of the span in nanoseconds from the UNIX epoch.
|
int |
hashCode() |
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) |
boolean |
isInitialized() |
static TraceSpan.Builder |
newBuilder() |
static TraceSpan.Builder |
newBuilder(TraceSpan prototype) |
TraceSpan.Builder |
newBuilderForType() |
protected TraceSpan.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static TraceSpan |
parseDelimitedFrom(java.io.InputStream input) |
static TraceSpan |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(byte[] data) |
static TraceSpan |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(com.google.protobuf.ByteString data) |
static TraceSpan |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(com.google.protobuf.CodedInputStream input) |
static TraceSpan |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(java.io.InputStream input) |
static TraceSpan |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<TraceSpan> |
parser() |
TraceSpan.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int SPAN_ID_FIELD_NUMBER
public static final int KIND_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
public static final int START_TIME_FIELD_NUMBER
public static final int END_TIME_FIELD_NUMBER
public static final int PARENT_SPAN_ID_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.MapField internalGetMapField(int number)
internalGetMapField in class com.google.protobuf.GeneratedMessageV3protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public long getSpanId()
Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.
fixed64 span_id = 1;getSpanId in interface TraceSpanOrBuilderpublic 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.
.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;getKindValue in interface TraceSpanOrBuilderpublic 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.
.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;getKind in interface TraceSpanOrBuilderpublic 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.
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.
string name = 3;getNameBytes in interface TraceSpanOrBuilderpublic boolean hasStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
.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.
.google.protobuf.Timestamp start_time = 4;getStartTime in interface TraceSpanOrBuilderpublic com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;getStartTimeOrBuilder in interface TraceSpanOrBuilderpublic boolean hasEndTime()
End time of the span in nanoseconds from the UNIX epoch.
.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.
.google.protobuf.Timestamp end_time = 5;getEndTime in interface TraceSpanOrBuilderpublic com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder()
End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;getEndTimeOrBuilder in interface TraceSpanOrBuilderpublic long getParentSpanId()
ID of the parent span, if any. Optional.
fixed64 parent_span_id = 6;getParentSpanId in interface TraceSpanOrBuilderpublic 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 final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static TraceSpan parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic TraceSpan.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static TraceSpan.Builder newBuilder()
public static TraceSpan.Builder newBuilder(TraceSpan prototype)
public TraceSpan.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected TraceSpan.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static TraceSpan getDefaultInstance()
public static com.google.protobuf.Parser<TraceSpan> parser()
public com.google.protobuf.Parser<TraceSpan> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public TraceSpan getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder