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, unknownFieldsmemoizedSizememoizedHashCode| 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, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic 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 MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected MapField internalGetMapField(int number)
internalGetMapField in class GeneratedMessageV3protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class 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 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 TraceSpanOrBuilderpublic 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 TraceSpanOrBuilderpublic boolean hasStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;hasStartTime in interface TraceSpanOrBuilderpublic Timestamp getStartTime()
Start time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp start_time = 4;getStartTime in interface TraceSpanOrBuilderpublic 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 Timestamp getEndTime()
End time of the span in nanoseconds from the UNIX epoch.
.google.protobuf.Timestamp end_time = 5;getEndTime in interface TraceSpanOrBuilderpublic 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. 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 TraceSpanOrBuilderpublic 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 TraceSpanOrBuilderpublic 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 TraceSpanOrBuilderpublic 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 TraceSpanOrBuilderpublic 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 TraceSpanOrBuilderpublic final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo in interface MessageLitewriteTo in class GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface Messageequals in class AbstractMessagepublic int hashCode()
hashCode in interface MessagehashCode in class AbstractMessagepublic static TraceSpan parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static TraceSpan parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseFrom(java.io.InputStream input, 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, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static TraceSpan parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic TraceSpan.Builder newBuilderForType()
newBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static TraceSpan.Builder newBuilder()
public static TraceSpan.Builder newBuilder(TraceSpan prototype)
public TraceSpan.Builder toBuilder()
toBuilder in interface MessagetoBuilder in interface MessageLiteprotected TraceSpan.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class GeneratedMessageV3public static TraceSpan getDefaultInstance()
public Parser<TraceSpan> getParserForType()
getParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public TraceSpan getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder