Commit e500d2b
feat(atlas): implement comprehensive MongoDB Atlas alerting system (#3)
* feat(atlas): implement comprehensive MongoDB Atlas alerting system
Add complete alert configuration and management capabilities with both CLI
and YAML ApplyDocument support. This feature provides critical monitoring
and notification functionality for MongoDB Atlas infrastructure.
BREAKING CHANGE: None - This is a new feature addition.
- `matlas atlas alerts list/get/acknowledge` - Alert monitoring and management
- `matlas atlas alert-configurations list/get/delete/matcher-fields` - Configuration CRUD operations
- AlertConfiguration kind for declarative alert management
- Alert kind for read-only alert status information
- Full ApplyDocument integration with validation
- EMAIL, SMS, SLACK, PAGER_DUTY, OPS_GENIE, DATADOG
- MICROSOFT_TEAMS, WEBHOOK, USER, GROUP, TEAM
- EQUALS, NOT_EQUALS, CONTAINS, NOT_CONTAINS
- STARTS_WITH, ENDS_WITH, REGEX, NOT_REGEX
- MetricThreshold: CPU, memory, disk usage with AVERAGE/TOTAL modes
- GeneralThreshold: Simple numeric thresholds for events
- AlertsService: Alert operations (list, get, acknowledge)
- AlertConfigurationsService: Full CRUD for alert configurations
- Bidirectional conversion between internal and Atlas SDK types
- AlertConfig: Complete configuration structure
- AlertMatcher: Rule-based targeting system
- AlertNotification: Multi-channel notification support
- AlertMetricThreshold/AlertThreshold: Flexible threshold system
- Comprehensive field validation and type checking
- Enum validation for operators and notification types
- Range validation for thresholds and numeric fields
- internal/types/apply.go: Added KindAlert and KindAlertConfiguration
- internal/types/config.go: Alert configuration type definitions
- internal/services/atlas/alerts.go: Alert operations service
- internal/services/atlas/alert_configurations.go: Configuration service
- internal/apply/validation.go: Alert validation functions
- cmd/atlas/alerts/alerts.go: Alert management commands
- cmd/atlas/alerts/alert_configurations.go: Configuration commands
- cmd/atlas/atlas.go: Integration with main atlas command
- docs/alerts.md: Complete alerting documentation
- docs/examples/alerts.md: Usage examples and patterns
- examples/alert-*.yaml: 4 comprehensive example configurations
- features/2025-08-30-alerting-system.md: Feature specification
- scripts/test/alerts-lifecycle.sh: Comprehensive test suite
- .github/workflows/release.yml: Updated CI configuration
- Alert configuration CRUD operations
- All notification channel types and matcher operators
- Threshold configurations and validation
- YAML parsing and ApplyDocument integration
- Error handling and edge cases
- Baseline integrity verification
- Atlas Go SDK AlertConfigurationsApi and AlertsApi
- Full matlas infra apply/plan/diff/validate support
- Consistent CLI patterns and output formatting
- Environment variable support for sensitive credentials
Closes: Related to monitoring and alerting infrastructure requirements
Refs: Feature specification in features/2025-08-30-alerting-system.md
* fix: fmt
---------
Co-authored-by: Danny Teller <danny.teller@tipalti.com>1 parent f9b8aef commit e500d2b
26 files changed
Lines changed: 5628 additions & 123 deletions
File tree
- .github/workflows
- cmd/atlas
- alerts
- docs
- examples
- examples
- features
- internal
- apply
- services/atlas
- types
- scripts
- test
- tracking
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 37 | | |
48 | 38 | | |
49 | 39 | | |
| |||
191 | 181 | | |
192 | 182 | | |
193 | 183 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | 184 | | |
205 | 185 | | |
206 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
5 | 18 | | |
6 | 19 | | |
7 | 20 | | |
| |||
0 commit comments