Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat: add dataset_run_id to scores blob storage export (#12792)

Valery Meleshkinfae8ea09254e
diff --git a/packages/shared/src/server/repositories/scores.ts b/packages/shared/src/server/repositories/scores.ts
index 62b213bb71..b74c7c472d 100644
--- a/packages/shared/src/server/repositories/scores.ts
+++ b/packages/shared/src/server/repositories/scores.ts
@@ -1985,6 +1985,7 @@ export const getScoresForBlobStorageExport = function (
trace_id,
observation_id,
session_id,
+ dataset_run_id,
name,
value,
source,
diff --git a/worker/src/__tests__/blobStorageIntegrationProcessing.test.ts b/worker/src/__tests__/blobStorageIntegrationProcessing.test.ts
index 9bd242e6fc..686ba84dc4 100644
--- a/worker/src/__tests__/blobStorageIntegrationProcessing.test.ts
+++ b/worker/src/__tests__/blobStorageIntegrationProcessing.test.ts
@@ -7,6 +7,7 @@ import {
createOrgProjectAndApiKey,
createTraceScore,
createSessionScore,
+ createDatasetRunScore,
createScoresCh,
createTrace,
createTracesCh,
@@ -120,6 +121,8 @@ describe("BlobStorageIntegrationProcessingJob", () => {
const now = new Date();
const sessionScoreId = randomUUID();
const sessionId = randomUUID();
+ const datasetRunScoreId = randomUUID();
+ const datasetRunId = randomUUID();
// Set lastSyncAt to 2 hours ago so the chunked export (1 hour window) covers recent data
const twoHoursAgo = new Date(now.getTime() - 2 * 60 * 60 * 1000);
@@ -197,6 +200,14 @@ describe("BlobStorageIntegrationProcessingJob", () => {
name: "Test Session Score",
value: 0.8,
}),
+ createDatasetRunScore({
+ id: datasetRunScoreId,
+ dataset_run_id: datasetRunId,
+ project_id: projectId,
+ timestamp: now.getTime() - 90 * 60 * 1000, // 90 minutes before now
+ name: "Test Dataset Run Score",
+ value: 0.7,
+ }),
]),
createEventsCh([event]),
]);
@@ -251,6 +262,11 @@ describe("BlobStorageIntegrationProcessingJob", () => {
expect(content).toContain(sessionId);
expect(content).toContain("Test Session Score");
expect(content).toContain("0.8");
+ // Verify dataset_run_id is exported for dataset-run-scoped scores
+ expect(content).toContain(datasetRunScoreId);
+ expect(content).toContain(datasetRunId);
+ expect(content).toContain("Test Dataset Run Score");
+ expect(content).toContain("0.7");
}
if (eventFile) {