class SpanLink implements JsonSerializable (View source)

Properties

string $traceId

A 32-character, lower-case hexadecimal encoded string of the linked trace ID. This field shouldn't be directly assigned an id from SpanData. Use the SpanData::getLinks() method instead.

string $spanId

A 16-character, lower-case hexadecimal encoded string of the linked span ID. This field shouldn't be directly assigned an id from SpanData. Use the SpanData::getLinks() method instead.

string $traceState
string[] $attributes
int $droppedAttributesCount

Methods

mixed
jsonSerialize()

Specify data which should be serialized to JSON

static SpanLink
fromHeaders(array|callable $headersOrCallback)

Consumes distributed tracing headers, from which a span link will be constructed.

Details

mixed jsonSerialize()

Specify data which should be serialized to JSON

Return Value

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

static SpanLink fromHeaders(array|callable $headersOrCallback)

Consumes distributed tracing headers, from which a span link will be constructed.

Parameters

array|callable $headersOrCallback

Either an array with a lowercase header to value mapping, or a callback, which given a header name for distributed tracing, returns the value it should be updated to.

Return Value

SpanLink