Skip to content

Conversation

@zuoyaofu
Copy link
Contributor

@zuoyaofu zuoyaofu commented Mar 26, 2025

Problem

Some users are reporting S3 upload failures but we don't have the id2 that S3 team requires to investigate further.

Related Commons change: #1005

Solution

Emit amazonq_createUpload metric with id2, and add logs for these ids so customers can use too.


  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions
Copy link

  • This pull request modifies code in src/* but no tests were added/updated.
    • Confirm whether tests should be added or ensure the PR description explains why tests are not required.

@zuoyaofu zuoyaofu changed the title Id2 telemetry(amazonq): Add id2 and logging for createUpload metrics Mar 26, 2025
@zuoyaofu zuoyaofu closed this Mar 26, 2025
@zuoyaofu zuoyaofu reopened this Mar 26, 2025
@zuoyaofu zuoyaofu marked this pull request as ready for review March 26, 2025 09:06
@zuoyaofu zuoyaofu requested a review from a team as a code owner March 26, 2025 09:06
@zuoyaofu zuoyaofu requested a review from a team as a code owner March 26, 2025 21:31
@zuoyaofu zuoyaofu enabled auto-merge March 27, 2025 07:01

try {
const response = await request.fetch('PUT', resp.uploadUrl, {
body: readFileSync(fileName),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible this exceeds a request size limit? Should it be streamed?

logger.debug(`StatusCode: ${response.status}, Text: ${response.statusText}`)
requestId = response.headers?.get('x-amz-request-id') ?? undefined
id2 = response.headers?.get('x-amz-id-2') ?? undefined
responseCode = response.status.toString()
Copy link
Contributor

@justinmk3 justinmk3 Mar 27, 2025

Choose a reason for hiding this comment

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

Not great that all of this is placed in the business logic for a feature. This kind of thing should live in shared/request. It is generally useful for many features.

And clearly, it's not easy to get right, since this PR is already fixing a bug related to it. Yet this bug fix won't be shared with other similar code that needs to make requests (even if it's specific to S3 PUT).

@justinmk3 justinmk3 disabled auto-merge March 27, 2025 19:11
@justinmk3 justinmk3 merged commit 3452a26 into aws:master Mar 27, 2025
31 checks passed
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.

5 participants