Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Tracing for AWS SDKv2 clients does not use the allow listed parameters for SQS/SNS #373

Closed
humanzz opened this issue Feb 24, 2023 · 0 comments

Comments

@humanzz
Copy link
Contributor

humanzz commented Feb 24, 2023

The file https://github.com/aws/aws-xray-sdk-java/blob/master/aws-xray-recorder-sdk-aws-sdk-v2/src/main/resources/com/amazonaws/xray/interceptors/DefaultOperationParameterWhitelist.json lists sqs and sns as SQS and SNS.

The code loading this allow list, to get the allowlist parameters has a lookup in a map using Sqs and Sns which leads to not loading this metadata and therefore to not including the queue url or topic arn in the segement data.

Example code

public static void main(String[] args) {
            AWSXRay.beginDummySegment();
            SqsClient client = SqsClient.builder()
                    .credentialsProvider(kelpieBetaConduitCredentialsProvider())
                    .overrideConfiguration(c -> c.addExecutionInterceptor(new TracingInterceptor()))
                    .region(REGION)
                    .httpClient(UrlConnectionHttpClient.create())
                    .build();
            client.sendMessage(SendMessageRequest.builder()
                            .queueUrl("https://sqs.us-west-2.amazonaws.com/...")
                            .messageBody("Hello World!")
                    .build());
            AWSXRay.endSegment();
    }

Debugging Code showing the issue for SqsClient

Screenshot 2023-02-24 at 16 55 52

humanzz added a commit to humanzz/aws-xray-sdk-java that referenced this issue Feb 24, 2023
willarmiros pushed a commit that referenced this issue Feb 27, 2023
)

* Fix sqs/sns case for parameter allowlist lookups (#373)

* Test sqs/sns and refactor TracingInterceptorTest

* Fix checkstyle issues
@humanzz humanzz closed this as completed Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant