You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform-plugin-sdk/v2 was recently updated to include a new tflog based http.Transport implementation to replace the Go standard library log based one. Given that this code enhances/configures Go standard library functionality, is tightly coupled to terraform-plugin-log, and doesn't necessarily apply to just terraform-plugin-sdk, it might make sense to include it in this module as well.
Attempted solutions
Import and use terraform-plugin-sdk implementation or manually recreate it.
Proposal
Introduce a new tfhttplog (or tfloghttp or tflog/tfhttplog) package, which contains the following:
Ability to get a tflog ready http.Transport (e.g. support http.Client{Transport: XXX} directly)
The latter two may also necessitate the need for something to create/handle HTTP transaction IDs (or a guided way for the consumer to inject their own), since that is something baked into the http.Transport itself currently.
When creating the website documentation for this functionality, it might be useful to provide examples for how to use it with go-retryablehttp.
terraform-plugin-log version
Use cases
terraform-plugin-sdk/v2 was recently updated to include a new
tflog
basedhttp.Transport
implementation to replace the Go standard librarylog
based one. Given that this code enhances/configures Go standard library functionality, is tightly coupled to terraform-plugin-log, and doesn't necessarily apply to just terraform-plugin-sdk, it might make sense to include it in this module as well.Attempted solutions
Import and use terraform-plugin-sdk implementation or manually recreate it.
Proposal
Introduce a new
tfhttplog
(ortfloghttp
ortflog/tfhttplog
) package, which contains the following:tflog
readyhttp.Transport
(e.g. supporthttp.Client{Transport: XXX}
directly)tflog
logic forhttp.Request
logging (e.g. support go-retryablehttp.Client.RequestLogHook)tflog
logic forhttp.Response
logging (e.g. support go-retryablehttp.Client.ResponseLogHook)The latter two may also necessitate the need for something to create/handle HTTP transaction IDs (or a guided way for the consumer to inject their own), since that is something baked into the
http.Transport
itself currently.When creating the website documentation for this functionality, it might be useful to provide examples for how to use it with
go-retryablehttp
.References
The text was updated successfully, but these errors were encountered: