OpenTelemetry PHP

Configuration
in package
uses LogsMessagesTrait

FinalYes

Table of Contents

Properties

$configs  : array<string|int, mixed>|null
$envReader  : EnvReader|null
$file  : string
$sdkPlugin  : ComponentPlugin

Methods

create()  : SdkBuilder
getInstrumentationConfig()  : ConfigProperties
Instrumentation configuration from the `instrumentation/development` node of the same document, or an empty {@see ConfigProperties} if the node is absent.
parseFile()  : Configuration
logDebug()  : void
logError()  : void
logInfo()  : void
logNotice()  : void
logWarning()  : void
__construct()  : mixed
doLog()  : void
Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
envReader()  : EnvReader
Reads the same sources, in the same order, as the SDK resolver that finds `OTEL_CONFIG_FILE`.
envSourceProviders()  : array<int, EnvSource>
instrumentationFactory()  : ConfigurationFactory<string|int, ConfigurationRegistry>
loadComponentProviders()  : iterable<string|int, mixed>
sdkFactory()  : ConfigurationFactory<string|int, SdkBuilder>
shouldLog()  : bool

Properties

$configs

private array<string|int, mixed>|null $configs = null

Methods

getInstrumentationConfig()

Instrumentation configuration from the `instrumentation/development` node of the same document, or an empty {@see ConfigProperties} if the node is absent.

public getInstrumentationConfig([Context $context = new Context() ]) : ConfigProperties
Parameters
$context : Context = new Context()
Tags
experimental
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.61.0/specification/configuration/api.md#get-instrumentation-config
Return values
ConfigProperties

parseFile()

public static parseFile(string $file[, string|null $cacheFile = null ][, bool $debug = true ][, EnvReader|null $envReader = null ]) : Configuration
Parameters
$file : string
$cacheFile : string|null = null
$debug : bool = true
$envReader : EnvReader|null = null
Return values
Configuration

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()

Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.

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

loadComponentProviders()

private static loadComponentProviders() : iterable<string|int, mixed>
Return values
iterable<string|int, mixed>

shouldLog()

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

Search results