OpenTelemetry PHP

SpanConverter
in package
implements SpanConverterInterface

Table of Contents

Interfaces

SpanConverterInterface

Constants

KEY_DROPPED_ATTRIBUTES_COUNT  = 'otel.dropped_attributes_count'
KEY_DROPPED_EVENTS_COUNT  = 'otel.dropped_events_count'
KEY_DROPPED_LINKS_COUNT  = 'otel.dropped_links_count'
KEY_INSTRUMENTATION_SCOPE_NAME  = 'otel.scope.name'
KEY_INSTRUMENTATION_SCOPE_VERSION  = 'otel.scope.version'
NANOS_PER_MICROSECOND  = 1000
NET_PEER_IP_KEY  = 'net.peer.ip'
REMOTE_ENDPOINT_PREFERRED_ATTRIBUTE_TO_RANK_MAP  = ['peer.service' => 1, 'net.peer.name' => 2, 'net.peer.ip' => 3, 'peer.hostname' => 4, 'peer.address' => 5, 'http.host' => 6, 'db.name' => 7]
STATUS_CODE_TAG_KEY  = 'otel.status_code'
STATUS_DESCRIPTION_TAG_KEY  = 'error'

Properties

$defaultServiceName  : string

Methods

__construct()  : mixed
convert()  : array<string|int, mixed>
nanosToMicros()  : int
convertEventAttributesToJson()  : string|null
convertSpan()  : array<string|int, mixed>
findRemoteEndpointPreferredAttribute()  : array<string|int, mixed>|null
getPortNumberFromSpanAttributes()  : int|null
getRemoteEndpointDataFromIpAddressAndPort()  : array<string|int, mixed>|null
sanitiseTagValue()  : string
toAnnotation()  : array<string|int, mixed>
toRemoteEndpoint()  : array<string|int, mixed>|null
toSpanKind()  : string|null

Constants

KEY_DROPPED_ATTRIBUTES_COUNT

public mixed KEY_DROPPED_ATTRIBUTES_COUNT = 'otel.dropped_attributes_count'

KEY_DROPPED_EVENTS_COUNT

public mixed KEY_DROPPED_EVENTS_COUNT = 'otel.dropped_events_count'
public mixed KEY_DROPPED_LINKS_COUNT = 'otel.dropped_links_count'

KEY_INSTRUMENTATION_SCOPE_NAME

public mixed KEY_INSTRUMENTATION_SCOPE_NAME = 'otel.scope.name'

KEY_INSTRUMENTATION_SCOPE_VERSION

public mixed KEY_INSTRUMENTATION_SCOPE_VERSION = 'otel.scope.version'

NANOS_PER_MICROSECOND

public mixed NANOS_PER_MICROSECOND = 1000

NET_PEER_IP_KEY

public mixed NET_PEER_IP_KEY = 'net.peer.ip'

REMOTE_ENDPOINT_PREFERRED_ATTRIBUTE_TO_RANK_MAP

public mixed REMOTE_ENDPOINT_PREFERRED_ATTRIBUTE_TO_RANK_MAP = ['peer.service' => 1, 'net.peer.name' => 2, 'net.peer.ip' => 3, 'peer.hostname' => 4, 'peer.address' => 5, 'http.host' => 6, 'db.name' => 7]

STATUS_CODE_TAG_KEY

public mixed STATUS_CODE_TAG_KEY = 'otel.status_code'

STATUS_DESCRIPTION_TAG_KEY

public mixed STATUS_DESCRIPTION_TAG_KEY = 'error'

Properties

$defaultServiceName read-only

private string $defaultServiceName

Methods

convert()

public convert(iterable<string|int, mixed> $spans) : array<string|int, mixed>
Parameters
$spans : iterable<string|int, mixed>
Return values
array<string|int, mixed>

nanosToMicros()

public static nanosToMicros(int $nanoseconds) : int
Parameters
$nanoseconds : int
Tags
psalm-pure
Return values
int

findRemoteEndpointPreferredAttribute()

private static findRemoteEndpointPreferredAttribute(SpanDataInterface $span) : array<string|int, mixed>|null
Parameters
$span : SpanDataInterface
Return values
array<string|int, mixed>|null

getRemoteEndpointDataFromIpAddressAndPort()

private static getRemoteEndpointDataFromIpAddressAndPort(string $ipString, int|null $portNumber) : array<string|int, mixed>|null
Parameters
$ipString : string
$portNumber : int|null
Return values
array<string|int, mixed>|null

sanitiseTagValue()

private sanitiseTagValue(mixed $value) : string
Parameters
$value : mixed
Return values
string

        
On this page

Search results