class TagKey

A key to a value stored in a TagContext

Each TagKey has a string name. Names have a maximum length of 255 and contain only printable ASCII characters.

Traits

Internal utility methods for working with tag keys, tag values, and metric names.

Constants

MAX_LENGTH

The maximum length for a tag key name.

Methods

static TagKey
create(string $name)

Constructs a TagKey with the given name.

string
getName()

Returns the name of the TagKey.

Details

at line 54
static TagKey create(string $name)

Constructs a TagKey with the given name.

The name must meet the following requirements:

  1. It cannot be empty
  2. It cannot be longer than TagKey::MAX_LENGTH
  3. It can only contain printable ASCII characters.

Parameters

string $name the name of the key

Return Value

TagKey

Exceptions

Exception if name is not valid.

at line 67
final string getName()

Returns the name of the TagKey.

Return Value

string