Skip to content
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 request/response traces #397

Merged
merged 2 commits into from
May 20, 2021
Merged

Add request/response traces #397

merged 2 commits into from
May 20, 2021

Conversation

jdisanti
Copy link
Collaborator

This adds request/response tracing called out in #371.

Example output:

May 20 08:53:31.506 TRACE send_operation{operation="PutParameter" service="ssm"}: smithy_http_tower::dispatch: request=Request { method: POST, uri: https://ssm.us-east-1.amazonaws.com/, version: HTTP/1.1, headers: {"content-type": "application/x-amz-json-1.1", "x-amz-target": "AmazonSSM.PutParameter", "content-length": "117", "host": "ssm.us-east-1.amazonaws.com", "authorization": "<redacted>", "x-amz-date": "20210520T155331Z", "x-amz-security-token": "<redacted>", "user-agent": "aws-sdk-rust/0.1.0 os/linux lang/rust/1.52.1", "x-amz-user-agent": "aws-sdk-rust/0.1.0 api/ssm/0.0.2 os/linux lang/rust/1.52.1"}, body: SdkBody(Once(Some(b"{\"Name\":\"test_parameter_name\",\"Description\":\"some description\",\"Value\":\"some_value\",\"Type\":\"String\",\"Overwrite\":true}"))) }

May 20 08:53:37.051 TRACE send_operation{operation="PutParameter" service="ssm"}:load_response: smithy_http::middleware: response=Response { status: 200, version: HTTP/1.1, headers: {"server": "Server", "date": "Thu, 20 May 2021 15:53:37 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "32", "connection": "keep-alive", "x-amzn-requestid": "913ce42a-a071-47b6-ba6b-7d1f0b8d6f1a"}, body: SdkBody(Streaming(Body(Streaming))) }

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Collaborator

@rcoh rcoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, would be nice to remove this box at some point but one extra allocation per request isn't really hurting anyone.

@jdisanti jdisanti merged commit d0eafbc into smithy-lang:main May 20, 2021
@jdisanti jdisanti deleted the trace branch May 25, 2021 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants