InstrumentationScope
Read onlyYes
FinalYes
Tags
Properties
- $attributes : Attributes
- $name : string
- $schemaUrl : string|null
- $version : string
Methods
- __construct() : mixed
- fromArray() : self
- Create an InstrumentationScope from a normalized array representation.
-
normalize()
: array{name: string, version: string, schemaUrl: null|string, attributes: array
} - Normalize the scope to an array representation for serialization.
- withAttributes() : self
- Create a new scope with additional attributes merged with existing ones.
- withSchemaUrl() : self
- Create a new scope with a specific schema URL.
Properties
$attributes
public
Attributes
$attributes
= new Attributes()
$name
public
string
$name
$schemaUrl
public
string|null
$schemaUrl
= null
$version
public
string
$version
= 'unknown'
Methods
__construct()
public
__construct(string $name[, string $version = 'unknown' ][, null|string $schemaUrl = null ][, Attributes $attributes = new Attributes() ]) : mixed
Parameters
- $name : string
-
The name of the instrumentation scope (typically library or service name)
- $version : string = 'unknown'
-
The version of the instrumentation scope
- $schemaUrl : null|string = null
-
The schema URL for semantic conventions used by this scope
- $attributes : Attributes = new Attributes()
-
Additional scope attributes
fromArray()
Create an InstrumentationScope from a normalized array representation.
public
static fromArray(array{name: string, version?: string, schemaUrl?: null|string, attributes?: array} $data) : self
Parameters
-
$data
: array{name: string, version?: string, schemaUrl?: null|string, attributes?: array
}
Return values
selfnormalize()
Normalize the scope to an array representation for serialization.
public
normalize() : array{name: string, version: string, schemaUrl: null|string, attributes: array}
Return values
array{name: string, version: string, schemaUrl: null|string, attributes: arraywithAttributes()
Create a new scope with additional attributes merged with existing ones.
public
withAttributes(TAttributeValueMap|Attributes $attributes) : self
Parameters
- $attributes : TAttributeValueMap|Attributes
Return values
selfwithSchemaUrl()
Create a new scope with a specific schema URL.
public
withSchemaUrl(string $schemaUrl) : self
Parameters
- $schemaUrl : string