Skip to content

Add OpenTelemetry export for LLM and tool operations #377

@bug-ops

Description

@bug-ops

Epic: #366

Description

Add optional OpenTelemetry OTLP export for traces and metrics, enabling Prometheus/Grafana integration.

Design

[observability]
exporter = "otlp"  # "none" | "otlp"
endpoint = "http://localhost:4317"

Tasks

  • Add opentelemetry, opentelemetry_sdk, opentelemetry-otlp deps (feature-gated otel)
  • tracing-opentelemetry layer in subscriber stack
  • LLM calls: span with model, prompt_tokens, completion_tokens, latency_ms attributes
  • Tool executions: span with tool_name, result, duration_ms
  • Memory operations: span with operation (recall/remember), result_count
  • Config section [observability] with exporter selection
  • Graceful shutdown flushes pending spans

Metadata

Metadata

Assignees

No one assigned

    Labels

    M21Milestone 21: Observability & costcorellmLLM provider relatedpriority/mediumMedium prioritysize/L

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions