friendsofhyperf/telescope

An elegant debug assistant for the hyperf framework.

Maintainers

πŸ‘ huangdijia

Package info

github.com/friendsofhyperf/telescope

Issues

Documentation

Language:Vue

pkg:composer/friendsofhyperf/telescope

Fund package maintenance!

huangdijia

hdj.me/sponsors

Statistics

Installs: 5 502

Dependents: 2

Suggesters: 0

Stars: 22

v3.2.1 2026-06-09 14:51 UTC

Requires (Dev)

None

Suggests

Provides

None

Conflicts

None

Replaces

None

MIT 77514a91f22f3c1cb48441eae56dfdda3ddde24a

  • huangdijia <huangdijia.woop@gmail.com>

debuggingswoolehyperfv3.2

This package is auto-updated.

Last update: 2026-06-17 01:08:12 UTC


README

δΈ­ζ–‡θ―΄ζ˜Ž

Available Listeners

  • Request Monitor
  • Exception Monitor
  • Data Query Monitor
  • gRPC Request Monitor
  • Redis Monitor
  • Log Monitor
  • Command Line Monitor
  • Event Monitor
  • HTTP Client Monitor
  • Cache Monitor
  • Scheduled Task Monitor

Installation

composer require friendsofhyperf/telescope

Use the vendor:publish command to publish its public resources

php bin/hyperf.php vendor:publish friendsofhyperf/telescope

Run the migrate command to execute database changes and create the tables required by Telescope:

php bin/hyperf.php migrate

Usage

Middleware (Optional for gRPC)

Add the middleware in the config/autoload/middlewares.php configuration file

To enable additional gRPC functionality, use the grpc middleware

<?php

return [
 'grpc' => [
 FriendsOfHyperf\Telescope\Middleware\TelescopeMiddleware::class,
 ],
];

Note: Request tracking is automatically enabled via the RequestHandledListener. The TelescopeMiddleware is only needed for additional gRPC-specific functionality.

View Dashboard

http://127.0.0.1:9501/telescope

Database Configuration

Manage the database connection configuration in config/autoload/telescope.php. It defaults to the default connection:

'connection' => env('TELESCOPE_DB_CONNECTION', 'default'),

Tags

You may wish to attach your own custom tags to entries. To do this, use the Telescope::tag method.

Batch Filtering

You may want to record entries only under certain special conditions. To do this, use the Telescope::filter method.

Example

use FriendsOfHyperf\Telescope\Telescope;
use Hyperf\Event\Contract\ListenerInterface;
use Hyperf\Framework\Event\BootApplication;
use FriendsOfHyperf\Telescope\IncomingEntry;

class TelescopeInitListener implements ListenerInterface
{
 public function listen(): array
 {
 return [
 BootApplication::class,
 ];
 }

 public function process(object $event): void
 {
 // attach your own custom tags
 Telescope::tag(function (IncomingEntry $entry) {
 if ($entry->type === 'request') {
 return [
 'status:' . $entry->content['response_status'],
 'uri:'. $entry->content['uri'],
 ];
 }
 });

 // filter entry
 Telescope::filter(function (IncomingEntry $entry): bool {
 if ($entry->type === 'request'){
 if ($entry->content['uri'] == 'xxxx') {
 return false;
 }
 }
 return true;
 });

 }
}