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
agnost.shutdown() / await agnost.shutdown() once when the application
exits, not after each request.
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 another OTel SDK) configured? Add the Agnost processor to the provider orNodeSDK constructor. OpenTelemetry JS 2.x does
not support adding processors after the provider has been constructed.
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
Use current matching releases. This guide is verified with[email protected] and
@arizeai/[email protected]. If an older application
throws an APIPromise export error, upgrade both packages together rather than
mixing current instrumentation with an old OpenAI SDK.
References
Next steps
- Conversations: review the complete OpenAI interaction.
- Events: inspect SDK or OpenTelemetry activity.
- Intents: organize production conversations by what users wanted.