affordablemobiles/open-telemetry-operations-php
Operational tooling for OpenTelemetry in PHP applications. This package provides helpers to configure and manage tracing and metrics, making it easier to instrument Laravel/PHP services and ship telemetry data to your observability backend.
Architecture fit. This package occupies a narrow but well-defined slot in the OpenTelemetry PHP stack: it is an exporter/propagator layer that translates OTLP-shaped telemetry into Google Cloud Operations Suite payloads (Cloud Trace spans, Cloud Monitoring time series) and understands the X-Cloud-Trace-Context header used for trace continuity across GCP load balancers. For a Laravel application the natural integration point is a service provider registered in config/app.php (or via package auto-discovery), wiring an Exporter and Propagator into the OTel SDK's TracerProvider/MeterProvider. It is not a framework-level package; it is a transport adapter, so its architectural footprint is small and reversible — a meaningful advantage for risk-managed adoption.
Integration feasibility. Composer-installable under MIT, with a Laravel-shaped ergonomic layer. Realistic prerequisites: PHP 8.1+, the open-telemetry/sdk and open-telemetry/api packages, a PSR-18 HTTP client (Guzzle is standard in Laravel), and Google Application Default Credentials. On Cloud Run / GKE / App Engine, ADC and GOOGLE_CLOUD_PROJECT are ambient, so configuration is minimal; off-GCP it requires a service-account key file and therefore a secrets-management story. Feasible in a day for a spike; production-ready in a sprint or two including sampling and shutdown-flush hardening.
Technical risk. The dominant risk is sourcing, not engineering. One star, zero dependents, a single corporate maintainer (a UK mobile retailer, not a telemetry vendor), and a last release of April 2024 all indicate a package extracted from internal usage rather than a supported product. It is almost certainly a fork of Google's official open-telemetry/opentelemetry-operations-php, which raises divergence risk: it may pin older OTel SDK versions, lag upstream fixes, or carry retailer-specific assumptions. The OTel PHP SDK stabilized through 2023–2024, so a 2024-04 pin may be compatible with 1.x but is unlikely to track the current release line. Secondary risks: silent export failures (exporter errors frequently swallowed in batch processors), credential rotation, and GCP API surface drift (Trace/Monitoring v2/v3).
Key questions. Is this a fork or original code, and what does it add over the official Google package? Which OTel PHP SDK versions are supported and tested? Does it cover traces only, or also metrics and logs? What is the resource-detection story for Cloud Run/GKE (service name, revision, instance ID)? How are exporter errors surfaced, and is there a documented shutdown/flush path for FPM and Octane? Who maintains it, and is there an upgrade commitment?
Stack fit. Laravel 10/11 on PHP 8.1–8.3, Composer, Guzzle, and an existing PSR-3 logger. Fits cleanly alongside queue workers, Octane, and typical Laravel observability (Telescope, Horizon) without conflict, provided the OTel SDK version constraint resolves. The GCP-native alternative — running an OpenTelemetry Collector sidecar and exporting via googlecloud exporter — is the more vendor-neutral baseline and should be the comparison point.
Migration path. Do not adopt directly into production. Sequence: (1) stand up an OTel Collector in a non-prod GCP project and validate end-to-end trace propagation with the vanilla OTel PHP SDK; (2) run a bake-off between this package and the official open-telemetry/opentelemetry-operations-php, both pinned, both instrumenting the same Laravel service; (3) decide direct-export vs. collector-mediated export based on cost, latency, and credential surface; (4) only then adopt the winning exporter. If this package wins, vendor-fork it into an internal repository to insulate against upstream abandonment.
Compatibility. Verify Composer constraints against your Laravel/PHP matrix before any design work — a PHP 8.1 floor and an OTel SDK pin are the two most likely blockers. Confirm PSR-18 client compatibility (Laravel's default Guzzle binding is usually fine) and that the propagator can be composed with any existing W3C traceparent propagator if you have non-GCP upstream services.
Sequencing. Instrumentation → local collector validation → GCP project wiring (IAM, service account, APIs enabled) → sampling policy → production canary on one service → fleet rollout. Budget a gate at each step; the canary should specifically exercise Cloud Run cold starts and FPM request teardown, where flush bugs surface.
Maintenance. Highest ongoing cost is ownership of a low-velocity dependency. Expect to pin versions, monitor the upstream Google package for security and API changes, and carry a maintenance burden if you fork. Treat this package as internalized code from day one: assign an owner, document the fork delta, and schedule quarterly upstream-diff reviews.
Support. No vendor support, no SLA, no community depth (one star, zero dependents). Internal expertise is the only support channel. This is acceptable for a non-critical observability path and unacceptable for anything that gates incident response — which, ironically, observability does. Mitigate by ensuring the application still functions if the exporter is disabled (feature-flag the tracer provider).
Scaling. The package itself is not the scaling bottleneck; GCP ingestion economics are. Cloud Trace and Cloud Monitoring bill per span and per time series, so head-based sampling (e.g., 10% baseline, 100% on error) is mandatory before fleet-wide rollout. Also account for HTTP batching size, queue-worker egress, and the cost of cross-region export if services run outside the GCP region hosting the telemetry APIs.
Failure modes. (1) Silent span loss when the batch processor's queue fills or the exporter 4xx/5xx responses are swallowed — instrument the exporter itself or add a fallback log. (2) Trace truncation at request end in FPM/Octane if shutdown() is not wired into the framework lifecycle. (3) Credential expiry or ADC misconfiguration surfaces as silent no-ops rather than errors. (4) Quota exhaustion on Cloud Trace/Monitoring producing rate-limit drops under load. (5) Fork divergence causing a hard-to-diagnose incompatibility after a routine composer update.
Ramp-up. A mid-level Laravel engineer needs roughly one to two weeks to become productive with OTel concepts (context propagation, samplers, resource attributes, batch processors) plus the GCP-specific surface. A TPM should plan for a spike owner, a documented runbook covering credential setup and exporter health checks, and a rollback lever (disabling the tracer provider via env var) before committing to production.
TPM recommendation. Position this package as a candidate in a two-week evaluation, not a committed dependency. The engineering lift is low and reversible; the sourcing risk is high and structural. Default to the official Google package or a collector-mediated architecture unless this fork demonstrably solves a Laravel-specific problem the official package does not — in which case, fork it internally and own it.
How can I help you explore Laravel packages today?