This repository was archived by the owner on Jan 21, 2020. It is now read-only.
Add HTTP request debug logging #300
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds debug-level logging for plugin clients and servers.
Here's an excerpt from the group Plugin to show how this logging presents, showing the full call chain to create an instance:
INFO[0000] Listening at: /Users/billfarner/.infrakit/plugins/group DEBU[0015] Received request POST /rpc HTTP/1.1 Host: d Accept-Encoding: gzip Content-Length: 409 Content-Type: application/json User-Agent: Go-http-client/1.1 {"method":"Group.CommitGroup","params":[{"Spec":{"ID":"cattle","Properties":{"Allocation":{"Size":5},"Instance":{"Plugin":"instance-file","Properties":{"Note":"Instance properties version 1.0"}},"Flavor":{"Plugin":"flavor-vanilla","Properties":{"Init":["docker pull nginx:alpine","docker run -d -p 80:80 nginx-alpine"],"Tags":{"tier":"web","project":"infrakit"}}}}},"Pretend":false}],"id":5577006791947779410} ... DEBU[0015] Sending request POST / HTTP/1.1 Content-Type: application/json {"method":"Flavor.Validate","params":[{"Properties":{"Init":["docker pull nginx:alpine","docker run -d -p 80:80 nginx-alpine"],"Tags":{"tier":"web","project":"infrakit"}},"Allocation":{"Size":5,"LogicalIDs":null}}],"id":2403489562072437156} DEBU[0015] Received response HTTP/1.1 200 OK Content-Length: 60 Content-Type: text/plain; charset=utf-8 Date: Tue, 15 Nov 2016 23:03:26 GMT {"result":{"OK":true},"error":null,"id":2403489562072437156} ... DEBU[0015] Sending request POST / HTTP/1.1 Content-Type: application/json {"method":"Instance.Validate","params":[{"Properties":{"Note":"Instance properties version 1.0"}}],"id":6372761812113081704} DEBU[0015] Received response HTTP/1.1 200 OK Content-Length: 60 Content-Type: text/plain; charset=utf-8 Date: Tue, 15 Nov 2016 23:03:26 GMT {"result":{"OK":true},"error":null,"id":6372761812113081704} INFO[0015] Committing group cattle (pretend=false) DEBU[0015] Sending response HTTP/1.1 200 OK Connection: close X-Content-Type-Options: nosniff {"result":{"Details":"Managing 5 instances"},"error":null,"id":5577006791947779410}Closes #269
Signed-off-by: Bill Farner [email protected]