Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions backend/app/controllers/ai_trace.controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controllers

import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"sync"
Expand Down Expand Up @@ -162,8 +163,11 @@ func (a aiTraceController) FindByTraceName(c *gin.Context) {
return
}

// Stats are best-effort: the trace list still renders without them, so a
// failure here is reported rather than aborting the request.
stats, err := telemetry.AiTraceRepository.GetTraceNameStats(c, projectId, traceName, request.FromDate, request.ToDate)
if err != nil {
traceway.CaptureException(fmt.Errorf("failed to load ai trace stats (traceName=%s): %w", traceName, err))
stats = nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func (r *aiTraceRepository) GetTraceNameStats(ctx context.Context, projectId uui
WHERE project_id = :project_id AND trace_name = :trace_name AND recorded_at >= :from AND recorded_at <= :to
ORDER BY duration ASC`, params)
if err != nil {
return stats, nil
return nil, err
}

sortedDurations := make([]float64, len(durationRows))
Expand Down
Loading