Language support
Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
Manual setup: Agnost AI SDK
Manual setup: OpenTelemetry
Theopenai SDK ships no first-party OTel: use OpenInference’s auto-instrumentation. Pick your language in the code blocks below; the choice persists across the page.
1. Install
Already have OpenInference + an OTLP exporter wired up? Skip. No setup yet?2. Wire OpenInference + OTLP exporter pointing at Agnost AI
Already have OpenInference (or any OTel TracerProvider) running? Append Agnost AI as an additional span processor on the existing provider:3. Pass userId / sessionId per call
using_attributes (Python) and setUser / setSession (TS) propagate via OTel context, landing as user.id / session.id on every span the OpenAI SDK emits inside the block.
What appears in Agnost AI
- Conversations grouped by
session.id. - User-level analytics grouped by
user.id. - Events containing OpenInference spans.
- Tool calls when OpenAI tool-use spans are emitted.
Verify
Run one OpenAI call inside the context block, then open Events in Agnost AI. Confirmuser.id, session.id, model, and message attributes are present.
Troubleshooting
- Import and initialize instrumentation before creating the OpenAI client.
- Confirm the OTLP exporter points at
https://otel.agnost.ai/v1/traces. - For TypeScript, confirm the
openaiand@arizeai/openinference-instrumentation-openaiversions match the table below.
TypeScript version compatibility
Pin matching majors: version mismatches throwdoes not provide an export named 'APIPromise' at import time:
References
Next steps
- Conversations: review the complete OpenAI interaction.
- Events: inspect SDK or OpenTelemetry activity.
- Intents: organize production conversations by what users wanted.
