Installation
Add the package to your Laravel application in minutes
Quickstart
Get up and running with your first traces
Instrumentations
Auto-instrumentation for HTTP, DB, queues, Redis, and more
API Reference
Full reference for all facades and configuration options
What is Laravel OpenTelemetry?
keepsuit/laravel-opentelemetry is a Laravel package that brings first-class OpenTelemetry support to your application. With a single Composer install and a few environment variables, your app automatically emits distributed traces, metrics, and structured logs — with zero manual instrumentation required for most use cases.
Key features
Auto-instrumentation
Traces HTTP requests, database queries, queue jobs, Redis commands, cache operations, events, views, Livewire components, Scout searches, and console commands out of the box.
Traces, Metrics & Logs
Export all three OpenTelemetry signals — traces via spans, metrics with counters/histograms/gauges, and structured logs via OTLP.
Tail Sampling
Keep only the traces that matter. Built-in rules for errors and slow traces, plus a simple interface for custom rules.
Worker Mode
Automatic detection and optimization for long-running processes: Octane, Horizon, and queue workers.
Manual Tracing
Create custom spans with the
Tracer facade and a fluent SpanBuilder API when you need more control.Multiple Exporters
Ship telemetry via OTLP (HTTP or gRPC), Zipkin, or console output. Configure separate endpoints per signal.
Supported instrumentations
| Instrumentation | Env Variable | Default |
|---|---|---|
| HTTP Server | OTEL_INSTRUMENTATION_HTTP_SERVER | enabled |
| HTTP Client | OTEL_INSTRUMENTATION_HTTP_CLIENT | enabled |
| Database (SQL) | OTEL_INSTRUMENTATION_QUERY | enabled |
| Queue Jobs | OTEL_INSTRUMENTATION_QUEUE | enabled |
| Redis | OTEL_INSTRUMENTATION_REDIS | enabled |
| Cache | OTEL_INSTRUMENTATION_CACHE | enabled |
| Events | OTEL_INSTRUMENTATION_EVENT | enabled |
| Views | OTEL_INSTRUMENTATION_VIEW | enabled |
| Livewire | OTEL_INSTRUMENTATION_LIVEWIRE | enabled |
| Console Commands | OTEL_INSTRUMENTATION_CONSOLE | enabled |
| Laravel Scout | OTEL_INSTRUMENTATION_SCOUT | enabled |
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- An OpenTelemetry Collector or compatible backend (Jaeger, Tempo, Honeycomb, Datadog, etc.)
