Correcting under-reported trace usage on self-hosted LangSmith
Last updated: August 24, 2026
Applies to: Self-hosted LangSmith deployments
Category: Self-hosted · Billing & usage
Summary
On some self-hosted LangSmith deployments, a portion of hourly trace-usage records were rejected when first received and left in a terminal failed state.
This article explains how to run a one-time, safe-to-re-run script to trigger the replay of your failed usage transactions.
Run this script only if LangChain Support has asked you to. When we do, we'll confirm that your deployment is affected and provide any details you need. You do not need to determine the time window yourself — the script's built-in defaults already cover the affected period for this issue.
Prerequisites
Access to your deployment's LangSmith PostgreSQL connection string.
The support script pg_reset_failed_trace_transactions.sql and the helper run_support_query_pg.sh, both located in the LangSmith Helm chart under charts/langsmith/scripts/support_queries/postgres/.
Run the script from the scripts directory:
sh run_support_query_pg.sh "postgres://USER:PASS@HOST:PORT/DB" \
--input support_queries/postgres/pg_reset_failed_trace_transactions.sql
The script processes records in batches and prints progress as it runs, ending with done
The re-queued records are picked up automatically by the usage reporter on its next scheduled run and marked as sent — no service restart required. Your usage reporting will then reflect the corrected totals for the affected period.
Reach out to Technical Support if you have any questions