Skip to content

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

chore: stringify metadata in backfill (#10916)

Steffen Schmitz2d1d777a9382
diff --git a/worker/src/backgroundMigrations/backfillEventsHistoric.ts b/worker/src/backgroundMigrations/backfillEventsHistoric.ts
index eea86b726a..b2b1c5acb6 100644
--- a/worker/src/backgroundMigrations/backfillEventsHistoric.ts
+++ b/worker/src/backgroundMigrations/backfillEventsHistoric.ts
@@ -529,7 +529,7 @@ export default class BackfillEventsHistoric implements IBackgroundMigration {
o.cost_details,
coalesce(o.input, '') AS input,
coalesce(o.output, '') AS output,
- metadata::JSON AS metadata,
+ toJsonString(o.metadata) AS metadata,
mapKeys(o.metadata) AS metadata_names,
mapValues(o.metadata) AS metadata_raw_values,
multiIf(mapContains(o.metadata, 'resourceAttributes'), 'otel-backfill', 'ingestion-api-backfill') AS source,