Skip to content

Commit e6d6f85

Browse files
committed
feat: update bedrock guardrail cfn primary id
1 parent cb31105 commit e6d6f85

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsAttributeKeys.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,6 @@ private AwsAttributeKeys() {}
8989
AttributeKey.stringKey("aws.bedrock.data_source.id");
9090
static final AttributeKey<String> AWS_GUARDRAIL_ID =
9191
AttributeKey.stringKey("aws.bedrock.guardrail.id");
92+
static final AttributeKey<String> AWS_GUARDRAIL_ARN =
93+
AttributeKey.stringKey("aws.bedrock.guardrail.arn");
9294
}

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME;
4545
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER;
4646
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_DATA_SOURCE_ID;
47+
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_GUARDRAIL_ARN;
4748
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_GUARDRAIL_ID;
4849
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_KNOWLEDGE_BASE_ID;
4950
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_LAMBDA_NAME;
@@ -455,6 +456,8 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes
455456
remoteResourceType = Optional.of(NORMALIZED_BEDROCK_SERVICE_NAME + "::Guardrail");
456457
remoteResourceIdentifier =
457458
Optional.ofNullable(escapeDelimiters(span.getAttributes().get(AWS_GUARDRAIL_ID)));
459+
cloudformationPrimaryIdentifier =
460+
Optional.ofNullable(escapeDelimiters(span.getAttributes().get(AWS_GUARDRAIL_ARN)));
458461
} else if (isKeyPresent(span, GEN_AI_REQUEST_MODEL)) {
459462
remoteResourceType = Optional.of(NORMALIZED_BEDROCK_SERVICE_NAME + "::Model");
460463
remoteResourceIdentifier =

0 commit comments

Comments
 (0)