Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/langsmith/billing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ Navigate to the usage graph under **Settings** -> **Billing and Usage** -> **Usa
There are several usage metrics that LangSmith charges for:

- LangSmith Traces (Base Charge): tracks all traces that you send to LangSmith.
- LangSmith Traces (Extended Data Retention Upgrades): tracks all traces that also have our Extended 400 Day Data Retention.
- LangSmith Traces (Extended Data Retention Upgrades): tracks all traces that also have extended data retention (400 days by default, [customizable for Enterprise customers](/langsmith/data-purging-compliance#customize-extended-retention-policy)).
- LangSmith Deployment Runs: tracks end-to-end invocations of deployed LangGraph agents.

For more details on traces, refer to the [data retention conceptual docs](/langsmith/administration-overview#data-retention). For more details on Deployment Runs, refer to [LangSmith Deployment billing](#langsmith-deployment-billing).


#### Invoices

To understand how your usage translates to spend, navigate to the **Invoices** tab. The first invoice that will appear on screen is a draft of your current month's invoice, which shows your running spend thus far this month.
Expand All @@ -161,7 +160,8 @@ For organizations with **multiple workspaces only**: For simplicity, LangSmith i
</Note>

#### Configure trace tier distribution
LangSmith has two trace tiers: base traces and extended traces. Base traces have the base retention and are short-lived (14 days), while extended traces have extended retention and are long-lived (400 days). For more information, refer to the [data retention conceptual docs](/langsmith/administration-overview#data-retention).

LangSmith has two trace tiers: base traces and extended traces. Base traces have the base retention and are short-lived (14 days), while extended traces have extended retention and are long-lived (400 days by default, [customizable for Enterprise customers](/langsmith/data-purging-compliance#customize-extended-retention-policy)). For more information, refer to the [data retention conceptual docs](/langsmith/administration-overview#data-retention).

Set the desired default trace tier by selecting an option below the **Default data retention** label. All traces will have this tier by default when they are registered. Note that because extended traces cost more than base traces, selecting **Extended** as your default data retention option will result in less overall traces allowed in the billing period. By default, updating this setting will only apply to future incoming traces. To apply to all existing traces in the workspace, select the checkbox.

Expand All @@ -174,6 +174,10 @@ The extended data retention limit can cause features other than tracing to stop

### Other methods of managing traces

#### Customize extended retention period ([Enterprise](/langsmith/pricing-plans) only)

[Enterprise](/langsmith/pricing-plans) customers can customize the extended data retention period at the workspace level to meet compliance requirements. The default is 400 days, but this can be adjusted based on your organization's needs. For more information, refer to [Customize extended retention policy](/langsmith/data-purging-compliance#customize-extended-retention-policy).

#### Change project-level default retention

Data retention settings are adjustable per tracing project.
Expand All @@ -196,7 +200,7 @@ To configure this:
2. Name your rule and optionally apply filters or a sample rate. For more information on configuring filters, refer to [filtering techniques](/langsmith/filter-traces-in-application#filter-operators).

<Note>
When an automation rule matches any [run](/langsmith/observability-concepts#runs) within a [trace](/langsmith/observability-concepts#traces), then all runs within the trace are upgraded to be retained for 400 days.
When an automation rule matches any [run](/langsmith/observability-concepts#runs) within a [trace](/langsmith/observability-concepts#traces), then all runs within the trace are upgraded to extended data retention (400 days by default, [customizable for Enterprise customers](/langsmith/data-purging-compliance#customize-extended-retention-policy)).
</Note>

For example, this is the expected configuration to keep 10% of all traces for extended data retention:
Expand Down
29 changes: 29 additions & 0 deletions src/langsmith/data-purging-compliance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,35 @@ LangSmith provides automatic data retention capabilities to help with compliance

For detailed information about data retention configuration and management, please refer to the [Data Retention concepts](/langsmith/administration-overview#data-retention) documentation.

## Customize extended retention policy

<Note>
This feature is available for [Enterprise](/langsmith/pricing-plans) plan customers. For [self-hosted](/langsmith/self-hosted) Enterprise customers, refer to the [workspace-level configuration section](#workspace-level-extended-retention-for-self-hosted).
</Note>

[Enterprise](/langsmith/pricing-plans) customers can customize the extended data retention period for traces at the [workspace](/langsmith/administration-overview#workspaces) level to meet specific compliance requirements. By default, extended retention is set to 400 days, but you can adjust this based on your organization's needs. Changes to the retention period apply to new traces only.

### Configure extended retention

In the [LangSmith UI](https://smith.langchain.com):

1. Navigate to **Settings** at the bottom of the page.
1. Select **Usage configuration** from the left-hand menu.
1. Find the workspace in the list that you would like to configure.
1. Click on the value under the **Data retention policy** column for that workspace.
1. On the **workspace usage configurations** modal, customize the extended policy using the dropdown for **Extended - All traces are retained for** option.
1. Select **Save**.
Comment thread
kenvora marked this conversation as resolved.

### Workspace-level extended retention for self-hosted

Self-hosted [Enterprise](/langsmith/pricing-plans) customers can also use workspace-level extended retention configuration instead of system-wide TTL settings. This provides more granular control over data retention for different workspaces without requiring environment variable changes.

<Warning>
If you use blob storage, you **must** add a lifecycle rule for each custom retention period you configure. For example, setting a workspace to 90-day retention means blob data is written to the `ttl_90d/` prefix, which requires a matching lifecycle rule to be cleaned up automatically. See [blob storage TTL configuration](/langsmith/self-host-blob-storage#custom-workspace-level-retention-prefixes) for details and examples.
</Warning>

To configure this for self-hosted deployments, refer to the [self-hosted TTL documentation](/langsmith/self-host-ttl) for the legacy system-wide approach or contact [support](https://support.langchain.com).

## Trace deletes

You can use the API to complete trace deletes. The API supports two methods for deleting traces:
Expand Down
117 changes: 114 additions & 3 deletions src/langsmith/self-host-blob-storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,121 @@ If using an access key and secret, you can also provide an existing Kubernetes s

If using the [TTL](/langsmith/self-host-ttl) feature with LangSmith, you'll also have to configure TTL rules for your blob storage. Trace information stored on blob storage is stored on a particular prefix path, which determines the TTL for the data. When a trace's retention is extended, its corresponding blob storage path changes to ensure that it matches the new extended retention.

The following TTL prefix are used:
The following TTL prefixes are used:

* `ttl_s/`: Short term TTL, configured for 14 days.
* `ttl_l/`: Long term TTL, configured for 400 days.
* `ttl_s/`: Short term (base) TTL, configured for 14 days.
* `ttl_l/`: Long term (extended) TTL, configured for 400 days by default.

### Custom workspace-level retention prefixes

If you use [workspace-level extended retention](/langsmith/data-purging-compliance#customize-extended-retention-policy), LangSmith writes blob data to prefixes of the form `ttl_XXd/`, where `XX` is the number of days configured for that workspace. For example, if a workspace is configured with 90-day extended retention, blob data for that workspace is written to the `ttl_90d/` prefix.

You must create a lifecycle rule for **each** custom retention period configured across your workspaces. Common examples:

* `ttl_90d/` — 90-day retention
* `ttl_180d/` — 180-day retention
* `ttl_365d/` — 365-day retention

<Warning>
If a lifecycle rule is missing for a configured retention period, blob data under that prefix will never be automatically deleted. Ensure you add a matching lifecycle rule whenever you configure a new workspace retention period.
</Warning>

For example, if you have workspaces configured with 90-day and 180-day extended retention, you would add the following lifecycle rules **in addition to** the default `ttl_s` and `ttl_l` rules shown [below](#ttl-configuration):

<Tabs>
<Tab title="AWS">

```hcl
rule {
id = "ttl-90d"
prefix = "ttl_90d/"
enabled = true
expiration {
days = 90
}
}
rule {
id = "ttl-180d"
prefix = "ttl_180d/"
enabled = true
expiration {
days = 180
}
}
```

</Tab>
<Tab title="GCP">

```hcl
lifecycle_rule {
condition {
age = 90
matches_prefix = ["ttl_90d"]
}
action {
type = "Delete"
}
}
lifecycle_rule {
condition {
age = 180
matches_prefix = ["ttl_180d"]
}
action {
type = "Delete"
}
}
```

</Tab>
<Tab title="Azure">

```hcl
rule {
name = "ttl-90d"
enabled = true
type = "Lifecycle"
filters {
prefix_match = ["my-container/ttl_90d"]
blob_types = ["blockBlob"]
}
actions {
base_blob {
delete_after_days_since_creation_greater_than = 90
}
snapshot {
delete_after_days_since_creation_greater_than = 90
}
version {
delete_after_days_since_creation_greater_than = 90
}
}
}
rule {
name = "ttl-180d"
enabled = true
type = "Lifecycle"
filters {
prefix_match = ["my-container/ttl_180d"]
blob_types = ["blockBlob"]
}
actions {
base_blob {
delete_after_days_since_creation_greater_than = 180
}
snapshot {
delete_after_days_since_creation_greater_than = 180
}
version {
delete_after_days_since_creation_greater_than = 180
}
}
}
```

</Tab>
</Tabs>

If you have customized the TTLs in your LangSmith configuration, you will need to adjust the TTLs in your blob storage configuration to match.

Expand Down
4 changes: 4 additions & 0 deletions src/langsmith/self-host-ttl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ sidebarTitle: Enable TTL & data retention

LangSmith Self-Hosted allows enablement of automatic TTL and Data Retention of traces. This can be useful if you're complying with data privacy regulations, or if you want to have more efficient space usage and auto cleanup of your traces. Traces will also have their data retention period automatically extended based on certain actions or run rule applications.

<Note>
**Self-hosted [Enterprise](/langsmith/pricing-plans) customers:** You can now configure extended data retention at the workspace level through the UI, which provides more granular control without requiring environment variable changes. For more information, refer to [Customize extended retention policy](/langsmith/data-purging-compliance#customize-extended-retention-policy). The system-wide TTL configuration documented on this page is still supported.
</Note>

## Requirements

You can configure retention through helm or environment variable settings. There are a few options that are configurable:
Expand Down