-
[OPIK-3209] [BE] Add span feedback scores filters to trace table (#4226)
发布于
2025-12-01 10:47:42 +00:00 - [OPIK-3208] [BE] Add span feedback scores aggregation to trace detail view
- Add span_feedback_scores field to Trace API model
- Add span score aggregation logic to TraceDAO query
- Update TraceEnrichmentMapper to map aggregated span scores
- Add tests for span score aggregation
- Update testcontainers version to 2.0.2
- Fix getValue method to handle missing columns gracefully
[OPIK-3208] [FE] Display aggregated span feedback scores in trace detail view
- Add span_feedback_scores to Trace type definition
- Display aggregated span feedback scores in TraceDataViewer
- Add span feedback score chips in trace tree view
- Update TreeDetailsStore to support span_feedback_scores
- Remove individual span scores drill-down section
- [OPIK-3208] [FE] Fix feedback scores title for span view
- Show 'Trace Feedback Scores' only when viewing a trace
- Show 'Feedback Scores' when viewing a span
- [OPIK-3208] [FE] Disable deletion for span feedback scores at trace level
- Make onDeleteFeedbackScore optional in FeedbackScoreTable
- Hide delete actions column when deletion is disabled
- Prevent deletion of aggregated span scores shown at trace level
-
[OPIK-3209] Add spans feedback scores filters
-
Fix remaining issues
-
[OPIK-3209] Address PR review comments: add type guard, fix method spelling, add JavaDoc
-
[OPIK-3209] [BE] Add span feedback scores statistics to trace table headers
-
[OPIK-3209] [BE] Fix StatsUtils to only add span feedback scores stats when values exist
-
[OPIK-3209] Add tests for span feedback scores statistics
-
refactor: Remove code duplication in span feedback scores display
- Extract helper functions for value parsing and display logic in ValueCell
- Consolidate child row creation logic into reusable createChildRow function
- Export extractAuthorName helper and use it consistently in AuthorCell
- Simplify formatParentRowWithCounts by merging categorical/non-categorical logic
- Add spanId field to ValueEntry API model for proper span identification
This refactoring reduces code duplication by ~60 lines and improves maintainability
without changing functionality.- feat: Add Type column cell component for span feedback scores
- Create TypeCell component to display span type with icon and label
- Component hides type for parent/aggregated rows
- Uses BaseTraceDataTypeIcon for consistent iconography
- Part of span feedback scores feature implementation
- feat: Add aggregated span feedback scores display in trace detail view
Backend changes:
- Add span feedback scores aggregation in TraceDAO using CTEs
- Include span_id, span_type, and category_name in value_by_author map
- Use composite keys (author_spanId) to preserve individual span scores
- Filter out '' from aggregated reasons
- Add spanId field to ValueEntry API model
Frontend changes:
- Display aggregated span feedback scores in trace detail view
- Add hierarchical view with parent/child rows for multiple spans
- Add Type column to show span type (LLM, Tool, General, Guardrail)
- Support deletion of individual span scores using span_id
- Update table titles to 'Trace scores' and 'Span scores' (Sentence case)
- Fix author name display to handle composite keys correctly
- Update value formatting to show counts and averages for parent rows
- Remove span feedback scores tags from trace header and tree view
- Update tooltips to include 'span' suffix (e.g., 'LLM span')
- Fix 'All scores' summary to display actual values
- Handle empty reasons gracefully (don't show '')
This feature allows users to see aggregated feedback scores from multiple spans
at the trace level while maintaining the ability to view and manage individual
span scores.- fix: Update annotation sidebar titles and score filtering
- Change sidebar title to 'Trace feedback scores' / 'Span feedback scores'
- Change 'All scores' section to show 'Trace scores' / 'Span scores' (remove 'All scores' prefix)
- Filter scores correctly: only show trace scores when viewing trace, only span scores when viewing span
- Update 'Your scores' header to include entity type (Trace/Span/Thread scores)
- Update Thread annotations to match the same pattern
- [FE] Refactor feedback score tables to use isAggregatedSpanScores prop
- Replace 'span-detail' entityType with isAggregatedSpanScores prop for cleaner logic
- Extract helper functions to reduce code duplication (getStorageKeyType, getConfigurableColumnsWithoutType)
- Fix all linting errors and remove unused imports/variables
- Improve code organization and maintainability
-
Fix issues
-
[OPIK-3209] [FE] Fix linting errors
-
Fix tests
-
[OPIK-3209] [BE] Fix thread annotation queue IDs alias inconsistency
- Added THREAD_ANNOTATION_QUEUE_IDS_ANALYTICS_DB constant for thread annotation queue IDs (ttaqi alias)
- Updated TRACE_THREAD_FIELDS_MAP to use ttaqi.annotation_queue_ids for TraceThreadField.ANNOTATION_QUEUE_IDS
- Updated SELECT_COUNT_TRACES_THREADS_BY_PROJECT_IDS to use ttaqi alias to match SELECT_TRACES_THREADS_BY_PROJECT_IDS
- Fixes FindTraceThreads.whenFilterByAnnotationQueueId__thenReturnThreadsWithMatchingTags test failure
-
Fix
-
[OPIK-3209] [BE] Address PR review comments: extract constant, improve comments, refactor ternary
-
[OPIK-3209] Address PR review comments: fix array mutation, extract span suffix constant, add JavaDoc, remove duplicate comment
下载附件