public final class Span extends GeneratedMessageV3 implements SpanOrBuilder
A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end-to-end latency, and one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous—there may be gaps or overlaps between spans in a trace.Protobuf type
google.devtools.cloudtrace.v2.Span| Modifier and Type | Class and Description |
|---|---|
static class |
Span.Attributes
A set of attributes, each in the format `[KEY]:[VALUE]`.
|
static interface |
Span.AttributesOrBuilder |
static class |
Span.Builder
A span represents a single operation within a trace.
|
static class |
Span.Link
A pointer from the current span to another span in the same trace or in a
different trace.
|
static interface |
Span.LinkOrBuilder |
static class |
Span.Links
A collection of links, which are references from this span to a span
in the same or different trace.
|
static interface |
Span.LinksOrBuilder |
static class |
Span.TimeEvent
A time-stamped annotation or message event in the Span.
|
static interface |
Span.TimeEventOrBuilder |
static class |
Span.TimeEvents
A collection of `TimeEvent`s.
|
static interface |
Span.TimeEventsOrBuilder |
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 |
ATTRIBUTES_FIELD_NUMBER |
static int |
CHILD_SPAN_COUNT_FIELD_NUMBER |
static int |
DISPLAY_NAME_FIELD_NUMBER |
static int |
END_TIME_FIELD_NUMBER |
static int |
LINKS_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
PARENT_SPAN_ID_FIELD_NUMBER |
static int |
SAME_PROCESS_AS_PARENT_SPAN_FIELD_NUMBER |
static int |
SPAN_ID_FIELD_NUMBER |
static int |
STACK_TRACE_FIELD_NUMBER |
static int |
START_TIME_FIELD_NUMBER |
static int |
STATUS_FIELD_NUMBER |
static int |
TIME_EVENTS_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
Span.Attributes |
getAttributes()
A set of attributes on the span.
|
Span.AttributesOrBuilder |
getAttributesOrBuilder()
A set of attributes on the span.
|
Int32Value |
getChildSpanCount()
An optional number of child spans that were generated while this span
was active.
|
Int32ValueOrBuilder |
getChildSpanCountOrBuilder()
An optional number of child spans that were generated while this span
was active.
|
static Span |
getDefaultInstance() |
Span |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
TruncatableString |
getDisplayName()
A description of the span's operation (up to 128 bytes).
|
TruncatableStringOrBuilder |
getDisplayNameOrBuilder()
A description of the span's operation (up to 128 bytes).
|
Timestamp |
getEndTime()
The end time of the span.
|
TimestampOrBuilder |
getEndTimeOrBuilder()
The end time of the span.
|
Span.Links |
getLinks()
Links associated with the span.
|
Span.LinksOrBuilder |
getLinksOrBuilder()
Links associated with the span.
|
java.lang.String |
getName()
The resource name of the span in the following format:
projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
[TRACE_ID] is a unique identifier for a trace within a project;
it is a 32-character hexadecimal encoding of a 16-byte array.
|
ByteString |
getNameBytes()
The resource name of the span in the following format:
projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
[TRACE_ID] is a unique identifier for a trace within a project;
it is a 32-character hexadecimal encoding of a 16-byte array.
|
java.lang.String |
getParentSpanId()
The [SPAN_ID] of this span's parent span.
|
ByteString |
getParentSpanIdBytes()
The [SPAN_ID] of this span's parent span.
|
Parser<Span> |
getParserForType() |
BoolValue |
getSameProcessAsParentSpan()
(Optional) Set this parameter to indicate whether this span is in
the same process as its parent.
|
BoolValueOrBuilder |
getSameProcessAsParentSpanOrBuilder()
(Optional) Set this parameter to indicate whether this span is in
the same process as its parent.
|
int |
getSerializedSize() |
java.lang.String |
getSpanId()
The [SPAN_ID] portion of the span's resource name.
|
ByteString |
getSpanIdBytes()
The [SPAN_ID] portion of the span's resource name.
|
StackTrace |
getStackTrace()
Stack trace captured at the start of the span.
|
StackTraceOrBuilder |
getStackTraceOrBuilder()
Stack trace captured at the start of the span.
|
Timestamp |
getStartTime()
The start time of the span.
|
TimestampOrBuilder |
getStartTimeOrBuilder()
The start time of the span.
|
Status |
getStatus()
An optional final status for this span.
|
StatusOrBuilder |
getStatusOrBuilder()
An optional final status for this span.
|
Span.TimeEvents |
getTimeEvents()
A set of time events.
|
Span.TimeEventsOrBuilder |
getTimeEventsOrBuilder()
A set of time events.
|
UnknownFieldSet |
getUnknownFields() |
boolean |
hasAttributes()
A set of attributes on the span.
|
boolean |
hasChildSpanCount()
An optional number of child spans that were generated while this span
was active.
|
boolean |
hasDisplayName()
A description of the span's operation (up to 128 bytes).
|
boolean |
hasEndTime()
The end time of the span.
|
int |
hashCode() |
boolean |
hasLinks()
Links associated with the span.
|
boolean |
hasSameProcessAsParentSpan()
(Optional) Set this parameter to indicate whether this span is in
the same process as its parent.
|
boolean |
hasStackTrace()
Stack trace captured at the start of the span.
|
boolean |
hasStartTime()
The start time of the span.
|
boolean |
hasStatus()
An optional final status for this span.
|
boolean |
hasTimeEvents()
A set of time events.
|
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Span.Builder |
newBuilder() |
static Span.Builder |
newBuilder(Span prototype) |
Span.Builder |
newBuilderForType() |
protected Span.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
static Span |
parseDelimitedFrom(java.io.InputStream input) |
static Span |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Span |
parseFrom(byte[] data) |
static Span |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static Span |
parseFrom(java.nio.ByteBuffer data) |
static Span |
parseFrom(java.nio.ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static Span |
parseFrom(ByteString data) |
static Span |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static Span |
parseFrom(CodedInputStream input) |
static Span |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static Span |
parseFrom(java.io.InputStream input) |
static Span |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<Span> |
parser() |
Span.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, 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 NAME_FIELD_NUMBER
public static final int SPAN_ID_FIELD_NUMBER
public static final int PARENT_SPAN_ID_FIELD_NUMBER
public static final int DISPLAY_NAME_FIELD_NUMBER
public static final int START_TIME_FIELD_NUMBER
public static final int END_TIME_FIELD_NUMBER
public static final int ATTRIBUTES_FIELD_NUMBER
public static final int STACK_TRACE_FIELD_NUMBER
public static final int TIME_EVENTS_FIELD_NUMBER
public static final int LINKS_FIELD_NUMBER
public static final int STATUS_FIELD_NUMBER
public static final int SAME_PROCESS_AS_PARENT_SPAN_FIELD_NUMBER
public static final int CHILD_SPAN_COUNT_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3public java.lang.String getName()
The resource name of the span in the following format:
projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
[TRACE_ID] is a unique identifier for a trace within a project;
it is a 32-character hexadecimal encoding of a 16-byte array.
[SPAN_ID] is a unique identifier for a span within a trace; it
is a 16-character hexadecimal encoding of an 8-byte array.
string name = 1;getName in interface SpanOrBuilderpublic ByteString getNameBytes()
The resource name of the span in the following format:
projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]
[TRACE_ID] is a unique identifier for a trace within a project;
it is a 32-character hexadecimal encoding of a 16-byte array.
[SPAN_ID] is a unique identifier for a span within a trace; it
is a 16-character hexadecimal encoding of an 8-byte array.
string name = 1;getNameBytes in interface SpanOrBuilderpublic java.lang.String getSpanId()
The [SPAN_ID] portion of the span's resource name.
string span_id = 2;getSpanId in interface SpanOrBuilderpublic ByteString getSpanIdBytes()
The [SPAN_ID] portion of the span's resource name.
string span_id = 2;getSpanIdBytes in interface SpanOrBuilderpublic java.lang.String getParentSpanId()
The [SPAN_ID] of this span's parent span. If this is a root span, then this field must be empty.
string parent_span_id = 3;getParentSpanId in interface SpanOrBuilderpublic ByteString getParentSpanIdBytes()
The [SPAN_ID] of this span's parent span. If this is a root span, then this field must be empty.
string parent_span_id = 3;getParentSpanIdBytes in interface SpanOrBuilderpublic boolean hasDisplayName()
A description of the span's operation (up to 128 bytes).
Stackdriver Trace displays the description in the
{% dynamic print site_values.console_name %}.
For example, the display name can be a qualified method name or a file name
and a line number where the operation is called. A best practice is to use
the same display name within an application and at the same call point.
This makes it easier to correlate spans in different traces.
.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;hasDisplayName in interface SpanOrBuilderpublic TruncatableString getDisplayName()
A description of the span's operation (up to 128 bytes).
Stackdriver Trace displays the description in the
{% dynamic print site_values.console_name %}.
For example, the display name can be a qualified method name or a file name
and a line number where the operation is called. A best practice is to use
the same display name within an application and at the same call point.
This makes it easier to correlate spans in different traces.
.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;getDisplayName in interface SpanOrBuilderpublic TruncatableStringOrBuilder getDisplayNameOrBuilder()
A description of the span's operation (up to 128 bytes).
Stackdriver Trace displays the description in the
{% dynamic print site_values.console_name %}.
For example, the display name can be a qualified method name or a file name
and a line number where the operation is called. A best practice is to use
the same display name within an application and at the same call point.
This makes it easier to correlate spans in different traces.
.google.devtools.cloudtrace.v2.TruncatableString display_name = 4;getDisplayNameOrBuilder in interface SpanOrBuilderpublic boolean hasStartTime()
The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running.
.google.protobuf.Timestamp start_time = 5;hasStartTime in interface SpanOrBuilderpublic Timestamp getStartTime()
The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running.
.google.protobuf.Timestamp start_time = 5;getStartTime in interface SpanOrBuilderpublic TimestampOrBuilder getStartTimeOrBuilder()
The start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server's application handler starts running.
.google.protobuf.Timestamp start_time = 5;getStartTimeOrBuilder in interface SpanOrBuilderpublic boolean hasEndTime()
The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running.
.google.protobuf.Timestamp end_time = 6;hasEndTime in interface SpanOrBuilderpublic Timestamp getEndTime()
The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running.
.google.protobuf.Timestamp end_time = 6;getEndTime in interface SpanOrBuilderpublic TimestampOrBuilder getEndTimeOrBuilder()
The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running.
.google.protobuf.Timestamp end_time = 6;getEndTimeOrBuilder in interface SpanOrBuilderpublic boolean hasAttributes()
A set of attributes on the span. You can have up to 32 attributes per span.
.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;hasAttributes in interface SpanOrBuilderpublic Span.Attributes getAttributes()
A set of attributes on the span. You can have up to 32 attributes per span.
.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;getAttributes in interface SpanOrBuilderpublic Span.AttributesOrBuilder getAttributesOrBuilder()
A set of attributes on the span. You can have up to 32 attributes per span.
.google.devtools.cloudtrace.v2.Span.Attributes attributes = 7;getAttributesOrBuilder in interface SpanOrBuilderpublic boolean hasStackTrace()
Stack trace captured at the start of the span.
.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;hasStackTrace in interface SpanOrBuilderpublic StackTrace getStackTrace()
Stack trace captured at the start of the span.
.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;getStackTrace in interface SpanOrBuilderpublic StackTraceOrBuilder getStackTraceOrBuilder()
Stack trace captured at the start of the span.
.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;getStackTraceOrBuilder in interface SpanOrBuilderpublic boolean hasTimeEvents()
A set of time events. You can have up to 32 annotations and 128 message events per span.
.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;hasTimeEvents in interface SpanOrBuilderpublic Span.TimeEvents getTimeEvents()
A set of time events. You can have up to 32 annotations and 128 message events per span.
.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;getTimeEvents in interface SpanOrBuilderpublic Span.TimeEventsOrBuilder getTimeEventsOrBuilder()
A set of time events. You can have up to 32 annotations and 128 message events per span.
.google.devtools.cloudtrace.v2.Span.TimeEvents time_events = 9;getTimeEventsOrBuilder in interface SpanOrBuilderpublic boolean hasLinks()
Links associated with the span. You can have up to 128 links per Span.
.google.devtools.cloudtrace.v2.Span.Links links = 10;hasLinks in interface SpanOrBuilderpublic Span.Links getLinks()
Links associated with the span. You can have up to 128 links per Span.
.google.devtools.cloudtrace.v2.Span.Links links = 10;getLinks in interface SpanOrBuilderpublic Span.LinksOrBuilder getLinksOrBuilder()
Links associated with the span. You can have up to 128 links per Span.
.google.devtools.cloudtrace.v2.Span.Links links = 10;getLinksOrBuilder in interface SpanOrBuilderpublic boolean hasStatus()
An optional final status for this span.
.google.rpc.Status status = 11;hasStatus in interface SpanOrBuilderpublic Status getStatus()
An optional final status for this span.
.google.rpc.Status status = 11;getStatus in interface SpanOrBuilderpublic StatusOrBuilder getStatusOrBuilder()
An optional final status for this span.
.google.rpc.Status status = 11;getStatusOrBuilder in interface SpanOrBuilderpublic boolean hasSameProcessAsParentSpan()
(Optional) Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Stackdriver Trace is unable to take advantage of this helpful information.
.google.protobuf.BoolValue same_process_as_parent_span = 12;hasSameProcessAsParentSpan in interface SpanOrBuilderpublic BoolValue getSameProcessAsParentSpan()
(Optional) Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Stackdriver Trace is unable to take advantage of this helpful information.
.google.protobuf.BoolValue same_process_as_parent_span = 12;getSameProcessAsParentSpan in interface SpanOrBuilderpublic BoolValueOrBuilder getSameProcessAsParentSpanOrBuilder()
(Optional) Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Stackdriver Trace is unable to take advantage of this helpful information.
.google.protobuf.BoolValue same_process_as_parent_span = 12;getSameProcessAsParentSpanOrBuilder in interface SpanOrBuilderpublic boolean hasChildSpanCount()
An optional number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans.
.google.protobuf.Int32Value child_span_count = 13;hasChildSpanCount in interface SpanOrBuilderpublic Int32Value getChildSpanCount()
An optional number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans.
.google.protobuf.Int32Value child_span_count = 13;getChildSpanCount in interface SpanOrBuilderpublic Int32ValueOrBuilder getChildSpanCountOrBuilder()
An optional number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans.
.google.protobuf.Int32Value child_span_count = 13;getChildSpanCountOrBuilder in interface SpanOrBuilderpublic 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 Span parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Span parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Span parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Span parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Span parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Span parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static Span parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Span parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Span parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Span parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Span parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Span parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic Span.Builder newBuilderForType()
newBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static Span.Builder newBuilder()
public static Span.Builder newBuilder(Span prototype)
public Span.Builder toBuilder()
toBuilder in interface MessagetoBuilder in interface MessageLiteprotected Span.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class GeneratedMessageV3public static Span getDefaultInstance()
public Parser<Span> getParserForType()
getParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public Span getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder