Nexus API Reference

OtelSpan
in package
implements Span

FinalYes
Tags
psalm-api

Adapts an OpenTelemetry SpanInterface to the Nexus Span contract. If constructed with the activation ScopeInterface, self::end() detaches it before ending the span.

Table of Contents

Interfaces

Span

Methods

__construct()  : mixed
addEvent()  : void
context()  : SpanContext
end()  : void
recordException()  : void
setAttribute()  : void
setAttributes()  : void
setStatus()  : void

Methods

__construct()

public __construct(SpanInterface $span[, ScopeInterface|null $scope = null ]) : mixed
Parameters
$span : SpanInterface
$scope : ScopeInterface|null = null

addEvent()

public addEvent(string $name[, array<string|int, mixed> $attributes = [] ]) : void
Parameters
$name : string
$attributes : array<string|int, mixed> = []

recordException()

public recordException(Throwable $exception) : void
Parameters
$exception : Throwable

setAttribute()

public setAttribute(string $key, string|int|float|bool $value) : void
Parameters
$key : string
$value : string|int|float|bool

setAttributes()

public setAttributes(array<string|int, mixed> $attributes) : void
Parameters
$attributes : array<string|int, mixed>

setStatus()

public setStatus(StatusCode $code[, string|null $description = null ]) : void
Parameters
$code : StatusCode
$description : string|null = null

        
On this page

Search results