micro-module/observability-bundle

OpenTelemetry observability bundle with conditional subsystem loading for Symfony applications

Maintainers

Package info

github.com/temafey/micro_modules_observability_bundle

Type:symfony-bundle

pkg:composer/micro-module/observability-bundle

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-03-29 20:14 UTC

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