Definition
/**
* Create an HTTP transport for OTLP endpoints.
*
* Creates an HttpTransport configured to send telemetry data to an OTLP-compatible
* endpoint using PSR-18 HTTP client. Supports both JSON and Protobuf formats.
*
* Example usage:
* ```php
* // JSON over HTTP
* $transport = otlp_http_transport(
* client: $client,
* requestFactory: $psr17Factory,
* streamFactory: $psr17Factory,
* endpoint: 'http://localhost:4318',
* serializer: otlp_json_serializer(),
* );
*
* // Protobuf over HTTP
* $transport = otlp_http_transport(
* client: $client,
* requestFactory: $psr17Factory,
* streamFactory: $psr17Factory,
* endpoint: 'http://localhost:4318',
* serializer: otlp_protobuf_serializer(),
* );
* ```
*
* @param ClientInterface $client PSR-18 HTTP client
* @param RequestFactoryInterface $requestFactory PSR-17 request factory
* @param StreamFactoryInterface $streamFactory PSR-17 stream factory
* @param string $endpoint OTLP endpoint URL (e.g., 'http://localhost:4318')
* @param Serializer $serializer Serializer for encoding telemetry data (JSON or Protobuf)
* @param array<string, string> $headers Additional headers to include in requests
*/
otlp_http_transport(ClientInterface $client, RequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory, string $endpoint, Serializer $serializer, array $headers) : HttpTransport