apirelio/php-core
Framework-independent PHP 8.2+ core for Apirelio API monitoring SDKs. Provides the stable privacy-safe event contract, customer and application value objects, metadata privacy rules, error-code extraction, HTTP retry orchestration and a locked local file buffer for fail-safe delivery.
Architecture fit. This is an initial assessment; no prior evaluation exists, so the baseline is being established here. Apirelio's PHP telemetry core is a shared library — the release notes describe it as the "core," which implies a layered architecture in which framework-agnostic instrumentation lives here and a Laravel adapter (service provider, middleware, facade) sits above it or is expected to be written by us. That distinction is the single most important architectural question and the release notes do not answer it. If a Laravel bridge ships separately, this package is a transitive dependency we consume indirectly and the integration surface is small. If it does not, we are adopting a lower-level library and own the Laravel wiring ourselves — a materially larger commitment.
Integration feasibility. The declared PHP support range (8.2–8.5) is a good signal. It sits squarely within the supported range for Laravel 11 and 12 (both require PHP 8.2+) and cleanly excludes Laravel 10 and earlier, which is a reasonable and modern floor. PHP 8.5 support indicates active maintenance and forward compatibility rather than a library pinned to an aging runtime. The "stable 1.x" designation matters: pre-1.0 telemetry libraries routinely reshuffle instrumentation APIs, so hitting 1.0 gives us semver guarantees we can build a dependency policy around. Beyond that, we have no information on transport (OTLP? vendor endpoint? local log sink?), no information on PSR compliance (PSR-3 logging, PSR-18 HTTP client, PSR-15-style middleware), and no information on configuration model. Feasibility is plausible but unverified.
Technical risk. The dominant risk is not the library itself but the observability surface it creates. Telemetry is cross-cutting: it touches every request, every outbound call, and every queue job. A defect here degrades the whole application rather than one feature. Specific risks to retire before commitment:
Key questions.
Stack fit. The PHP 8.2 floor aligns with our Laravel 11/12 target if we are on those versions; if any service remains on Laravel 10 or PHP 8.1, it is out of scope for this package without an upgrade, and that should be treated as a hard partition of the rollout rather than a blocker for the whole effort. Adoption should start where the runtime is already compliant.
Migration path. There is nothing to migrate from — this is a greenfield introduction. That is an advantage: we can stage it as an additive change behind configuration flags rather than a cutover. The recommended path is a single non-critical service first, with telemetry emission enabled but export pointed at a throwaway or local collector, so we observe volume and shape before provisioning backend capacity.
Compatibility. Two compatibility axes need checking, and neither is answerable from the release notes. The first is runtime coexistence: if we already run an APM tool, two instruments instrumenting the same request can double-count spans or conflict at the autoloader/hook level. The second is dependency tree: a "shared core" may pull in an HTTP client, a protobuf or serialization library, or an SDK that constrains our composer.lock. Both should be resolved in a throwaway branch before any service integration begins.
Sequencing.
Maintenance. We inherit a dependency that must track PHP and Laravel releases. Given the declared 8.2–8.5 range, the maintainers appear to be keeping pace with PHP's annual cadence, which is reassuring but also means an annual upgrade obligation on our side. Pin to a caret constraint on 1.x, budget a review per minor, and treat the package as a monitored dependency rather than install-and-forget.
Support. The package is third-party and external. Support posture is unknown: we have no stated SLA, no visibility into maintainer headcount, and no evidence of an LTS commitment. For a telemetry layer that sits in the request path of every service, that is an unpriced risk. Mitigation is architectural — keep the integration thin and behind our own abstraction so the package can be swapped without touching every service — plus a fallback plan that disables the package via configuration rather than a redeploy of dependent code.
Scaling. Telemetry scales with traffic, and cost scales superlinearly if cardinality is unmanaged (per-user or per-request-ID metric dimensions are the usual culprit). At current traffic this is negligible; at 5–10x it becomes a budget line and a collector-capacity problem. The planning inputs are bytes-per-request emitted and sampling rate, both of which the canary phase should measure. Establish a cardinality budget per service before general rollout, not after.
Failure modes. Ranked by blast radius:
Each of these needs a kill switch — a single config flag or env var that disables emission without a code change — and that requirement should be treated as non-negotiable.
Ramp-up. Modest for a single service, moderate at the org level. The engineering work is small; the process work is not. Teams need to understand what is emitted, how to query it, and how sampling affects interpretation — otherwise dashboards get built on sampled data and read as absolute truth, which is a subtler and more durable failure than an outage. Plan for a short internal enablement session alongside the pilot, and document the sampling configuration in the same place people will look for the dashboards.
Bottom line. Worth pursuing, but the release notes are not sufficient basis for a commitment decision. The PHP 8.2–8.5 range and the 1.0 stability marker are genuinely positive signals about maintenance health. Everything that determines operational risk — exporter behavior, sampling defaults, cardinality controls, PII redaction, and whether Laravel wiring is included — is unaddressed. Recommend approving a time-boxed spike, not a rollout.
How can I help you explore Laravel packages today?