Skip to main content
This is a beta feature. The API may change in future releases.
The LangSmith Collector-Proxy is a lightweight, high-performance proxy server that sits between your application and the LangSmith backend. It batches and compresses trace data before sending it to LangSmith, reducing network overhead and improving performance.

When to use the Collector-Proxy

The Collector-Proxy is particularly valuable when:
  • You’re running multiple instances of your application in parallel and need to efficiently aggregate traces
  • You want more efficient tracing than direct OTEL API calls to LangSmith (the collector optimizes batching and compression)
  • You’re using a language that doesn’t have a native LangSmith SDK

Key features

  • Efficient Data Transfer Batches multiple spans into fewer, larger uploads.
  • Compression Uses zstd to minimize payload size.
  • OTLP Support Accepts OTLP JSON and Protobuf over HTTP POST.
  • Semantic Translation Maps GenAI semantic conventions to the LangSmith Run model.
  • Flexible Batching Flush by span count or time interval.

Configuration

Configure via environment variables:

Project configuration

The Collector-Proxy supports LangSmith project configuration with the following priority:
  1. If a project is specified in the request headers (Langsmith-Project), that project will be used
  2. If no project is specified in headers, it will use the project set in the LANGSMITH_PROJECT environment variable
  3. If neither is set, it will trace to the default project.

Authentication

The API key can be provided either:
  • As an environment variable (LANGSMITH_API_KEY)
  • In the request headers (X-API-Key)

Deployment (Docker)

You can deploy the Collector-Proxy with Docker:
  1. Build the image
  2. Run the container

Usage

Point any OTLP-compatible client or the OpenTelemetry Collector exporter at:
Send a test trace:

Health & scaling

  • Liveness: GET /live → 200
  • Readiness: GET /ready → 200

Horizontal scaling

To ensure full traces are batched correctly, route spans with the same trace ID to the same instance (e.g., via consistent hashing).

Fork & extend

Fork the Collector-Proxy repo on GitHub and implement your own converter:
  • Create a custom GenAiConverter or modify the existing one in internal/translator/otel_converter.go
  • Register the custom converter in internal/translator/translator.go

Connect these docs to Claude, VSCode, and more via MCP for real-time answers.