Skip to main content

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.
composer require keepsuit/laravel-opentelemetry

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

InstrumentationEnv VariableDefault
HTTP ServerOTEL_INSTRUMENTATION_HTTP_SERVERenabled
HTTP ClientOTEL_INSTRUMENTATION_HTTP_CLIENTenabled
Database (SQL)OTEL_INSTRUMENTATION_QUERYenabled
Queue JobsOTEL_INSTRUMENTATION_QUEUEenabled
RedisOTEL_INSTRUMENTATION_REDISenabled
CacheOTEL_INSTRUMENTATION_CACHEenabled
EventsOTEL_INSTRUMENTATION_EVENTenabled
ViewsOTEL_INSTRUMENTATION_VIEWenabled
LivewireOTEL_INSTRUMENTATION_LIVEWIREenabled
Console CommandsOTEL_INSTRUMENTATION_CONSOLEenabled
Laravel ScoutOTEL_INSTRUMENTATION_SCOUTenabled

Requirements

  • PHP 8.2+
  • Laravel 11, 12, or 13
  • An OpenTelemetry Collector or compatible backend (Jaeger, Tempo, Honeycomb, Datadog, etc.)

Build docs developers (and LLMs) love