generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 981
feat(cloudwatch-mcp-server): Add Anomaly Detection Alarm recommendation to AWS CloudWatch MCP server #1454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
abarkley123
wants to merge
7
commits into
awslabs:main
Choose a base branch
from
abarkley123:cloudwatch-metric-analysis-enhanced
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(cloudwatch-mcp-server): Add Anomaly Detection Alarm recommendation to AWS CloudWatch MCP server #1454
abarkley123
wants to merge
7
commits into
awslabs:main
from
abarkley123:cloudwatch-metric-analysis-enhanced
Conversation
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
…tion alarm recommendations - Add MetricAnalyzer with seasonal pattern detection using FFT analysis - Add SeasonalDetector supporting hourly, daily, weekly patterns - Add comprehensive metric analysis including trend, seasonality, and data quality - Generate anomaly detection alarms for seasonal metrics automatically - Fix early return issue for custom metrics without metadata - Fix trend detection bug for flat metrics (zero std deviation) - Add CloudFormation templates and CLI commands for alarm deployment - Add comprehensive test coverage with strengthened assertions - Support both existing metadata recommendations and dynamic analysis SIM: https://i.amazon.com/CWP-13586 cr: https://code.amazon.com/reviews/CR-223169200
…tion alarm recommendations
1b5a74c
to
f6f39bc
Compare
gcacace
requested changes
Oct 6, 2025
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Outdated
Show resolved
Hide resolved
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Show resolved
Hide resolved
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Outdated
Show resolved
Hide resolved
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Outdated
Show resolved
Hide resolved
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Outdated
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/seasonal_detector.py
Outdated
Show resolved
Hide resolved
...rver/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/templates/anomaly_detection_alarm.json
Outdated
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/tools.py
Outdated
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/tools.py
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/tools.py
Outdated
Show resolved
Hide resolved
… template generation, add input validation, improve naming conventions, and reorganize constants
gcacace
requested changes
Oct 10, 2025
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Outdated
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/tools.py
Outdated
Show resolved
Hide resolved
goranmod
reviewed
Oct 10, 2025
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Show resolved
Hide resolved
...server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/cloudformation_template_generator.py
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/metric_analyzer.py
Outdated
Show resolved
Hide resolved
src/cloudwatch-mcp-server/awslabs/cloudwatch_mcp_server/cloudwatch_metrics/tools.py
Outdated
Show resolved
Hide resolved
…rovements and refactor of trend identification algorithm.
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.
feat(cloudwatch-mcp-server): Add Anomaly Detection Alarm recommendation to AWS CloudWatch MCP server
Summary
This PR enhances the CloudWatch MCP server with a new metric analysis tool, allowing customers to better understand their metrics. The existing alarm recommendation system leverages these new metric analysis capabilities, allowing the tool to provide CloudWatch Anomaly Detection Alarm recommendations. These Anomaly Detection alarm recommendations also come with CloudFormation templates to make customer's lives easier when onboarding.
Changes
This PR enhances the server with metric analysis tooling and enhanced alarm recommendation capabilities:
Architecture:
Anomaly Detection Alarm Recommendations:
Metric Analyser:
SeasonalDetector
component using STL decomposition to detect multiple patterns (e.g. hourly, daily, weekly)testing
coefficient of variation
CloudFormation Template Generation:
User experience
Before this change:
After this change:
Intelligent Metric Analysis: Users can analyze any CloudWatch metric to understand its behavior patterns, including:
Metric characteristic based Alarm Recommendations: The server automatically recommends:
CloudFormation templates: Users receive:
Example workflow (backwards compatible):
analyze_metric
forAWS/DynamoDB/UserErrors
Set the threshold according to the expected write traffic for the DynamoDB table
Example workflow:
analyze_metric
forCustomNamespace/MCP/NewMetric
get_recommended_metric_alarms
forAWS/EC2/CPUUtilization
Checklist
Is this a breaking change? N
The changes maintain backward compatibility. All existing CloudWatch MCP server functionality remains unchanged. New analysis and recommendation capabilities are additive enhancements.
RFC issue number: 1453
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.