Skip to content
Search
DSL · Telemetry otlp

otlp_grpc_transport

Definition

/**
 * Create a gRPC transport for OTLP endpoints.
 *
 * Creates a GrpcTransport configured to send telemetry data to an OTLP-compatible
 * endpoint using gRPC protocol with Protobuf serialization. OTLP/gRPC mandates
 * Protobuf, so the serializer is built internally and not configurable.
 *
 * Requires:
 * - ext-grpc PHP extension
 * - google/protobuf package
 *
 * @param string $endpoint gRPC endpoint (e.g., 'localhost:4317')
 * @param array<string, string> $headers Additional headers (metadata) to include in requests
 * @param bool $insecure Whether to use insecure channel credentials (default true for local dev)
 * @param int $timeoutMs Per-call deadline in milliseconds (covers connect + send + receive)
 * @param int $shutdownTimeoutMs Wall-clock budget for draining pending calls at shutdown
 * @param ?Transport $failover Optional failover transport receiving prior batches when primary fails
 */
otlp_grpc_transport(string $endpoint, array $headers, bool $insecure, int $timeoutMs, int $shutdownTimeoutMs, ?Transport $failover) : Transport

Contributors

Built in the open.

Join us on GitHub
scroll back to top