generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Merged
gcacace
merged 16 commits into
awslabs:main
from
abarkley123:cloudwatch-metric-analysis-enhanced
Nov 5, 2025
Merged
feat(cloudwatch-mcp-server): Add Anomaly Detection Alarm recommendation to AWS CloudWatch MCP server #1454
gcacace
merged 16 commits into
awslabs:main
from
abarkley123:cloudwatch-metric-analysis-enhanced
Nov 5, 2025
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.
gcacace
previously approved these changes
Oct 16, 2025
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1454 +/- ##
==========================================
+ Coverage 89.83% 89.90% +0.06%
==========================================
Files 741 745 +4
Lines 52968 53322 +354
Branches 8512 8551 +39
==========================================
+ Hits 47586 47938 +352
- Misses 3447 3448 +1
- Partials 1935 1936 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gcacace
previously approved these changes
Oct 16, 2025
goranmod
previously approved these changes
Oct 16, 2025
…-server." This reverts commit f2be918.
…-metric-analysis-enhanced
gcacace
previously approved these changes
Oct 16, 2025
goranmod
previously approved these changes
Oct 16, 2025
josephschoi
reviewed
Oct 20, 2025
gcacace
reviewed
Oct 28, 2025
gcacace
approved these changes
Oct 29, 2025
goranmod
approved these changes
Oct 29, 2025
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:
SeasonalDetectorcomponent 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_metricforAWS/DynamoDB/UserErrorsSet the threshold according to the expected write traffic for the DynamoDB tableExample workflow:
analyze_metricforCustomNamespace/MCP/NewMetricget_recommended_metric_alarmsforAWS/EC2/CPUUtilizationChecklist
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.