dotswan/eagle-eye
dotswan/eagle-eye is a Laravel package for gaining visibility into your application's activity. It offers a lightweight, configurable way to track and inspect users and events, helping you monitor behavior and debug issues faster.
Install on the beta channel and pin it, since 1.0.0 is still pre-release:
composer require dotswan/eagle-eye:^1.0@beta
You will likely also need "minimum-stability": "beta" (or a prefer-stable + explicit constraint) in composer.json.
First steps, in order:
http.request, model.created, auth.login, …), the trace-id propagation settings, the sampling budget, the redaction rules, and the driver (Loki, MySQL, or a local sink). Publish it before writing any code — most "why isn't this captured?" questions are answered there.local and only wire Loki/MySQL in staging, so you are not debugging your observability tool through your observability tool.The first real use case is almost always: "I need to correlate an HTTP request with the model writes and the auth event it caused, without adding Log::info calls to every controller." That is the zero-code capture path — middleware plus Eloquent/auth event listeners — and it is the part worth validating before you tune anything else.
Zero-code capture as the default, opt-in per family. Leave model/auth/HTTP capture enabled globally and disable noisy families per environment (model.updated on a high-write table will dwarf everything else). Prefer config-level toggles over removing listeners, so the trace id stays consistent across whatever remains.
Treat the trace id as the contract. Everything downstream — log correlation, the erasure barrier, the budget pipe — keys off it. Propagate it through queued jobs and outbound HTTP calls explicitly; a job dispatched without the trace id produces an orphaned model.created that looks like a bug in the package but is a gap in your dispatch path.
Redaction belongs in the sanitiser layer, not in your models. Actor and subject identities are sanitised before the erasure barrier digests them. If you add a custom identity (a tenant, an API client), register its sanitiser alongside the built-in ones rather than mutating the attribute in a model accessor — accessor-level changes leak into your application logic and are invisible to the barrier.
Budget the volume, don't sample blindly. The budget pipe is your cost control. Set a per-environment budget and, critically, make sure "dropped by budget" is distinguishable from "never captured" in your own dashboards — otherwise a sampling change looks identical to a regression.
Integration testing pattern. Assert on captured events rather than on the destination: run the action under test, then assert the emitted event set and that the trace ids match. Include an anonymous model subclass (new class extends Model) in at least one test — it is an explicitly covered regression case and a cheap guard against the class of bug fixed in beta.2.
Driver abstraction is your escape hatch. Keep Loki/MySQL specifics out of application code; if you find yourself importing a driver class into a service, the config is doing too little.
auth.login entries — to be discarded with no trace. If telemetry vanishes wholesale rather than partially, suspect the buffer/flush path, not your listeners. Upgrade to beta.2 and, regardless, emit a low-volume canary event you can alert on.1.0.0. Pin the exact beta, read the upgrade notes on each bump, and isolate any direct use of package classes behind a thin internal wrapper so a rename is a one-file change.How can I help you explore Laravel packages today?