Skip to content

Design and implement route history tracking #5971

@HyeockJinKim

Description

@HyeockJinKim

Story Description

Extend the history tracking system to include routing operations, tracking traffic routing decisions and load balancing history.

Acceptance Criteria

  • Design route history schema and models
  • Create RouteHistoryRepository in repositories layer
  • Integrate with existing routing/load balancing logic
  • Track route selection decisions
  • Record traffic distribution patterns
  • Monitor route health and performance metrics
  • Track route failures and recovery
  • Implement query methods for route history
  • Add comprehensive testing

Schema Design

Main Table: route_history

- id: UUID (Primary Key)
- route_id: UUID
- session_id: UUID (Optional, Foreign Key to sessions)
- endpoint_id: UUID (Optional)
- route_type: Enum (session/service/inference)
- source_info: JSONB (client IP, user agent, etc.)
- target_info: JSONB (selected backend, agent, etc.)
- routing_decision: JSONB (algorithm used, weights, etc.)
- status: Enum (routed/failed/timeout/rejected)
- latency_ms: Integer
- error_code: String (Optional)
- message: Text
- created_at: DateTime

Sub-table: route_history_metrics

- id: UUID (Primary Key)
- history_id: UUID (Foreign Key to route_history)
- metric_name: String
- metric_value: Float
- metric_unit: String
- timestamp: DateTime

Repository Methods

async def record_route_decision(...)
async def update_route_status(...)
async def add_route_metrics(...)
async def get_route_history(session_id)
async def get_route_statistics(time_range)
async def get_failed_routes(time_range)

Integration Points

  • App proxy routing decisions
  • Load balancer selections
  • Service endpoint routing
  • Inference endpoint routing
  • WebSocket connection routing

Metrics to Track

  • Route selection time
  • Backend response time
  • Total request latency
  • Route failure rate
  • Traffic distribution patterns

JIRA Issue: BA-2443

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions