NonRecordingSpan
extends Span
in package
Tags
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
$context read-only
private
SpanContextInterface
$context
$invalidSpan
private
static self|null
$invalidSpan
= null
Methods
__construct()
public
__construct(SpanContextInterface $context) : mixed
Parameters
- $context : SpanContextInterface
activate()
Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.
public
final activate() : ScopeInterface
Tags
Return values
ScopeInterfaceaddEvent()
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
Return values
SpanInterfaceaddLink()
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
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
Return values
SpanInterfacegetContext()
public
getContext() : SpanContextInterface
Tags
Return values
SpanContextInterfacegetCurrent()
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
Return values
SpanInterfacegetInvalid()
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
Return values
SpanInterfaceisRecording()
public
isRecording() : bool
Tags
Return values
boolrecordException()
public
recordException(Throwable $exception[, iterable<string|int, mixed> $attributes = [] ]) : SpanInterface
Parameters
- $exception : Throwable
- $attributes : iterable<string|int, mixed> = []
Tags
Return values
SpanInterfacesetAttribute()
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
Return values
SpanInterfacesetAttributes()
public
setAttributes(iterable<string|int, mixed> $attributes) : SpanInterface
Parameters
- $attributes : iterable<string|int, mixed>
Tags
Return values
SpanInterfacesetStatus()
public
setStatus(string $code[, string|null $description = null ]) : SpanInterface
Parameters
- $code : string
- $description : string|null = null
Tags
Return values
SpanInterfacestoreInContext()
Returns a new {@see ContextInterface} created by setting `$this` into the provided [@see ContextInterface}.
public
final storeInContext(ContextInterface $context) : ContextInterface
Parameters
- $context : ContextInterface
Tags
Return values
ContextInterfaceupdateName()
public
updateName(string $name) : SpanInterface
Parameters
- $name : string
Tags
Return values
SpanInterfacewrap()
Returns a non-recording {@see SpanInterface} that hold the provided *$spanContext* but has no functionality.
public
final static wrap(SpanContextInterface $spanContext) : SpanInterface
Parameters
- $spanContext : SpanContextInterface