Stackdriver Trace Client - Class Trace (1.7.0)

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 \ Trace

Methods

__construct

Instantiate a new Trace instance.

Parameters
Name
Description
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(); 
Returns
Type
Description
string

info

Returns a serializable array representing this trace.

Returns
Type
Description
array

spans

Retrieves the spans for this trace.

Example:

 $spans = $trace->spans(); 
Returns
Type
Description

span

Create an instance of Google\Cloud\Trace\Span

Example:

 $span = $trace->span(['name' => 'newSpan']); 
Parameter
Name
Description
options
array

[optional] See Google\Cloud\Trace\Span::__construct() for configuration details.

Returns
Type
Description

setSpans

Set the spans for this trace.

Example:

 $trace->setSpans([$span1, $span2]); 
Parameter
Name
Description
spans
Create a Mobile Website
View Site in Mobile | Classic
Share by: