Use common metrics code and fix bug#433
Merged
Merged
Conversation
There was a problem hiding this comment.
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
buildEMFObjectandMetricStatusfrom@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,
}),
51612b9 to
28c009d
Compare
Vlasis-Perdikidis
previously approved these changes
Mar 3, 2026
Vlasis-Perdikidis
left a comment
Contributor
There was a problem hiding this comment.
just an issue with imports order
Vlasis-Perdikidis
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Context
Type of changes
Checklist
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.