diff --git a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java index 4e1b0f0dc..5aa898064 100644 --- a/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java +++ b/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java @@ -502,7 +502,7 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes remoteResourceIdentifier = getDbConnection(span); } - if (cloudformationPrimaryIdentifier.isEmpty()) { + if (!cloudformationPrimaryIdentifier.isPresent()) { cloudformationPrimaryIdentifier = remoteResourceIdentifier; }