Reference documentation and code samples for the Stackdriver Trace Client class Trace.
This plain PHP class represents a Trace resource. The model currently has no backing API model and is identified by its traceId.
Example:
use Google\Cloud\Trace\TraceClient;
$traceClient = new TraceClient();
$trace = $traceClient->trace();
Namespace
Google \ Cloud \ TraceMethods
__construct
Instantiate a new Trace instance.
projectId
string
The id of the project this trace belongs to.
traceId
string
[optional] The id of the trace. If not provided, one will be generated automatically for you.
spans
array
[optional] Array of Span constructor arguments. See Google\Cloud\Trace\Span::__construct() for configuration details.
traceId
Retrieves the trace's id.
Example:
echo $trace->traceId();
string
info
Returns a serializable array representing this trace.
array
spans
Retrieves the spans for this trace.
Example:
$spans = $trace->spans();
span
options
setSpans
Set the spans for this trace.
Example:
$trace->setSpans([$span1, $span2]);