Skip to content

AWS SDK v2 spans use only operation name, missing service name prefix #1421

@MadsSFox

Description

@MadsSFox

Description

The kamon-aws-sdk module has inconsistent span naming between SDK v1 and v2:

  • SDK v1 (AwsSdkRequestHandler): Names spans as serviceName.operationName → e.g. AmazonDynamoDBv2.Query
  • SDK v2 (AwsSdkClientExecutionInterceptor): Names spans as just operationName → e.g. Query

This makes it difficult to identify which AWS service a span belongs to in distributed traces, especially when an application uses multiple AWS services (DynamoDB, S3, SQS, STS, etc.) — a Query span is ambiguous without the service name.

Expected Behavior

SDK v2 spans should include the service name, matching the v1 convention: DynamoDb.Query, S3.GetObject, Sqs.SendMessage, etc.

Root Cause

In AwsSdkClientExecutionInterceptor.scala, the span is created with just the operation name. The service name is available via context.request().let(SdkHttpRequest::host) parsing or executionAttributes.getAttribute(SdkExecutionAttribute.SERVICE_NAME) but is not used.

The v1 handler was written later and includes the service name, but the v2 interceptor was never updated to match.

Fix

PR #1420 addresses this with a one-line change to prepend the service name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions