@@ -42,8 +42,12 @@ internal class AwsMetricAttributeGenerator : IMetricAttributeGenerator
4242 // Normalized remote service names for supported AWS services
4343 private static readonly string NormalizedDynamoDBServiceName = "AWS::DynamoDB" ;
4444 private static readonly string NormalizedKinesisServiceName = "AWS::Kinesis" ;
45+ private static readonly string NormalizedLambdaServiceName = "AWS::Lambda" ;
4546 private static readonly string NormalizedS3ServiceName = "AWS::S3" ;
47+ private static readonly string NormalizedSecretsManagerServiceName = "AWS::SecretsManager" ;
48+ private static readonly string NormalizedSNSServiceName = "AWS::SNS" ;
4649 private static readonly string NormalizedSQSServiceName = "AWS::SQS" ;
50+ private static readonly string NormalizedStepFunctionsName = "AWS::StepFunctions" ;
4751 private static readonly string NormalizedBedrockServiceName = "AWS::Bedrock" ;
4852 private static readonly string NormalizedBedrockRuntimeServiceName = "AWS::BedrockRuntime" ;
4953 private static readonly string DbConnectionResourceType = "DB::Connection" ;
@@ -358,12 +362,20 @@ private static string NormalizeRemoteServiceName(Activity span, string serviceNa
358362 case "AmazonKinesis" : // AWS SDK v1
359363 case "Kinesis" : // AWS SDK v2
360364 return NormalizedKinesisServiceName ;
365+ case "Lambda" :
366+ return NormalizedLambdaServiceName ;
361367 case "Amazon S3" : // AWS SDK v1
362368 case "S3" : // AWS SDK v2
363369 return NormalizedS3ServiceName ;
370+ case "Secrets Manager" :
371+ return NormalizedSecretsManagerServiceName ;
372+ case "SNS" :
373+ return NormalizedSNSServiceName ;
364374 case "AmazonSQS" : // AWS SDK v1
365375 case "Sqs" : // AWS SDK v2
366376 return NormalizedSQSServiceName ;
377+ case "SFN" :
378+ return NormalizedStepFunctionsName ;
367379 case "Bedrock" :
368380 case "Bedrock Agent" :
369381 case "Bedrock Agent Runtime" :
@@ -398,11 +410,28 @@ private static void SetRemoteResourceTypeAndIdentifier(Activity span, ActivityTa
398410 remoteResourceType = NormalizedKinesisServiceName + "::Stream" ;
399411 remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSKinesisStreamName ) ) ;
400412 }
413+ else if ( IsKeyPresent ( span , AttributeAWSLambdaResourceMappingId ) )
414+ {
415+ remoteResourceType = NormalizedLambdaServiceName + "::EventSourceMapping" ;
416+ remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSLambdaResourceMappingId ) ) ;
417+ }
401418 else if ( IsKeyPresent ( span , AttributeAWSS3Bucket ) )
402419 {
403420 remoteResourceType = NormalizedS3ServiceName + "::Bucket" ;
404421 remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSS3Bucket ) ) ;
405422 }
423+ else if ( IsKeyPresent ( span , AttributeAWSSecretsManagerSecretArn ) )
424+ {
425+ remoteResourceType = NormalizedSecretsManagerServiceName + "::Secret" ;
426+ remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSSecretsManagerSecretArn ) ) ? . Split ( ':' ) . Last ( ) ;
427+ cloudformationPrimaryIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSSecretsManagerSecretArn ) ) ;
428+ }
429+ else if ( IsKeyPresent ( span , AttributeAWSSNSTopicArn ) )
430+ {
431+ remoteResourceType = NormalizedSNSServiceName + "::Topic" ;
432+ remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSSNSTopicArn ) ) ? . Split ( ':' ) . Last ( ) ;
433+ cloudformationPrimaryIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSSNSTopicArn ) ) ;
434+ }
406435 else if ( IsKeyPresent ( span , AttributeAWSSQSQueueName ) )
407436 {
408437 remoteResourceType = NormalizedSQSServiceName + "::Queue" ;
@@ -415,6 +444,18 @@ private static void SetRemoteResourceTypeAndIdentifier(Activity span, ActivityTa
415444 remoteResourceIdentifier = EscapeDelimiters ( GetQueueName ( ( string ? ) span . GetTagItem ( AttributeAWSSQSQueueUrl ) ) ) ;
416445 cloudformationPrimaryIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSSQSQueueUrl ) ) ;
417446 }
447+ else if ( IsKeyPresent ( span , AttributeAWSStepFunctionsActivityArn ) )
448+ {
449+ remoteResourceType = NormalizedStepFunctionsName + "::Activity" ;
450+ remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSStepFunctionsActivityArn ) ) ? . Split ( ':' ) . Last ( ) ;
451+ cloudformationPrimaryIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSStepFunctionsActivityArn ) ) ;
452+ }
453+ else if ( IsKeyPresent ( span , AttributeAWSStepFunctionsStateMachineArn ) )
454+ {
455+ remoteResourceType = NormalizedStepFunctionsName + "::StateMachine" ;
456+ remoteResourceIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSStepFunctionsStateMachineArn ) ) ? . Split ( ':' ) . Last ( ) ;
457+ cloudformationPrimaryIdentifier = EscapeDelimiters ( ( string ? ) span . GetTagItem ( AttributeAWSStepFunctionsStateMachineArn ) ) ;
458+ }
418459 else if ( IsKeyPresent ( span , AttributeAWSBedrockGuardrailId ) )
419460 {
420461 remoteResourceType = NormalizedBedrockServiceName + "::Guardrail" ;
0 commit comments