PHPackages                             kabiroman/adaptive-entity-manager-opentelemetry-bridge - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. kabiroman/adaptive-entity-manager-opentelemetry-bridge

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

kabiroman/adaptive-entity-manager-opentelemetry-bridge
======================================================

OpenTelemetry bridge for Adaptive Entity Manager - adds distributed tracing and observability to entity lifecycle operations

08PHP

Since Dec 17Pushed 4mo agoCompare

[ Source](https://github.com/kabiroman/adaptive-entity-manager-opentelemetry-bridge)[ Packagist](https://packagist.org/packages/kabiroman/adaptive-entity-manager-opentelemetry-bridge)[ RSS](/packages/kabiroman-adaptive-entity-manager-opentelemetry-bridge/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Adaptive Entity Manager OpenTelemetry Bridge
============================================

[](#adaptive-entity-manager-opentelemetry-bridge)

This Symfony bundle automatically creates OpenTelemetry spans for `persist`, `update`, and `remove` operations from `kabiroman/adaptive-entity-manager-bundle` and resolves manager names based on entity namespaces.

Installation
------------

[](#installation)

```
composer require kabiroman/adaptive-entity-manager-opentelemetry-bridge
```

Register the bundle in `config/bundles.php` and make sure an OTLP exporter/SDK is configured if you plan to export traces.

Configuration
-------------

[](#configuration)

Supported configuration structure (`config/packages/adaptive_entity_manager_opentelemetry_bridge.yaml`):

```
adaptive_entity_manager_opentelemetry_bridge:
    enabled: true
    manager_namespaces:
        sales: 'App\Domain\Sales\'
        legacy: 'App\Domain\Legacy\'
```

- `enabled` toggles tracing on or off.
- `manager_namespaces` maps manager names (keys) to namespace prefixes (values), which are used to determine entity ownership.

Usage
-----

[](#usage)

`EntityPersistenceTracingSubscriber` listens to lifecycle events emitted by `AdaptiveEntityManager`. Thanks to autoconfiguration, it receives `TracerInterface`, `LoggerInterface` (if available), the `enabled` flag, and namespace mapping from the bundle configuration.

### Span naming

[](#span-naming)

Spans are named according to the following pattern:

```
aem.{operation}.{EntityShortName}

```

Examples:

- `aem.persist.User`
- `aem.update.Order`
- `aem.remove.Product`

### Span attributes

[](#span-attributes)

- `aem.operation`: `persist`, `update`, or `remove`
- `aem.entity.class`: fully qualified class name
- `aem.entity.short_class`: short class name
- `aem.entity.id`: result of `getId()` (when available)
- `aem.manager`: manager name resolved from namespace or `unknown`
- `aem.entity.changed_fields` and `aem.entity.changed_fields_count` for updates
- `component`: `adaptive-entity-manager`

### Events

[](#events)

- `aem.entity.persisted` — emitted after entity persist
- `aem.entity.updated` — emitted after entity update
- `aem.entity.removed` — emitted after entity removal

Troubleshooting
---------------

[](#troubleshooting)

### Spans do not appear in Jaeger/Tempo

[](#spans-do-not-appear-in-jaegertempo)

1. Confirm that `TracerInterface` is registered: ```
    php bin/console debug:container TracerInterface
    ```
2. Make sure the subscriber and bundle are loaded: ```
    php bin/console debug:container EntityPersistenceTracingSubscriber
    ```
3. Check the configuration that Symfony loads: ```
    php bin/console debug:config adaptive_entity_manager_opentelemetry_bridge
    ```
4. Enable debug logging if needed: ```
    monolog:
        handlers:
            main:
                level: debug
    ```

### `aem.manager` always reads `unknown`

[](#aemmanager-always-reads-unknown)

Ensure the configured namespaces match your entity namespaces:

```
manager_namespaces:
    sales: 'App\Domain\Sales\'  # Must match the entity namespace prefix
```

- `App\Domain\Sales\Entity\User` ✅
- `App\Entity\Sales\User` ❌ (namespace differs)

Jaeger / Tempo / OTLP
---------------------

[](#jaeger--tempo--otlp)

The bundle relies on `OpenTelemetry\API\Trace\TracerInterface`, so actual exporting and exporter selection happens outside the bundle (for example, with `OpenTelemetry\SDK` and an OTLP exporter). Ensure a `TracerInterface` service is available in your application.

Graceful degradation
--------------------

[](#graceful-degradation)

- If no `TracerInterface` is registered, spans are not created.
- When `enabled` is `false`, the subscriber is a no-op.
- If `manager_namespaces` is empty, the manager name defaults to `unknown`.
- The logger is optional and only used for debug output.

Examples
--------

[](#examples)

Minimal configuration example:

```
adaptive_entity_manager_opentelemetry_bridge:
    enabled: '%env(bool:OTEL_ENABLED)%'
    manager_namespaces:
        sales: 'App\Domain\Sales\'
```

When Jaeger/Tempo receives traces, look for spans such as `aem.persist.User` and `aem.update.Order` that include manager, entity class, and id attributes.

Roadmap
-------

[](#roadmap)

This package is actively maintained. See [ROADMAP.md](ROADMAP.md) for planned features and future releases.

**Upcoming:**

- **v1.1.0** (Q1 2026): Span customization hooks, behavior tests, and edge case coverage
- **v1.2.0** (Q2 2026): Integration tests, performance benchmarks, and CI/CD

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit issues or pull requests.

License
-------

[](#license)

MIT License - see LICENSE file for details.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance50

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c62cce4303211376add33f2a06f03ee14c20daad7ffd0a2cc6026cbfb7c6a3a8?d=identicon)[kabiroman](/maintainers/kabiroman)

---

Top Contributors

[![kabiroman](https://avatars.githubusercontent.com/u/51466769?v=4)](https://github.com/kabiroman "kabiroman (4 commits)")

### Embed Badge

![Health badge](/badges/kabiroman-adaptive-entity-manager-opentelemetry-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/kabiroman-adaptive-entity-manager-opentelemetry-bridge/health.svg)](https://phpackages.com/packages/kabiroman-adaptive-entity-manager-opentelemetry-bridge)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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