Class TraceSpan
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- 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
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 typegoogle.devtools.cloudtrace.v1.TraceSpan- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTraceSpan.BuilderA span represents a single timed event within a trace.static classTraceSpan.SpanKindType of span.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static intEND_TIME_FIELD_NUMBERstatic intKIND_FIELD_NUMBERstatic intLABELS_FIELD_NUMBERstatic intNAME_FIELD_NUMBERstatic intPARENT_SPAN_ID_FIELD_NUMBERstatic intSPAN_ID_FIELD_NUMBERstatic intSTART_TIME_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancontainsLabels(String key)Collection of labels associated with the span.booleanequals(Object obj)static TraceSpangetDefaultInstance()TraceSpangetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()com.google.protobuf.TimestampgetEndTime()End time of the span in nanoseconds from the UNIX epoch.com.google.protobuf.TimestampOrBuildergetEndTimeOrBuilder()End time of the span in nanoseconds from the UNIX epoch.TraceSpan.SpanKindgetKind()Distinguishes between spans generated in a particular context.intgetKindValue()Distinguishes between spans generated in a particular context.Map<String,String>getLabels()Deprecated.intgetLabelsCount()Collection of labels associated with the span.Map<String,String>getLabelsMap()Collection of labels associated with the span.StringgetLabelsOrDefault(String key, String defaultValue)Collection of labels associated with the span.StringgetLabelsOrThrow(String key)Collection of labels associated with the span.StringgetName()Name of the span.com.google.protobuf.ByteStringgetNameBytes()Name of the span.longgetParentSpanId()Optional.com.google.protobuf.Parser<TraceSpan>getParserForType()intgetSerializedSize()longgetSpanId()Identifier for the span.com.google.protobuf.TimestampgetStartTime()Start time of the span in nanoseconds from the UNIX epoch.com.google.protobuf.TimestampOrBuildergetStartTimeOrBuilder()Start time of the span in nanoseconds from the UNIX epoch.booleanhasEndTime()End time of the span in nanoseconds from the UNIX epoch.inthashCode()booleanhasStartTime()Start time of the span in nanoseconds from the UNIX epoch.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()protected com.google.protobuf.MapFieldinternalGetMapField(int number)booleanisInitialized()static TraceSpan.BuildernewBuilder()static TraceSpan.BuildernewBuilder(TraceSpan prototype)TraceSpan.BuildernewBuilderForType()protected TraceSpan.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)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()TraceSpan.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
SPAN_ID_FIELD_NUMBER
public static final int SPAN_ID_FIELD_NUMBER
- See Also:
- Constant Field Values
-
KIND_FIELD_NUMBER
public static final int KIND_FIELD_NUMBER
- See Also:
- Constant Field Values
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
START_TIME_FIELD_NUMBER
public static final int START_TIME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
END_TIME_FIELD_NUMBER
public static final int END_TIME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
PARENT_SPAN_ID_FIELD_NUMBER
public static final int PARENT_SPAN_ID_FIELD_NUMBER
- See Also:
- Constant Field Values
-
LABELS_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetMapField
protected com.google.protobuf.MapField internalGetMapField(int number)
- Overrides:
internalGetMapFieldin classcom.google.protobuf.GeneratedMessageV3
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
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
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.
.google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;- Specified by:
getKindin interfaceTraceSpanOrBuilder- Returns:
- The kind.
-
getName
public String 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
public boolean containsLabels(String key)
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 public Map<String,String> getLabels()
Deprecated.UsegetLabelsMap()instead.- Specified by:
getLabelsin interfaceTraceSpanOrBuilder
-
getLabelsMap
public Map<String,String> 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
public String getLabelsOrDefault(String key, String defaultValue)
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
public String getLabelsOrThrow(String key)
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.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- 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
public static TraceSpan parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static TraceSpan parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static TraceSpan parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static TraceSpan parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static TraceSpan parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static TraceSpan parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public TraceSpan.Builder newBuilderForType()
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static TraceSpan.Builder newBuilder()
-
newBuilder
public static TraceSpan.Builder newBuilder(TraceSpan prototype)
-
toBuilder
public TraceSpan.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected TraceSpan.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static TraceSpan getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<TraceSpan> parser()
-
getParserForType
public com.google.protobuf.Parser<TraceSpan> getParserForType()
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public TraceSpan getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-