Weave Code
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

Query Tracer Laravel Package

fitztrev/query-tracer

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Debugging & Performance Optimization: Accelerates root-cause analysis for slow or unexpected database queries, reducing time spent in profiling tools like Laravel Debugbar or Clockwork.
  • Developer Productivity: Enables faster debugging for junior/mid-level engineers by surfacing query origins directly in SQL output (e.g., WHERE 1=1 AND __QUERY_TRACER__ = 'App\Models\User::find(1)').
  • Build vs. Buy: Justifies not building a custom query-tracing solution for Laravel apps, especially if Debugbar/Clockwork isn’t already in use.
  • Roadmap Prioritization: Validates investment in observability tools (e.g., Clockwork) by providing a lightweight, query-specific alternative.
  • Legacy System Maintenance: Useful for older Laravel apps (pre-5.5+) where Debugbar’s backtrace feature isn’t enabled or isn’t sufficient.

When to Consider This Package

  • Adopt if:

    • Your team frequently debugs database queries in Laravel and lacks a robust observability stack.
    • You’re using Laravel ≤5.5 (Debugbar’s backtrace feature was added later) or prefer a standalone solution.
    • You need quick, ad-hoc query tracing without integrating full APM tools (e.g., New Relic, Laravel Telescope).
    • Your app runs in local/staging environments where performance overhead is negligible (package adds minimal WHERE clauses).
  • Look elsewhere if:

    • You’re on Laravel 5.5+ and already use Debugbar/Clockwork (their built-in backtrace is more maintained).
    • You need production-grade tracing (this package is unmaintained; last release was 2016).
    • Your queries are extremely sensitive to overhead (e.g., high-traffic APIs; the WHERE clauses add negligible but measurable latency).
    • You require distributed tracing (e.g., across microservices) or query performance metrics (consider Laravel Telescope or Spatie’s packages).
    • Your team prefers modern alternatives like laravel-debugbar or spatie/laravel-query-logger.

How to Pitch It (Stakeholders)

For Executives:

"This lightweight package lets our Laravel devs instantly pinpoint where slow or problematic database queries originate—without switching tools. For example, instead of guessing which controller/model triggers a 2-second query, they’ll see the exact call stack in the SQL output. It’s a 10x faster alternative to manual debugging or APM tools for common issues, and the cost is just a few minutes of setup. Given its minimal overhead (only active in debug mode), it’s a no-brainer for local/dev environments where we’re already using Laravel Debugbar or Clockwork."

For Engineering:

*"QueryTracer is a drop-in solution for Laravel apps needing query backtraces. It hooks into Laravel’s global scopes to inject readable markers (e.g., __QUERY_TRACER__ = 'App\User::find()') into SQL queries when debug is on. Key benefits:

  • No config changes beyond adding the service provider.
  • Works with existing tools (Debugbar/Clockwork) or standalone.
  • Zero maintenance (though unupdated, it’s stable for Laravel ≤5.5).
  • Use case: Debugging N+1 queries, optimizing Eloquent relationships, or hunting down stale queries in legacy code.

Tradeoff: If you’re on Laravel 5.5+, Debugbar’s built-in backtrace is better maintained. Otherwise, this is a 5-minute fix for a common pain point."*

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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle