@@ -204,6 +204,24 @@ function convertLogsToCreateableEvents(
204204
205205 const resourceProperties = extractEventProperties ( resourceAttributes ) ;
206206
207+ const userDefinedResourceAttributes = truncateAttributes (
208+ convertKeyValueItemsToMap ( resourceAttributes ?? [ ] , [ ] , undefined , [
209+ SemanticInternalAttributes . USAGE ,
210+ SemanticInternalAttributes . SPAN ,
211+ SemanticInternalAttributes . METADATA ,
212+ SemanticInternalAttributes . STYLE ,
213+ SemanticInternalAttributes . METRIC_EVENTS ,
214+ SemanticInternalAttributes . TRIGGER ,
215+ "process" ,
216+ "sdk" ,
217+ "service" ,
218+ "ctx" ,
219+ "cli" ,
220+ "cloud" ,
221+ ] ) ,
222+ spanAttributeValueLengthLimit
223+ ) ;
224+
207225 const taskEventStore =
208226 extractStringAttribute ( resourceAttributes , [ SemanticInternalAttributes . TASK_EVENT_STORE ] ) ??
209227 env . EVENT_REPOSITORY_DEFAULT_STORE ;
@@ -249,6 +267,7 @@ function convertLogsToCreateableEvents(
249267 status : logLevelToEventStatus ( log . severityNumber ) ,
250268 startTime : log . timeUnixNano ,
251269 properties,
270+ resourceProperties : userDefinedResourceAttributes ,
252271 style : convertKeyValueItemsToMap (
253272 pickAttributes ( log . attributes ?? [ ] , SemanticInternalAttributes . STYLE ) ,
254273 [ ]
@@ -285,6 +304,24 @@ function convertSpansToCreateableEvents(
285304
286305 const resourceProperties = extractEventProperties ( resourceAttributes ) ;
287306
307+ const userDefinedResourceAttributes = truncateAttributes (
308+ convertKeyValueItemsToMap ( resourceAttributes ?? [ ] , [ ] , undefined , [
309+ SemanticInternalAttributes . USAGE ,
310+ SemanticInternalAttributes . SPAN ,
311+ SemanticInternalAttributes . METADATA ,
312+ SemanticInternalAttributes . STYLE ,
313+ SemanticInternalAttributes . METRIC_EVENTS ,
314+ SemanticInternalAttributes . TRIGGER ,
315+ "process" ,
316+ "sdk" ,
317+ "service" ,
318+ "ctx" ,
319+ "cli" ,
320+ "cloud" ,
321+ ] ) ,
322+ spanAttributeValueLengthLimit
323+ ) ;
324+
288325 const taskEventStore =
289326 extractStringAttribute ( resourceAttributes , [ SemanticInternalAttributes . TASK_EVENT_STORE ] ) ??
290327 env . EVENT_REPOSITORY_DEFAULT_STORE ;
@@ -336,6 +373,7 @@ function convertSpansToCreateableEvents(
336373 events : spanEventsToEventEvents ( span . events ?? [ ] ) ,
337374 duration : span . endTimeUnixNano - span . startTimeUnixNano ,
338375 properties,
376+ resourceProperties : userDefinedResourceAttributes ,
339377 style : convertKeyValueItemsToMap (
340378 pickAttributes ( span . attributes ?? [ ] , SemanticInternalAttributes . STYLE ) ,
341379 [ ]
0 commit comments