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

How to get request id for Dynamodb and S3 calls using SDK? #215

Closed
jeevankk opened this issue Jan 14, 2014 · 6 comments
Closed

How to get request id for Dynamodb and S3 calls using SDK? #215

jeevankk opened this issue Jan 14, 2014 · 6 comments
Labels
feature-request A feature should be added or improved.

Comments

@jeevankk
Copy link

I can't find the documentation anywhere. When we contacted AWS support regarding another issue they asked us to log the request id. I can't find it anywhere.

@lsegal
Copy link
Contributor

lsegal commented Jan 14, 2014

You can get the request ID from the headers of the response:

dynamodb.listTables(function(err, data) {
  console.log(this.httpResponse.headers['x-amzn-requestid']);
});

@jeevankk
Copy link
Author

@lsegal

resp.data.RequestId = resp.httpResponse.headers['x-amz-request-id'] ||

According to this line

resp.data.RequestId = resp.httpResponse.headers['x-amz-request-id'] ||
                          resp.httpResponse.headers['x-amzn-requestid'];

you are setting the request id to resp.data.RequestId. Can I access like this.data.RequestId ?

@lsegal
Copy link
Contributor

lsegal commented Jan 14, 2014

That is only for REST JSON services. DynamoDB happens to be an RPC JSON service, and not REST based. That said, it would be trivial to copy that same code over to json.rb, which is what the RPC JSON protocol uses.

@jeevankk
Copy link
Author

I think request id should be a part of error which is returned by AWS-SDK, since AWS support team will not be able to help us until we provide them the request id.

@lsegal lsegal closed this as completed in 3cc5536 Feb 20, 2014
@lsegal
Copy link
Contributor

lsegal commented Feb 20, 2014

Hi @jeevankkwy. I've made the above change that adds a AWS.Response.requestId property that should be accessible from all services. Note that the property is no longer modeled in the "data" bag, which makes it a breaking change (and will only be available in the 2.x releases).

Let me know if you think the request ID is better off in the data property-- it's not too late to move this back, but putting it directly in the response should give it some better documentation visibility.

lsegal added a commit that referenced this issue Mar 26, 2014
lsegal added a commit that referenced this issue Apr 24, 2014
@lock
Copy link

lock bot commented Sep 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Sep 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants