Proposal
Add opt-in OpenTelemetry instrumentation conforming to the OTel gen_ai.* semantic conventions, so downstream observability tools (Datadog, Honeycomb, Phoenix, Langfuse, OTLP collectors, Vercel's built-in observability) get structured visibility into agent execution. Off by default, zero runtime cost when disabled.
Context
The agent workflow currently emits useful logs and platform metrics but no structured spans. As background coding agents move toward production, teams need a standard wire format for tracing. The gen_ai.* conventions are the emerging standard, and AI agent workflows are an active focus area in the OpenTelemetry GenAI SIG (open-telemetry/semantic-conventions#2912).
Implementation
I prepared a branch with the change. It's six files / +174 lines:
apps/web/instrumentation.ts— Next.js server-side OTel registration via@vercel/otel, dynamic-imported only whenOTEL_ENABLED=truepackages/agent/telemetry.ts—getAgentTelemetry()helper returning the AI SDKexperimental_telemetryconfigpackages/agent/open-agent.ts—prepareCallnow setsexperimental_telemetryso allopenAgent.stream()callers get instrumented automaticallypackages/agent/index.ts— re-exports the helperapps/web/package.json+bun.lock— adds@vercel/otel ^1.13.0apps/web/.env.example— addsOTEL_ENABLED,OTEL_SERVICE_NAME,OTEL_EXPORTER_OTLP_ENDPOINTREADME.md— new "Telemetry" section
Branch (passes bun run ci locally): https://github.com/meshailabs/open-agents/tree/feat/otel-gen-ai-instrumentation
Diff against main: https://github.com/vercel-labs/open-agents/compare/main...meshailabs:open-agents:feat/otel-gen-ai-instrumentation
Why I'm opening an issue
I tried to submit this as a PR but the repo is gated to collaborators only. Happy to clean up, scope down, or split the patch in any direction the maintainers prefer — let me know if there's a path you'd like to take here.
Activity
0No activity yet.