OpenTelemetry PHP

EnvironmentGetterSetter
in package
implements ExtendedPropagationGetterInterface, PropagationSetterInterface

FinalYes
Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.44.0/specification/context/env-carriers.md

Default implementation of ExtendedPropagationGetterInterface and PropagationSetterInterface. This type uses environment variables as a carrier for context propagation. It is provided to TextMapPropagatorInterface::inject() or TextMapPropagatorInterface::extract().

Table of Contents

Interfaces

ExtendedPropagationGetterInterface
Interface for getting values from a carrier.
PropagationSetterInterface

Properties

$instance  : self|null

Methods

get()  : string|null
Gets the value of a given key from a carrier.
getAll()  : array<int, string>
Gets all values of a given key from a carrier.
getInstance()  : self
keys()  : array<int, string>
Returns the list of all the keys in the carrier.
set()  : void
Set the value for a given key on the associated carrier.

Properties

Methods

get()

Gets the value of a given key from a carrier.

public get(mixed $carrier, string $key) : string|null
Parameters
$carrier : mixed
$key : string
Attributes
#[Override]
Return values
string|null

getAll()

Gets all values of a given key from a carrier.

public getAll(mixed $carrier, string $key) : array<int, string>
Parameters
$carrier : mixed
$key : string
Attributes
#[Override]
Return values
array<int, string>

keys()

Returns the list of all the keys in the carrier.

public keys(mixed $carrier) : array<int, string>
Parameters
$carrier : mixed
Attributes
#[Override]
Return values
array<int, string>

set()

Set the value for a given key on the associated carrier.

public set(mixed &$carrier, string $key, string $value) : void
Parameters
$carrier : mixed
$key : string
$value : string
Attributes
#[Override]

        
On this page

Search results