openwork icon indicating copy to clipboard operation
openwork copied to clipboard

[Feature] Add observability support (LangSmith / OpenTelemetry)

Open mbhassan opened this issue 7 months ago • 6 comments

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.

mbhassan avatar Apr 12 '26 08:04 mbhassan

@benjaminshafii @src-opn do we want to support Open Telemetry for 3rd parties that are self-hosting?

jcllobet avatar Apr 13 '26 18:04 jcllobet

@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 avatar Apr 13 '26 18:04 src-opn

@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

mbhassan avatar Apr 13 '26 18:04 mbhassan

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 avatar Jul 11 '26 08:07 Neelagiri65

@Neelagiri65 only solution i found was to route the traffic through a gateway like bifrost

mbhassan avatar Jul 12 '26 09:07 mbhassan

closed due to age, please reopen and tag me if still valid

OmarMcAdam avatar Oct 28 '26 22:10 OmarMcAdam