|
41 | 41 | import static io.opentelemetry.semconv.SemanticAttributes.SERVER_PORT; |
42 | 42 | import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_ADDRESS; |
43 | 43 | import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_PORT; |
44 | | -import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME; |
45 | 44 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_AGENT_ID; |
| 45 | +import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME; |
46 | 46 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_DATASOURCE_ID; |
47 | 47 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_GUARDRAIL_ID; |
48 | 48 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_KNOWLEDGEBASE_ID; |
|
58 | 58 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_SPAN_KIND; |
59 | 59 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_STREAM_NAME; |
60 | 60 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_TABLE_NAME; |
| 61 | +import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL; |
61 | 62 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.MAX_KEYWORD_LENGTH; |
62 | 63 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.SQL_DIALECT_PATTERN; |
63 | 64 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_OPERATION; |
64 | 65 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_REMOTE_OPERATION; |
65 | 66 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_REMOTE_SERVICE; |
66 | 67 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_SERVICE; |
67 | | -import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL; |
68 | 68 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isAwsSDKSpan; |
69 | 69 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isDBSpan; |
70 | 70 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isKeyPresent; |
@@ -370,14 +370,16 @@ private static String normalizeRemoteServiceName(SpanData span, String serviceNa |
370 | 370 | case "AmazonSQS": // AWS SDK v1 |
371 | 371 | case "Sqs": // AWS SDK v2 |
372 | 372 | return NORMALIZED_SQS_SERVICE_NAME; |
373 | | - // For Bedrock, Bedrock Agent, and Bedrock Agent Runtime, we can align with AWS Cloud Control and use AWS::Bedrock for RemoteService. |
| 373 | + // For Bedrock, Bedrock Agent, and Bedrock Agent Runtime, we can align with AWS Cloud |
| 374 | + // Control and use AWS::Bedrock for RemoteService. |
374 | 375 | case "Bedrock": // AWS SDK v2 & v1 |
375 | 376 | case "AWSBedrockAgentRuntime": // AWS SDK v1 |
376 | 377 | case "BedrockAgentRuntime": // AWS SDK v2 |
377 | 378 | case "AWSBedrockAgent": // AWS SDK v1 |
378 | 379 | case "BedrockAgent": // AWS SDK v2 |
379 | 380 | return NORMALIZED_BEDROCK_SERVICE_NAME; |
380 | | - // For BedrockRuntime, we are using AWS::BedrockRuntime as the associated remote resource (Model) is not listed in Cloud Control. |
| 381 | + // For BedrockRuntime, we are using AWS::BedrockRuntime as the associated remote resource |
| 382 | + // (Model) is not listed in Cloud Control. |
381 | 383 | case "AmazonBedrockRuntime": // AWS SDK v1 |
382 | 384 | case "BedrockRuntime": // AWS SDK v2 |
383 | 385 | return NORMALIZED_BEDROCK_RUNTIME_SERVICE_NAME; |
@@ -443,8 +445,7 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes |
443 | 445 | } else if (isKeyPresent(span, GEN_AI_REQUEST_MODEL)) { |
444 | 446 | remoteResourceType = Optional.of(NORMALIZED_BEDROCK_SERVICE_NAME + "::Model"); |
445 | 447 | remoteResourceIdentifier = |
446 | | - Optional.ofNullable( |
447 | | - escapeDelimiters(span.getAttributes().get(GEN_AI_REQUEST_MODEL))); |
| 448 | + Optional.ofNullable(escapeDelimiters(span.getAttributes().get(GEN_AI_REQUEST_MODEL))); |
448 | 449 | } |
449 | 450 | } else if (isDBSpan(span)) { |
450 | 451 | remoteResourceType = Optional.of(DB_CONNECTION_RESOURCE_TYPE); |
|
0 commit comments