Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added support for AWS AppRunner origin #6141

Merged
merged 1 commit into from
Nov 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions exporter/awsxrayexporter/internal/translator/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
OriginECSFargate = "AWS::ECS::Fargate"
OriginEB = "AWS::ElasticBeanstalk::Environment"
OriginEKS = "AWS::EKS::Container"
OriginAppRunner = "AWS::AppRunner::Service"
)

var (
Expand Down Expand Up @@ -231,16 +232,17 @@ func determineAwsOrigin(resource pdata.Resource) string {
}
}

// TODO(willarmiros): Only use platform for origin resolution once detectors for all AWS environments are
// implemented for robustness
if is, present := resource.Attributes().Get(conventions.AttributeCloudPlatform); present {
switch is.StringVal() {
// TODO: Replace with semantic convention const when aws_app_runner is included in an official semconv release
codeboten marked this conversation as resolved.
Show resolved Hide resolved
case "aws_app_runner":
return OriginAppRunner
case conventions.AttributeCloudPlatformAWSEKS:
return OriginEKS
case conventions.AttributeCloudPlatformAWSElasticBeanstalk:
return OriginEB
case conventions.AttributeCloudPlatformAWSECS:
lt, present := resource.Attributes().Get("aws.ecs.launchtype")
lt, present := resource.Attributes().Get(conventions.AttributeAWSECSLaunchtype)
if !present {
return OriginECS
}
Expand All @@ -255,7 +257,7 @@ func determineAwsOrigin(resource pdata.Resource) string {
case conventions.AttributeCloudPlatformAWSEC2:
return OriginEC2

// If infrastructure_service is defined with a non-AWS value, we should not assign it an AWS origin
// If cloud_platform is defined with a non-AWS value, we should not assign it an AWS origin
default:
return ""
}
Expand Down