OpenTelemetry PHP

ResourceInfo
in package
uses LogsMessagesTrait

A Resource is an immutable representation of the entity producing telemetry. For example, a process producing telemetry that is running in a container on Kubernetes has a Pod name, it is in a namespace and possibly is part of a Deployment which also has a name. All three of these attributes can be included in the Resource.

The class named as ResourceInfo due to resource is the soft reserved word in PHP.

Table of Contents

Properties

$attributes  : AttributesInterface
$schemaUrl  : string|null

Methods

create()  : self
defaultResource()  : ResourceInfo
emptyResource()  : ResourceInfo
getAttributes()  : AttributesInterface
getSchemaUrl()  : string|null
merge()  : ResourceInfo
Merge current resource with an updating resource, combining all attributes. If a key exists on both the old and updating resource, the value of the updating resource MUST be picked (even if the updated value is empty)
serialize()  : string
logDebug()  : void
logError()  : void
logInfo()  : void
logNotice()  : void
logWarning()  : void
__construct()  : mixed
doLog()  : void
mergeSchemaUrl()  : string|null
Merge the schema URLs from the old and updating resource.
shouldLog()  : bool

Properties

Methods

getSchemaUrl()

public getSchemaUrl() : string|null
Return values
string|null

merge()

Merge current resource with an updating resource, combining all attributes. If a key exists on both the old and updating resource, the value of the updating resource MUST be picked (even if the updated value is empty)

public merge(ResourceInfo $updating) : ResourceInfo
Parameters
$updating : ResourceInfo
Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/resource/sdk.md#merge
todo

can we optimize this to avoid re-validating the attributes on merge?

Return values
ResourceInfo

serialize()

public serialize() : string
Return values
string

logDebug()

protected static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logError()

protected static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logInfo()

protected static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logNotice()

protected static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logWarning()

protected static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

doLog()

private static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed>

shouldLog()

private static shouldLog(string $level) : bool
Parameters
$level : string
Return values
bool

        
On this page

Search results