Azure OpenAI (tracing)
Azure OpenAI (tracing)
The Azure OpenAI TypeScript instrumentation traces calls made through the current openai package’s AzureOpenAI client. It also supports the legacy @azure/openai OpenAIClient when that package is present.
This tracing setup uses your Azure OpenAI credentials directly. To route requests through Respan instead, use the Azure OpenAI gateway setup.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Use Respan Gateway
See Azure OpenAI gateway setup to route calls through the Respan gateway.
Setup
Set environment variables
AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, and OPENAI_API_VERSION are used for Azure OpenAI requests. RESPAN_API_KEY exports traces to Respan.
View your trace
Open the Traces page to see Azure OpenAI chat, completion, embedding, and streaming spans.
Configuration
Attributes
With propagateAttributes
Override per-request attributes using a context scope.
Captured operations
AzureOpenAI.chat.completions.create()AzureOpenAI.completions.create()AzureOpenAI.embeddings.create()- Streaming chat and text completion calls
- Legacy
@azure/openaiOpenAIClientchat, completion, embedding, and streaming methods