flow php

UNIFIED DATA PROCESSING FRAMEWORK

composer require flow-php/etl ~0.30.0

ChangelogRelease Cycle

play Try Flow Online

elephant
extract

Extracts

Read from various data sources.

arrow
transform

Transforms

Shape and optimize for your needs.

arrow
load

Loads

Store and secure in one of many available data sinks.


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

Contributors

Join us on GitHub external resource
scroll back to top