Follow Discord
Sweep 22 Oct 2026 · 04:32Z Build v2.1.308 527 read Stable v2.1.308 Latest v2.1.308 Next v2.1.308 Feeds RSS JSON llms.txt llms-full.txt Unofficial

Claude Code v2.0.18 ·

OpenTelemetry Tracing Support (Opt-In)

Entry
JSON All of v2.0.18
EntryKind: in v2.0.18,
ChangesSection of the release

What: Comprehensive distributed tracing infrastructure for monitoring Claude Code's internal operations, API calls, and performance metrics. This feature is disabled by default and requires explicit opt-in.

How to use:

# Enable telemetry
export CLAUDE_CODE_ENABLE_TELEMETRY=true

# Configure where traces are exported (optional)
export OTEL_TRACES_EXPORTER=console  # or "otlp" for OpenTelemetry collectors

# Privacy controls (optional - both default to redacted)
export OTEL_LOG_USER_PROMPTS=true     # Log user prompts in traces
export OTEL_LOG_MODEL_RESPONSE=true   # Log model responses in traces

Details:

  • Tracks user interactions, LLM API requests/responses, and tool executions
  • Privacy-conscious by default: User prompts and model responses are redacted unless explicitly enabled via OTEL_LOG_USER_PROMPTS and OTEL_LOG_MODEL_RESPONSE
  • Supports multiple export formats:
  • console - Output traces to console for debugging
  • otlp - Export to OpenTelemetry Protocol collectors (supports gRPC, HTTP/JSON, HTTP/Protobuf)
  • Records detailed metrics: token counts (input, output, cache read, cache creation), latency, success/failure rates
  • Full OpenTelemetry specification compliance with 15+ configuration environment variables
  • Configurable sampling strategies via OTEL_TRACES_SAMPLER (defaults to parentbased_always_on)
  • Batch span processor with tunable performance parameters
  • Evidence: DiB() at line 2314, JiB() at line 2048, Jb0() at line 2087, cL5() at line 2277

Supported Environment Variables:

Telemetry Control:

Export Configuration:

Sampling:

  • OTEL_TRACES_SAMPLER - Sampler type (default: "parentbased_always_on")
  • OTEL_TRACES_SAMPLER_ARG - Sampler configuration (e.g., ratio for TraceIdRatioBased)

Span Limits:

  • OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT - Max attribute value length (unlimited by default)
  • OTEL_ATTRIBUTE_COUNT_LIMIT - Max attributes per span (default: 128)
  • OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT - Span-specific attribute value limit
  • OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT - Span-specific attribute count (default: 128)
  • OTEL_SPAN_LINK_COUNT_LIMIT - Max links per span (default: 128)
  • OTEL_SPAN_EVENT_COUNT_LIMIT - Max events per span (default: 128)
  • OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT - Max attributes per event (default: 128)
  • OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT - Max attributes per link (default: 128)

Batch Processor:

  • OTEL_BSP_MAX_EXPORT_BATCH_SIZE - Batch size (default: 512)
  • OTEL_BSP_MAX_QUEUE_SIZE - Queue size (default: 2048)
  • OTEL_BSP_SCHEDULE_DELAY - Export delay in ms (default: 5000)
  • OTEL_BSP_EXPORT_TIMEOUT - Timeout in ms (default: 30000)

See this entry in the whole of v2.0.18 →

Feedback