Common Issues
Data Not Appearing in Dashboard
API key not configured
API key not configured
Symptom: No data appears in dashboard, and you see:Solution:Set your API key using environment variables:Or programmatically:
Run never ended
Run never ended
Symptom: Code executes without errors, but no data appears in dashboard.Solution:Ensure you call Enable debug mode to verify:You should see:
.end() or .error() on every run:[TCC] Payload sent successfullySteps or tool calls not ended
Steps or tool calls not ended
Symptom: Error when ending run:Solution:All steps and tool calls must be ended before ending the run:
Missing prompt on run
Missing prompt on run
Symptom: Error when ending run:Solution:Always call
.prompt() before ending:Network or authentication errors
Network or authentication errors
Symptom: Error in console:Solution:
- Verify your API key is correct
- Check that the key matches your environment (dev vs production)
- Ensure the API key hasn’t been revoked
Wrong environment
Wrong environment
Symptom: Data appears in development dashboard but not production (or vice versa).Solution:API keys automatically route to environments:
- Keys starting with
dev_→ Development - All other keys → Production
Debugging
Enable Debug Mode
Debug mode outputs detailed logs to help troubleshoot issues:Understanding Debug Output
Network Inspection
Inspect the actual HTTP request:Error Messages
Run Errors
Run already ended
You called Solution: Ensure you only end each run once.
.end() or .error() multiple times on the same run.Run requires a prompt
You called Solution: Always set a prompt before ending.
.end() without first calling .prompt().X step(s) not ended
You created steps but didn’t call Solution: Call
.end() on them..end() on all steps before ending the run.X tool call(s) not ended
You created tool calls but didn’t call
.end() on them.Solution: Call .end() on all tool calls before ending the run.Step Errors
Step already ended
You called
.end() or .error() multiple times on the same step.Solution: Ensure you only end each step once.Step requires a prompt
You called Solution: Set both prompt and response before ending.
.end() without first calling .prompt().Step requires a response
You called
.end() without first calling .response().Solution: Set both prompt and response before ending.Tool Call Errors
ToolCall already ended
You called
.end() or .error() multiple times on the same tool call.Solution: Ensure you only end each tool call once.ToolCall requires a name
You called Solution: Set the name in the constructor or via
.end() without setting a tool name..name():Performance Issues
High Latency
Network latency
Network latency
Observatory uses async requests with automatic retries. This should not block your application.If you’re experiencing high latency:
- Check your network connection to
api.thecontext.company - Verify you’re not in a region with high latency to the API
- Consider using a custom
TCC_URLendpoint closer to your infrastructure
Large payloads
Large payloads
Very large prompts or responses can slow down transmission.Solution:Truncate extremely large content:
Memory Leaks
Runs not being garbage collected
Runs not being garbage collected
If you create runs but never end them, they’ll accumulate in memory.Solution:Always end or error runs:Enable auto-flush timeout as a safety net:
Integration Issues
Next.js
instrumentation.ts not loading
instrumentation.ts not loading
Symptom: No telemetry data captured in Next.js app.Solution:
- Ensure
instrumentation.tsis in the root of your project (same level asapp/orpages/) - Enable instrumentation in
next.config.js:
next.config.js
- Restart your dev server
Server Components issues
Server Components issues
Symptom: Errors when using Observatory in React Server Components.Solution:Observatory’s OpenTelemetry integration works automatically in Server Components. For client components, use the widget package.
Vercel
Environment variables not set
Environment variables not set
Solution:Add
TCC_API_KEY to your Vercel project settings:- Go to Project Settings → Environment Variables
- Add
TCC_API_KEYwith your API key - Redeploy
TypeScript
Type errors
Type errors
Symptom: TypeScript compilation errors.Solution:
- Ensure you’re using TypeScript 5.0 or later
- Check that types are installed:
- Verify your
tsconfig.jsonincludes:
FAQ
How do I test instrumentation locally?
How do I test instrumentation locally?
Use a local ingestion endpoint:Or just enable debug mode to see payloads in console:
Can I use Observatory in production?
Can I use Observatory in production?
Yes! Observatory is designed for production use. The SDK:
- Uses async requests that don’t block your application
- Includes automatic retries for transient failures
- Gracefully handles missing API keys (logs warning and continues)
- Has minimal performance overhead
What happens if the API is down?
What happens if the API is down?
The SDK will:
- Retry the request up to 2 times with exponential backoff
- Log an error to console after retries are exhausted
- Continue running your application normally
How do I handle timeouts?
How do I handle timeouts?
Runs have an auto-flush timeout that defaults to 20 minutes:If a run exceeds the timeout, it’s automatically sent with error status.
Can I delete or modify data after sending?
Can I delete or modify data after sending?
Once data is sent to Observatory, it cannot be modified via the SDK. Contact support if you need to delete or modify historical data.
How do I instrument streaming responses?
How do I instrument streaming responses?
For streaming responses, collect the full response before ending the step:
How do I handle concurrent runs?
How do I handle concurrent runs?
Each run is independent and can be processed concurrently:
Getting Help
If you’re still experiencing issues:GitHub Issues
Report bugs or request features
Documentation
Browse the full documentation
Discord Community
Get help from the community
Email Support
Contact the support team
