How to Trace Agent Responsespublic

Validated on 30 Jun 2025 • Last edited on 8 Jul 2025

GradientAI Platform lets you build fully-managed AI agents with knowledge bases for retrieval-augmented generation, multi-agent routing, guardrails, and more, or use serverless inference to make direct requests to popular foundation models.

Agent Tracing shows a step-by-step timeline of how your agent processes each prompt, from receiving the input to generating the final response. Each trace includes: token usage, processing times, session and trace IDs, and accessed resources such as knowledge bases, agent routing, and functions.

Enable Trace Storage

Before you can view traces, you must enable trace storage for your agent. This allows you to save traces and conversation logs for later review.

From the DigitalOcean Control Panel, click Agent Platform in the left menu. In the Agent Workspaces tab, select the workspace that contains the agent you want to enable traces for. From the workspace’s Agents tab, select the agent, then click the Observability tab and find the Traces and conversation logs section.

To enable trace storage, click Enable trace storage. You can disable trace storage at any time, but disabling it deletes all stored traces and conversation logs for your agent.

Once you’ve enabled trace storage and your agent has received some requests, you can view the traces.

View Traces

You can access traces from the Agent Playground or from the agent’s Observability tab.

Click View log stream to open the log stream window where you can view traces at three levels of granularity:

  • Sessions display the complete set of interactions (traces) with your agent, including all prompts and responses within a single session.
  • Traces display individual actions (spans) taken during an interaction, including the prompt, response, and all processing steps.
  • Spans display information about the individual action taken by the agent, such as a tool call, knowledge base retrieval, or function execution.

You can list traces by individual sessions, traces, or spans by clicking their respective tabs. The default view is Sessions, which shows a list of all sessions for the agent.

To open a session, click on the Sessions tab and then click a session from the list. This opens a diagram view of the session’s first trace. The diagram shows the input, document retrievals, tool calls, and the final output. You can click on any of the nodes to see more details about that step in the trace.

Visual flowchart of the agent's processing steps for a single trace.

You can then page through the session’s traces by clicking the left and right arrows at the top of the diagram.

Latency and Messages Views

The Latency and Messages tabs provide additional insights into the agent’s performance.

To view the latency for each step in the session, click the Latency tab. This shows a timeline of the session’s processing times. You can click on individual nodes in the timeline to see more details about that step. This can help you identify bottlenecks or delays in the agent’s processing.

Overview of the timing and duration of each span's execution within the session.

The Messages tab shows a conversation log and a waterfall chart of all the traces for that session. You can click on any of the traces or spans to see the details about it, including IDs, timestamps, and processing times. This view is useful for quickly scanning through the session’s interactions.

Overview of the agent's full conversation with user inputs and outputs.

Export Traces

Exporting session and tracing logs lets you download session or trace data as a .csv file for offline analysis or archiving.

To begin exporting data, open the control panel, click GenAI Platform in the left menu, then in Agent Workspaces, select the workspace that contains your agent. From the workspace’s Agents tab, select the agent, then click the Observability tab and scroll to the Traces and conversation logs section.

In the log stream window, switch to either the Sessions or Traces tab, select the interactions you want to export using the checkboxes, then click Export to open the Export Data window.

In the export window, choose the columns you want to include. You can click All, None, or Visible Columns (the default set), or manually select individual columns using the checkboxes.

After selecting your columns, choose a file name or leave the field blank to use the autogenerated name. Then, click Export to download the .csv file to your local machine.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.