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
  • Claude telemetry configuration (official pattern)
  • Validation
  • Source references
PythonFrameworks

Observability for Claude Agent SDK with Opik

Was this page helpful?
Previous

Observability for AutoGen with Opik

Next
Built with

Claude Code telemetry is configured through environment variables.

When this guide applies

Use this guide when you want to configure Claude Code’s official OpenTelemetry settings and align endpoint/header values with your Opik deployment mode.

Claude Code’s monitoring docs currently describe OTel metrics and events/logs exporters. Opik tracing views are span-based. Verify your pipeline emits spans if your goal is trace visualization 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 (recommended for deterministic routing)

Claude telemetry configuration (official pattern)

Intent: Enable Claude Code telemetry and route supported OTel signals to your collector/backend.

Applies when: You run Claude Code with telemetry enabled via environment variables.

Required fields:

  • CLAUDE_CODE_ENABLE_TELEMETRY=1
  • at least one exporter (OTEL_METRICS_EXPORTER or OTEL_LOGS_EXPORTER)

Optional fields:

  • OTEL_EXPORTER_OTLP_PROTOCOL
  • OTEL_EXPORTER_OTLP_ENDPOINT
  • OTEL_EXPORTER_OTLP_HEADERS
  • per-signal overrides such as OTEL_EXPORTER_OTLP_METRICS_ENDPOINT

Minimal valid setup:

$export CLAUDE_CODE_ENABLE_TELEMETRY=1
$export OTEL_METRICS_EXPORTER=otlp
$export OTEL_LOGS_EXPORTER=otlp
$export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
$export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
$# Optional if your collector/export path requires auth
$export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <token>"
$claude

Validation

  1. Start Claude with telemetry enabled.
  2. Confirm your OTLP backend receives claude_code.* metrics/events.
  3. If targeting Opik trace views, verify spans are emitted by your pipeline; metrics/logs alone will not appear as traces.

Source references

  • Claude Code monitoring (official)
  • Opik OpenTelemetry overview
  • OpenTelemetry SDK environment variables