Stackdriver Trace Client - Class Link (1.4.11)

Reference documentation and code samples for the Stackdriver Trace Client class Link.

This plain PHP class represents a Link resource. A pointer from the current span to another span in the same trace or in a different trace. For example, this can be used in batching operations, where a single batch handler processes multiple requests from different traces or when the handler receives a request from a different project.

Example:

use Google\Cloud\Trace\Link;

$link = new Link('abcd1234', 'abcd2345');
$span->addLink($link);

Methods

Create a new Link.

Parameters
NameDescription
traceId string
spanId string
options array

Configuration options.

↳ type string

The relationship of the current span relative to the linked span. Defaults to TYPE_UNSPECIFIED.

↳ uncompressedSizeBytes int

The number of uncompressed bytes sent or received.

↳ compressedSizeBytes int

The number of compressed bytes sent or received. If missing assumed to be the same size as uncompressed.

Returns a serializable array representing this Link.

Returns
TypeDescription
array

Constants

Value: \Google\Cloud\Trace\V2\Span_Link_Type::TYPE_UNSPECIFIED
Value: \Google\Cloud\Trace\V2\Span_Link_Type::CHILD_LINKED_SPAN
Value: \Google\Cloud\Trace\V2\Span_Link_Type::PARENT_LINKED_SPAN