Skip to main content

Module observer

Module observer 

Source
Expand description

Non-intrusive pipeline monitoring (PROCESSOR-DESIGN §5.1).

A FrameObserver sees every processed/pushed frame without sitting in the chain — the seam OpenTelemetry/Sentry/Langfuse/RTVI observers plug into. The Observer fan-out is cheaply clonable; hooks are invoked synchronously on the hot path only when at least one observer is registered (the run loop skips the call entirely otherwise — zero-cost-when-off).

Mirrors pipecat BaseObserver (observers/base_observer.py:70).

The rtvi sibling is a pure frame→event RTVI-protocol observer; the network exporters (OpenTelemetry/Sentry/Langfuse) live in flowcat-services so core stays dependency-light.

Re-exports§

pub use rtvi::FunctionCallReportLevel;
pub use rtvi::RtviMessage;
pub use rtvi::RtviObserver;
pub use rtvi::RtviObserverParams;
pub use rtvi::RtviSink;
pub use rtvi::VecSink;
pub use rtvi::MESSAGE_LABEL as RTVI_MESSAGE_LABEL;
pub use rtvi::PROTOCOL_VERSION as RTVI_PROTOCOL_VERSION;

Modules§

rtvi
RTVI-protocol observer (pure frame→message mapping, no network).

Structs§

FrameEvent
A processor is about to handle a frame.
FramePushEvent
A frame was pushed source→destination.
IdleFrameObserver
Drives idle detection (PROCESSOR-DESIGN §4.1 / pipecat task.py:70): bumps a monotonic counter every time one of the configured “activity” frame kinds is observed. The PipelineTask idle watcher reads the counter and fires a timeout when it stops advancing.
MetricsLogObserver
Collects (and tracing-logs) every MetricsData flowing on Frame::Metrics — a pure, network-free metrics observer. Mirrors pipecat’s MetricsLogObserver: it watches the push hook, de-dupes by frame id, and records each metric with its timestamp so tests (and metric exporters) can read TTFB/RTF/processing/usage semantics without a live sink.
ObservedMetric
One observed metric, tagged with the pipeline-clock timestamp it was seen at. The collected record the MetricsLogObserver keeps for inspection/export.
Observer
Cheap clonable fan-out over many observers (pipecat TaskObserver proxy, task.py:401). When empty, the run loop never calls into it.
TurnTrackingObserver
Tracks user/bot speaking edges → turn boundaries (pipecat TurnTrackingObserver). Records each boundary with its timestamp so tests and exporters can read the turn sequence.
UserBotLatencyObserver
Measures the user-stop → first-bot-audio latency (TTFB of the bot’s reply). Mirrors pipecat UserBotLatencyObserver.

Enums§

TurnEdge
A turn boundary: who spoke and when (ns on the pipeline clock). Mirrors pipecat’s TurnTrackingObserver output.

Traits§

FrameObserver
Non-intrusive observer. Mirrors pipecat BaseObserver (base_observer.py).