go-agent
go-agent copied to clipboard
nrawssdk-v2: fix usage examples of nrawssdk.AppendMiddlewares
Links
Details
When testing the nrawssdk-v2 integration along with nrlambda I found out that the provided method of injecting the middleware to APIOptions does not work (no trace is seen for any aws call), what worked was to use the optFns param.
In this PR I'm only changing the documentation and example to reflect what has been working, but maybe you'd want to expand on it to add an exported function that can be used as an optFn ?
Also I could not find how to make the test fail as I'm not familiar enough with the internals.
@Meroje Hi, I'm taking a look at this and was wondering what this really changes other than when nrawssdk.AppendMiddlewares(&awsConfig.APIOptions, nil) is invoked. I can see that it's passing the unit test, so I'm not worried about the functionality. I am just not sure why we are changing the usage pattern on users if the outcome is the same.
I found that the previous method had no effect and I would never get any telemetry from aws sdk.
Oh ok, that's a good reason haha. Ok, I'll verify this and see if we can land it in an upcoming release.
@Meroje are you able to sign the CLA here so that we can proceed?