agentops
agentops copied to clipboard
Replace 'session' with 'trace' in API Functions and SDK Components
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_idparameters - SDK functions like
start_sessionandend_sessionuse session terminology
Required Changes
AgentOps.Next Repository
- [ ] Create new
/tracesendpoints in V1-V3 API that mirror functionality of/sessionsendpoints - [ ] Update V4 API to replace all
session_idparameters withtrace_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_traceandend_tracethat mirror functionality of session functions - [ ] Update
SpanKind.SESSIONtoSpanKind.TRACEin 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