agentops icon indicating copy to clipboard operation
agentops copied to clipboard

Replace 'session' with 'trace' in API Functions and SDK Components

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

Replace "session" with "trace" in API Endpoints and Routes

Description

As part of our transition to OpenTelemetry standards, we need to replace the notion of "sessions" with "traces" across our API endpoints and routes. This issue focuses on updating API endpoints, function names, and parameters in both repositories.

Current State

  • V1-V3 API endpoints use "sessions" terminology
  • V4 API endpoints already use "traces" but still have session_id parameters
  • SDK functions like start_session and end_session use session terminology

Required Changes

AgentOps.Next Repository

  • [ ] Create new /traces endpoints in V1-V3 API that mirror functionality of /sessions endpoints
  • [ ] Update V4 API to replace all session_id parameters with trace_id
  • [ ] Update event handlers to use trace terminology
  • [ ] Add deprecation notices to session-based endpoints
  • [ ] Update API documentation to reflect new terminology

AgentOps Repository

  • [ ] Create new public API functions like start_trace and end_trace that mirror functionality of session functions
  • [ ] Update SpanKind.SESSION to SpanKind.TRACE in span kinds definition
  • [ ] Update session decorator to trace decorator
  • [ ] Add deprecation warnings to session-based functions
  • [ ] Ensure backward compatibility for existing users

Implementation Considerations

  • Maintain backward compatibility for existing integrations
  • Provide clear migration path for users
  • Follow OpenTelemetry standards for trace and span naming
  • Coordinate with database schema changes

Acceptance Criteria

  • All new API endpoints use "trace" terminology
  • Existing session endpoints include deprecation notices
  • SDK functions properly implement trace-based functionality
  • Documentation is updated to reflect new terminology
  • Tests pass for both new and legacy endpoints

Related Issues

  • Database schema changes for session to trace transition
  • UI component updates for session to trace transition
  • Documentation updates for session to trace transition