|
40 | 40 | import static io.opentelemetry.semconv.SemanticAttributes.SERVER_PORT;
|
41 | 41 | import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_ADDRESS;
|
42 | 42 | import static io.opentelemetry.semconv.SemanticAttributes.SERVER_SOCKET_PORT;
|
43 |
| -import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME; |
44 | 43 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_AGENT_ID;
|
| 44 | +import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_BUCKET_NAME; |
45 | 45 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_DATASOURCE_ID;
|
46 | 46 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_GUARDRAIL_ID;
|
47 | 47 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_KNOWLEDGEBASE_ID;
|
|
56 | 56 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_SPAN_KIND;
|
57 | 57 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_STREAM_NAME;
|
58 | 58 | import static software.amazon.opentelemetry.javaagent.providers.AwsAttributeKeys.AWS_TABLE_NAME;
|
| 59 | +import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL; |
59 | 60 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.MAX_KEYWORD_LENGTH;
|
60 | 61 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.SQL_DIALECT_PATTERN;
|
61 | 62 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_OPERATION;
|
62 | 63 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_REMOTE_OPERATION;
|
63 | 64 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_REMOTE_SERVICE;
|
64 | 65 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.UNKNOWN_SERVICE;
|
65 |
| -import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.GEN_AI_REQUEST_MODEL; |
66 | 66 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isAwsSDKSpan;
|
67 | 67 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isDBSpan;
|
68 | 68 | import static software.amazon.opentelemetry.javaagent.providers.AwsSpanProcessingUtil.isKeyPresent;
|
@@ -367,14 +367,16 @@ private static String normalizeRemoteServiceName(SpanData span, String serviceNa
|
367 | 367 | case "AmazonSQS": // AWS SDK v1
|
368 | 368 | case "Sqs": // AWS SDK v2
|
369 | 369 | 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. |
371 | 372 | case "Bedrock": // AWS SDK v2 & v1
|
372 | 373 | case "AWSBedrockAgentRuntime": // AWS SDK v1
|
373 | 374 | case "BedrockAgentRuntime": // AWS SDK v2
|
374 | 375 | case "AWSBedrockAgent": // AWS SDK v1
|
375 | 376 | case "BedrockAgent": // AWS SDK v2
|
376 | 377 | 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. |
378 | 380 | case "AmazonBedrockRuntime": // AWS SDK v1
|
379 | 381 | case "BedrockRuntime": // AWS SDK v2
|
380 | 382 | return NORMALIZED_BEDROCK_RUNTIME_SERVICE_NAME;
|
@@ -440,8 +442,7 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes
|
440 | 442 | } else if (isKeyPresent(span, GEN_AI_REQUEST_MODEL)) {
|
441 | 443 | remoteResourceType = Optional.of(NORMALIZED_BEDROCK_SERVICE_NAME + "::Model");
|
442 | 444 | remoteResourceIdentifier =
|
443 |
| - Optional.ofNullable( |
444 |
| - escapeDelimiters(span.getAttributes().get(GEN_AI_REQUEST_MODEL))); |
| 445 | + Optional.ofNullable(escapeDelimiters(span.getAttributes().get(GEN_AI_REQUEST_MODEL))); |
445 | 446 | }
|
446 | 447 | } else if (isDBSpan(span)) {
|
447 | 448 | remoteResourceType = Optional.of(DB_CONNECTION_RESOURCE_TYPE);
|
|
0 commit comments