Skip to content
Search
DSL · Telemetry otlp

otlp_curl_transport

Definition

/**
 * Create a synchronous curl transport for OTLP endpoints.
 *
 * Creates a CurlTransport that drives each request to completion and reports the
 * outcome immediately (returns on success, throws on failure). OTLP/HTTP allows
 * JSON or Protobuf encoding; defaults to JSON. Keeping export off the application
 * hot path is the job of the batching processor in front of the exporter.
 *
 * Requires: ext-curl PHP extension
 *
 * @param string $endpoint OTLP endpoint URL (e.g., 'http://localhost:4318')
 * @param JsonSerializer|ProtobufSerializer $serializer Serializer for encoding telemetry data (JSON or Protobuf)
 * @param CurlTransportOptions $options Transport configuration options
 * @param ?Transport $failover Optional failover transport receiving the batch when the primary fails
 */
otlp_curl_transport(string $endpoint, JsonSerializer|ProtobufSerializer $serializer, CurlTransportOptions $options, ?Transport $failover) : Transport

Contributors

Built in the open.

Join us on GitHub
scroll back to top