echo_'s avatar

Pulse vs Telescope

Please when do you use telescope vs pulse ? is pulse a replacement for telescope or they can coexist ? Can we deploy telescope on production or it's just for development purpose ?

0 likes
3 replies
LaryAI's avatar

Certainly! Here’s a clear explanation:

Laravel Telescope and Laravel Pulse are both tools for monitoring your Laravel applications, but they serve different purposes and can coexist.

When to Use Telescope vs Pulse

  • Telescope is primarily a debugging assistant for Laravel developers. It provides detailed insight into requests, exceptions, database queries, queued jobs, mail, notifications, cache operations, and more. It's most useful during development or debugging sessions when you need to see exactly what's happening in your app.

  • Pulse is a lightweight, real-time performance monitoring tool. It focuses on metrics like request performance, slow queries, queue job durations, and other high-level stats. Pulse is designed to be safe and efficient for use in production environments.

Is Pulse a Replacement for Telescope?

No, Pulse is not a replacement for Telescope. They have different focuses:

  • Use Telescope for deep debugging and inspecting individual events.
  • Use Pulse for ongoing performance monitoring and quick insights in production.

Can Telescope Be Deployed in Production?

Technically, you can deploy Telescope to production, but it is not recommended due to:

  • Potential performance overhead.
  • Sensitive data exposure (since Telescope logs a lot of request and user data).

If you must use Telescope in production (e.g., for debugging a specific issue), restrict access using the gate in TelescopeServiceProvider:

Telescope::auth(function ($request) {
    return in_array($request->user()->email, [
        '[email protected]',
    ]);
});

But generally, Telescope is intended for local development or tightly controlled staging environments.


Summary Table:

Tool Purpose Use in Production? Use in Development?
Telescope Debugging/Inspection Not recommended Yes
Pulse Performance Monitoring Yes Yes

They can absolutely coexist and complement each other!

JussiMannisto's avatar
Level 50

Telescope is meant for development, Pulse is for production.

You have to tune Telescope in production or it will kill the performance of a busy site. It logs everything in the database synchronously, which is really bad with things like database queries. I'd never use it in production myself.

Pulse works differently: the worker tracks relevant metrics in memory (Redis) and periodically flushes aggregated data to the database. It doesn't store every request and query. By default, it tracks things like slow queries and jobs, user activity, etc. You can add your own recorders and customize the dashboard.

2 likes

Please or to participate in this conversation.