Installation
- Node.js
- Browser
The integration is enabled by default:
Basic Usage
Just use the OpenAI SDK normally:Configuration
Default Behavior
By default, prompts and responses are not captured:Capture Prompts and Responses
- Global Setting
- OpenAI Only
- Inputs Only
Enable for all AI integrations:
Integration Options
boolean
default:"sendDefaultPii"
Capture prompt messages
boolean
default:"sendDefaultPii"
Capture completion responses
Captured Data
Always Captured
These attributes are always included:When recordInputs: true
Prompt messages are captured:
When recordOutputs: true
Completion responses are captured:
Supported Operations
The integration instruments all OpenAI operations:Chat Completions
Streaming Completions
Embeddings
Function Calling
Practical Examples
Customer Support Bot
Content Generation
Semantic Search with Embeddings
Error Handling
Performance Monitoring
View OpenAI performance in Sentry:- Response Times: Track API latency
- Token Usage: Monitor prompt and completion tokens
- Error Rates: Identify rate limits and failures
- Model Comparison: Compare performance across models
Source Code
The OpenAI integration is implemented in:packages/node/src/integrations/tracing/openai/index.ts:11