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

AwsSdk handler does not work when using a derived class from the service client #250

Open
a-jackson opened this issue May 17, 2022 · 0 comments

Comments

@a-jackson
Copy link
Contributor

I've made my own derived class from the service client classes, e.g. AmazonS3Client so that I can use dependency injection to inject IOptions<> and call the base constructor with the appropriate AmazonS3Config. Maybe not conventional but it works.

I just added XRay and it is not recording traces for the AWS SDK calls. Looking into this I find that this guard is preventing the Pipeline Handler from being added.

serviceClientType is passed from the AmazonServiceClient constructor as this.GetType() and so is my derived type, e.g. MyAmazonS3Client. Therefore serviceClientType.BaseType is AmazonS3Client and not AmazonServiceClient.

I suggest this be changed to if (typeof(AmazonServiceClient).IsAssignableFrom(serviceClientType)) and it would not matter how many levels of derivation were used.

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