I discovered an issue with assigning the tracer to the TracingTransport instance the first time when RoundTrip is called by the http.Client. If the TracingTransport instance is re-used across multiple Lambda invocations the first invocation will succeed however subsequent requests will fail as the tracer is only valid for a single invocation with a new tracer created on each invocation as at the end of the invocation the tracer is stopped.
This change alters that behavior to use a local variable for the tracer in the TracingTransport instance allowing it to be used across multiple invocations.
Discovered an odd issue when wrapping another transport, where after the request is sent the function req.GetBody() is nil. I'm not sure why this is happening when calling the AWS Elasticsearch service with a signed request but I can reproduce it. Made another change to the TracingTransport to capture the request headers & body before sending. This change is implemented similar to how the response body is read & a new reader is created for it.
I discovered an issue with assigning the tracer to the TracingTransport instance the first time when RoundTrip is called by the http.Client. If the TracingTransport instance is re-used across multiple Lambda invocations the first invocation will succeed however subsequent requests will fail as the tracer is only valid for a single invocation with a new tracer created on each invocation as at the end of the invocation the tracer is stopped.
This change alters that behavior to use a local variable for the tracer in the TracingTransport instance allowing it to be used across multiple invocations.
Discovered an odd issue when wrapping another transport, where after the request is sent the function req.GetBody() is nil. I'm not sure why this is happening when calling the AWS Elasticsearch service with a signed request but I can reproduce it. Made another change to the TracingTransport to capture the request headers & body before sending. This change is implemented similar to how the response body is read & a new reader is created for it.