PHPackages                             cboxdk/laravel-telemetry - 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. cboxdk/laravel-telemetry

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

cboxdk/laravel-telemetry
========================

Collector-free telemetry for Laravel: Prometheus metrics, OTLP traces and events. No C extension, no protobuf, no sidecar — metrics that actually work under FPM.

v1.2.0(1w ago)32.2k↑149.3%[1 PRs](https://github.com/cboxdk/laravel-telemetry/pulls)4MITPHPPHP ^8.3|^8.4|^8.5CI passing

Since Jul 3Pushed 1mo agoCompare

[ Source](https://github.com/cboxdk/laravel-telemetry)[ Packagist](https://packagist.org/packages/cboxdk/laravel-telemetry)[ Docs](https://github.com/cboxdk/laravel-telemetry)[ RSS](/packages/cboxdk-laravel-telemetry/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (68)Versions (30)Used By (4)

Telemetry for Laravel
=====================

[](#telemetry-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/82ee5b6cba33ffce7905b9ead5257dd70b67560edf27a1be667c932519fe7b17/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63626f78646b2f6c61726176656c2d74656c656d657472792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cboxdk/laravel-telemetry)[![Tests](https://camo.githubusercontent.com/349e89b745dea9ad556ab6e1c209c89e82b5f3b8be9a64a0b35459e657b3cd52/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63626f78646b2f6c61726176656c2d74656c656d657472792f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cboxdk/laravel-telemetry/actions/workflows/run-tests.yml)[![PHPStan](https://camo.githubusercontent.com/13e680393662036bdf844df4951278b6580cd27a880a3d8e2c6b61462548647b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63626f78646b2f6c61726176656c2d74656c656d657472792f7068707374616e2e796d6c3f6272616e63683d6d61696e266c6162656c3d7068707374616e267374796c653d666c61742d737175617265)](https://github.com/cboxdk/laravel-telemetry/actions/workflows/phpstan.yml)[![Total Downloads](https://camo.githubusercontent.com/53bdaa5f1cfb9b8d36453cce33e38f4df110f0cd220718520ccb426d18de06a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63626f78646b2f6c61726176656c2d74656c656d657472792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cboxdk/laravel-telemetry)

**Collector-free telemetry for Laravel: Prometheus metrics, OTLP traces and events. No C extension, no protobuf, no sidecar — metrics that actually work under FPM.**

```
Telemetry::counter('orders.created')->inc();
Telemetry::gauge('queue.depth', fn () => Queue::size());
Telemetry::histogram('checkout.duration', unit: 'ms')->record($ms);

Telemetry::span('import.customers', function () {
    // traced work — exceptions recorded, duration measured
});

Telemetry::event('autoscale.decision', ['workers' => 7]);
```

Why
---

[](#why)

PHP is shared-nothing: in-process metric state dies with the request, which is why the official OTel SDK's metrics don't work under FPM without a collector. This package aggregates metrics in **Redis** (or APCu) instead — web workers, queue workers and nodes all write to the same series. Prometheus scrapes a route; traces and events go straight to any OTLP backend as spec-stable HTTP JSON.

- ✅ Pure Composer package — deploys anywhere Laravel runs
- ✅ Prometheus scrape endpoint(s), closed by default outside local/testing (IP allowlist or bearer token — same convention as Horizon/Telescope), with metric filters
- ✅ Real OTLP (`/v1/traces`, `/v1/metrics`, `/v1/logs`) without the SDK
- ✅ `telemetry` log channel: Laravel logs become trace-correlated OTLP log records (severity-mapped, feedback-loop safe)
- ✅ Auto-instrumentation: requests, queue jobs (full W3C trace propagation into workers), DB queries, commands — plus `Http::withTraceparent()` for outbound calls
- ✅ Auto-detects Horizon, Reverb and Pennant when installed — supervisor state/long-wait detection, WebSocket message/channel metrics, and feature-flag check counters, no extra config
- ✅ `Telemetry::fake()` with assertions for counters, gauges, histograms, spans and events
- ✅ Provider contract so packages publish telemetry without coupling
- ✅ Host CPU/memory/load via [`cboxdk/system-metrics`](https://github.com/cboxdk/system-metrics) — just install it
- ✅ Zero cost when disabled; telemetry never throws into your app
- ✅ Resource attribution: peak memory + CPU per request/job/task, per-span CPU &amp; memory deltas, real RSS via `cboxdk/system-metrics`
- ✅ Ships 13 Grafana dashboards (`telemetry:dashboards`) — an APM-style suite (requests, jobs, queries, cache, exceptions, system, users …) — service-scoped, LGTM-ready
- ✅ Opt-in web analytics: a shared cookieless `session.id`, unsampled `page_view` events, and built-in geo + User-Agent enrichment (default off)
- ✅ Browser/RUM tracing: a zero-build `@telemetryBrowser` snippet ingests frontend spans and `track()` events into the same trace as the backend, plus token-gated source-map upload for symbolicated JS stack traces
- ✅ Error tracking flow: the trace id ties Sentry/Flare issues, support cases and the trace waterfall together automatically
- ✅ AI-ready: ships [Laravel Boost](https://github.com/laravel/boost)guidelines, `llms.txt` and an agent guide — your AI assistant follows the conventions out of the box

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

[](#installation)

```
composer require cboxdk/laravel-telemetry
```

```
TELEMETRY_STORE=redis            # redis | apcu | array
TELEMETRY_EXPORTERS=otlp         # optional; Prometheus endpoint is on by default
TELEMETRY_OTLP_ENDPOINT=https://otlp.example.com:4318
```

Scrape `GET /telemetry/metrics`, and for OTLP metrics schedule the flush:

```
Schedule::command('telemetry:flush')->everyMinute()->onOneServer();
```

Documentation
-------------

[](#documentation)

Full documentation lives in [`docs/`](docs/index.md):

- [Getting started](docs/getting-started/installation.md) — [quickstart](docs/getting-started/quickstart.md), [testing](docs/getting-started/testing.md), [API reference](docs/getting-started/api-reference.md), [AI assistants](docs/getting-started/ai-assistants.md)
- [Core concepts](docs/core-concepts/architecture.md) — [metrics](docs/core-concepts/metrics.md), [traces](docs/core-concepts/traces.md), [events](docs/core-concepts/events.md), [logs](docs/core-concepts/logs.md), [naming](docs/core-concepts/naming.md)
- Cookbook — [multi-tenant SaaS](docs/cookbook/multi-tenant-saas.md), [queue monitoring](docs/cookbook/queue-monitoring.md), [external services](docs/cookbook/external-services.md)
- [Configuration reference](docs/configuration/reference.md)
- [Extension points](docs/extension-points/providers.md) — [custom exporters](docs/extension-points/exporters.md)
- [Production](docs/production/prometheus.md) — [OTLP](docs/production/otlp.md), [**the recommended Grafana stack**](docs/production/grafana-stack.md), [performance](docs/production/performance.md), [security](docs/production/security.md), [analytics](docs/production/analytics.md), [browser/RUM tracing](docs/production/browser-tracing.md), [error tracking](docs/production/error-tracking.md)

Publishing telemetry from your package
--------------------------------------

[](#publishing-telemetry-from-your-package)

```
if (class_exists(\Cbox\Telemetry\Facades\Telemetry::class)) {
    Telemetry::provider(new QueueMetricsProvider);
}
```

Telemetry never knows about your package — your package publishes telemetry if telemetry exists. See [providers](docs/extension-points/providers.md).

Development
-----------

[](#development)

```
composer check   # pint --test, phpstan (level 8), pest
```

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance94

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.7% 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

28

Last Release

12d ago

Major Versions

v0.4.1 → v1.0.02026-07-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/b9761a79e61f2d5b9d650510dfb3555da18daf38f027aa84012c937e397e39a7?d=identicon)[cboxdk](/maintainers/cboxdk)

---

Top Contributors

[![sylvesterdamgaard](https://avatars.githubusercontent.com/u/2431914?v=4)](https://github.com/sylvesterdamgaard "sylvesterdamgaard (75 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

laravelMetricstracingopentelemetryotlptelemetryobservabilityprometheuscbox

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cboxdk-laravel-telemetry/health.svg)

```
[![Health](https://phpackages.com/badges/cboxdk-laravel-telemetry/health.svg)](https://phpackages.com/packages/cboxdk-laravel-telemetry)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M331](/packages/laravel-ai)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M189](/packages/spatie-laravel-health)[moonshine/moonshine

Laravel administration panel

1.3k268.2k89](/packages/moonshine-moonshine)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

173666.7k1](/packages/keepsuit-laravel-opentelemetry)[anousss007/vigilance

A driver-agnostic control center for Laravel queues, jobs, commands and the scheduler. Monitor what ran (with parameters), see failures, and dispatch jobs or run artisan commands manually from a self-contained dashboard.

1939.9k](/packages/anousss007-vigilance)

PHPackages © 2026

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