- Metrics: Quantitative measurements (e.g. average response time)
- Logs: Event logs emitted by various components
- Tracing: Detailed timelines of requests and their paths across distributed services
Why Do You Need Tracing in Your Assistant
When building pro-code conversational AI solutions, teams need to quickly answer questions like:- What exactly happened when the assistant processed a user message? See which flows were invoked, which custom actions ran, which commands got generated, and why.
- Why is my assistant slow or occasionally unresponsive? Is the slowness coming from an LLM call, a vector store query, or a custom action HTTP request?
- How can I debug or optimize custom action performance? Pinpoint exactly where your code is spending time—e.g. upstream or downstream dependencies in your custom actions.
- How can I track LLM input and outputs, its usage and costs? Trace the LLM’s prompt token usage, temperature settings, etc. to monitor usage in real time.
How to Enable Tracing in Rasa
Enabling tracing in Rasa is straightforward—connect it to a supported tracing backend or collector. Once configured, Rasa activates its instrumentation layer and emits trace spans for conversation processing, LLM calls, flow transitions, custom actions, and more.The instrumentation layer also records Observability Metrics. If you configure a
metrics block in your endpoints file, you must also enable tracing or no metric measurements will be collected.1. Choose Your Tracing Backend or Collector
Rasa supports:- Jaeger A popular open source end-to-end distributed tracing system.
- OTEL Collector (OpenTelemetry Collector) A vendor-agnostic approach that can forward data to Jaeger, Zipkin, or other tracing backends.
2. Configure tracing in Your Endpoints
In your endpoints.yml or Helm values, add a tracing: block. For example, to configure Jaeger and Langfuse as tracing tools:
endpoints.yml
endpoints.yml
3. (Optional) Instrument Custom Code
If you want deeper insights into custom action performance, you can add custom spans to specific parts of your code. For example, you can retrieve the tracer in your action server and wrap code sections in manual spans. This is especially useful for investigating complex logic or third-party dependencies.For a full list of traced events and code snippets for custom instrumentation,
see our reference documentation.
Best Practices for Tracing
- Start Tracing Early Instrument your assistant from the beginning of development—waiting until there’s a performance issue might make it harder to diagnose.
- Trace Only Where Needed While you can trace everything, capturing very verbose details (like prompt token usage) in production can add overhead. Often, it’s better to enable advanced tracing features in test or staging environments, then turn them off once you identify the root cause.
- Use a Single Runtime Trace Collector Sending data to a single OTEL or Jaeger collector is simpler to maintain and ensures all trace spans appear in one place—important for diagnosing end-to-end issues.
- Correlate with Logs & Metrics Traces alone might not be sufficient. Combine them with logs (e.g. error messages) and metrics (e.g. average token usage per conversation) to get a 360° view of system health.
- Leverage the Dialogue Stack CALM’s dialogue stack concept means multiple flows can be active at once. Tracing helps you see which flow is top-of-stack at any given time—and why that flow was triggered.
- Trace LLM Calls Separately Rasa uses multiple LLM based components that are all critical to fulfilling a single turn of a conversation. A lot of low effort high value runtime optimizations are found by deeply analyzing input and output of each LLM call, token usage to monitor costs, latencies to manage responsiveness of the agent. Ensure you have a langfuse instance connected and configured to your rasa agent to catch issues early on in production.
- Focus on Action Server Performance Custom actions are often the biggest source of latencies. Use tracing spans around external API calls in your action code to detect slow dependencies.