OpenTelemetry PHP

BatchSpanProcessor
in package
implements SpanProcessorInterface uses LogsMessagesTrait

Table of Contents

Interfaces

SpanProcessorInterface

Constants

DEFAULT_EXPORT_TIMEOUT  = 30000
DEFAULT_MAX_EXPORT_BATCH_SIZE  = 512
DEFAULT_MAX_QUEUE_SIZE  = 2048
DEFAULT_SCHEDULE_DELAY  = 5000

Properties

$autoFlush  : bool
$batch  : array<int, SpanDataInterface>
$batchId  : int
$clock  : ClockInterface
$closed  : bool
$exportContext  : ContextInterface
$exporter  : SpanExporterInterface
$exporterAttributes  : array<non-empty-string, string>
$flush  : SplQueue<string|int, ContextInterface}>
$maxExportBatchSize  : int
$maxQueueSize  : int
$nextScheduledRun  : int|null
$processorAttributes  : array<non-empty-string, string>
$queue  : SplQueue<string|int, array<int, SpanDataInterface>>
$queueSize  : int
$running  : bool
$scheduledDelayNanos  : int
$spanExportedCounter  : CounterInterface|null
$spanInflightCounter  : UpDownCounterInterface|null
$spanProcessedCounter  : CounterInterface|null

Methods

__construct()  : mixed
builder()  : BatchSpanProcessorBuilder
forceFlush()  : bool
Export all ended spans to the configured Exporter that have not yet been exported.
onEnd()  : void
onStart()  : void
shutdown()  : bool
Cleanup; after shutdown, calling onStart, onEnd, or forceFlush is invalid Returns `false` is the processor is already shutdown, otherwise `true`.
logDebug()  : void
logError()  : void
logInfo()  : void
logNotice()  : void
logWarning()  : void
doLog()  : void
enqueueBatch()  : void
flush()  : bool
shouldFlush()  : bool
shouldLog()  : bool

Constants

Properties

$exporterAttributes read-only

private array<non-empty-string, string> $exporterAttributes

$processorAttributes read-only

private array<non-empty-string, string> $processorAttributes

Methods

__construct()

public __construct(SpanExporterInterface $exporter, ClockInterface $clock[, int $maxQueueSize = self::DEFAULT_MAX_QUEUE_SIZE ][, int $scheduledDelayMillis = self::DEFAULT_SCHEDULE_DELAY ][, int $exportTimeoutMillis = self::DEFAULT_EXPORT_TIMEOUT ][, int $maxExportBatchSize = self::DEFAULT_MAX_EXPORT_BATCH_SIZE ][, bool $autoFlush = true ][, MeterProviderInterface|null $meterProvider = null ]) : mixed
Parameters
$exporter : SpanExporterInterface
$clock : ClockInterface
$maxQueueSize : int = self::DEFAULT_MAX_QUEUE_SIZE
$scheduledDelayMillis : int = self::DEFAULT_SCHEDULE_DELAY
$exportTimeoutMillis : int = self::DEFAULT_EXPORT_TIMEOUT
$maxExportBatchSize : int = self::DEFAULT_MAX_EXPORT_BATCH_SIZE
$autoFlush : bool = true
$meterProvider : MeterProviderInterface|null = null

forceFlush()

Export all ended spans to the configured Exporter that have not yet been exported.

public forceFlush([CancellationInterface|null $cancellation = null ]) : bool

Returns true if the flush was successful, otherwise false.

Parameters
$cancellation : CancellationInterface|null = null
Attributes
#[Override]
Return values
bool

shutdown()

Cleanup; after shutdown, calling onStart, onEnd, or forceFlush is invalid Returns `false` is the processor is already shutdown, otherwise `true`.

public shutdown([CancellationInterface|null $cancellation = null ]) : bool
Parameters
$cancellation : CancellationInterface|null = null
Attributes
#[Override]
Return values
bool

logDebug()

protected static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logError()

protected static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logInfo()

protected static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logNotice()

protected static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

logWarning()

protected static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
$message : string
$context : array<string|int, mixed> = []

doLog()

private static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
$level : string
$message : string
$context : array<string|int, mixed>

shouldLog()

private static shouldLog(string $level) : bool
Parameters
$level : string
Return values
bool

        
On this page

Search results