OpenTelemetry PHP

NonRecordingSpan extends Span
in package

FinalYes
Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#wrapping-a-spancontext-in-a-span
psalm-internal

OpenTelemetry

Table of Contents

Properties

$context  : SpanContextInterface
$invalidSpan  : self|null

Methods

__construct()  : mixed
activate()  : ScopeInterface
Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.
addEvent()  : SpanInterface
addLink()  : SpanInterface
Records a link to another `SpanContext`.
end()  : void
fromContext()  : SpanInterface
Returns the {@see SpanInterface} from the provided *$context*, falling back on {@see SpanInterface::getInvalid()} if there is no span in the provided context.
getContext()  : SpanContextInterface
getCurrent()  : SpanInterface
Returns the current {@see SpanInterface} from the current {@see ContextInterface}, falling back on {@see SpanInterface::getEmpty()} if there is no span in the current context.
getInvalid()  : SpanInterface
Returns an invalid {@see SpanInterface} that is used when tracing is disabled, such s when there is no available SDK.
isRecording()  : bool
recordException()  : SpanInterface
setAttribute()  : SpanInterface
setAttributes()  : SpanInterface
setStatus()  : SpanInterface
storeInContext()  : ContextInterface
Returns a new {@see ContextInterface} created by setting `$this` into the provided [@see ContextInterface}.
updateName()  : SpanInterface
wrap()  : SpanInterface
Returns a non-recording {@see SpanInterface} that hold the provided *$spanContext* but has no functionality.

Properties

$invalidSpan

private static self|null $invalidSpan = null

Methods

activate()

Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.

public final activate() : ScopeInterface
Tags
inheritDoc
Return values
ScopeInterface

addEvent()

public addEvent(string $name[, iterable<string|int, mixed> $attributes = [] ][, int|null $timestamp = null ]) : SpanInterface
Parameters
$name : string
$attributes : iterable<string|int, mixed> = []
$timestamp : int|null = null
Tags
inheritDoc
Return values
SpanInterface

Records a link to another `SpanContext`.

public addLink(SpanContextInterface $context[, iterable<string|int, mixed> $attributes = [] ]) : SpanInterface

Adding links at span creation via is preferred to calling later, for contexts that are available during span creation, because head sampling decisions can only consider information present during span creation.

Parameters
$context : SpanContextInterface

span context to link

$attributes : iterable<string|int, mixed> = []

attributes to associate with the link

Return values
SpanInterface

this span

end()

public end([int|null $endEpochNanos = null ]) : void
Parameters
$endEpochNanos : int|null = null
Tags
inheritDoc

fromContext()

Returns the {@see SpanInterface} from the provided *$context*, falling back on {@see SpanInterface::getInvalid()} if there is no span in the provided context.

public final static fromContext(ContextInterface $context) : SpanInterface
Parameters
$context : ContextInterface
Tags
inheritDoc
Return values
SpanInterface

getCurrent()

Returns the current {@see SpanInterface} from the current {@see ContextInterface}, falling back on {@see SpanInterface::getEmpty()} if there is no span in the current context.

public final static getCurrent() : SpanInterface
Tags
inheritDoc
Return values
SpanInterface

getInvalid()

Returns an invalid {@see SpanInterface} that is used when tracing is disabled, such s when there is no available SDK.

public final static getInvalid() : SpanInterface
Tags
inheritDoc
Return values
SpanInterface

isRecording()

public isRecording() : bool
Tags
inheritDoc
Return values
bool

recordException()

public recordException(Throwable $exception[, iterable<string|int, mixed> $attributes = [] ]) : SpanInterface
Parameters
$exception : Throwable
$attributes : iterable<string|int, mixed> = []
Tags
inheritDoc
Return values
SpanInterface

setAttribute()

public setAttribute(string $key, mixed $value) : SpanInterface
Parameters
$key : string
$value : mixed

Note: arrays MUST be homogeneous, i.e. it MUST NOT contain values of different types.

Tags
inheritDoc
Return values
SpanInterface

        
On this page

Search results