prism-php/opentelemetry

OpenTelemetry telemetry driver for Prism PHP applications.

Fund package maintenance!
sixlive

dev-main 2025-05-29 20:40 UTC

This package is auto-updated.

Last update: 2025-06-04 16:58:18 UTC


README

Total Downloads Latest Stable Version License

Prism OpenTelemetry

OpenTelemetry telemetry driver for Prism PHP applications. This package provides distributed tracing capabilities using OpenTelemetry standards.

Installation

Install the package via Composer:

composer require prism-php/opentelemetry

Configuration

Configure Prism to use the OpenTelemetry driver in your config/prism.php:

// config/prism.php
'telemetry' => [
    'enabled' => true,
    'driver' => 'opentelemetry',
    'drivers' => [
        'opentelemetry' => [
            'service_name' => env('OPENTELEMETRY_SERVICE_NAME', 'laravel-app'),
            'service_version' => env('OPENTELEMETRY_SERVICE_VERSION', '1.0.0'),
            'endpoint' => env('OPENTELEMETRY_ENDPOINT', 'http://localhost:4318/v1/traces'),
        ],
    ],
],

Configure your environment variables:

# Enable Prism telemetry
PRISM_TELEMETRY_ENABLED=true
PRISM_TELEMETRY_DRIVER=opentelemetry

# OpenTelemetry configuration
OPENTELEMETRY_SERVICE_NAME=my-laravel-app
OPENTELEMETRY_SERVICE_VERSION=1.0.0
OPENTELEMETRY_ENDPOINT=http://localhost:4318/v1/traces

Usage

Once configured, Prism will automatically send telemetry data to your OpenTelemetry collector.

License

The MIT License (MIT). Please see License File for more information.