[Feature] Add observability support (LangSmith / OpenTelemetry)
Summary
Add tracing and observability for LLM calls, so users can monitor, debug and evaluate agentic workflows without relying on print statements or guesswork.
Problem / goal
When running agentic workflows there is no way to observe, trace or debug LLM calls. This makes it impossible to diagnose failures, measure latency, track token usage, or compare prompt versions over time.
Primary user(s)
- [x] Bob (IT / power user)
- [ ] Susan (non-technical)
- [ ] Other team roles
OpenCode primitive alignment
session.*, mcp (tracing hooks), skills/plugins (evaluation wrappers)
Alignment with VISION/PRINCIPLES/PRODUCT
Observability is a core need for any production-grade agentic tool. Teams cannot responsibly deploy agents without visibility into what they are doing. This directly supports the product's goal of being enterprise-ready.
Testability
pnpm dev + run a multi-step agent task + verify traces appear in LangSmith or OTEL backend (e.g. Jaeger running locally via Docker)
Ready to build it yourself?
Yes
Additional context
Two integration paths to consider:
- LangSmith: direct integration for trace logging, prompt versioning and evaluation dashboards
- OpenTelemetry (OTEL): vendor-neutral open standard routing traces to any compatible backend (Jaeger, Honeycomb, Grafana Tempo etc.)
Even a lightweight OTEL exporter hook would be a great starting point.
@benjaminshafii @src-opn do we want to support Open Telemetry for 3rd parties that are self-hosting?
@mbhassan This is an interesting one. We generally dont want to ship any telemetry code within the app Have you looked at a provider gateway that could give you the insights you need at a higher level? Thinks like https://vercel.com/docs/ai-gateway/capabilities/observability We'll need to discuss internally how we could integrate this
@src-opn yea pretty much what I have configured manually.
Keeping it open source i'd just suggest just emitting LLM traces via an OTeL endpoint. Bit like how langfuse has supported it.
https://langfuse.com/integrations/native/opentelemetry
this is the gap that keeps showing up .. mcp servers ship with nothing built in so tool call latency and errors stay invisible until something breaks in production and you are stuck adding print statements after the fact.
langsmith or otel both work but the real question is whether it becomes a standard expectation for any server or stays a bolt on each team reinvents.
Which one is better ?
@Neelagiri65 only solution i found was to route the traffic through a gateway like bifrost
closed due to age, please reopen and tag me if still valid