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

fix(middleware-logger): remove $metadata from response.output #1790

Closed
wants to merge 4 commits into from

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Dec 14, 2020

Issue #, if available:
Fixes: #1490

Description of changes:
remove $metadata from response.output

Test code
const { DynamoDB } = require("../aws-sdk-js-v3/clients/client-dynamodb");

(async () => {
  const region = "us-east-1";
  const client = new DynamoDB({ region });

  console.log(await client.listTables({ Limit: 1 }));
})();
Output before
{
  '$metadata': {
    httpStatusCode: 200,
    httpHeaders: {
      server: 'Server',
      date: 'Mon, 14 Dec 2020 20:40:57 GMT',
      'content-type': 'application/x-amz-json-1.0',
      'content-length': '44',
      connection: 'keep-alive',
      'x-amzn-requestid': 'M7HOMU8M8R280SCB6QD266MOC3VV4KQNSO5AEMVJF66Q9ASUAAJG',
      'x-amz-crc32': '2729330041'
    },
    requestId: 'M7HOMU8M8R280SCB6QD266MOC3VV4KQNSO5AEMVJF66Q9ASUAAJG',
    attempts: 1,
    totalRetryDelay: 0
  },
  LastEvaluatedTableName: undefined,
  TableNames: [ 'aws-js-sdk-workshop-notes' ]
}
Output after
{
  LastEvaluatedTableName: undefined,
  TableNames: [ 'aws-js-sdk-workshop-notes' ]
}

The metadata is logged by middleware-logger in #1788

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

@trivikr trivikr marked this pull request as draft December 16, 2020 18:55
@trivikr
Copy link
Member Author

trivikr commented Dec 16, 2020

Converting to draft as making $metadata optional is a big change and would require updates/modifications in integ tests.

@trivikr
Copy link
Member Author

trivikr commented Dec 18, 2020

During post-scrum on 12/18, we decided not to remove metadata as we're already GA and it's easy to find important information from $metadata.
We'll remove httpHeaders from metadata though in #1491

@trivikr trivikr closed this Dec 18, 2020
@github-actions
Copy link

github-actions bot commented Jan 8, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 8, 2021
@trivikr trivikr deleted the remove-metedata-from-output branch January 13, 2021 07:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove $metadata from API response
1 participant