PHPackages                             macpaw/symfony-otel-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. macpaw/symfony-otel-bundle

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

macpaw/symfony-otel-bundle
==========================

1.0(9mo ago)9511[1 PRs](https://github.com/MacPaw/symfony-otel-bundle/pulls)MITPHPPHP ^8.2CI passing

Since Jul 31Pushed 4mo ago12 watchersCompare

[ Source](https://github.com/MacPaw/symfony-otel-bundle)[ Packagist](https://packagist.org/packages/macpaw/symfony-otel-bundle)[ RSS](/packages/macpaw-symfony-otel-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (20)Versions (5)Used By (0)

Symfony OpenTelemetry Bundle
============================

[](#symfony-opentelemetry-bundle)

A comprehensive OpenTelemetry integration bundle for Symfony applications that provides automatic instrumentation, custom span creation, and distributed tracing capabilities.

Features
--------

[](#features)

- **Automatic Instrumentation** - Built-in instrumentations for HTTP requests, database operations, and more
- **Custom Instrumentations** - Easy-to-use framework for creating custom instrumentations
- **Middleware System** - Extensible middleware system for span customization
- **Exception Handling** - Automatic span cleanup and error recording
- **Docker Support** - Complete development environment with Tempo and Grafana
- **Performance Optimized** - Support for both HTTP and gRPC transport protocols
- **OpenTelemetry Compliant** - Follows OpenTelemetry specifications and semantic conventions

Quick Overview
--------------

[](#quick-overview)

This bundle provides a configured OpenTelemetry integration for Symfony applications, offering:

- Automatic telemetry collection via kernel event listeners
- Custom instrumentation framework for business logic
- Built-in support for distributed tracing
- Complete testing and development environment

Bundle Overview
---------------

[](#bundle-overview)

This bundle is a wrapper around the [official OpenTelemetry PHP SDK bundle](https://github.com/opentelemetry-php/contrib-sdk-bundle) that simplifies integration and provides additional instrumentation capabilities for Symfony applications.

**Key characteristics:**

- **Transport-agnostic** - Uses standard OpenTelemetry SDK environment variables for transport configuration
- **Framework-focused** - Provides Symfony-specific instrumentation and middleware
- **Extensible** - Easy to add custom instrumentations and span processors

Built-in Features
-----------------

[](#built-in-features)

- **Request Execution Time Tracking** - Automatic HTTP request timing
- **Exception Handling** - Automatic span cleanup and error recording
- **Custom Instrumentations** - Framework for creating custom telemetry collection

For detailed instrumentation guide, see [Instrumentation Guide](docs/instrumentation.md).

Environment Variables
---------------------

[](#environment-variables)

The bundle supports all standard OpenTelemetry SDK environment variables. For complete configuration reference, see [Configuration Guide](docs/configuration.md).

**Essential variables:**

- `OTEL_SERVICE_NAME` - Your service name
- `OTEL_TRACER_NAME` - Tracer name
- `OTEL_EXPORTER_OTLP_ENDPOINT` - Collector endpoint
- `OTEL_EXPORTER_OTLP_PROTOCOL` - Transport protocol (grpc/http/protobuf)

### Transport Configuration

[](#transport-configuration)

**Important:** This bundle is **transport-agnostic** - it doesn't handle transport configuration directly. All transport settings are managed through standard OpenTelemetry SDK environment variables.

**Recommended for production:**

```
# Install gRPC support
composer require open-telemetry/transport-grpc
pecl install grpc # may take a time to compile - 30-40 minutes

# Configure gRPC endpoint
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:4317
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
```

**Default HTTP endpoint:** `http://collector:4318`

**Transport protocols supported:**

- `grpc` - High performance, recommended for production
- `http/protobuf` - Standard HTTP with protobuf encoding
- `http/json` - HTTP with JSON encoding (slower)

**Note:** Our bundle supports all transport protocols supported by the OpenTelemetry PHP SDK since we don't decorate the transport layer. For complete transport configuration options, see the [official OpenTelemetry PHP Exporters documentation](https://opentelemetry.io/docs/languages/php/exporters/).

For detailed Docker setup and development environment configuration, see [Docker Development Guide](docs/docker.md).

Documentation
-------------

[](#documentation)

- [Installation Guide](docs/installation.md) - Complete installation and setup instructions
- [Configuration Reference](docs/configuration.md) - Bundle configuration and environment variables
- [Instrumentation Guide](docs/instrumentation.md) - Built-in instrumentations and custom development
- [Docker Development](docs/docker.md) - Local development environment setup
- [Testing Guide](docs/testing.md) - Testing, trace visualization, and troubleshooting
- [OpenTelemetry Basics](docs/otel_basics.md) - OpenTelemetry concepts and fundamentals
- [Contributing Guide](CONTRIBUTING.md) - How to contribute to the project

Quick Start
-----------

[](#quick-start)

1. **Install the bundle:**

    ```
    composer require macpaw/symfony-otel-bundle
    ```
2. **Enable in your application:**

    ```
    // config/bundles.php
    return [
        Macpaw\SymfonyOtelBundle\SymfonyOtelBundle::class => ['all' => true],
    ];
    ```
3. **Configure environment variables:**

    ```
    OTEL_SERVICE_NAME=your-service-name
    OTEL_TRACER_NAME=your-tracer-name
    OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
    ```
4. **Start testing:**

    ```
    make up
    open http://localhost:8080
    ```

Usage
-----

[](#usage)

For detailed usage instructions, see [Testing Guide](docs/testing.md).

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance67

Regular maintenance activity

Popularity17

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

282d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1935412?v=4)[MacPaw Inc.](/maintainers/macpaw)[@MacPaw](https://github.com/MacPaw)

---

Top Contributors

[![serhiidonii](https://avatars.githubusercontent.com/u/158484424?v=4)](https://github.com/serhiidonii "serhiidonii (42 commits)")[![ihor-kopyl](https://avatars.githubusercontent.com/u/190011858?v=4)](https://github.com/ihor-kopyl "ihor-kopyl (34 commits)")[![tahrz](https://avatars.githubusercontent.com/u/38757318?v=4)](https://github.com/tahrz "tahrz (21 commits)")[![Citizen4our](https://avatars.githubusercontent.com/u/47303372?v=4)](https://github.com/Citizen4our "Citizen4our (6 commits)")[![crossplanegithub[bot]](https://avatars.githubusercontent.com/u/1935412?v=4)](https://github.com/crossplanegithub[bot] "crossplanegithub[bot] (1 commits)")

---

Tags

backendmacpawotel

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/macpaw-symfony-otel-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/macpaw-symfony-otel-bundle/health.svg)](https://phpackages.com/packages/macpaw-symfony-otel-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[symfony/debug-bundle

Provides a tight integration of the Symfony VarDumper component and the ServerLogCommand from MonologBridge into the Symfony full-stack framework

2.4k115.8M817](/packages/symfony-debug-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
