OpenTelemetry PHP

ReadableSpanInterface

Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/sdk.md#additional-span-interfaces

Table of Contents

Methods

getAttribute()  : mixed
Returns the value of the attribute with the provided *key*.
getContext()  : SpanContextInterface
getDuration()  : int
Returns the duration of the {@see API\SpanInterface} in nanoseconds.
getInstrumentationScope()  : InstrumentationScopeInterface
getKind()  : int
getName()  : string
getParentContext()  : SpanContextInterface
hasEnded()  : bool
toSpanData()  : SpanDataInterface
Returns an immutable representation of this instance.

Methods

getAttribute()

Returns the value of the attribute with the provided *key*.

public getAttribute(string $key) : mixed

Returns null if there are no attributes set, or no attribute with that key exists.

Parameters
$key : string

getDuration()

Returns the duration of the {@see API\SpanInterface} in nanoseconds.

public getDuration() : int

If still active, returns now() - start.

Return values
int

        
On this page

Search results