Skip to content

Use common metrics code and fix bug#433

Merged
stevebux merged 4 commits into
mainfrom
feature/CCM-12934-Metric-Fix
Mar 3, 2026
Merged

Use common metrics code and fix bug#433
stevebux merged 4 commits into
mainfrom
feature/CCM-12934-Metric-Fix

Conversation

@stevebux

Copy link
Copy Markdown
Contributor

Description

Context

Type of changes

  • Refactoring (non-breaking change)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would change existing functionality)
  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I am familiar with the contributing guidelines
  • I have followed the code style of the project
  • I have added tests to cover my changes
  • I have updated the documentation accordingly
  • This PR is a result of pair or mob programming
  • If I have used the 'skip-trivy-package' label I have done so responsibly and in the knowledge that this is being fixed as part of a separate ticket/PR.

Sensitive Information Declaration

To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.

  • I confirm that neither PII/PID nor sensitive data are included in this PR and the codebase changes.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors update-letter-queue Lambda metric emission to use the shared EMF metrics helper code, and updates the unit tests accordingly, aligning this Lambda’s metrics formatting with the rest of the repository.

Changes:

  • Replaced the Lambda’s local EMF metric builder with buildEMFObject and MetricStatus from @internal/helpers.
  • Updated metric logging calls to use MetricStatus.Success / MetricStatus.Failure.
  • Updated unit tests to assert the new metric name values.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lambdas/update-letter-queue/src/update-letter-queue.ts Switches metric construction to the shared @internal/helpers EMF builder and standardizes metric status names.
lambdas/update-letter-queue/src/tests/update-letter-queue.test.ts Updates assertions to match the new MetricStatus metric names.
Comments suppressed due to low confidence (1)

lambdas/update-letter-queue/src/tests/update-letter-queue.test.ts:307

  • These metric assertions only check the _aws.CloudWatchMetrics[].Metrics[] entries. To ensure the EMF payload is actually valid/emittable, also assert the returned object contains the top-level value field keyed by the metric name (e.g. [MetricStatus.Success]: count / [MetricStatus.Failure]: count).
            Metrics: [
              expect.objectContaining({
                Name: MetricStatus.Success,
                Value: count,
              }),

@stevebux stevebux force-pushed the feature/CCM-12934-Metric-Fix branch from 51612b9 to 28c009d Compare March 3, 2026 09:13

@Vlasis-Perdikidis Vlasis-Perdikidis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

just an issue with imports order

@stevebux stevebux merged commit 41547ac into main Mar 3, 2026
42 checks passed
@stevebux stevebux deleted the feature/CCM-12934-Metric-Fix branch March 3, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants