micro-module / observability-bundle
OpenTelemetry observability bundle with conditional subsystem loading for Symfony applications
Package info
github.com/temafey/micro_modules_observability_bundle
Type:symfony-bundle
pkg:composer/micro-module/observability-bundle
Requires
- php: ^8.4
- open-telemetry/api: ^1.0
- open-telemetry/sdk: ^1.0
- psr/log: ^2.0 || ^3.0
- symfony/config: ^7.0 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/http-kernel: ^7.0 || ^8.0
Requires (Dev)
- ackintosh/ganesha: ^4.0
- broadway/broadway: ^3.0
- doctrine/dbal: ^4.0
- micro-module/base: ^0.12 || ^0.13 || ^0.14
- micro-module/event-queue: ^0.7
- mockery/mockery: ^1.6
- nyholm/symfony-bundle-test: ^3.0
- open-telemetry/exporter-otlp: ^1.3
- phpstan/phpstan: ^2.0
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^11.0
- predis/predis: ^2.0
- ramsey/uuid: ^4.0
- symfony/console: ^7.0 || ^8.0
- symplify/easy-coding-standard: ^12.0
Suggests
- ackintosh/ganesha: Required for circuit breaker protection
- broadway/broadway: Required for EventBus/EventStore tracing
- doctrine/dbal: Required for Doctrine query tracing (^4.0)
- micro-module/enqueue: Required for AMQP message tracing
- micro-module/tactician-bundle: Required for CommandBus tracing middleware
- predis/predis: Required for Redis circuit breaker storage
- symfony/console: Required for test tracing console commands
- symfony/monolog-bundle: Required for trace context in log entries
This package is auto-updated.
Last update: 2026-03-29 20:19:21 UTC
README
OpenTelemetry observability bundle for Symfony applications with conditional subsystem loading.
Features
- Core: TracerFactory + MeterFactory for OpenTelemetry instrumentation
- Doctrine: DBAL query tracing middleware
- AMQP: RabbitMQ producer/consumer span propagation
- Broadway: EventBus/EventStore decorator tracing
- Redis: Operation tracing with cache hit/miss tracking
- Profiling: Pyroscope continuous profiling
- Circuit Breaker: Ganesha-based protection for OTel exporters
- Command Bus: Tactician middleware tracing
Each subsystem is independently toggleable and only loaded when its dependencies are present.
Installation
composer require micro-module/observability-bundle
Configuration
# config/packages/micro_observability.yaml micro_observability: service_name: "my-service" # required service_version: "1.0.0" doctrine: enabled: true # requires doctrine/dbal connections: [default] amqp: enabled: true # requires micro-module/enqueue broadway: enabled: true # requires broadway/broadway redis: enabled: true # requires ext-redis profiling: enabled: false pyroscope_endpoint: "http://pyroscope:4040" circuit_breaker: enabled: true # requires ackintosh/ganesha failure_threshold: 50 time_window_seconds: 30 minimum_requests: 3 interval_to_half_open_seconds: 10 command_bus: enabled: true # requires league/tactician logging: enabled: true # Monolog trace context flusher: enabled: true # Metrics/log flusher
Conditional Loading
Each subsystem checks both the enabled config flag AND whether its dependencies are installed:
// Example: Doctrine tracing only loads if BOTH conditions are true if ($config['doctrine']['enabled'] && class_exists(\Doctrine\DBAL\Driver\Middleware::class)) { $container->import('../config/doctrine.php'); }
This means you can safely enable all subsystems — those without installed dependencies are silently skipped.
License
Proprietary