class TraceSpan extends Message

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

Methods

__construct()

No description

int|string
getSpanId()

Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.

setSpanId(int|string $var)

Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.

int
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.

setKind(int $var)

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.

string
getName()

Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console.

setName(string $var)

Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers Console.

getStartTime()

Start time of the span in nanoseconds from the UNIX epoch.

setStartTime(Timestamp $var)

Start time of the span in nanoseconds from the UNIX epoch.

getEndTime()

End time of the span in nanoseconds from the UNIX epoch.

setEndTime(Timestamp $var)

End time of the span in nanoseconds from the UNIX epoch.

int|string
getParentSpanId()

ID of the parent span, if any. Optional.

setParentSpanId(int|string $var)

ID of the parent span, if any. Optional.

RepeatedField
getLabels()

Collection of labels associated with the span.

setLabels(array|RepeatedField $var)

Collection of labels associated with the span.

Details

at line 73
__construct()

at line 85
int|string getSpanId()

Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.

Generated from protobuf field fixed64 span_id = 1;

Return Value

int|string

at line 97
setSpanId(int|string $var)

Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace.

Generated from protobuf field fixed64 span_id = 1;

Parameters

int|string $var

at line 111
int 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.

Generated from protobuf field .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;

Return Value

int

at line 124
setKind(int $var)

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.

Generated from protobuf field .google.devtools.cloudtrace.v1.TraceSpan.SpanKind kind = 2;

Parameters

int $var

at line 141
string getName()

Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers 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.

Generated from protobuf field string name = 3;

Return Value

string

at line 157
setName(string $var)

Name of the trace. The trace name is sanitized and displayed in the Stackdriver Trace tool in the Google Developers 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.

Generated from protobuf field string name = 3;

Parameters

string $var

at line 169
Timestamp getStartTime()

Start time of the span in nanoseconds from the UNIX epoch.

Generated from protobuf field .google.protobuf.Timestamp start_time = 4;

Return Value

Timestamp

at line 180
setStartTime(Timestamp $var)

Start time of the span in nanoseconds from the UNIX epoch.

Generated from protobuf field .google.protobuf.Timestamp start_time = 4;

Parameters

Timestamp $var

at line 192
Timestamp getEndTime()

End time of the span in nanoseconds from the UNIX epoch.

Generated from protobuf field .google.protobuf.Timestamp end_time = 5;

Return Value

Timestamp

at line 203
setEndTime(Timestamp $var)

End time of the span in nanoseconds from the UNIX epoch.

Generated from protobuf field .google.protobuf.Timestamp end_time = 5;

Parameters

Timestamp $var

at line 215
int|string getParentSpanId()

ID of the parent span, if any. Optional.

Generated from protobuf field fixed64 parent_span_id = 6;

Return Value

int|string

at line 226
setParentSpanId(int|string $var)

ID of the parent span, if any. Optional.

Generated from protobuf field fixed64 parent_span_id = 6;

Parameters

int|string $var

at line 238
RepeatedField getLabels()

Collection of labels associated with the span.

Generated from protobuf field map<string, string> labels = 7;

Return Value

RepeatedField

at line 249
setLabels(array|RepeatedField $var)

Collection of labels associated with the span.

Generated from protobuf field map<string, string> labels = 7;

Parameters

array|RepeatedField $var