Table of Contents
Interfaces
- SpanExporterInterface
- LoggerAwareInterface
Constants
-
GRANULARITY_AGGREGATE
= 1
-
GRANULARITY_SPAN
= 2
Properties
-
$converter
: SpanConverterInterface|null
-
$defaultLogLevel
: string
-
$granularity
: int
-
$running
: bool
-
$serviceName
: string
Methods
-
__construct()
: mixed
-
doExport()
: bool
-
export()
: FutureInterface<string|int, bool>
-
forceFlush()
: bool
-
getSpanConverter()
: SpanConverterInterface
-
setDefaultLogLevel()
: void
-
setGranularity()
: void
-
shutdown()
: bool
-
convertSpan()
: array<string|int, mixed>
-
getLogger()
: LoggerInterface
-
log()
: void
-
setSpanConverter()
: void
-
doLog()
: void
-
setServiceName()
: void
GRANULARITY_AGGREGATE
public
mixed
GRANULARITY_AGGREGATE
= 1
GRANULARITY_SPAN
public
mixed
GRANULARITY_SPAN
= 2
$converter
private
SpanConverterInterface|null
$converter
= null
$defaultLogLevel
private
string
$defaultLogLevel
= \Psr\Log\LogLevel::INFO
$granularity
private
int
$granularity
= self::GRANULARITY_AGGREGATE
$running
private
bool
$running
= true
$serviceName
private
string
$serviceName
__construct()
public
__construct(string $serviceName[, LoggerInterface|null $logger = null ][, string|null $defaultLogLevel = LogLevel::DEBUG ][, SpanConverterInterface|null $converter = null ][, int $granularity = 1 ]) : mixed
Parameters
-
$serviceName
: string
-
-
$logger
: LoggerInterface|null
= null
-
-
$defaultLogLevel
: string|null
= LogLevel::DEBUG
-
-
$converter
: SpanConverterInterface|null
= null
-
-
$granularity
: int
= 1
-
doExport()
public
doExport(iterable<string|int, mixed> $spans) : bool
Parameters
-
$spans
: iterable<string|int, mixed>
-
-
inheritDoc
-
export()
public
export(iterable<string|int, SpanDataInterface> $batch[, CancellationInterface|null $cancellation = null ]) : FutureInterface<string|int, bool>
Parameters
-
$batch
: iterable<string|int, SpanDataInterface>
-
-
$cancellation
: CancellationInterface|null
= null
-
forceFlush()
public
forceFlush([CancellationInterface|null $cancellation = null ]) : bool
Parameters
-
$cancellation
: CancellationInterface|null
= null
-
-
see
-
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#forceflush-2
getSpanConverter()
public
getSpanConverter() : SpanConverterInterface
setDefaultLogLevel()
public
setDefaultLogLevel(string $logLevel) : void
Parameters
-
$logLevel
: string
-
setGranularity()
public
setGranularity(int $granularity) : void
Parameters
-
$granularity
: int
-
shutdown()
public
shutdown([CancellationInterface|null $cancellation = null ]) : bool
Parameters
-
$cancellation
: CancellationInterface|null
= null
-
-
see
-
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/sdk.md#shutdown-2
convertSpan()
protected
convertSpan(SpanDataInterface $span) : array<string|int, mixed>
Parameters
-
$span
: SpanDataInterface
-
-
psalm-suppress
-
Return values
array<string|int, mixed>
getLogger()
protected
getLogger() : LoggerInterface
Return values
LoggerInterface
log()
protected
log(string $message[, array<string|int, mixed> $context = [] ][, string|null $level = null ]) : void
Parameters
-
$message
: string
-
-
$context
: array<string|int, mixed>
= []
-
-
$level
: string|null
= null
-
setSpanConverter()
protected
setSpanConverter(SpanConverterInterface $converter) : void
Parameters
-
$converter
: SpanConverterInterface
-
doLog()
private
doLog(iterable<string|int, mixed> $spans) : void
Parameters
-
$spans
: iterable<string|int, mixed>
-
setServiceName()
private
setServiceName(string $serviceName) : void
Parameters
-
$serviceName
: string
-