You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#87 - Alarming construct to streamline alarming setup - #88
Date#setTime returns the numeric epoch in milliseconds, so each Slack log entry displays a value such as 1700000000001 instead of a readable event time. Format the date value before embedding it.
Both branches call JSON.parse without the fallback promised above. Any non-JSON message matched by a custom subscription filter aborts the entire CloudWatch Logs batch, so the documented “any other format still works” behavior does not work; preserve the raw text when parsing fails.
Classify standard Lambda module-load failures correctly
The standard Lambda module-load failures contain Runtime.ImportModuleError and/or Cannot find module; they do not contain “missing on module”. As a result, these failures fall through to the general classifier and are mislabeled instead of being reported as configuration errors.
@dario-fazio : I reviewed the esbuild setup and added a small optimisation to reduce the Lambda bundle size. I haven’t checked if the potential issues flagged by Copilot are valid. Otherwise it looks good to me.
Date#setTime returns the epoch value as a number, so Slack displays values such as 1700000000001 instead of a readable event time. Format the constructed date rather than interpolating the setter's return value.
This issue also appears on line 188 of the same file.
A non-JSON event makes JSON.parse throw and fails the entire CloudWatch Logs batch, despite this handler and its documentation supporting plaintext/custom filter patterns. Fall back to the raw log message when parsing fails so one event cannot block every notification in the batch.
Missing-dependency errors are not classified as configuration errors
This phrase does not match Lambda's missing-dependency errors (Runtime.ImportModuleError: Cannot find module/package ...), so those events are classified only as generic errors rather than configuration errors. Match the actual runtime messages.
this.publishErrorLogsToSlackFunction.functionArn remains a token owned by the construct stack; importing that token into scope still creates the export/import coupling this code says it avoids. Use an ARN built from a retained stable function name and environment, or keep the direct reference and document the dependency.
Format event timestamps instead of returning epoch numbers
Date#setTime returns the epoch millisecond number, so Slack receives values such as 1700000000000 rather than a readable event time. Format the constructed date instead.
This issue also appears in the following locations of the same file:
line 189
line 194
Handle CloudWatch control messages and empty logEvents
CloudWatch Logs can send CONTROL_MESSAGE payloads without data events to verify the destination. Calling .map unconditionally makes that invocation fail and retry; return successfully for control messages or an absent/empty logEvents array.
This issue also appears in the following locations of the same file:
This import still receives functionArn as a token owned by the construct's stack, so a subscription created in another stack retains a CloudFormation export/import dependency despite the comment. Import from a stable physical ARN derived or configured in the consuming stack instead.
Date#setTime returns the numeric epoch value, so Slack displays values such as 1700000000001 rather than a readable event time. Format the timestamp as a date string.
This pattern does not match the standard Lambda import failure text (Cannot find module ...), so those failures fall through to the generic type instead of being labeled as configuration errors. Match the actual runtime phrase here.
General errors emitted by @shiftcode/logger are JSON such as {"level":"ERROR",...}, which this regex does not match. Consequently, alarm enrichment filters out the repository's normal structured error logs and reports “no error logs found.” Include the structured level field in the general-error matcher.
resources: ['*'], // TODO be more restrictive here
}),
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
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.
No description provided.