Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Stackdriver Bundle Laravel Package

mgdsoft/stackdriver-bundle

A Symfony bundle for integrating Google Stackdriver services into your PHP application, helping route logs and errors to Google Cloud observability tooling with minimal configuration.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

The package is mislabeled in the request: mgdsoft/stackdriver-bundle is a Symfony bundle, not a Laravel package. Its value proposition is twofold — a Monolog handler that ships records to Google Stackdriver (now Google Cloud Operations: Cloud Logging + Error Reporting) and an exception reporter that formats payloads for Error Reporting's grouping rules. Laravel's logging stack is Monolog-based, so the handler concept is portable, but the bundle is not: the Symfony DI extension, configuration tree, service definitions, and compiler passes have no equivalent in Laravel's container. In a Laravel codebase you would consume at most the handler class (and likely have to rewrite its constructor wiring), meaning you inherit the maintenance of a piece of code the vendor has already abandoned. Fit is therefore "conceptually relevant, structurally mismatched."

The underlying capability, however, is real and still needed. GCP-native logging and error grouping are worth having in a Laravel app running on GKE, Cloud Run, or GCE, and doing it well requires more than error_log() — it requires correct severity mapping, logging.googleapis.com/trace / spanId correlation, serviceContext for Error Reporting grouping, and HTTP @type payloads for request-scoped logs. That is exactly the kind of nuance this bundle was written to handle.

Integration feasibility

Low-to-moderate, and almost entirely decoupled from the package itself.

  • Monolog handler classes are cheap to instantiate directly in config/logging.php as a custom channel via tap or a Monolog\Handler\HandlerInterface factory. No bundle wiring required.
  • The hard dependencies are google/cloud-logging and google/cloud-error-reporting (or raw REST via Guzzle). Those are Google-maintained and current; the bundle is just glue.
  • The realistic path is: read the source (it is small), lift the handler + exception formatter, and pin it in-house against current Monolog and current Google Cloud PHP SDK versions. That is a half-day to two-day spike for a competent PHP engineer, plus review.
  • Risk that the lifted code targets Monolog 1.x APIs (HandlerInterface::handle, AbstractProcessingHandler signatures changed in 2.x/3.x) and PHP 7.x type semantics. Modern Laravel (10/11) ships Monolog 3.x, so signature and return-type drift is near-certain.

Technical risk

High, concentrated in supply chain and longevity rather than in the code's logic.

  1. Archived, zero stars, zero dependents. No security response, no CVE path, no upstream fixes for PHP 8.x deprecations or Monolog 3 breaking changes. Adopting it as a Composer dependency means an unmaintained transitive dependency in the lockfile permanently, which most security scanners (and any SOC 2 / ISO vendor review) will flag.
  2. No community validation. Zero dependents means the Error Reporting payload shaping has never been battle-tested outside the author's environment. Grouping bugs in Error Reporting are subtle and produce silently degraded signal (every exception becomes its own group, or unrelated ones merge) — the failure is invisible until an incident.
  3. Credential and egress assumptions are baked into the handler. If it authenticates via a service-account JSON path or a hardcoded project ID rather than Application Default Credentials / Workload Identity, it will not survive a move to GKE Workload Identity or Cloud Run's metadata-based credentials without modification.
  4. Blocking I/O on the request path. Most hand-rolled Stackdriver handlers flush synchronously. Under load that adds GCP API latency to user-facing responses and turns a Cloud Logging quota or outage into an application latency incident.

Key questions

  • Is GCP actually the target cloud for this workload, and is Cloud Logging + Error Reporting the sanctioned observability stack, or is there already a Datadog/Sentry/OTel standard this would fragment?
  • Is there existing production usage of this bundle we must migrate off, or is this a greenfield evaluation? (Given zero dependents, existing usage is likely internal-only.)
  • Who owns the forked handler — is there a named engineer and a review cadence, or is this "we'll copy it and forget it"?
  • Do we need Error Reporting's grouping specifically, or is "exceptions land in Cloud Logging with a stack trace" sufficient? If the latter, the official google/cloud-logging PSR-3 logger gets us 90% of the value with a maintained dependency.
  • What is the projected Cloud Logging ingestion volume, and has anyone modeled the cost? Logging ingestion is frequently the surprise line item in GCP bills for chatty Laravel apps.
  • What is the acceptable behaviour when the logging backend is unavailable — drop, buffer, or fail the request?

Integration Approach

Stack fit

Poor as a package, acceptable as source material. Laravel + Monolog + GCP is a well-trodden combination with official support; the missing piece is only the formatting of Stackdriver-specific fields. That formatting is ~200 lines of well-understood logic that Google documents publicly. The recommended posture is: do not add mgdsoft/stackdriver-bundle to composer.json. Instead, vendor a minimal adapter under app/Support/Logging/ that composes google/cloud-logging and google/cloud-error-reporting, using the bundle's source as a reference implementation for the field names.

Migration path

If the package is already in use:

  1. Inventory call sites — expected to be one or two Monolog channel configurations plus an exception handler registration.
  2. Stand up the replacement adapter behind the same Monolog channel name so application code and Log::channel('stackdriver') calls are unchanged.
  3. Dual-write for one sprint: existing handler plus new adapter, comparing severity mapping, trace correlation, and Error Reporting group counts in the GCP console.
  4. Remove the archived dependency and the Symfony bundle registration in the same PR that removes the dual-write.

If it is not in use — which the dependency metrics suggest — the migration path is simply "don't start." Document the decision so it does not get re-proposed from a stale Stack Overflow answer.

Compatibility

  • Assume Monolog 1.x-era signatures. Laravel 10/11 use Monolog 3.x; AbstractProcessingHandler::write() now has array $record): void and HandlerInterface gained close(). Expect compile-time fatals, not subtle runtime bugs — which is at least a fast failure.
  • Assume PHP 7.x constraints and no declare(strict_types=1) discipline; PHP 8.2/8.3 will surface dynamic-property and nullable-parameter deprecations.
  • Symfony bundle getContainerExtension() and Configuration tree are inert in Laravel; they must be stripped, not ported.
  • google/cloud-logging and google/cloud-error-reporting current majors are compatible with PHP 8.1+ and Monolog 3 via their PSR-3 logger; use those versions, not whatever the bundle pinned.

Sequencing

  1. Decision + ADR (1 week): confirm GCP is the observability target; record the reject/fork rationale. Cheapest point to stop.
  2. Spike (2–3 days): build the adapter against google/cloud-logging PsrLogger + google/cloud-error-reporting bootstrap; validate severity mapping, trace correlation, and Error Reporting grouping in a non-prod GCP project.
  3. Non-prod rollout (1 sprint): custom Monolog channel in config/logging.php, ADC/Workload Identity verified, log-based alerting smoke-tested.
  4. Production rollout (1 sprint): behind a feature flag on the log channel; monitor ingestion volume and cost for two weeks before enabling on high-traffic services.
  5. Cleanup: ensure the archived package never enters the lockfile; add a CI check or allowlist entry so it cannot be reintroduced.

Operational Impact

Maintenance

This is the dominant cost and the reason to reject the dependency outright. An archived package with zero stars has an effective maintenance burden of 100% internal ownership with 0% upstream contribution path. Every PHP minor upgrade, every Monolog major, every Google Cloud PHP SDK bump becomes a manual patch against code no one on the team wrote. Contrast with the maintainable alternative: Google's own libraries are on a published release cadence, have security disclosure processes, and are covered by most dependency scanners. The forked-adapter approach concentrates the maintenance into a small file the team owns deliberately rather than a directory of unfamiliar Symfony code.

Support

None. No issue tracker activity, no maintainer response, no Stack Overflow corpus, no Slack community. When the handler silently drops records or mis-groups exceptions, the only debugging path is reading the source. For a TPM this matters in incident reviews: "we couldn't determine why logs were missing" is not an acceptable root cause, and with this package it is the likely one. Escalation path is GCP Support for the API, which will not help with a third-party handler's payload shape.

Scaling

Two scaling axes, both problematic with a naive handler:

  • Throughput/latency: synchronous per-record HTTP calls to the Logging API add tens of milliseconds to request handling and degrade non-linearly during GCP-side throttling. Needs batching (BatchJob/PsrLogger with a batch processor) and a bounded buffer with an explicit drop policy. Verify the handler supports non-blocking flush before committing.
  • Cost: Cloud Logging charges per GiB ingested. A Laravel app logging at debug in production, or logging full query bindings/request bodies, can produce a four-figure monthly bill that nobody forecast. Set log exclusion filters, default production channels to warning+, and put a budget alert on the Logging SKU before enabling. Error Reporting itself is free but quota-limited per project.

Failure modes

  • Silent drop: handler catches transport exceptions and returns, so GCP outages or misconfigured credentials produce no logs and no application errors. Needs a fallback channel (stderr, which GKE/Cloud Run capture natively) and a health metric.
  • Credential drift: service-account JSON baked into config breaks under Workload Identity or key rotation. Mitigate by requiring ADC (google/auth default provider chain) and failing fast at boot in non-prod.
  • Grouping degradation: incorrect serviceContext or missing stack_trace fields cause Error Reporting to fragment one bug into hundreds of groups, or merge distinct bugs. This looks like "fewer errors" on a dashboard and is actively dangerous.
  • Trace correlation loss: without logging.googleapis.com/trace populated from the request, correlating logs to traces in Cloud Trace is manual and slow — negating much of the reason to use Stackdriver at all.
  • Buffered-log loss on fatal: records buffered in-memory are lost on OOM or segfault, exactly the cases where the logs matter most. Ensure a flush-on-shutdown path or an unbuffered tier for error+.

Ramp-up

Low individual ramp-up, moderate organizational ramp-up. Any PHP engineer can read the handler in an hour. The real ramp-up is GCP observability literacy: log severity mapping, exclusion filters, log-based metrics and alerting, Error Reporting grouping semantics, and IAM for ADC/Workload Identity. Budget for that regardless of which package you choose — it is the actual deliverable. Recommend pairing the adapter work with a written runbook covering "logs are missing," "errors are over-grouped," and "ingestion cost spiked," owned by whoever owns the on-call rotation.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console