Skip to main content
Opik Documentation
current

Search documentation

Type to search this documentation.

On this pageOverview

Observability for LangServe with Opik

Configure LangServe host-level OpenTelemetry export for Opik with clear applicability and minimal setup guidance.

LangServe does not define its own standalone OpenTelemetry bootstrap. Instrumentation is configured at the host app/runtime layer (typically FastAPI + LangChain components).

Use this when your LangServe routes run inside a Python web app and you want request + framework spans in Opik.

For full endpoint/header details, see Opik OpenTelemetry overview.

wordWrap
export OTEL_EXPORTER_OTLP_ENDPOINT=https://www.comet.com/opik/api/v1/private/otel
export OTEL_EXPORTER_OTLP_HEADERS='Authorization=<your-api-key>,Comet-Workspace=<your-workspace>,projectName=<your-project-name>'

Required headers: Authorization, Comet-Workspace Optional headers: projectName

wordWrap
export OTEL_EXPORTER_OTLP_ENDPOINT=https://<comet-deployment-url>/opik/api/v1/private/otel
export OTEL_EXPORTER_OTLP_HEADERS='Authorization=<your-api-key>,Comet-Workspace=<your-workspace>,projectName=<your-project-name>'

Required headers: Authorization, Comet-Workspace Optional headers: projectName

wordWrap
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:5173/api/v1/private/otel
export OTEL_EXPORTER_OTLP_HEADERS='projectName=<your-project-name>'

Required headers: none by default Optional headers: projectName, auth headers if enabled

Intent: Configure telemetry at the LangServe host boundary so request and framework spans can be exported.

Applies when: LangServe is mounted in an app you control (for example FastAPI).

Required inputs:

  • host runtime instrumentation enabled
  • OTLP endpoint
  • OTLP headers for your deployment mode

Optional inputs:

  • explicit service.name
  • additional framework or library instrumentors
  • route-level filtering/sampling

Minimal valid setup:

  • set OTEL_EXPORTER_OTLP_ENDPOINT
  • set OTEL_EXPORTER_OTLP_HEADERS
  • enable instrumentation for your host app and LangChain stack

Use canonical host/runtime setup from:

  1. Send a request through a LangServe endpoint.
  2. Confirm a root HTTP/server span is emitted from your host app.
  3. Confirm downstream LangChain/LangServe-related spans are exported and visible in Opik.
Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu