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

Laravel Top Laravel Package

leventcz/laravel-top

Real-time CLI monitoring for Laravel. Runs php artisan top to track key request metrics, busiest routes, and performance across all servers. Aggregates recent Laravel event data in Redis with short TTL, designed for production and Octane.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit:

  • Strengths: The package aligns with Laravel’s event-driven architecture, leveraging Redis for lightweight, real-time monitoring without persistent storage overhead. It complements Laravel’s CLI-first approach and Octane’s performance focus, offering a minimalist solution for HTTP-centric metrics. The short-TTL Redis storage ensures low operational burden and avoids historical data bloat.
  • Weaknesses: Scope is limited to HTTP metrics (excludes queues, commands, and background jobs), creating blind spots for non-request workloads. Redis dependency introduces coupling and potential contention, particularly in high-throughput environments. No support for distributed tracing, long-term trend analysis, or error tracking restricts use cases to immediate diagnostics.
  • Laravel 13.x/Octane Fit: Officially compatible but lacks validation for Octane’s event loop or multi-server setups. Assumes traditional request lifecycle, which may not fully translate to Octane’s async model or Laravel 13.x’s event propagation delays. The package’s reliance on Laravel events may conflict with Octane’s async workers or preflight requests.

Integration feasibility:

  • Pros: Zero database changes, minimal configuration (vendor:publish), and no external services required. Composer install + Redis setup is the only prerequisite. Facade API (Top::http(), Top::routes()) enables programmatic access for custom integrations (e.g., internal dashboards, CI/CD pipelines). Lightweight and non-intrusive.
  • Cons: Undocumented behavior for recording_mode=always in non-HTTP contexts (e.g., CLI commands, queues). No validation for Redis connection resilience or failure modes. Laravel 13.x compatibility is confirmed but lacks Octane-specific testing. Potential for Redis write contention in high-throughput environments.
  • Risk: High for teams using Redis for critical functions (e.g., caching, queues). Lack of error handling for Redis failures could lead to application instability during outages. No benchmarks for Laravel 13.x/Octane scalability.

Technical risk:

  • Scalability: No public benchmarks for Laravel 13.x/Octane. The 5-second aggregation window may not scale beyond 10k RPS without Redis tuning (e.g., pipelining, connection pooling). Risk of Redis write contention or memory pressure in high-throughput environments.
  • Stability: Low adoption (0 dependents) and no commercial support. The 2026 release date suggests potential versioning instability or abandonment. No documentation on handling Laravel 13.x-specific edge cases (e.g., Octane event propagation delays, preflight requests).
  • Gaps: No error handling for Redis failures, memory leaks, or Laravel 13.x’s Octane event system. Assumes single-server deployment, which may not accurately reflect multi-server metrics. No validation for thread safety in Octane’s concurrent request model.

Key questions:

  1. Performance: How does Redis write volume scale at >5k RPS in Laravel 13.x/Octane? Are there known bottlenecks or required Redis configurations (e.g., maxmemory-policy, lru-eviction)?
  2. Reliability: What failure modes occur during Redis downtime? Does the package degrade gracefully (e.g., silent fallback) or crash the application? Are there unhandled exceptions in the event listener or facade?
  3. Compatibility: Has recording_mode=always been tested in non-HTTP contexts (e.g., CLI commands, queues) in Laravel 13.x? How does it interact with Octane’s event loop or Laravel 13.x’s async workers?
  4. Memory: Are there known memory leaks in the event listener for Laravel 13.x/Octane? How does it handle long-running requests or Octane’s async workers (e.g., memory accumulation during startRecording)?
  5. Testing: What Laravel 13.x environments were tested (e.g., Octane, Valet, Forge, Vapor)? Were there failures in any? Are there known issues with preflight requests, CORS endpoints, or Laravel 13.x’s middleware changes?
  6. Facade API: Is the facade thread-safe for Octane’s concurrent requests? Are there race conditions when accessing Top::routes() or Top::http() during high load? Does it support Laravel 13.x’s dependency injection changes?
  7. Monitoring: Does the package emit any logs or events for operational visibility (e.g., Redis connection failures, metric collection errors)? Are there health checks or metrics for the package itself?
  8. Security: Are there risks of Redis injection or information leakage when using shared Redis instances across applications?
  9. Observability: Can metrics be exported to external systems (e.g., Prometheus) for integration with existing monitoring stacks?
  10. Upgrade Path: What changes are required to migrate from v1.x to future versions? Are there breaking changes planned for Laravel 14.x?

Integration Approach

Stack fit:

  • Ideal for:
    • Laravel 10–13.x applications with Redis 5.0+ and PHP 8.2+, especially those using Laravel Octane, Vapor, or Forge.
    • Teams prioritizing CLI-driven workflows and lightweight monitoring without APM overhead.
    • Use cases: Incident response, post-deploy validation, CI/CD performance gates, or developer productivity (e.g., embedding metrics in custom CLI tools).
  • Anti-patterns:
    • Teams requiring long-term trend analysis, error tracking, or distributed tracing (use Datadog/New Relic).
    • Applications with >10k RPS without Redis tuning (risk of contention).
    • Stacks without Redis or CLI access to production servers.
    • Laravel versions <10.x or environments where queue/command metrics are critical.

Migration path:

  1. Pre-integration:
    • Validate Redis compatibility (version 5.0+, connection pooling, and maxmemory-policy).
    • Test Laravel 13.x/Octane compatibility in a staging environment (focus on event propagation and async workers).
    • Assess Redis usage: Ensure the package won’t interfere with existing caching/queueing workloads.
  2. Installation:
    • Composer: composer require leventcz/laravel-top.
    • Publish config: php artisan vendor:publish --tag="top".
    • Configure Redis connection and recording_mode (default: runtime).
  3. Validation:
    • Test php artisan top in production-like conditions (load testing with expected traffic patterns).
    • Verify facade API (Top::http(), Top::routes()) in Laravel 13.x contexts (e.g., middleware, service containers).
    • Check for Redis contention or performance degradation under load.
  4. Production rollout:
    • Start with recording_mode=runtime to avoid unintended metric collection.
    • Monitor Redis memory usage and TTL eviction rates.
    • Gradually enable recording_mode=always if needed for facade-based integrations.

Compatibility:

  • Laravel 13.x: Officially supported but untested in Octane’s event loop. Assess impact of Laravel 13.x’s middleware changes (e.g., preflight requests) and dependency injection.
  • Redis: Requires 5.0+; test with your existing Redis configuration (e.g., persistence, replication).
  • PHP 8.2+: No known issues, but validate with Laravel 13.x’s strict typing changes.
  • Octane: Untested; validate event listener behavior in async workers and preflight requests.
  • Queues/Commands: Excluded by design; confirm this aligns with your monitoring needs.

Sequencing:

  1. Phase 1 (Validation):
    • Install and test in a non-production environment.
    • Verify metrics accuracy (e.g., route durations, memory usage) against existing tools (e.g., Laravel Debugbar).
    • Load test with expected traffic to identify Redis bottlenecks.
  2. Phase 2 (Integration):
    • Integrate facade API into custom tools (e.g., CI/CD scripts, internal dashboards).
    • Configure alerts or thresholds (e.g., fail builds if averageDuration exceeds 500ms).
  3. Phase 3 (Production):
    • Deploy to a subset of servers and monitor Redis/memory impact.
    • Gradually expand to all servers; adjust recording_mode as needed.
  4. Phase 4 (Optimization):
    • Tune Redis (e.g., maxmemory, eviction policies) based on usage patterns.
    • Explore exporting metrics to Prometheus or other monitoring systems.

Dependencies:

  • Redis: Critical. Ensure high availability and connection resilience (e.g., failover, retries).
  • Laravel Events: The package listens to Illuminate\Http\RequestHandled and similar events. Confirm no conflicts with custom event listeners.
  • PHP Extensions: None beyond Laravel’s requirements.

Operational Impact

Maintenance:

  • Pros:
    • Minimal maintenance: No database migrations, external services, or agents.
    • Configuration is limited to Redis connection and recording mode.
    • MIT license allows forks/modifications if needed.
  • Cons:
    • Redis dependency requires monitoring and maintenance (e.g., backups, scaling).
    • No official support or SLAs; issues must be community-driven.
    • Lack of documentation for advanced use cases
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.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle