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, unknownFields
memoizedSize
memoizedHashCode
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, 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 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 MessageOrBuilder
getUnknownFields
in class GeneratedMessageV3
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class GeneratedMessageV3
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public java.lang.String getSpanId()
The [SPAN_ID] portion of the span's resource name.
string span_id = 2;
getSpanId
in interface SpanOrBuilder
public ByteString getSpanIdBytes()
The [SPAN_ID] portion of the span's resource name.
string span_id = 2;
getSpanIdBytes
in interface SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public boolean hasStackTrace()
Stack trace captured at the start of the span.
.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;
hasStackTrace
in interface SpanOrBuilder
public StackTrace getStackTrace()
Stack trace captured at the start of the span.
.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;
getStackTrace
in interface SpanOrBuilder
public StackTraceOrBuilder getStackTraceOrBuilder()
Stack trace captured at the start of the span.
.google.devtools.cloudtrace.v2.StackTrace stack_trace = 8;
getStackTraceOrBuilder
in interface SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public boolean hasStatus()
An optional final status for this span.
.google.rpc.Status status = 11;
hasStatus
in interface SpanOrBuilder
public Status getStatus()
An optional final status for this span.
.google.rpc.Status status = 11;
getStatus
in interface SpanOrBuilder
public StatusOrBuilder getStatusOrBuilder()
An optional final status for this span.
.google.rpc.Status status = 11;
getStatusOrBuilder
in interface SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
public 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 SpanOrBuilder
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 Span parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Span parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Span parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Span parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Span parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Span parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static Span parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Span parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Span parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static Span parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public static Span parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOException
public static Span parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOException
public Span.Builder newBuilderForType()
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static Span.Builder newBuilder()
public static Span.Builder newBuilder(Span prototype)
public Span.Builder toBuilder()
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected Span.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class GeneratedMessageV3
public static Span getDefaultInstance()
public Parser<Span> getParserForType()
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessageV3
public Span getDefaultInstanceForType()
getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder