File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
aws-distro-opentelemetry-node-autoinstrumentation/src Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -453,23 +453,21 @@ export class AwsMetricAttributeGenerator implements MetricAttributeGenerator {
453453 span . attributes [ AwsSpanProcessingUtil . GEN_AI_REQUEST_MODEL ]
454454 ) ;
455455 }
456+
457+ if ( cloudFormationIdentifier === undefined ) {
458+ cloudFormationIdentifier = remoteResourceIdentifier ;
459+ }
460+
461+ attributes [ AWS_ATTRIBUTE_KEYS . AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER ] = cloudFormationIdentifier ;
462+
456463 } else if ( AwsSpanProcessingUtil . isDBSpan ( span ) ) {
457464 remoteResourceType = DB_CONNECTION_RESOURCE_TYPE ;
458465 remoteResourceIdentifier = AwsMetricAttributeGenerator . getDbConnection ( span ) ;
459466 }
460467
461- if ( cloudFormationIdentifier === undefined ) {
462- cloudFormationIdentifier = remoteResourceIdentifier ;
463- }
464-
465- if (
466- remoteResourceType !== undefined &&
467- remoteResourceIdentifier !== undefined &&
468- cloudFormationIdentifier !== undefined
469- ) {
468+ if ( remoteResourceType !== undefined && remoteResourceIdentifier !== undefined ) {
470469 attributes [ AWS_ATTRIBUTE_KEYS . AWS_REMOTE_RESOURCE_TYPE ] = remoteResourceType ;
471470 attributes [ AWS_ATTRIBUTE_KEYS . AWS_REMOTE_RESOURCE_IDENTIFIER ] = remoteResourceIdentifier ;
472- attributes [ AWS_ATTRIBUTE_KEYS . AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER ] = cloudFormationIdentifier ;
473471 }
474472 }
475473
You can’t perform that action at this time.
0 commit comments