From 88851f9e4389e648d02ecbb70bc83f56764859a7 Mon Sep 17 00:00:00 2001 From: Jayc Date: Wed, 27 Mar 2024 22:53:04 +0530 Subject: [PATCH] fix: capture metrics for v0 transformation metrics --- src/util/customTransformer.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/customTransformer.js b/src/util/customTransformer.js index a87c12dd6e..41f8f46c39 100644 --- a/src/util/customTransformer.js +++ b/src/util/customTransformer.js @@ -254,8 +254,12 @@ async function runUserTransform( const tags = { identifier: 'v0', errored: transformationError ? true : false, - ...(events.length && events[0].metadata ? getMetadata(events[0].metadata) : {}), - ...(events.length && events[0].metadata ? getTransformationMetadata(events[0].metadata) : {}), + ...(Object.values(eventsMetadata).length + ? getMetadata(Object.values(eventsMetadata)[0]) + : {}), + ...(Object.values(eventsMetadata).length + ? getTransformationMetadata(Object.values(eventsMetadata)[0]) + : {}), }; stats.counter('user_transform_function_input_events', events.length, tags);