public final class TraceSpan extends 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.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, 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 |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
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 Descriptors.Descriptor |
getDescriptor() |
Timestamp |
getEndTime()
End time of the span in nanoseconds from the UNIX epoch.
|
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 span.
|
ByteString |
getNameBytes()
Name of the span.
|
long |
getParentSpanId()
ID of the parent span, if any.
|
Parser<TraceSpan> |
getParserForType() |
int |
getSerializedSize() |
long |
getSpanId()
Identifier for the span.
|
Timestamp |
getStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
|
TimestampOrBuilder |
getStartTimeOrBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
|
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 GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected MapField |
internalGetMapField(int number) |
boolean |
isInitialized() |
static TraceSpan.Builder |
newBuilder() |
static TraceSpan.Builder |
newBuilder(TraceSpan prototype) |
TraceSpan.Builder |
newBuilderForType() |
protected TraceSpan.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
static TraceSpan |
parseDelimitedFrom(java.io.InputStream input) |
static TraceSpan |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(byte[] data) |
static TraceSpan |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(java.nio.ByteBuffer data) |
static TraceSpan |
parseFrom(java.nio.ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(ByteString data) |
static TraceSpan |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(CodedInputStream input) |
static TraceSpan |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static TraceSpan |
parseFrom(java.io.InputStream input) |
static TraceSpan |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<TraceSpan> |
parser() |
TraceSpan.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, makeExtensionsImmutable, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
public 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 UnknownFieldSet getUnknownFields()
getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected MapField internalGetMapField(int number)
internalGetMapField
in class GeneratedMessageV3
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public 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 TraceSpanOrBuilder
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;
getKindValue
in interface TraceSpanOrBuilder
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;
getKind
in interface TraceSpanOrBuilder
public java.lang.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 {% dynamic print site_values.console_name %}. 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 TraceSpanOrBuilder
public 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 {% dynamic print site_values.console_name %}. 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 TraceSpanOrBuilder
public boolean hasStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;
hasStartTime
in interface TraceSpanOrBuilder
public Timestamp getStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;
getStartTime
in interface TraceSpanOrBuilder
public TimestampOrBuilder getStartTimeOrBuilder()
Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;
getStartTimeOrBuilder
in interface TraceSpanOrBuilder
public boolean hasEndTime()
End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;
hasEndTime
in interface TraceSpanOrBuilder
public Timestamp getEndTime()
End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;
getEndTime
in interface TraceSpanOrBuilder
public TimestampOrBuilder getEndTimeOrBuilder()
End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;
getEndTimeOrBuilder
in interface TraceSpanOrBuilder
public long getParentSpanId()
ID of the parent span, if any. Optional.
fixed64 parent_span_id = 6;
getParentSpanId
in interface TraceSpanOrBuilder
public int getLabelsCount()
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;
getLabelsCount
in interface TraceSpanOrBuilder
public boolean containsLabels(java.lang.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;
containsLabels
in interface TraceSpanOrBuilder
@Deprecated public java.util.Map<java.lang.String,java.lang.String> getLabels()
getLabelsMap()
instead.getLabels
in interface TraceSpanOrBuilder
public java.util.Map<java.lang.String,java.lang.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;
getLabelsMap
in interface TraceSpanOrBuilder
public java.lang.String getLabelsOrDefault(java.lang.String key, java.lang.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;
getLabelsOrDefault
in interface TraceSpanOrBuilder
public java.lang.String getLabelsOrThrow(java.lang.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;
getLabelsOrThrow
in interface TraceSpanOrBuilder
public final boolean isInitialized()
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessageV3
public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo
in interface MessageLite
writeTo
in class GeneratedMessageV3
java.io.IOException
public int getSerializedSize()
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessageV3
public boolean equals(java.lang.Object obj)
equals
in interface Message
equals
in class AbstractMessage
public int hashCode()
hashCode
in interface Message
hashCode
in class AbstractMessage
public static TraceSpan parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static TraceSpan parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static TraceSpan parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static TraceSpan parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static TraceSpan parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static TraceSpan parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static TraceSpan parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static TraceSpan parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static TraceSpan parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static TraceSpan parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static TraceSpan parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static TraceSpan parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public TraceSpan.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static TraceSpan.Builder newBuilder()
public static TraceSpan.Builder newBuilder(TraceSpan prototype)
public TraceSpan.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected TraceSpan.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static TraceSpan getDefaultInstance()
public Parser<TraceSpan> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public TraceSpan getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder