PHPackages                             imezied/telescope-smart-tags - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. imezied/telescope-smart-tags

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

imezied/telescope-smart-tags
============================

Smart, configurable auto-tagging for Laravel Telescope — tag requests by HTTP status, exceptions, slow response times, route groups, and more.

v2.0.3(2mo ago)242MITPHPPHP ^8.3

Since Apr 2Pushed 2mo agoCompare

[ Source](https://github.com/iMezied/laravel-telescope-smart-tags)[ Packagist](https://packagist.org/packages/imezied/telescope-smart-tags)[ Docs](https://github.com/imezied/telescope-smart-tags)[ RSS](/packages/imezied-telescope-smart-tags/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (6)Used By (0)

🔖 telescope-smart-tags
======================

[](#-telescope-smart-tags)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6d6b90aaf9c952eced63f97c3a06049a8129007c14684d77cb585b5e9f433c88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696d657a6965642f74656c6573636f70652d736d6172742d746167732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imezied/telescope-smart-tags)[![Tests](https://camo.githubusercontent.com/028bf10dd90f86c78e0a19e91ecf12f38d3b645f746428fb41da65608467178d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f696d657a6965642f74656c6573636f70652d736d6172742d746167732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/imezied/telescope-smart-tags/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/99d4db18e4e880fc97892271fae78e4b88d59fd641313e16ad9ee1f227775df4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696d657a6965642f74656c6573636f70652d736d6172742d746167732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imezied/telescope-smart-tags)[![PHP Version](https://camo.githubusercontent.com/59f01a694739c1806d2c3ab531cfc9c8d024fb1afe43c2088d705b21af92b6eb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f696d657a6965642f74656c6573636f70652d736d6172742d746167732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imezied/telescope-smart-tags)[![License](https://camo.githubusercontent.com/cd725696bb6d311fecae6195a92ca2ec0935c4927d1f4e7e17adbbf35d8489bd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f696d657a6965642f74656c6573636f70652d736d6172742d746167732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/imezied/telescope-smart-tags)

**Smart, zero-config auto-tagging for Laravel Telescope.**

Out of the box, Telescope's tag system is powerful but manual. This package automatically enriches every entry with meaningful, filterable tags — by HTTP status, exception type, response time, route group, and more — so you can instantly find what matters.

```
# Instead of scrolling through hundreds of requests...
# Just filter by tag:

validation-failed    → all 422 responses
error:5xx            → all server errors
slow:critical        → requests over 3s
carrier:dhl          → your custom domain tags
family:database      → all DB-related exceptions

```

---

Features
--------

[](#features)

- **HTTP Status Tags** — `http:422`, `error:4xx`, `validation-failed`, `rate-limited`, `server-error`, and more
- **Exception Tags** — `exception:QueryException`, `family:database`, `family:auth`, `family:validation`
- **Slow Request Tags** — `slow:warn` and `slow:critical` with configurable thresholds
- **Slow Query Tags** — `slow-query:warn` and `slow-query:critical` on DB watcher entries
- **Route Group Tags** — `group:api`, `group:webhook`, `group:admin` via URI prefix matching
- **Auth Context Tags** — `auth:authenticated` vs `auth:guest`
- **Custom Resolvers** — plug in your own domain logic (e.g. `carrier:dhl`, `tenant:acme`)
- **Fully configurable** — enable/disable each resolver independently, tune thresholds, extend semantic maps

---

Requirements
------------

[](#requirements)

DependencyVersionPHP`^8.3`Laravel`^11.0 | ^12.0 | ^13.0`laravel/telescope`^5.0`---

Installation
------------

[](#installation)

```
composer require imezied/telescope-smart-tags --dev
```

That's it. The package auto-discovers and registers itself via Laravel's service provider. All resolvers are active by default with sensible defaults.

### Publish the config (optional)

[](#publish-the-config-optional)

```
php artisan vendor:publish --tag=telescope-smart-tags-config
```

This creates `config/telescope-smart-tags.php` where you can tune every resolver.

---

Tags Reference
--------------

[](#tags-reference)

### HTTP Status Tags

[](#http-status-tags)

Applied to every **Request** entry.

TagWhen`http:200`, `http:422`, `http:500`Exact status code (always)`success:2xx`Status 200–299`redirect:3xx`Status 300–399`error:4xx`Status 400–499`error:5xx`Status 500–599`bad-request`400`unauthorized`401`forbidden`403`not-found`404`csrf-mismatch`419`validation-failed`422`rate-limited`429`server-error`500`service-unavailable`503### Exception Tags

[](#exception-tags)

Applied to every **Exception** entry.

TagExample`exception:{ClassName}``exception:QueryException``exception-fqn:{dotted.namespace}``exception-fqn:Illuminate.Database.QueryException``family:validation``ValidationException``family:auth``AuthenticationException`, `AuthorizationException``family:database``QueryException`, `ModelNotFoundException``family:rate-limit``ThrottleRequestsException``family:http``NotFoundHttpException`, `MethodNotAllowedHttpException``family:logic``BadMethodCallException`, `InvalidArgumentException``family:runtime``RuntimeException``family:type``TypeError`### Slow Request Tags

[](#slow-request-tags)

Applied to **Request** entries exceeding configured thresholds.

TagDefault Threshold`slow`&gt; 1,000ms`slow:warn`&gt; 1,000ms`slow:critical`&gt; 3,000ms### Slow Query Tags

[](#slow-query-tags)

Applied to **Query** entries exceeding configured thresholds.

TagDefault Threshold`slow-query`&gt; 500ms`slow-query:warn`&gt; 500ms`slow-query:critical`&gt; 2,000ms### Auth Context Tags

[](#auth-context-tags)

TagWhen`auth:authenticated`Request has a logged-in user`auth:guest`No authenticated user---

Configuration
-------------

[](#configuration)

```
// config/telescope-smart-tags.php

return [

    'enabled' => env('TELESCOPE_SMART_TAGS_ENABLED', true),

    'resolvers' => [
        'http_status'   => true,
        'exceptions'    => true,
        'slow_requests' => true,
        'slow_queries'  => true,
        'route_groups'  => false, // opt-in
        'auth_context'  => false, // opt-in
    ],

    'http_status' => [
        'include_exact'    => true,
        'include_family'   => true,
        'include_semantic' => true,
        'custom_map' => [
            // 418 => 'im-a-teapot',
        ],
    ],

    'exceptions' => [
        'include_class'     => true,
        'include_family'    => true,
        'custom_family_map' => [
            // 'App\Exceptions\PaymentGatewayException' => 'family:payment',
        ],
    ],

    'slow_requests' => [
        'warn_ms'     => env('TELESCOPE_SLOW_REQUEST_WARN_MS', 1000),
        'critical_ms' => env('TELESCOPE_SLOW_REQUEST_CRITICAL_MS', 3000),
    ],

    'slow_queries' => [
        'warn_ms'     => env('TELESCOPE_SLOW_QUERY_WARN_MS', 500),
        'critical_ms' => env('TELESCOPE_SLOW_QUERY_CRITICAL_MS', 2000),
    ],

    'route_groups' => [
        'prefix_map' => [
            // 'api/v2'  => 'group:api-v2',
            // 'api'     => 'group:api',
            // 'webhook' => 'group:webhook',
            // 'admin'   => 'group:admin',
        ],
        'route_name_map' => [
            // 'api.'   => 'group:api',
            // 'admin.' => 'group:admin',
        ],
    ],

    'custom_resolvers' => [
        // App\Telescope\CarrierTagResolver::class,
        // App\Telescope\TenantTagResolver::class,
    ],
];
```

### Environment Variables

[](#environment-variables)

```
TELESCOPE_SMART_TAGS_ENABLED=true

TELESCOPE_SLOW_REQUEST_WARN_MS=1000
TELESCOPE_SLOW_REQUEST_CRITICAL_MS=3000

TELESCOPE_SLOW_QUERY_WARN_MS=500
TELESCOPE_SLOW_QUERY_CRITICAL_MS=2000
```

---

Custom Resolvers
----------------

[](#custom-resolvers)

Build domain-specific resolvers by implementing `TagResolverInterface`:

```
namespace App\Telescope;

use Laravel\Telescope\EntryType;
use Laravel\Telescope\IncomingEntry;
use imezied\TelescopeSmartTags\TagResolvers\TagResolverInterface;

class CarrierTagResolver implements TagResolverInterface
{
    public function supports(IncomingEntry $entry): bool
    {
        return $entry->type === EntryType::REQUEST;
    }

    public function resolve(IncomingEntry $entry): array
    {
        $carrier = $entry->content['payload']['carrier'] ?? null;

        return $carrier ? ["carrier:{$carrier}"] : [];
    }
}
```

Register in your config:

```
'custom_resolvers' => [
    App\Telescope\CarrierTagResolver::class,
],
```

Your resolver is resolved through the Laravel service container, so constructor injection works:

```
class TenantTagResolver implements TagResolverInterface
{
    public function __construct(private TenantRepository $tenants) {}

    public function supports(IncomingEntry $entry): bool
    {
        return $entry->type === EntryType::REQUEST;
    }

    public function resolve(IncomingEntry $entry): array
    {
        $host   = $entry->content['headers']['host'][0] ?? null;
        $tenant = $host ? $this->tenants->findByDomain($host) : null;

        return $tenant ? ["tenant:{$tenant->slug}"] : [];
    }
}
```

### Manipulating the Registry at Runtime

[](#manipulating-the-registry-at-runtime)

You can also interact with the `TagRegistry` directly in a service provider:

```
use imezied\TelescopeSmartTags\TagRegistry;

public function boot(): void
{
    $this->app->make(TagRegistry::class)
        ->add(new MyCustomResolver())
        ->add(new AnotherResolver());
}
```

---

How It Works
------------

[](#how-it-works)

The package hooks into Telescope's `Telescope::tag()` callback during the `boot` phase:

```
Request/Exception/Query
        │
        ▼
  TagRegistry::resolve()
        │
        ├── HttpStatusTagResolver::resolve()   → ['http:422', 'error:4xx', 'validation-failed']
        ├── SlowRequestTagResolver::resolve()  → ['slow', 'slow:warn']
        ├── RouteGroupTagResolver::resolve()   → ['group:api']
        └── [your custom resolvers]            → ['carrier:dhl', 'tenant:acme']
        │
        ▼
  Merged + Deduplicated Tags
        │
        ▼
  Telescope Entry (searchable in dashboard)

```

Each resolver is independently toggled, zero overhead if disabled.

---

Testing Your Custom Resolver
----------------------------

[](#testing-your-custom-resolver)

```
use imezied\TelescopeSmartTags\Tests\TestCase;
use App\Telescope\CarrierTagResolver;

class CarrierTagResolverTest extends TestCase
{
    public function test_tags_carrier_from_payload(): void
    {
        $resolver = new CarrierTagResolver();

        $entry = $this->makeRequestEntry([
            'payload' => ['carrier' => 'dhl'],
        ]);

        $tags = $resolver->resolve($entry);

        $this->assertContains('carrier:dhl', $tags);
    }

    public function test_returns_empty_without_carrier(): void
    {
        $resolver = new CarrierTagResolver();
        $entry    = $this->makeRequestEntry(['payload' => []]);

        $this->assertEmpty($resolver->resolve($entry));
    }
}
```

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG.md](CHANGELOG.md) for recent changes.

---

Contributing
------------

[](#contributing)

Pull requests are welcome. For major changes, please open an issue first.

1. Fork the repo
2. Create your branch (`git checkout -b feature/my-resolver`)
3. Add tests for your resolver
4. Run `composer test` — all tests must pass
5. Run `composer lint` — code style must pass
6. Submit your PR

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) for details.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance83

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

5

Last Release

88d ago

Major Versions

v1.0.0 → v2.0.02026-04-05

PHP version history (2 changes)v1.0.0PHP ^8.1

v2.0.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c2b6cfe5487a902166eda7a5f0c3c16fd02a9cfe9e4ecc52e8c4acc9cb7387e?d=identicon)[imezied](/maintainers/imezied)

---

Top Contributors

[![iMezied](https://avatars.githubusercontent.com/u/335139?v=4)](https://github.com/iMezied "iMezied (7 commits)")

---

Tags

laravelmonitoringdebuggingtaggingobservabilitytelescope

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/imezied-telescope-smart-tags/health.svg)

```
[![Health](https://phpackages.com/badges/imezied-telescope-smart-tags/health.svg)](https://phpackages.com/packages/imezied-telescope-smart-tags)
```

###  Alternatives

[lucianotonet/laravel-telescope-mcp

MCP Server extension for Laravel Telescope

2027.2k](/packages/lucianotonet-laravel-telescope-mcp)[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

771.7k](/packages/nightowl-agent)[iazaran/trace-replay

Enterprise-ready process tracking, replay, and AI-assisted debugging for Laravel applications.

1031.3k](/packages/iazaran-trace-replay)[binarybuilds/laravel-mail-manager

A Laravel mail manager to record and re-send all outgoing emails.

2440.3k1](/packages/binarybuilds-laravel-mail-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
