Skip to content

Commit 01eb413

Browse files
committed
Apply spotless.
1 parent 06d874e commit 01eb413

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ private AwsAttributeKeys() {}
5858
static final AttributeKey<String> AWS_TABLE_NAME = AttributeKey.stringKey("aws.table.name");
5959
static final AttributeKey<String> AWS_AGENT_ID = AttributeKey.stringKey("aws.bedrock.agent.id");
6060
static final AttributeKey<String> AWS_KNOWLEDGEBASE_ID =
61-
AttributeKey.stringKey("aws.bedrock.knowledgebase.id");
61+
AttributeKey.stringKey("aws.bedrock.knowledgebase.id");
6262
static final AttributeKey<String> AWS_DATASOURCE_ID =
63-
AttributeKey.stringKey("aws.bedrock.datasource.id");
63+
AttributeKey.stringKey("aws.bedrock.datasource.id");
6464
static final AttributeKey<String> AWS_GUARDRAIL_ID =
65-
AttributeKey.stringKey("aws.bedrock.guardrail.id");
65+
AttributeKey.stringKey("aws.bedrock.guardrail.id");
6666
}

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_PORT;
4141
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_ADDRESS;
4242
import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_PORT;
43-
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME;
4443
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_AGENT_ID;
44+
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME;
4545
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_DATASOURCE_ID;
4646
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_GUARDRAIL_ID;
4747
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_KNOWLEDGEBASE_ID;
@@ -56,13 +56,13 @@
5656
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_SPAN_KIND;
5757
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_STREAM_NAME;
5858
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_TABLE_NAME;
59+
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL;
5960
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.MAX_KEYWORD_LENGTH;
6061
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.SQL_DIALECT_PATTERN;
6162
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_OPERATION;
6263
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_REMOTE_OPERATION;
6364
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_REMOTE_SERVICE;
6465
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_SERVICE;
65-
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL;
6666
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isAwsSDKSpan;
6767
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isDBSpan;
6868
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isKeyPresent;
@@ -367,14 +367,16 @@ private static String normalizeRemoteServiceName(SpanData span, String serviceNa
367367
case "AmazonSQS": // AWS SDK v1
368368
case "Sqs": // AWS SDK v2
369369
return NORMALIZED_SQS_SERVICE_NAME;
370-
// For Bedrock, Bedrock Agent, and Bedrock Agent Runtime, we can align with AWS Cloud Control and use AWS::Bedrock for RemoteService.
370+
// For Bedrock, Bedrock Agent, and Bedrock Agent Runtime, we can align with AWS Cloud
371+
// Control and use AWS::Bedrock for RemoteService.
371372
case "Bedrock": // AWS SDK v2 & v1
372373
case "AWSBedrockAgentRuntime": // AWS SDK v1
373374
case "BedrockAgentRuntime": // AWS SDK v2
374375
case "AWSBedrockAgent": // AWS SDK v1
375376
case "BedrockAgent": // AWS SDK v2
376377
return NORMALIZED_BEDROCK_SERVICE_NAME;
377-
// For BedrockRuntime, we are using AWS::BedrockRuntime as the associated remote resource (Model) is not listed in Cloud Control.
378+
// For BedrockRuntime, we are using AWS::BedrockRuntime as the associated remote resource
379+
// (Model) is not listed in Cloud Control.
378380
case "AmazonBedrockRuntime": // AWS SDK v1
379381
case "BedrockRuntime": // AWS SDK v2
380382
return NORMALIZED_BEDROCK_RUNTIME_SERVICE_NAME;
@@ -440,8 +442,7 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes
440442
} else if (isKeyPresent(span, GEN_AI_REQUEST_MODEL)) {
441443
remoteResourceType = Optional.of(NORMALIZED_BEDROCK_SERVICE_NAME + "::Model");
442444
remoteResourceIdentifier =
443-
Optional.ofNullable(
444-
escapeDelimiters(span.getAttributes().get(GEN_AI_REQUEST_MODEL)));
445+
Optional.ofNullable(escapeDelimiters(span.getAttributes().get(GEN_AI_REQUEST_MODEL)));
445446
}
446447
} else if (isDBSpan(span)) {
447448
remoteResourceType = Optional.of(DB_CONNECTION_RESOURCE_TYPE);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ final class AwsSpanProcessingUtil {
5858
static final int MAX_KEYWORD_LENGTH = 27;
5959
// TODO: Use Semantic Conventions once upgrade once upgrade to v1.26.0
6060
static final AttributeKey<String> GEN_AI_REQUEST_MODEL =
61-
AttributeKey.stringKey("gen_ai.request.model");
61+
AttributeKey.stringKey("gen_ai.request.model");
6262
static final Pattern SQL_DIALECT_PATTERN =
6363
Pattern.compile("^(?:" + String.join("|", getDialectKeywords()) + ")\\b");
6464

awsagentprovider/src/test/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGeneratorTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_SPAN_KIND;
3838
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_STREAM_NAME;
3939
import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_TABLE_NAME;
40+
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL;
4041
import static software.amazon.opentelemetry.javaagent.providers.MetricAttributeGenerator.DEPENDENCY_METRIC;
4142
import static software.amazon.opentelemetry.javaagent.providers.MetricAttributeGenerator.SERVICE_METRIC;
42-
import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL;
4343

4444
import io.opentelemetry.api.common.AttributeKey;
4545
import io.opentelemetry.api.common.Attributes;
@@ -730,7 +730,8 @@ public void testSdkClientSpanWithRemoteResourceAttributes() {
730730
validateRemoteResourceAttributes("AWS::Bedrock::DataSource", "test_datasource_id");
731731
mockAttribute(AWS_DATASOURCE_ID, null);
732732

733-
// Validate behaviour of AWS_BEDROCK_DATASOURCE_ID attribute with special chars(^), then remove it.
733+
// Validate behaviour of AWS_BEDROCK_DATASOURCE_ID attribute with special chars(^), then remove
734+
// it.
734735
mockAttribute(AWS_DATASOURCE_ID, "test_datasource_^id");
735736
validateRemoteResourceAttributes("AWS::Bedrock::DataSource", "test_datasource_^^id");
736737
mockAttribute(AWS_DATASOURCE_ID, null);
@@ -749,9 +750,9 @@ public void testSdkClientSpanWithRemoteResourceAttributes() {
749750
mockAttribute(GEN_AI_REQUEST_MODEL, "test.service_id");
750751
validateRemoteResourceAttributes("AWS::Bedrock::Model", "test.service_id");
751752
mockAttribute(GEN_AI_REQUEST_MODEL, null);
752-
mockAttribute(RPC_SYSTEM, "null");
753753

754-
// Validate behaviour of AWS_BEDROCK_RUNTIME_MODEL_ID attribute with special chars(^), then remove it.
754+
// Validate behaviour of AWS_BEDROCK_RUNTIME_MODEL_ID attribute with special chars(^), then
755+
// remove it.
755756
mockAttribute(GEN_AI_REQUEST_MODEL, "test.service_^id");
756757
validateRemoteResourceAttributes("AWS::Bedrock::Model", "test.service_^^id");
757758
mockAttribute(GEN_AI_REQUEST_MODEL, null);

0 commit comments

Comments
 (0)