agentops icon indicating copy to clipboard operation
agentops copied to clipboard

Replace 'session' with 'trace' in Data Models and Classes

Open devin-ai-integration[bot] opened this issue 9 months ago • 0 comments

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 sessions table and related tables with session references
  • ClickHouse already uses otel.otel_traces table but with session_id parameters
  • TypeScript interfaces like ISessionAndStats use session terminology
  • Python data models use session terminology

Required Changes

AgentOps.Next Repository

  • [ ] Create new traces table in Supabase that mirrors sessions table
  • [ ] Update foreign key references from session_id to trace_id in related tables
  • [ ] Update TypeScript interfaces:
    • [ ] ISessionAndStatsITraceAndStats
    • [ ] IExtendedSessionIExtendedTrace
  • [ ] Update database client functions to use trace terminology
  • [ ] Ensure ClickHouse queries consistently use trace terminology

AgentOps Repository

  • [ ] Rename Session class to Trace class
  • [ ] 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