# Enable OpenTelemetry traces without sending data to LangSmith

**URL:** https://forum.langchain.com/t/enable-opentelemetry-traces-without-sending-data-to-langsmith/3428
**Category:** Observability & Evals
**Created:** [April 17, 2026, 12:23am UTC](https://forum.langchain.com/t/enable-opentelemetry-traces-without-sending-data-to-langsmith/3428 "2026-04-17T00:23:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![liurui-1](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/liurui-1/32/2840_2.png) [@liurui-1](https://forum.langchain.com/u/liurui-1)
#### Post date: [April 17, 2026, 12:23am UTC](https://forum.langchain.com/t/enable-opentelemetry-traces-without-sending-data-to-langsmith/3428/1 "2026-04-17T00:23:32Z")

</div>

Hello, I want to send traces and metrics (if it has) of my LangChain apps to the back-end OpenTelemetry Collector along with other apps. This time I do not want to install a local LangSmith server. Is it possible?

---

<div class="post-metadata">

### Author: ![pawel-twardziak](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/pawel-twardziak/32/960_2.png) [@pawel-twardziak](https://forum.langchain.com/u/pawel-twardziak)
#### Post date: [April 17, 2026, 9:09am UTC](https://forum.langchain.com/t/enable-opentelemetry-traces-without-sending-data-to-langsmith/3428/2 "2026-04-17T09:09:28Z")

</div>

hi @liurui-1

try to install langsmith[otel], then set:

```auto
  LANGSMITH_OTEL_ENABLED=true
  LANGSMITH_OTEL_ONLY=true # skip LangSmith writer entirely
  OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318

```

- LANGSMITH\_OTEL\_ONLY=true makes the SDK’s background thread bypass the LangSmith ingest path - spans go only to OTLP  
(langsmith/\_internal/\_background\_thread.py::get\_tracing\_mode, lines 574–594).
- OTEL\_EXPORTER\_OTLP\_ENDPOINT is read before the default LangSmith endpoint is injected (\_internal/otel/\_otel\_client.py::get\_otlp\_tracer\_provider), so your collector  
replaces [api.smith.langchain.com/otel](http://api.smith.langchain.com/otel). No LANGSMITH\_API\_KEY required.
- Caveat worth flagging to the OP: LangSmith’s OTEL bridge emits traces only, not OTLP metrics - token/latency data arrives as span attributes. For real metric instruments,  
use the OTEL metrics SDK separately.

Docs: [Trace with OpenTelemetry - Docs by LangChain](https://docs.langchain.com/langsmith/trace-with-opentelemetry)

---

<div class="post-metadata">

### Author: ![liurui-1](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/liurui-1/32/2840_2.png) [@liurui-1](https://forum.langchain.com/u/liurui-1)
#### Post date: [April 18, 2026, 4:30am UTC](https://forum.langchain.com/t/enable-opentelemetry-traces-without-sending-data-to-langsmith/3428/3 "2026-04-18T04:30:45Z")

</div>

Hi @pawel-twardziak , Thanks a lot! Your answer works. One thing I see is that environment variable “LANGSMITH\_TRACING=true” is still required.  
The environment variables I’m using are:

```auto
export LANGSMITH_TRACING=true
export LANGSMITH_OTEL_ENABLED=true
export LANGSMITH_OTEL_ONLY=true
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
export LS_APM_OTEL_ENABLED=true
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_SERVICE_NAME=mylangchain

```
