Skip to content

opentelemetry-php/contrib-auto-laravel

Repository files navigation

Releases Issues Source Mirror Latest Version Stable

This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.

OpenTelemetry Laravel auto-instrumentation

Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.

Overview

Auto-instrumentation hooks are registered via composer, and spans will automatically be created.

Configuration

The extension can be disabled via runtime configuration:

OTEL_PHP_DISABLED_INSTRUMENTATIONS=laravel

Log Context Attributes

By default, log context is JSON-encoded into a single context attribute. This can make it difficult to search for specific context values in observability backends like SigNoz.

To flatten log context into individual, searchable attributes, enable:

OTEL_PHP_LARAVEL_LOG_ATTRIBUTES_FLATTEN=true

Default behavior (off):

context: {"http":{"method":"GET","path":"/users"},"user_id":"123"}

With flattening enabled:

http.method: GET
http.path: /users
user_id: 123

Nested arrays are flattened using dot notation, making each value individually searchable in your observability backend.

About

[READONLY] Laravel auto-instrumentation

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages