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 class
TraceSpan.Builder
A span represents a single timed event within a trace.static class
TraceSpan.SpanKind
Type 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 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
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
containsLabels(String key)
Collection of labels associated with the span.boolean
equals(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.Map<String,String>
getLabels()
Deprecated.int
getLabelsCount()
Collection of labels associated with the span.Map<String,String>
getLabelsMap()
Collection of labels associated with the span.String
getLabelsOrDefault(String key, String defaultValue)
Collection of labels associated with the span.String
getLabelsOrThrow(String key)
Collection of labels associated with the span.String
getName()
Name of the span.com.google.protobuf.ByteString
getNameBytes()
Name of the span.long
getParentSpanId()
Optional.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.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)
protected Object
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
static TraceSpan
parseDelimitedFrom(InputStream input)
static TraceSpan
parseDelimitedFrom(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(InputStream input)
static TraceSpan
parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static TraceSpan
parseFrom(ByteBuffer data)
static TraceSpan
parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser<TraceSpan>
parser()
TraceSpan.Builder
toBuilder()
void
writeTo(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:
newInstance
in classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetMapField
protected com.google.protobuf.MapField internalGetMapField(int number)
- Overrides:
internalGetMapField
in classcom.google.protobuf.GeneratedMessageV3
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTable
in 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:
getSpanId
in 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:
getKindValue
in 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:
getKind
in 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:
getName
in 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:
getNameBytes
in 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:
hasStartTime
in 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:
getStartTime
in 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:
getStartTimeOrBuilder
in interfaceTraceSpanOrBuilder
-
hasEndTime
public boolean hasEndTime()
End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;
- Specified by:
hasEndTime
in 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:
getEndTime
in 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:
getEndTimeOrBuilder
in 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:
getParentSpanId
in interfaceTraceSpanOrBuilder
- Returns:
- The parentSpanId.
-
getLabelsCount
public int getLabelsCount()
Description copied from interface:TraceSpanOrBuilder
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:
getLabelsCount
in 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:
containsLabels
in interfaceTraceSpanOrBuilder
-
getLabels
@Deprecated public Map<String,String> getLabels()
Deprecated.UsegetLabelsMap()
instead.- Specified by:
getLabels
in 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:
getLabelsMap
in 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:
getLabelsOrDefault
in 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:
getLabelsOrThrow
in interfaceTraceSpanOrBuilder
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessageV3
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in 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:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in 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:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected TraceSpan.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForType
in 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:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public TraceSpan getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
-