@@ -72,6 +72,28 @@ export class DataGenerator {
7272 return Math . floor ( Math . random ( ) * ( max - min + 1 ) ) + min ;
7373 }
7474
75+ private buildNestedSeedMetadata (
76+ source : string ,
77+ index : number ,
78+ overrides : Record < string , string > = { } ,
79+ ) : Record < string , string > {
80+ const plans = [ "free" , "pro" , "enterprise" ] ;
81+ const regions = [ "eu-central-1" , "us-east-1" , "ap-south-1" ] ;
82+ const queues = [ "support-chat" , "sales-chat" , "ops-chat" ] ;
83+ const priorities = [ "low" , "normal" , "high" ] ;
84+
85+ return {
86+ source,
87+ "customer.id" : `customer_${ index % 100 } ` ,
88+ "customer.plan" : plans [ index % plans . length ] ,
89+ "customer.region.code" : regions [ index % regions . length ] ,
90+ "routing.queue" : queues [ index % queues . length ] ,
91+ "routing.priority" : priorities [ index % priorities . length ] ,
92+ "flags.beta" : index % 2 === 0 ? "true" : "false" ,
93+ ...overrides ,
94+ } ;
95+ }
96+
7597 /**
7698 * Creates dataset run items for dataset runs.
7799 * Use for: Dataset experiment scenarios.
@@ -299,7 +321,9 @@ export class DataGenerator {
299321 ? `session_${ this . randomInt ( 1 , 100 ) } `
300322 : undefined ,
301323 environment : "default" ,
302- metadata : { generated : "synthetic" } ,
324+ metadata : this . buildNestedSeedMetadata ( "synthetic" , i , {
325+ generated : "synthetic" ,
326+ } ) ,
303327 tags : this . randomBoolean ( 0.3 ) ? [ "production" , "ai-agent" ] : [ ] ,
304328 public : this . randomBoolean ( 0.8 ) ,
305329 bookmarked : this . randomBoolean ( 0.1 ) ,
@@ -549,6 +573,14 @@ export class DataGenerator {
549573 ? "WARNING"
550574 : "ERROR" ,
551575 environment : trace . environment ,
576+ metadata : this . buildNestedSeedMetadata (
577+ "synthetic-observation" ,
578+ traceIndex * observationsPerTrace + i ,
579+ {
580+ "observation.type" : obsType ,
581+ "workflow.step" : String ( i + 1 ) ,
582+ } ,
583+ ) ,
552584 } ) ;
553585
554586 observations . push ( observation ) ;
@@ -1039,7 +1071,10 @@ export class DataGenerator {
10391071 timestamp : now + index * 1000 ,
10401072 name : "SupportChatSession" ,
10411073 user_id : null ,
1042- metadata : { scenario : "support-chat" } ,
1074+ metadata : this . buildNestedSeedMetadata ( "support-chat" , index , {
1075+ scenario : "support-chat" ,
1076+ "routing.queue" : "membership-support" ,
1077+ } ) ,
10431078 release : null ,
10441079 version : null ,
10451080 project_id : projectId ,
0 commit comments