Skip to Content
GlossaryTrace - Glossary

Trace

Back to GlossaryResults Analysis

A record of an AI application's execution path that captures inputs, outputs, intermediate steps, and timing data for observability and debugging.

Also known as: span, execution trace, tracing

Overview

When Rhesis executes a test against your endpoint, it records a trace—a complete picture of what happened inside your application during that execution. Traces help you understand not just whether a test passed or failed, but exactly why.

What a Trace Captures

  • Inputs and outputs: The data that entered and left each step of your application
  • Intermediate steps: Function calls, tool invocations, and decision points
  • Agent handoffs: Transitions between agents in multi-agent workflows
  • Token usage: Model token consumption at each step
  • Timing: Latency for each span within the execution
  • Status: Success or failure state of each operation

Trace Structure

Each trace is composed of spans—individual units of work within the execution. Spans are arranged in a parent-child hierarchy that mirrors your application's call graph. The top-level span represents the entire request; child spans represent sub-operations.

Multi-Turn Conversations and trace_id

For multi-turn tests, all turns of a conversation are linked under a shared . This lets you view the complete conversational context in the Conversation View tab and navigate between individual turns without losing context.

Visualizing Traces

Rhesis provides two views for traces:

List View: A chronological list of spans with timing and status information, suitable for inspecting individual steps.

Graph View: A visual graph that shows the relationships between spans, agent invocations, and handoffs. Turn labels appear on edges, and progressive agent invocation counts help you understand complex multi-agent flows.

Filtering Traces

Filter traces by:

  • Status: Passed, failed, or error
  • Duration: Long-running requests
  • Type: Single-turn, multi-turn, or conversation
  • Custom attributes: Any metadata your application emits

SDK Integration

The Rhesis SDK automatically captures traces when you use the or decorators. No manual instrumentation is required for basic tracing.

python
from rhesis.sdk.decorators import endpoint

@endpoint
def my_llm_app(input: str) -> str:
      # Rhesis automatically traces this function
      return call_your_llm(input)

For deeper tracing of internal functions, add :

python
from rhesis.sdk.decorators import observe

@observe
def retrieve_context(query: str) -> list[str]:
      # This function's I/O will appear as a child span
      return vector_search(query)

OpenTelemetry Export

Traces can be exported to any OpenTelemetry-compatible backend (Jaeger, Grafana Tempo, Datadog, etc.) using the SDK's OpenTelemetry integration.

Best Practices

  • Add to key internal functions (retrieval, tool calls, sub-agents) to maximize trace depth
  • Use the Graph View for multi-agent workflows and the List View for single-function debugging
  • Filter traces by status after a test run to locate failing executions quickly
  • Include custom attributes in trace spans to surface application-specific context alongside standard fields

Related Terms