google/cloud-error-reporting
Idiomatic PHP client for Google Cloud Error Reporting (Stackdriver), which counts, analyzes, and aggregates crashes across your cloud services. Install via Composer; supports REST and gRPC. Beta component from Google Cloud PHP.
Architecture fit. google/cloud-error-reporting is a thin, generated GAPIC client for the Google Cloud Error Reporting API (v1beta1), exposing ErrorGroupServiceClient and ErrorStatsServiceClient plus error-event reporting. It is not an application-level error handler. That distinction drives the entire evaluation: the package gives you programmatic access to error groups, counts, and affected-service statistics, and a way to explicitly report an error event. The actual ergonomics — aggregation, deduplication across releases, alerting, and the console UI — come from the Cloud Error Reporting backend, which ingests structured error payloads (notably from Cloud Logging entries carrying stack traces). So the value proposition is "one more surface on an existing GCP observability stack," not "drop-in exception tracking for Laravel."
Integration feasibility. Composer-installable, Apache-2.0, standard Google ADC authentication, REST or gRPC transport. Wiring it into a Laravel app is straightforward but entirely manual: bind a singleton client in a service provider, call it from App\Exceptions\Handler::report(), and wrap calls in try/catch since every client method throws ApiException. There is no Laravel package, no service provider, no config file, no Monolog handler, no middleware. Expect roughly one to three days of engineering for a competent PHP developer to build a resilient wrapper (including fallback logging and retry) — small, but it is work you own forever. Note also that google/cloud-logging is a more natural ingestion path for Laravel: writing exceptions as structured log entries with serviceContext and a stack trace gets you Error Reporting aggregation without this package. Use this client primarily when you need to read error groups/stats programmatically — e.g., surfacing "top errors this release" in an internal dashboard, or gating a deploy on new-error-group creation.
Technical risk.
V1beta1 namespaced classes that have shifted across releases.ErrorReporter interface with a GCP implementation), but only if you decide to abstract on day one. Retrofitting is painful.Key questions.
serviceContext, which avoids this dependency entirely?Stack fit. Reasonable for PHP 8.2+ services already on GCP (Cloud Run, GKE, Compute, App Engine) where ADC and IAM are already provisioned. Poor fit for on-premise, AWS/Azure-primary, or multi-cloud estates — the client is hard-wired to Google service addresses (mitigated somewhat by Universe Domain support added in v0.22.0 for regional/data-residency requirements). No conflicts with Laravel core dependencies; pulls in google/cloud-core and, if you want gRPC, the grpc extension (~5MB image growth and a C extension build step).
Migration path. There is nothing to migrate from — this is greenfield instrumentation, not a replacement. The realistic path is incremental: start by shipping structured error logs through your existing Monolog stack and confirm they appear in Error Reporting with correct serviceContext and stack traces. Only then add this client for the capabilities logs cannot give you: enumerating open error groups, pulling affected-user counts, or reporting errors from contexts where logging is not the transport (e.g., a CLI worker that does not write to Cloud Logging).
Compatibility. REST over HTTP/1.1 as the default transport; gRPC only where you have the extension and a long-lived process. For Laravel on FPM or serverless (Bref, Cloud Run scale-to-zero), REST is the safer default — gRPC channel setup adds cold-start cost that outweighs the streaming benefits you will not use here. PHP 8.4 compatibility was explicitly patched in v0.22.9, so current PHP versions are covered.
Sequencing.
ErrorReporterContract with report(Throwable, array $context); implement GCP and a no-op/local-log fallback. This is the durable asset — the vendor client is disposable underneath it.Handler::report() and queue failed() events. Do not block the request path — dispatch to a queued job or a terminally-failing-safe path.Maintenance. Low code volume, but nonzero ongoing cost: 0.x minor bumps requiring review, a GAPIC surface that has already been restructured twice, and authentication that depends on google/auth and correctly scoped service accounts. Budget roughly a half-day per quarter for dependency review, plus the inevitable break when a minor release renames a client. Pin exact versions and let Renovate/Dependabot open the PRs rather than floating constraints.
Support. Community support is effectively absent (20 stars, 0 dependents) — the only escalation path is Google Cloud Support, which is available only with a paid GCP support plan. That is a real procurement consideration: this dependency inherits your GCP support tier, or you have no support at all. Internal ownership must be named explicitly.
Scaling. Cost and quota are driven by the GCP backend, not the client. Google Cloud throttles API requests, so batch and back off with exponential retry — do not issue one API call per exception. Under an incident storm, a naive implementation becomes a self-inflicted DoS on your error reporter precisely when you need it most. Cap report volume per time window and sample aggressively; the SDK does not do this for you.
Failure modes.
Ramp-up. Minimal for a PHP developer comfortable with Composer and DI; the sample is copy-pasteable. The real learning curve is GCP-side — IAM roles, ADC in local versus deployed environments, log-to-error mapping, and alert policy configuration — which is roughly one to two days for someone new to the console. Allocate that to whoever owns observability, and write a runbook covering "reporter is down, how do I know?" before the first production deploy.
Recommendation. Adopt as a query-side client behind an internal interface if you are already GCP-native and need programmatic access to error groups; treat it as low-priority. For the far more common "capture Laravel exceptions" need, prefer a structured Cloud Logging path or a first-party Laravel error-tracking package — this client is the wrong layer for that job, and its beta status, zero ecosystem, and manual instrumentation burden make it a poor default.
How can I help you explore Laravel packages today?