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

# Manage a trace

> Compare traces side-by-side, share traces publicly, and view server logs from the trace view in LangSmith.

From the trace view, you can [compare two traces](#compare-traces) side-by-side, [share a trace publicly](#share-a-trace), and [view the server logs](#view-server-logs) associated with a trace execution.

## Compare traces

You can start comparing traces from two areas in the [UI](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=langsmith-manage-trace):

1. From the **Runs** tab in the **Tracing** projects view, select checkboxes next to the traces you would like to compare. Then, select **Compare Runs** at the bottom of the page to open a side-by-side comparison view.
2. When you're viewing a trace, select the more <Icon icon="dots-vertical" /> menu to navigate to **Compare**. This will open the trace run table. Select the trace you want to compare against the original trace. The side pane will open with both traces selected in a side-by-side comparison view.

To stop comparing, close the pane or click on **Stop comparing** in the upper right-hand side of the pane.

## Share a trace

<Warning>
  **Sharing a trace publicly will make it accessible to anyone with the link. Make sure you're not sharing sensitive information.**

  If your [self-hosted](/langsmith/self-hosted) or [hybrid](/langsmith/hybrid) LangSmith deployment is within a VPC, then the public link is accessible only to members authenticated within your VPC. For enhanced security, we recommend configuring your instance with a private URL accessible only to users with access to your network.
</Warning>

To share a trace publicly:

1. Open any trace in the [UI](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=langsmith-manage-trace).
2. Click the **Share** button in the more <Icon icon="dots-vertical" /> menu at the top of the trace view.
3. In the dialog that appears, copy the public link.

Shared traces are accessible to anyone with the link, even without a LangSmith account. They can view the trace but not edit it.

To unshare a trace, use either of the following methods:

1. Open the shared trace, click **Public** in the toolbar at the top of the trace view, then click **Unshare** in the dialog.
2. Go to **Settings** → **Shared URLs** to view all publicly shared traces in the selected workspace. Click **Unshare** next to the trace you want to unshare.

## View server logs

<Note>
  Viewing server logs for a trace only works with the [Cloud SaaS](/langsmith/cloud) and [fully self-hosted](/langsmith/self-hosted) deployment options.
</Note>

When viewing a trace that was generated by a run in LangSmith, you can access the associated server logs directly from the trace view.

In the trace view, use the **See Logs** button in the top right corner, next to the **Run in Studio** button.

Clicking this button will take you to the server logs view for the associated deployment in LangSmith.

The server logs view displays logs from both:

* **Agent Server's own operational logs**: Internal server operations, API calls, and system events
* **User application logs**: Logs written in your graph with:
  * Python: Use the `logging` or `structlog` libraries.
  * JavaScript: Use the re-exported Winston logger from `@langchain/langgraph-sdk/logging`:

    ```javascript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
    import { getLogger } from "@langchain/langgraph-sdk/logging";

    const logger = getLogger();
    logger.info("Your log message");
    ```

When you navigate from the trace view, the **Filters** box will automatically pre-fill with the Trace ID from the trace you just viewed, so you can quickly filter the logs to see only those related to your specific trace execution.

<img src="https://mintcdn.com/langchain-5e9cc07a/4kN8yiLrZX_amfFn/langsmith/images/lgp-server-logs-filters.png?fit=max&auto=format&n=4kN8yiLrZX_amfFn&q=85&s=cb6f3c15ca3c8d462ee10c5fd190c73e" alt="Deployment server logs filters" width="1348" height="681" data-path="langsmith/images/lgp-server-logs-filters.png" />

## Delete a trace

If you need to remove traces from LangSmith before their expiration date, you can delete an entire project or delete specific traces.

### Delete an entire project

* In the [LangSmith UI](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=langsmith-manage-trace), select the **Delete** option on the project's overflow menu.
* With the [`delete_tracer_sessions`](https://api.smith.langchain.com/redoc#tag/tracer-sessions/operation/delete_tracer_session_api_v1_sessions__session_id__delete) API endpoint.
* With the `delete_project()` ([Python](https://reference.langchain.com/python/langsmith/observability/sdk/)) or `deleteProject()` ([JS/TS](https://reference.langchain.com/javascript/modules/langsmith.html)) in the LangSmith SDK.

### Delete specific traces:

Use the [`delete_runs`](https://api.smith.langchain.com/redoc#tag/run/operation/delete_runs_api_v1_runs_delete_post) API endpoint to delete runs by trace IDs or metadata key-value pairs. The request body accepts:

* `session_id`: scope deletion to a specific project.
* `trace_ids`: list of trace IDs to delete.
* `metadata`: delete all runs matching the given metadata key-value pairs.

For full API usage, including code examples, the 1000-trace-per-request limit, deletion timeline, and metadata matching behavior, refer to [Data purging for compliance](/langsmith/data-purging-compliance#trace-deletes).

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/langsmith/manage-trace.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
