symfonic.observability.otel.ports¶
ports ¶
Facade-facing port into the optional OpenTelemetry runtime service.
The implementation remains in :mod:.exporter; this named port keeps the
facade compiler dependent on the service entry surface rather than its
internals, as required by the layer dependency matrix.
OTelExporterHandles
dataclass
¶
OTelExporterHandles(callback_bridge: CallbackBridge, framework_bridge: FrameworkBridge, tracer: OTelTracer)
Bundle of references the engine wires into its registration sites.
The engine prepends callback_bridge to per-invocation callback
lists, hands framework_bridge to the framework-hook dispatcher,
and keeps tracer for the start_run_span context manager plus
shutdown on agent close.
register_into ¶
Append the two bridges to their respective registration sites.
Both lists are mutated in place. The engine owns the lists, so the exporter does not need to track membership separately. Tests can verify wiring by inspecting the lists after construction.
Source code in src/symfonic/observability/otel/exporter.py
build_if_enabled ¶
Convenience wrapper: return handles when config.otel_enabled.
Used by SymfonicAgent.__init__ so the engine site stays a
single-line statement. When otel_enabled is False this function
returns None without touching any module under
symfonic.observability.otel.tracer/etc, preserving the zero-cost
invariant.