Skip to main content
Observability hooks capture component-level latency and token usage without changing the data flow. They are side-effect-only, so you can register many safely, each fires at the end of a component’s turn with a payload of metrics (a dict).

Component Metrics

Register a metrics hook with the @pipeline.metrics.on("<component>") decorator. Each component delivers different payload keys.

Use cases

Use stt, llm, tts, and eou metrics with Cascade pipelines. Use realtime metrics when the pipeline runs in Realtime or Hybrid mode with a realtime model as the LLM.

What’s Next

Observability and Analytics

View the captured metrics, traces, and logs on the Dashboard.

Run Your Agent

Monitor agent and user state changes.

References

Examples

Observability Hooks

Emit metrics and traces from pipeline hooks.

SDK Reference

Pipeline Hooks

Pipeline Hooks in the Python API reference.

Metrics

Metrics in the Python API reference.