Class TraceSpan
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.devtools.cloudtrace.v1.TraceSpan
- All Implemented Interfaces:
TraceSpanOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
@Generated
public final class TraceSpan
extends com.google.protobuf.GeneratedMessage
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA span represents a single timed event within a trace.static enumType of span.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage
com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message, T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage
com.google.protobuf.AbstractMessage.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsLabels(String key) Collection of labels associated with the span.booleanstatic TraceSpanstatic final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.TimestampEnd time of the span in nanoseconds from the UNIX epoch.com.google.protobuf.TimestampOrBuilderEnd time of the span in nanoseconds from the UNIX epoch.getKind()Distinguishes between spans generated in a particular context.intDistinguishes between spans generated in a particular context.Deprecated.intCollection of labels associated with the span.Collection of labels associated with the span.getLabelsOrDefault(String key, String defaultValue) Collection of labels associated with the span.getLabelsOrThrow(String key) Collection of labels associated with the span.getName()Name of the span.com.google.protobuf.ByteStringName of the span.longOptional.com.google.protobuf.Parser<TraceSpan>intlongIdentifier for the span.com.google.protobuf.TimestampStart time of the span in nanoseconds from the UNIX epoch.com.google.protobuf.TimestampOrBuilderStart time of the span in nanoseconds from the UNIX epoch.booleanEnd time of the span in nanoseconds from the UNIX epoch.inthashCode()booleanStart time of the span in nanoseconds from the UNIX epoch.protected com.google.protobuf.GeneratedMessage.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) final booleanstatic TraceSpan.Builderstatic TraceSpan.BuildernewBuilder(TraceSpan prototype) protected TraceSpan.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) static TraceSpanparseDelimitedFrom(InputStream input) static TraceSpanparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TraceSpanparseFrom(byte[] data) static TraceSpanparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TraceSpanparseFrom(com.google.protobuf.ByteString data) static TraceSpanparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TraceSpanparseFrom(com.google.protobuf.CodedInputStream input) static TraceSpanparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TraceSpanparseFrom(InputStream input) static TraceSpanparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static TraceSpanparseFrom(ByteBuffer data) static TraceSpanparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<TraceSpan>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessage
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
SPAN_ID_FIELD_NUMBER
public static final int SPAN_ID_FIELD_NUMBER- See Also:
-
KIND_FIELD_NUMBER
public static final int KIND_FIELD_NUMBER- See Also:
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
START_TIME_FIELD_NUMBER
public static final int START_TIME_FIELD_NUMBER- See Also:
-
END_TIME_FIELD_NUMBER
public static final int END_TIME_FIELD_NUMBER- See Also:
-
PARENT_SPAN_ID_FIELD_NUMBER
public static final int PARENT_SPAN_ID_FIELD_NUMBER- See Also:
-
LABELS_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER- See Also:
-
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessage
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage
-
getSpanId
public long getSpanId()Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace. For example, `2205310701640571284`.
fixed64 span_id = 1;- Specified by:
getSpanIdin interfaceTraceSpanOrBuilder- Returns:
- The spanId.
-
getKindValue
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.
.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;- Specified by:
getKindValuein interfaceTraceSpanOrBuilder- Returns:
- The enum numeric value on the wire for kind.
-
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;- Specified by:
getKindin interfaceTraceSpanOrBuilder- Returns:
- The kind.
-
getName
Name of the span. Must be less than 128 bytes. The span name is sanitized and displayed in the Stackdriver Trace tool in the Google Cloud Platform 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;- Specified by:
getNamein interfaceTraceSpanOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()Name of the span. Must be less than 128 bytes. The span name is sanitized and displayed in the Stackdriver Trace tool in the Google Cloud Platform 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;- Specified by:
getNameBytesin interfaceTraceSpanOrBuilder- Returns:
- The bytes for name.
-
hasStartTime
public boolean hasStartTime()Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;- Specified by:
hasStartTimein interfaceTraceSpanOrBuilder- Returns:
- Whether the startTime field is set.
-
getStartTime
public com.google.protobuf.Timestamp getStartTime()Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;- Specified by:
getStartTimein interfaceTraceSpanOrBuilder- Returns:
- The startTime.
-
getStartTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder()Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;- Specified by:
getStartTimeOrBuilderin interfaceTraceSpanOrBuilder
-
hasEndTime
public boolean hasEndTime()End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;- Specified by:
hasEndTimein interfaceTraceSpanOrBuilder- Returns:
- Whether the endTime field is set.
-
getEndTime
public com.google.protobuf.Timestamp getEndTime()End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;- Specified by:
getEndTimein interfaceTraceSpanOrBuilder- Returns:
- The endTime.
-
getEndTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder()End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;- Specified by:
getEndTimeOrBuilderin interfaceTraceSpanOrBuilder
-
getParentSpanId
public long getParentSpanId()Optional. ID of the parent span, if any.
fixed64 parent_span_id = 6 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getParentSpanIdin interfaceTraceSpanOrBuilder- Returns:
- The parentSpanId.
-
getLabelsCount
public int getLabelsCount()Description copied from interface:TraceSpanOrBuilderCollection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 kilobytes (10MB for `/stacktrace` values). Some predefined label keys exist, or you may create your own. When creating your own, we recommend the following formats: * `/category/product/key` for agents of well-known products (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` * `/component` * `/error/message` * `/error/name` * `/http/client_city` * `/http/client_country` * `/http/client_protocol` * `/http/client_region` * `/http/host` * `/http/method` * `/http/path` * `/http/redirected_url` * `/http/request/size` * `/http/response/size` * `/http/route` * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid`
map<string, string> labels = 7;- Specified by:
getLabelsCountin interfaceTraceSpanOrBuilder
-
containsLabels
Collection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 kilobytes (10MB for `/stacktrace` values). Some predefined label keys exist, or you may create your own. When creating your own, we recommend the following formats: * `/category/product/key` for agents of well-known products (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` * `/component` * `/error/message` * `/error/name` * `/http/client_city` * `/http/client_country` * `/http/client_protocol` * `/http/client_region` * `/http/host` * `/http/method` * `/http/path` * `/http/redirected_url` * `/http/request/size` * `/http/response/size` * `/http/route` * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid`
map<string, string> labels = 7;- Specified by:
containsLabelsin interfaceTraceSpanOrBuilder
-
getLabels
Deprecated.UsegetLabelsMap()instead.- Specified by:
getLabelsin interfaceTraceSpanOrBuilder
-
getLabelsMap
Collection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 kilobytes (10MB for `/stacktrace` values). Some predefined label keys exist, or you may create your own. When creating your own, we recommend the following formats: * `/category/product/key` for agents of well-known products (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` * `/component` * `/error/message` * `/error/name` * `/http/client_city` * `/http/client_country` * `/http/client_protocol` * `/http/client_region` * `/http/host` * `/http/method` * `/http/path` * `/http/redirected_url` * `/http/request/size` * `/http/response/size` * `/http/route` * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid`
map<string, string> labels = 7;- Specified by:
getLabelsMapin interfaceTraceSpanOrBuilder
-
getLabelsOrDefault
Collection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 kilobytes (10MB for `/stacktrace` values). Some predefined label keys exist, or you may create your own. When creating your own, we recommend the following formats: * `/category/product/key` for agents of well-known products (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` * `/component` * `/error/message` * `/error/name` * `/http/client_city` * `/http/client_country` * `/http/client_protocol` * `/http/client_region` * `/http/host` * `/http/method` * `/http/path` * `/http/redirected_url` * `/http/request/size` * `/http/response/size` * `/http/route` * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid`
map<string, string> labels = 7;- Specified by:
getLabelsOrDefaultin interfaceTraceSpanOrBuilder
-
getLabelsOrThrow
Collection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 kilobytes (10MB for `/stacktrace` values). Some predefined label keys exist, or you may create your own. When creating your own, we recommend the following formats: * `/category/product/key` for agents of well-known products (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` * `/component` * `/error/message` * `/error/name` * `/http/client_city` * `/http/client_country` * `/http/client_protocol` * `/http/client_region` * `/http/host` * `/http/method` * `/http/path` * `/http/redirected_url` * `/http/request/size` * `/http/response/size` * `/http/route` * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid`
map<string, string> labels = 7;- Specified by:
getLabelsOrThrowin interfaceTraceSpanOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static TraceSpan parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TraceSpan parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TraceSpan parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TraceSpan parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TraceSpan parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static TraceSpan parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static TraceSpan parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static TraceSpan parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static TraceSpan parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected TraceSpan.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-