class OtlpExporterFactory implements ExporterFactory

Create OTLP/HTTP exporters with coroutine-compatible Guzzle transports.

Properties

protected HttpFactory $httpFactory
protected HttpEndpointResolver $endpointResolver
protected ClientInterface> $clients

Methods

__construct()

Create an OTLP exporter factory.

SpanExporterInterface
spanExporter(array $config)

Create an OTLP span exporter.

MetricExporterInterface
metricExporter(array $config)

Create an OTLP metric exporter.

LogRecordExporterInterface
logExporter(array $config)

Create an OTLP log-record exporter.

TransportInterface
transport(array $config, string $signal)

Create an OTLP transport for one signal.

void
validateSignalConfig(array $config, string $signalPrefix)

Validate final signal settings before constructing an exporter transport.

string
signalPrefix(string $signal)

Return the configuration prefix for an OpenTelemetry signal.

array
signalConfig(array $config, string $signal)

Resolve the final per-signal OTLP settings.

string
contentType(string $protocol, string $signalPrefix)

Return the OTLP content type for an HTTP protocol.

ClientInterface
client(array $config)

Return a client shared by signals with the same network settings.

ClientInterface
createClient(array $options)

Create the PSR-18 client used by an OTLP transport.

array
clientOptions(array $config)

Build Guzzle options for the normalized TLS and timeout settings.

string|null
temporality(string $temporality)

Map the configured metric temporality to the SDK representation.

Details

at line 43
__construct()

Create an OTLP exporter factory.

at line 54
SpanExporterInterface spanExporter(array $config)

Create an OTLP span exporter.

Parameters

array $config

Return Value

SpanExporterInterface

at line 62
MetricExporterInterface metricExporter(array $config)

Create an OTLP metric exporter.

Parameters

array $config

Return Value

MetricExporterInterface

at line 75
LogRecordExporterInterface logExporter(array $config)

Create an OTLP log-record exporter.

Parameters

array $config

Return Value

LogRecordExporterInterface

at line 83
protected TransportInterface transport(array $config, string $signal)

Create an OTLP transport for one signal.

Parameters

array $config
string $signal

Return Value

TransportInterface

at line 115
protected void validateSignalConfig(array $config, string $signalPrefix)

Validate final signal settings before constructing an exporter transport.

Parameters

array $config
string $signalPrefix

Return Value

void

at line 161
protected string signalPrefix(string $signal)

Return the configuration prefix for an OpenTelemetry signal.

Parameters

string $signal

Return Value

string

at line 186
protected array signalConfig(array $config, string $signal)

Resolve the final per-signal OTLP settings.

Parameters

array $config
string $signal

Return Value

array

at line 207
protected string contentType(string $protocol, string $signalPrefix)

Return the OTLP content type for an HTTP protocol.

Parameters

string $protocol
string $signalPrefix

Return Value

string

at line 228
protected ClientInterface client(array $config)

Return a client shared by signals with the same network settings.

Parameters

array $config

Return Value

ClientInterface

at line 243
protected ClientInterface createClient(array $options)

Create the PSR-18 client used by an OTLP transport.

Parameters

array $options

Return Value

ClientInterface

at line 258
protected array clientOptions(array $config)

Build Guzzle options for the normalized TLS and timeout settings.

Parameters

array $config

Return Value

array

at line 276
protected string|null temporality(string $temporality)

Map the configured metric temporality to the SDK representation.

Parameters

string $temporality

Return Value

string|null