@LangChain: Claude Platform traces can now be sent to LangSmith through OpenTelemetry. Export from Claude Managed Agents, the Messa…

X AI KOLs Timeline Products

Summary

Claude Platform traces can now be exported to LangSmith via OpenTelemetry, letting users inspect every step of Claude Managed Agents sessions and Messages API requests. Available in public beta with multiple export paths including server-side destinations, Claude SDKs, and the LangSmith SDK wrapper.

Claude Platform traces can now be sent to LangSmith through OpenTelemetry. Export from Claude Managed Agents, the Messages API, or the Claude SDKs with native OTel support. Traces show up in LangSmith so you can inspect every step and improve agent performance. It’s available now in public beta. Docs: https://docs.langchain.com/langsmith/trace-anthropic…
Original Article
View Cached Full Text

Cached at: 10/14/26, 06:03 PM

Claude Platform traces can now be sent to LangSmith through OpenTelemetry.

Export from Claude Managed Agents, the Messages API, or the Claude SDKs with native OTel support. Traces show up in LangSmith so you can inspect every step and improve agent performance.

It’s available now in public beta.

Docs: https://docs.langchain.com/langsmith/trace-anthropic…


Trace Anthropic applications - Docs by LangChain

Source: https://docs.langchain.com/langsmith/trace-anthropic You can send Anthropic traces to LangSmith from Anthropic’s servers or from your own application:

  • From the Claude Platform: The Claude Platform sends traces directly from Anthropic’s servers. You configure it in the Claude Console, with no changes to your application code.
  • From your application: Your application sends the traces, in one of two ways:- Claude SDKs: The Claude SDKs emit OpenTelemetry (OTel) spans, and an OTel exporter library sends them to LangSmith. - LangSmith SDK wrapper: You wrap the Anthropic client with the LangSmith SDK (Python or TypeScript). You can combine the traces with@traceablespans for the rest of your code in a single trace.

Trace from the Claude Platform

The Claude Platform exports OTel traces of yourClaude Managed Agentssessions andMessages APIrequests. It sends them to adestination, an OTel endpoint that you register in the Claude Console. You can add LangSmith as a destination and view these traces without changing your application code. For details on destinations and delivery, seeUse OpenTelemetry with the Claude APIin the Anthropic docs.Before you begin, you need:

  • The admin role, or an equivalent permission, in your Claude Console organization. Without it, you cannot view or manage destinations.
  • A LangSmith API key. You can use apersonal access token, or aservice keywhen you want tracing to be independent of your user account. To create a key, seeCreate an account and API key.
  • For self-hosted LangSmith, an endpoint that the Claude Platform can reach: HTTPS on port 443, at a hostname that resolves to a public IP address.

Step 1. Add LangSmith as a destination

To add a destination:

  1. In the Claude Console, open theOpenTelemetry settings pageof your organization and clickAdd destination.
  2. In theProviderdrop-down, selectLangSmith. The form changes to show the LangSmith fields.
  3. Complete the fields:- Name: (Optional) A label for the destination, such asLangSmith. - Region: The region of your LangSmith deployment:US,EU,APAC, orUS on AWS. For self-hosted LangSmith, selectSelf-hostedand enter the OTel endpoint URL of your instance in theLangSmith URLfield, for examplehttps://<your\-langsmith\-host\>/api/v1/otel. - API key: Your LangSmith API key. - Project: (Optional) The name of thetracing projectto send traces to. If you leave it empty, traces go to thedefaultproject. - LangSmith workspace ID: (Optional) The ID of the LangSmith workspace to send traces to. If you leave it empty, traces go to the workspace that the API key belongs to. Organization-scoped service keys require it. To find the ID, seeCreate an account and API key. - Content mode: SelectFull contentto include prompts and responses in the spans. WithMetadata only, spans omit the input and output content. - Workspaces: The Claude workspaces that send traces to this destination:All,Selected, orAll except. For details on each option, seeChoose workspaces for a destinationin the Anthropic docs.
  4. ClickAdd destination.

When you edit the destination later, the form shows the genericOTLP endpoint URLandRequest headersfields instead of the LangSmith fields. TheOTLP endpoint URLholds the URL of your region, and the LangSmith fields become these request headers:

  • x\-api\-key: TheAPI key.
  • Langsmith\-Project: TheProject, if you set one.
  • X\-Tenant\-Id: TheLangSmith workspace ID, if you set one.

If you change the host of theOTLP endpoint URL, enter the header values again.

Step 2. Check that traces arrive

To check the setup:

  1. Send a Messages API request or run a Claude Managed Agents session in a Claude workspace that uses the destination.
  2. On the Claude Console OpenTelemetry settings page, check that theDeliverycolumn of the destination showsHealthy. This can take about a minute.
  3. In LangSmith, open the project that you named in theProjectfield, or thedefaultproject.

Troubleshoot delivery

If theDeliverycolumn on the Claude ConsoleOpenTelemetry settings pageshowsFailing, hold the pointer over it to see the last error:

  • HTTP 401: The destination sends no API key.
  • HTTP 403: The API key is wrong, or it has expired or been deleted. LangSmith also returns 403 for an organization-scoped service key without a workspace ID.
  • HTTP 404: The endpoint URL is wrong. Edit the destination and check that theOTLP endpoint URLends in/otel(/api/v1/otelfor self-hosted LangSmith) and does not include/v1/traces.

For other errors, seeDelivery errorsin the Anthropic docs.If theDeliverycolumn showsDisabled, hold the pointer over it to see why. For example, the Claude Platform disables a destination whose hostname resolves to an IP address that is not public. SeeDelivery and healthin the Anthropic docs.

Trace from your application

Use one of these methods when your application should send the traces. To trace your Anthropic calls together with the rest of your code in a single trace, use the LangSmith SDK wrapper.

Use the Claude SDKs

The Claude SDKs emit OTel spans in your application for each request that they send and for each tool use that the tool runner runs. An OTel exporter library sends the spans to LangSmith. For details on the SDK options and the spans that the SDKs emit, seeSet up SDK tracingin the Anthropic docs.To send Claude SDK spans to LangSmith:

  1. Install or upgrade the Claude SDKandregister a tracer provider.
  2. Configure an OTel exporter with the OTel endpoint URL of your LangSmith deployment:Set the following request headers:- x\-api\-key: Your LangSmith API key. - Langsmith\-Project: (Optional) The name of the tracing project to send traces to. Without this header, traces go to thedefaultproject. - X\-Tenant\-Id: (Optional) The ID of the LangSmith workspace to send traces to. Without this header, traces go to the workspace that the API key belongs to. Organization-scoped service keys require it. For example, with the standard OTel environment variables:For more information on exporter setup, seeTrace a non-LangChain application.
  3. (Optional) By default, the Claude SDKs record metadata only. To include prompts and responses in the spans, set the content mode. SeeConfigure the SDKin the Anthropic docs.

Use the LangSmith SDK wrapper

The Anthropic wrapper methods in Python (wrap\_anthropic) and TypeScript (wrapAnthropic) wrap your Anthropic client to log traces automatically. With the wrapper, LangSmith renders messages, including tool calls and multimodal content blocks, in a readable format. The wrapper works alongside the@traceabledecorator (Python) ortraceablefunction (TypeScript), so you can trace your Anthropic calls with the wrapper and trace other parts of your application with the decorator or function.

To traceClaude Managed Agentssessions with the TypeScriptwrapAnthropicwrapper, seeTrace Claude Managed Agents.


ClaudeDevs (@ClaudeDevs): Now in public beta, Claude Platform can send OpenTelemetry traces from the Messages API, Claude Managed Agents, and the Claude SDKs to your observability stack.

Similar Articles