> ## Documentation Index
> Fetch the complete documentation index at: https://dev.writer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Monitor agent performance

> Monitor agent performance with session logs and observability metrics in AI Studio. Track usage, analyze conversations, and debug agent behavior.

AI Studio provides session logs and observability metrics for agents so you can understand how your agents are performing.

The following observability views are available for individual agents:

* [Session logs](#session-logs)
* [Agent observability](#agent-observability)

You can also view [organization-wide usage and spend](/home/usage-and-spend).

## Session logs

Organization admins can choose to retain logs from agent sessions. When enabled, you can view the logs for an agent for the given retention period.

<Info>
  Session logs are only available to [organization
  admins](https://support.writer.com). Logs are available for custom [no-code
  agents](/no-code/introduction) and [Writer
  Agent](https://support.writer.com/article/235-ask-writer), but are not yet
  available for prebuilt agents.
</Info>

### Enable session logging

To enable session logging, log in to [AI Studio](https://app.writer.com/aistudio) and navigate to the **Admin** tab in the left sidebar.

<img src="https://mintcdn.com/writer/NOX5YaKoHPVl5k0p/images/admin-setting-ids-session/navbar-dropdown-admin.png?fit=max&auto=format&n=NOX5YaKoHPVl5k0p&q=85&s=f2910539ee2f4db3f4fda34e6a94df01" alt="Session log page in the Admin tab, which shows a list of agents and their session log settings." width="3360" height="2000" data-path="images/admin-setting-ids-session/navbar-dropdown-admin.png" />

From there, you can enable session logging for your organization.

Once enabled, you can choose the retention period for session logs for each agent. The default is no retention. The possible retention periods are 7 days, 30 days, 90 days, or 180 days.

Whenever someone updates an agent's session log settings, all organization admins receive an email notification.

### View session logs

To view session logs, navigate to [AI Studio](https://app.writer.com/aistudio) and select **Agents** from the left sidebar. Select an agent from the list, then select the **Observability** tab from the top of the page and choose the **Session logs** view. Click on an individual session to view the logs.

<img src="https://mintcdn.com/writer/Ph7gAl4exSh0IC1l/images/home/agent-session-logs.png?fit=max&auto=format&n=Ph7gAl4exSh0IC1l&q=85&s=15c696097203e5901807243dcfb52d63" alt="Session logs tab in AI Studio" width="3346" height="884" data-path="images/home/agent-session-logs.png" />

#### Flagged responses

In a chat with a no-code agent, an end user can flag a response as inappropriate or inaccurate. An organization admin can then view the flagged responses within the session logs.

To flag a response in a chat, the user clicks the **Flag** button in the bottom right corner of the response.

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/home/flag-response.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=703838451f5ff82d87fbd0816aa4cfd0" alt="Button to flag a response within a chat" width="608" height="160" data-path="images/home/flag-response.png" />

In the session logs for a particular conversation, you can see any flagged responses by clicking the **View flagged responses** button in the top right corner of the session log.

<img src="https://mintcdn.com/writer/EtzIGhya5-RmdX2Q/images/home/view-flagged.png?fit=max&auto=format&n=EtzIGhya5-RmdX2Q&q=85&s=7bc2626f4aff561d059ebbbe455c16d4" alt="Button to view flagged responses for a particular conversation" width="552" height="140" data-path="images/home/view-flagged.png" />

## Agent observability

Agent observability provides a detailed view of an agent's engagement, performance, and usage. Anyone can view these metrics for agents in your organization. Session logs are also available, but [only for organization admins if the agent's session log settings are enabled](#view-session-logs).

These metrics are only available for deployed agents.

To view metrics for deployed agents, navigate to [AI Studio](https://app.writer.com/aistudio) and select **Agents** from the left sidebar. Select an agent from the list, then select the **Observability** tab from the top of the page and choose the specific metric you want to view.

* **Engagement metrics**: Show the top five users for the agent over the specified time period and the total number of user interactions for the agent.
* **Performance metrics**: Show the average response time as well as the P90, P95, and P99 response times for the agent over the specified time period. It also shows the response codes broken down by `200`, `400`, and `500` status codes.
* **Usage metrics**: Show the total number of tokens and the total spend for the agent over the specified time period.

## Next steps

* [Observability overview](/home/observability): Monitor events, errors, and performance across your deployment
* [Usage and spend](/home/usage-and-spend): Track organization-wide costs and token consumption
* [Export telemetry data](/home/integrations/openllmetry) to your existing observability tools via OpenLLMetry
* [Configure guardrails](/home/guardrails) to enforce content policies across your agents
