Skip to content

feat(s3tables): add metrics configuration support for TableBucket#37275

Merged
mergify[bot] merged 10 commits intoaws:mainfrom
olenarostotskyy:olrostob/s3tables-metrics-config
Mar 20, 2026
Merged

feat(s3tables): add metrics configuration support for TableBucket#37275
mergify[bot] merged 10 commits intoaws:mainfrom
olenarostotskyy:olrostob/s3tables-metrics-config

Conversation

@olenarostotskyy
Copy link
Copy Markdown
Contributor

@olenarostotskyy olenarostotskyy commented Mar 17, 2026

Reason for this change

This PR adds request metrics configuration support to the S3 Tables TableBucket L2 construct, enabling users to enable or disable CloudWatch request metrics for their table buckets.

Request metrics provide insight into Amazon S3 Tables requests, helping users monitor and optimize their table bucket usage.

Description of changes

Enhanced TableBucket construct with request metrics configuration:

  • Added RequestMetricsStatus enum with ENABLED and DISABLED values
  • Added requestMetricsStatus property to TableBucketProps (flat structure per CDK guidelines)
  • Pass metrics configuration through to CfnTableBucket L1 construct

Documentation:

  • Updated README with "Enabling CloudWatch Request Metrics" section
  • Added RequestMetricsStatus to rosetta fixture

Description of how you validated changes

  • Unit tests: added 3 new test cases for request metrics (enabled, disabled, and not specified). All 193 tests passing.

  • Integration test: created integ.table-bucket-metrics.ts to validate metrics configuration deployment

  • Rosetta: verified with yarn rosetta:extract - passes successfully

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@alvazjor alvazjor added the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 18, 2026
@alvazjor alvazjor had a problem deploying to deployment-integ-test March 18, 2026 12:21 — with GitHub Actions Error
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 18, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results48 ran48 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 18, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates48 ran48 passed
TestResult
No test annotations available

@alvazjor alvazjor self-assigned this Mar 18, 2026
*
* @default - Metrics are disabled
*/
readonly metricsConfiguration?: MetricsConfiguration;
Copy link
Copy Markdown
Contributor

@alvazjor alvazjor Mar 18, 2026

Choose a reason for hiding this comment

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

The JSDoc here (and in the README too) can be improved by stating that this is a configuration specifically for request metrics and not all S3 table metrics: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-tables-cloudwatch-metrics.html
The default looks good

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Updated to clarify this is specifically for request metrics:

  • Renamed enum to RequestMetricsStatus
  • Renamed prop to requestMetricsStatus
  • Updated JSDoc and README to say "request metrics"

*
* @default MetricsConfigurationStatus.DISABLED
*/
readonly status?: MetricsConfigurationStatus;
Copy link
Copy Markdown
Contributor

@alvazjor alvazjor Mar 18, 2026

Choose a reason for hiding this comment

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

status is the only property of this interface, and we are marking it optional?
Also, CDK prefers to have flat structures when there is just 1 property, so I think we have 2 options here:

  1. Keep this nested object, make status non optional to have the user to actively choose what they want
  2. Drop this nested object completely, and have the prop flat in the TableBucketProps interface. So something like:
/**
 * CloudWatch configuration for the request metrics of the table bucket.
 *
 * When enabled, S3 Tables publishes CloudWatch request metrics for the table bucket.
 *
 * @default - Request metrics are not enabled
 */
readonly requestMetricsStatus?: MetricsConfigurationStatus;

And when passing them to the L1 resource in line 641, you construct there the CFN shape it needs.

I prefer option 2, seems leaner and more developer friendly, but up to you.

Any option you choose will need an improvement on the JS doc to clrearly mark that the configuration will only be applied to request metrics, and not all metrics

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed with Option 2: flattened to requestMetricsStatus?:

  • RequestMetricsStatus directly on props. Removed the nested interface.
  • JSDoc updated to clarify this is for request metrics only.

@alvazjor
Copy link
Copy Markdown
Contributor

Also, rosetta is failing the build, something is missing on the config so the README changes can indentify the new types you added and referenced there.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

dequeue

☑️ The pull request is not queued

alvazjor
alvazjor previously approved these changes Mar 19, 2026
@alvazjor
Copy link
Copy Markdown
Contributor

@Mergifyio queue

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Required conditions to enter a queue
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [📌 queue requirement]:
    • check-neutral = Mergify Merge Protections
    • check-skipped = Mergify Merge Protections
    • check-success = Mergify Merge Protections
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue default-squash]:
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -approved-reviews-by~=author
      • -closed
      • -label~=(blocked|do-not-merge|no-squash|priority-pr)
      • -merged
      • -title~=(WIP|wip)
      • base!=release
      • check-success=build
      • check-success=validate-pr
      • any of:
        • -label~=pr/needs-integration-tests-deployment
        • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
      • any of [🛡 GitHub branch protection]:
        • check-success = validate-pr
        • check-neutral = validate-pr
        • check-skipped = validate-pr
      • any of [🛡 GitHub branch protection]:
        • check-success = build
        • check-neutral = build
        • check-skipped = build
    • all of [📌 queue conditions of queue default-merge]:
      • label~=no-squash
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -approved-reviews-by~=author
      • -closed
      • -label~=(blocked|do-not-merge)
      • -merged
      • -title~=(WIP|wip)
      • check-success=build
      • check-success=validate-pr
      • any of:
        • -label~=pr/needs-integration-tests-deployment
        • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
      • any of [🛡 GitHub branch protection]:
        • check-success = validate-pr
        • check-neutral = validate-pr
        • check-skipped = validate-pr
      • any of [🛡 GitHub branch protection]:
        • check-success = build
        • check-neutral = build
        • check-skipped = build
    • all of [📌 queue conditions of queue priority-squash]:
      • label~=priority-pr
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0
      • -approved-reviews-by~=author
      • -closed
      • -label~=(blocked|do-not-merge|no-squash)
      • -merged
      • -title~=(WIP|wip)
      • base!=release
      • check-success=build
      • check-success=validate-pr
      • any of:
        • -label~=pr/needs-integration-tests-deployment
        • check-success=Deploy integration test snapshots (requires pr/needs-integration-tests-deployment label)
      • any of [🛡 GitHub branch protection]:
        • check-success = validate-pr
        • check-neutral = validate-pr
        • check-skipped = validate-pr
      • any of [🛡 GitHub branch protection]:
        • check-success = build
        • check-neutral = build
        • check-skipped = build

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 19, 2026

Merge Queue Status

  • Entered queue2026-03-19 20:02 UTC · Rule: default-squash
  • 🚫 Left the queue2026-03-19 23:24 UTC · at 44847f638920f679c35f55abe2d2bcb06fbea4a7

This pull request spent 3 hours 21 minutes 19 seconds in the queue, with no time running CI.

Reason

The pull request can't be updated

merge conflict between base and head

Hint

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@alvazjor
Copy link
Copy Markdown
Contributor

Hi @olenarostotskyy
Seems like there where some changes merged that are generating a conflict on this PR now. Can you please rebase? I will try to merge it again after fixed

@mergify mergify bot dismissed alvazjor’s stale review March 20, 2026 17:10

Pull request has been modified.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 20, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 20, 2026

Merge Queue Status

  • Entered queue2026-03-20 17:56 UTC · Rule: default-squash
  • Checks skipped · PR is already up-to-date
  • 🚫 Left the queue2026-03-20 17:56 UTC · at 30bb8ddf987e370f223510e8709603b3c3267476

This pull request spent 7 seconds in the queue, with no time running CI.

Required conditions to merge

Reason

Pull request #37275 has been dequeued

The pull request could not be merged. This could be related to an activated branch protection or ruleset rule that prevents us from merging. At least 1 approving review is required by reviewers with write access.

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio queue comment.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 20, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 20, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@alvazjor
Copy link
Copy Markdown
Contributor

@Mergifyio queue

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 20, 2026

Merge Queue Status

  • Entered queue2026-03-20 18:11 UTC · Rule: default-squash
  • Checks skipped · PR is already up-to-date
  • Merged2026-03-20 18:11 UTC · at 30bb8ddf987e370f223510e8709603b3c3267476

This pull request spent 9 seconds in the queue, with no time running CI.

Required conditions to merge

@mergify mergify bot merged commit e8786f5 into aws:main Mar 20, 2026
38 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Mar 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants