Skip to content

Commit 28d2894

Browse files
committed
feat: OTel tracing in LSD
1 parent 3f09fe9 commit 28d2894

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/langsmith/env-var.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,37 @@ A background run can execute for longer than 1 hour, but a client must reconnect
2424

2525
Defaults to `3600`.
2626

27+
## `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`
28+
29+
Specify `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` to configure OpenTelemetry APM tracing for the deployment. Specify other [`OTEL_*` environment variables](https://opentelemetry.io/docs/collector/configuration/) to configure tracing, logging, and other instrumentation.
30+
31+
```shell
32+
# If you set OTEL_EXPORTER_OTLP_TRACES_ENDPOINT or OTEL_EXPORTER_OTLP_ENDPOINT,
33+
# the server starts with OpenTelemetry instrumentation enabled.
34+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=<target trace ingestion endpoint>
35+
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
36+
OTEL_SERVICE_NAME=MY_LANGSMITH_DEPLOYMENT
37+
OTEL_EXPORTER_OTLP_HEADERS=api-key=<YOUR_INGEST_LICENSE_KEY>
38+
# Common OTEL settings
39+
OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT=4095
40+
OTEL_EXPORTER_OTLP_COMPRESSION=gzip
41+
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
42+
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=delta
43+
# Optional: OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED=true
44+
```
45+
46+
For example, to submit OpenTelemetry traces to [New Relic's US region](https://docs.newrelic.com/docs/opentelemetry/best-practices/opentelemetry-otlp/), set the following:
47+
48+
```shell
49+
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://otlp.nr-data.net/v1/traces
50+
OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp.nr-data.net
51+
OTEL_EXPORTER_OTLP_HEADERS=api-key=<YOUR_INGEST_LICENSE_KEY>
52+
```
53+
54+
<Note>
55+
OTel tracing was added in Agent Server version `0.5.32` and is currently in Alpha.
56+
</Note>
57+
2758
## `DD_API_KEY`
2859

2960
Specify `DD_API_KEY` (your [Datadog API Key](https://docs.datadoghq.com/account_management/api-app-keys/)) to automatically enable Datadog tracing for the deployment. Specify other [`DD_*` environment variables](https://ddtrace.readthedocs.io/en/stable/configuration.html) to configure the tracing instrumentation.

0 commit comments

Comments
 (0)