Skip to content

Conversation

@idoberko2
Copy link
Contributor

@idoberko2 idoberko2 commented Nov 6, 2025

Details

This completes the work done in #3910. In the previous PR, this was implemented for traces. This PR extends this functionality to spans.

add_full_span_to_dataset_items.mov

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK-2946

Testing

  • Added backend tests
  • Tested manually spans
  • Tested manually traces due to refactors

Documentation

Not changing as the relevant changes were made in #3910.

@idoberko2 idoberko2 self-assigned this Nov 6, 2025
Copilot AI review requested due to automatic review settings November 6, 2025 13:22
@idoberko2 idoberko2 requested a review from a team as a code owner November 6, 2025 13:22
@idoberko2 idoberko2 added the test-environment Deploy Opik adhoc environment label Nov 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

🔄 Test environment deployment started

Building images for PR #3964...

You can monitor the build progress here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR extends the functionality for adding enriched items to datasets from spans, complementing the previously implemented feature for traces (PR #3910). It introduces a new backend endpoint and frontend UI for adding spans to datasets with configurable metadata enrichment options.

Key changes:

  • Added backend endpoint to create dataset items from spans with enrichment options
  • Implemented frontend UI for span-specific metadata configuration
  • Created span enrichment service mirroring trace enrichment functionality

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
AddToDatasetDialog.tsx Refactored to support both trace and span enrichment, extracted reusable components for metadata configuration
useAddSpansToDatasetMutation.ts New API hook for adding spans to datasets with enrichment options
SpanEnrichmentServiceTest.java Comprehensive unit tests for span enrichment service covering various option combinations
DatasetsResourceCreateFromSpansTest.java Integration tests for the new spans-to-dataset endpoint
DatasetResourceClient.java Added client methods for calling the new spans endpoint
EnrichmentUtils.java Extracted common enrichment utilities for building feedback scores and comments JSON nodes
TraceEnrichmentService.java Refactored to use shared enrichment utilities
SpanService.java Added getByIds method for batch span retrieval
SpanEnrichmentService.java New service implementing span enrichment logic parallel to trace enrichment
SpanDAO.java Updated to support batch retrieval of spans by IDs
DatasetItemService.java Added createFromSpans method for creating dataset items from spans
DatasetsResource.java New REST endpoint for creating dataset items from spans
CreateDatasetItemsFromSpansRequest.java Request object for the new spans endpoint

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

SDK E2E Tests Results

0 tests   0 ✅  0s ⏱️
0 suites  0 💤
0 files    0 ❌

Results for commit 52270ad.

@CometActions
Copy link
Collaborator

Test environment is now available!

Access Information

The deployment has completed successfully and the version has been verified.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Backend Tests Results

5 433 tests   5 426 ✅  52m 4s ⏱️
  286 suites      7 💤
  286 files        0 ❌

Results for commit 742c941.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@andriidudar andriidudar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Ido, thanks for adding this functionality for Spans as well!

The code looks good overall — I’ve just left a few comments that I believe should be addressed to help improve performance and reduce some unnecessary load on the backend.

andriidudar
andriidudar previously approved these changes Nov 10, 2025
Copy link
Contributor

@andriidudar andriidudar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @idoberko2 , Thanks for handling my comments.
Approved

@idoberko2 idoberko2 merged commit 3710182 into main Nov 11, 2025
28 checks passed
@idoberko2 idoberko2 deleted the idoberko2/OPIK-2946-full-span-details-when-adding-to-dataset-item branch November 11, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-environment Deploy Opik adhoc environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants