# Stackdriver Trace Client - Class Link (1.9.5)

2.0.0 (latest) 2.0.0-RC1 1.9.5 1.8.10 1.7.0 1.6.5 1.5.3 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);

## Namespace

Google \\ Cloud \\ Trace

## Methods

### __construct

Create a new Link.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `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. |

### info

Returns a serializable array representing this Link.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `array` |   |

## Constants

### TYPE_UNSPECIFIED

    Value: \Google\Cloud\Trace\V2\Span\Link\Type::TYPE_UNSPECIFIED

### TYPE_CHILD_LINKED_SPAN

    Value: \Google\Cloud\Trace\V2\Span\Link\Type::CHILD_LINKED_SPAN

### TYPE_PARENT_LINKED_SPAN

    Value: \Google\Cloud\Trace\V2\Span\Link\Type::PARENT_LINKED_SPAN