# Stackdriver Trace V2 Client - Class StackTrace (2.0.0)

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 V2 Client class StackTrace.

A call stack appearing in a trace.

Generated from protobuf message `google.devtools.cloudtrace.v2.StackTrace`

## Namespace

Google \\ Cloud \\ Trace \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ stack_frames` | `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.StackTrace.StackFrames` Stack frames in this stack trace. A maximum of 128 frames are allowed. |
| `↳ stack_trace_hash_id` | `int|string` The hash ID is used to conserve network bandwidth for duplicate stack traces within a single trace. Often multiple spans will have identical stack traces. The first occurrence of a stack trace should contain both the `stackFrame` content and a value in `stackTraceHashId`. Subsequent spans within the same request can refer to that stack trace by only setting `stackTraceHashId`. |

### getStackFrames

Stack frames in this stack trace. A maximum of 128 frames are allowed.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.StackTrace.StackFrames|null` |   |

### hasStackFrames

### clearStackFrames

### setStackFrames

Stack frames in this stack trace. A maximum of 128 frames are allowed.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-trace/latest/V2.StackTrace.StackFrames` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getStackTraceHashId

The hash ID is used to conserve network bandwidth for duplicate
stack traces within a single trace.

Often multiple spans will have identical stack traces.
The first occurrence of a stack trace should contain both the
`stackFrame` content and a value in `stackTraceHashId`.
Subsequent spans within the same request can refer
to that stack trace by only setting `stackTraceHashId`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setStackTraceHashId

The hash ID is used to conserve network bandwidth for duplicate
stack traces within a single trace.

Often multiple spans will have identical stack traces.
The first occurrence of a stack trace should contain both the
`stackFrame` content and a value in `stackTraceHashId`.
Subsequent spans within the same request can refer
to that stack trace by only setting `stackTraceHashId`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |