feat(aws/logs): MetricFilter resource — log patterns as alertable metrics - #879
Closed
zeyuri wants to merge 1 commit into
Closed
feat(aws/logs): MetricFilter resource — log patterns as alertable metrics#879zeyuri wants to merge 1 commit into
zeyuri wants to merge 1 commit into
Conversation
Contributor
Author
|
Closing — superseded by #797, which landed a generated |
Contributor
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.
Adds
AWS.Logs.MetricFilter— the CloudWatch Logs primitive that turns matching log lines into a custom metric. The Logs family currently has onlyLogGroup, so today a stack can create the group but not the filter that makes its contents alertable.The use case — alerting on a crash-loop that emits no metric
Our production agent cluster (a long-running service on ECS-on-EC2) has one failure mode that produces no metric at all: the process crashes during boot, logs the failure, and the orchestrator restarts it — CPU/memory look healthy, request metrics just flatline. The only signal is a log line. The standard AWS answer is a metric filter:
The full chain (log line → metric → alarm → notification) has been how we catch cluster crash-loops in production since June; the filter was the one link that couldn't be declared upstream.
Behavior
putMetricFilteris create-or-update keyed by(logGroupName, filterName); the diff models that — name or log-group change forces replacement, pattern/transformation changes update in place.deleteMetricFilter, tolerating not-found.list()viadescribeMetricFilters, followingLogGroup's conventions.Ported from a vendored resource running this exact alerting chain in production.