-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Add verbose Dyn provider logs #14076
Conversation
To help troubleshoot, configure the underlying Dyn API module to output verbose logs when TF_LOG is debug or higher.
Hi @maxvt One question to ask here though - what exactly are you hoping to see in the logs? Some SDKs, like AWS allow logging whole HTTP request and response which has helped us greatly in the past and I'd like to treat that as the standard we should try and match in all providers. What we get here is the following data:
I don't want to treat this request as blocker for this PR or add more work where it wasn't expected but have you thought about looking into the Dyn library for improving the logging mechanisms to get similar level/quality of logs like in AWS (below)?
|
Hi @radeksimko, thank you for the comment. This PR helped me fix the issue I had, here's the output difference with the problem reproduced: before
The only error info is "400 Bad Request" with no further detail. This is difficult to debug. After the change, the output is:
Now we have two more pieces of information: the exact endpoint hit, which is useful for the documentation of the particular API the provider is using (in this case, ARecord POST), and comes from https://github.com/nesv/go-dynect/blob/master/dynect/client.go#L152; and, crucially, the full contents of the error response, including the exact cause ("permission: RecordAdd required"), which comes from https://github.com/nesv/go-dynect/blob/master/dynect/client.go#L161. This was sufficient to scope the problem to bad permissions on my end, and after a quick chat with Dyn support the issue was resolved. I agree it would be awesome to get AWS-quality logs for every provider, but it is out of scope for me to make improvements of that magnitude when my issue is already resolved. Perhaps the owner of go-dynect, @nesv, would be interested, or an issue could be created on that repo to track this request. Regardless of the format of logs coming out of go-dynect, the current change in this PR would still be required to enable detailed logs when TF_LOG is set high enough. Hopefully this clarifies what I intended to achieve with this PR and this change can be approved to make Dyn debugging easier, if not perfect, for users of the provider. |
OK, no problem - I see you know exactly what you're after and that it's useful in this context. 👍 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
To help troubleshoot, configure the underlying Dyn API module
to output verbose logs when TF_LOG is debug or higher.