agentops
agentops copied to clipboard
Replace 'session' with 'trace' in Data Models and Classes
Replace "session" with "trace" in Database Schema and Models
Description
As part of our transition to OpenTelemetry standards, we need to replace the notion of "sessions" with "traces" in our database schema and data models. This issue focuses on updating database tables, fields, and related data models in both repositories.
Current State
- Supabase schema has
sessionstable and related tables with session references - ClickHouse already uses
otel.otel_tracestable but with session_id parameters - TypeScript interfaces like
ISessionAndStatsuse session terminology - Python data models use session terminology
Required Changes
AgentOps.Next Repository
- [ ] Create new
tracestable in Supabase that mirrorssessionstable - [ ] Update foreign key references from session_id to trace_id in related tables
- [ ] Update TypeScript interfaces:
- [ ]
ISessionAndStats→ITraceAndStats - [ ]
IExtendedSession→IExtendedTrace
- [ ]
- [ ] Update database client functions to use trace terminology
- [ ] Ensure ClickHouse queries consistently use trace terminology
AgentOps Repository
- [ ] Rename
Sessionclass toTraceclass - [ ] Update session-related event classes to use trace terminology
- [ ] Update serialization/deserialization logic for trace data
Implementation Considerations
- Plan for data migration from session tables to trace tables
- Maintain data integrity during schema changes
- Consider impact on existing queries and reports
- Coordinate with API endpoint changes
Database Migration Strategy
- Create new trace-based tables
- Implement data migration scripts
- Update application code to use new tables
- Maintain backward compatibility during transition period
Acceptance Criteria
- All database schemas use "trace" terminology
- Data models properly reflect trace-based structure
- Existing data is migrated to new schema
- Queries and reports function correctly with new schema
- Tests pass for database operations
Related Issues
- API endpoint changes for session to trace transition
- UI component updates for session to trace transition
- Documentation updates for session to trace transition