muhammadhuzaifa/telescope-guzzle-watcher
Adds a Guzzle watcher to Laravel Telescope, recording outgoing HTTP client requests in the Telescope dashboard. Helps debug third-party API calls, headers, responses, and timing alongside your other Telescope entries.
Architecture fit. The package is an extension of Laravel Telescope, not a standalone tool. It registers a custom Watcher that hooks Guzzle's on_stats request option and emits entries into Telescope's existing http_client entry type. This is the right architectural seam: it reuses Telescope's storage, pruning, filtering, and UI, so there is no parallel observability stack to staff or pay for.
It addresses a genuine gap. Telescope's built-in HTTP Client Watcher only sees requests issued through Laravel's Http facade. Traffic from directly-instantiated Guzzle clients — most third-party SDKs (AWS, Stripe, Elasticsearch, Google, carrier/vendor APIs) — is invisible. For teams debugging "why is checkout slow," that blind spot is usually where the answer lives. The value proposition is therefore diagnostic completeness, not new capability.
Integration feasibility. Mechanically simple: Composer install, publish config, register the watcher in config/telescope.php, and attach the option where Guzzle clients are constructed. Low engineering effort — call it hours, not days — with no schema changes and no data migration.
The friction is the opt-in model. Because interception is driven by a per-request option, the watcher only captures clients you explicitly instrument. Third-party SDKs that build their own client internally are not covered unless the SDK exposes a handler/config hook. This materially narrows the blast radius versus the marketing claim, and it should be validated against the specific SDKs on your critical path before committing.
Technical risk.
Http facade runs on Guzzle. If the watcher attaches broadly, requests may be recorded twice — once natively, once by this watcher — inflating volume and muddying traces. Deduplication behavior is unverified.on_stats alone yields transfer statistics, not bodies, so the description implies more interception than the stated hook provides. Confirm what is actually serialized.IncomingEntry shape, and watcher contracts have changed across Telescope majors. A small package tracking a large framework component is structurally exposed to breakage on upgrade.Key questions for the maintainer / spike.
on_stats sufficient, or is middleware also injected — and if so, into whose handler stack?Stack fit. Targets Laravel with Telescope installed — practically Laravel 10/11/12 with Telescope 5.x and Guzzle 7. Prerequisite: Telescope's http_client entry type must exist in your installed version. On older Telescope majors this watcher has nothing to write into, so verify the entry type is present before scoping work.
Migration path. No migration in the data sense. Telescope entries land in the existing telescope_entries table under the http_client type. Rollback is a config flag — disable the watcher, or set TELESCOPE_ENABLED=false — with no code removal required. That reversibility is the strongest argument for a low-risk pilot.
Compatibility. Two dimensions to pin: (a) Telescope/PHP/Guzzle version matrix in composer.json, and (b) whether the SDK clients you actually care about expose a Guzzle handler or client injection point. The second is the real gate. An SDK that hides its transport cannot be instrumented by this package regardless of version compatibility.
Sequencing.
Http facade (already covered) versus raw clients versus SDK-internal.Maintenance. Low routine effort, but meaningful upgrade exposure. Telescope majors are the trigger for re-validation. Given the single maintainer and zero dependents, plan for the possibility of abandonment: vendor the package or fork it internally as a contingency. The code surface is small enough that a fork is a realistic fallback rather than a rewrite.
Support. Standard Laravel/Telescope skill set. No new tooling, no new UI, no new on-call runbook beyond "check Telescope." That is the package's quiet advantage — it adds signal without adding a surface for the on-call rotation to learn. The cost is a dependency on a hobby-scale package for production diagnostics, which should be a conscious, documented decision.
Scaling. This is the primary operational concern and it is arithmetic, not speculation. Every instrumented outbound call becomes a Telescope row plus a JSON payload. A service making ~50 Guzzle calls/minute produces roughly 70k entries/day; at 2–10 KB per entry that is on the order of 150–700 MB/day of write amplification against your primary database. Mitigations, all mandatory rather than optional:
telescope:prune aggressively (24–48h retention for this entry type).Failure modes.
| Mode | Impact | Mitigation |
|---|---|---|
| Serialization error on an exotic response | Lost diagnostic, or worse if not fail-open | Verify fail-open behavior; test with binary/streamed responses |
| Stream consumed by logging | Truncated downloads, broken SSE, memory spikes | Confirm before enabling; exclude streaming clients |
| Secret captured in entries | Credential exposure in DB and Telescope UI | Header/body redaction, verified by test |
| Telescope upgrade breaks watcher | Silent loss of visibility | Pin versions; add integration test on upgrade |
| Entry table bloat | DB degradation, pruning backlog | Aggressive prune schedule; volume alert |
| Package abandoned | No upstream fixes | Fork/vendor contingency |
Ramp-up. Days. Any Laravel engineer who has used Telescope understands the output immediately, and installation is a Composer command plus config. The real ramp-up cost is not learning the tool but institutionalizing the discipline: redaction review, environment gating, and a client-construction convention so instrumentation isn't applied inconsistently across teams.
Verdict. Worth a scoped pilot. High diagnostic value, low integration cost, clean rollback — but the opt-in interception model, unverified body/stream handling, and secret-redaction requirements mean this should not be adopted fleet-wide without a staging spike and a documented fork contingency.
How can I help you explore Laravel packages today?