Download the PHP package eerzho/opentelemetry-auto-class-laravel without Composer
On this page you can find all versions of the php package eerzho/opentelemetry-auto-class-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eerzho/opentelemetry-auto-class-laravel
More information about eerzho/opentelemetry-auto-class-laravel
Files in eerzho/opentelemetry-auto-class-laravel
Package opentelemetry-auto-class-laravel
Short Description Laravel integration for automatic OpenTelemetry tracing via the #[Traceable] attribute
License MIT
Informations about the package opentelemetry-auto-class-laravel
opentelemetry-auto-class-laravel
Laravel integration for automatic OpenTelemetry tracing of PHP methods via the #[Traceable] attribute. All classes with the attribute in configured namespaces are instrumented automatically using the ext-opentelemetry hook API.
This is a read-only sub-split. Please open issues and pull requests in the monorepo.
Installation
Optionally, publish the configuration to customize scanned namespaces (default is App\):
Requirements:
- ext-opentelemetry
- PHP 8.2+
- Laravel 10+
Usage
Basic
Add #[Traceable] to a class in the configured namespaces — all public methods will be traced automatically:
Make sure to run
composer dump-autoload -oso that all classes appear in the class map.For full details on how spans are created, argument serialization, and limitations, see opentelemetry-auto-class.
Exclude methods
Use the exclude parameter to skip specific methods from tracing:
Exclude arguments
By default, all method arguments are captured as span attributes. Use #[Arguments(exclude: [...])] on a method to hide sensitive parameters:
How it works
- On boot, the service provider reads namespaces from
config/traceable.php - Discovers all classes in those namespaces via Composer's
ClassLoader::getClassMap() - Scans discovered classes for
#[Traceable]attribute - Registers
ext-opentelemetryhooks for matched methods
Disabling instrumentation
To disable tracing at runtime, use the standard OpenTelemetry environment variable:
License
MIT
All versions of opentelemetry-auto-class-laravel with dependencies
ext-opentelemetry Version *
open-telemetry/api Version ^1.0
eerzho/opentelemetry-auto-class Version ^0.1
illuminate/support Version ^11.0 || ^12.0 || ^13.0