# Stackdriver Trace V2 Client - Class Attributes (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 Attributes.

A set of attributes as key-value pairs.

Generated from protobuf message `google.devtools.cloudtrace.v2.Span.Attributes`

## Namespace

Google \\ Cloud \\ Trace \\ V2 \\ Span

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ attribute_map` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values `true` or `false`. For example: "/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "example.com/myattribute": { "bool_value": false } |
| `↳ dropped_attributes_count` | `int` The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid. |

### getAttributeMap

A set of attributes. Each attribute's key can be up to 128 bytes
long. The value can be a string up to 256 bytes, a signed 64-bit integer,
or the boolean values `true` or `false`. For example:
"/instance_id": { "string_value": { "value": "my-instance" } }
"/http/request_bytes": { "int_value": 300 }
"example.com/myattribute": { "bool_value": false }

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setAttributeMap

A set of attributes. Each attribute's key can be up to 128 bytes
long. The value can be a string up to 256 bytes, a signed 64-bit integer,
or the boolean values `true` or `false`. For example:
"/instance_id": { "string_value": { "value": "my-instance" } }
"/http/request_bytes": { "int_value": 300 }
"example.com/myattribute": { "bool_value": false }

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

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

### getDroppedAttributesCount

The number of attributes that were discarded. Attributes can be discarded
because their keys are too long or because there are too many attributes.

If this value is 0 then all attributes are valid.

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

### setDroppedAttributesCount

The number of attributes that were discarded. Attributes can be discarded
because their keys are too long or because there are too many attributes.

If this value is 0 then all attributes are valid.

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

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