For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Copy to LLMGithubGo to App
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
DocumentationIntegrationsBuilding Self-Improving AgentsSelf-hosting OpikSDK & API reference
    • Overview
  • TypeScript
    • Opik TypeScript SDK
  • Python
      • AG2
      • Agent Spec
      • Agno
      • BeeAI
      • Claude Agent SDK
      • Autogen
      • CrewAI
      • DSPy
      • Google ADK
      • Haystack
      • Harbor
      • Instructor
      • LangChain
      • LangGraph
      • LangServe
      • LiveKit Agents
      • Llama Index
      • Microsoft Agent Framework
      • OpenAI Agents
      • Pipecat
      • Pydantic AI
      • Semantic Kernel
      • Smolagents
      • Strands Agents
      • Temporal
      • VoltAgent
    • Opik Python SDK
    • OpenTelemetry Python SDK
  • Java
    • Spring AI
    • Quarkus LangChain4j
  • .NET
  • Ruby
    • OpenTelemetry Ruby SDK
  • No-Code
    • Cursor
    • Dify
    • Flowise
    • Langflow
    • n8n
    • OpenClaw
    • OpenAI Codex
    • OpenWebUI
    • Prompt Flow
  • Multi-Language
    • OpenTelemetry
LogoLogo
Copy to LLMGithubGo to App
On this page
  • When this guide applies
  • Opik OTLP endpoint modes
  • OTEL configuration pattern for LangServe
  • Validation
  • Source references
PythonFrameworks

Observability for LangServe with Opik

Was this page helpful?
Previous

Observability for LiveKit with Opik

Next
Built with

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

When this guide applies

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

Opik OTLP endpoint modes

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

Opik Cloud
Enterprise deployment
Self-hosted instance
$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

OTEL configuration pattern for LangServe

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:

  • OpenTelemetry FastAPI instrumentation
  • Opik LangChain integration guide

Validation

  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.

Source references

  • LangServe repository
  • OpenTelemetry FastAPI instrumentation
  • Opik LangChain integration guide
  • Opik OpenTelemetry overview