Skip to content

Commit e500d2b

Browse files
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

.github/workflows/release.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,6 @@ jobs:
3434
with:
3535
go-version: ${{ env.GO_VERSION }}
3636

37-
- name: Cache Go Modules
38-
uses: actions/cache@v4
39-
with:
40-
path: |
41-
~/go/pkg/mod
42-
~/.cache/go-build
43-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
44-
restore-keys: |
45-
${{ runner.os }}-go-
46-
4737
- name: Clean Go Module Cache (prevent lint issues)
4838
run: go clean -modcache || true
4939

@@ -191,16 +181,6 @@ jobs:
191181
with:
192182
go-version: ${{ env.GO_VERSION }}
193183

194-
- name: Cache Go Modules
195-
uses: actions/cache@v4
196-
with:
197-
path: |
198-
~/go/pkg/mod
199-
~/.cache/go-build
200-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
201-
restore-keys: |
202-
${{ runner.os }}-go-
203-
204184
- name: Build Binary
205185
env:
206186
GOOS: ${{ matrix.goos }}

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
11
## [Unreleased]
22

33
### Added
4+
- **MongoDB Atlas Alerting System**: Complete alert configuration and management system
5+
- Alert configuration CLI commands (`matlas atlas alert-configurations list/get/delete/matcher-fields`)
6+
- Alert management CLI commands (`matlas atlas alerts list/get/acknowledge`)
7+
- AlertConfiguration and Alert YAML kinds for ApplyDocument support
8+
- 11 notification channel types: EMAIL, SMS, SLACK, PAGER_DUTY, OPS_GENIE, DATADOG, MICROSOFT_TEAMS, WEBHOOK, USER, GROUP, TEAM
9+
- 8 alert matcher operators: EQUALS, NOT_EQUALS, CONTAINS, NOT_CONTAINS, STARTS_WITH, ENDS_WITH, REGEX, NOT_REGEX
10+
- Metric-based and general threshold configurations with AVERAGE/TOTAL modes
11+
- Comprehensive alert validation with field and type checking
12+
- Alert configuration examples for basic, comprehensive, notification channels, and threshold patterns
13+
- Alert lifecycle test suite with proper cleanup and baseline integrity verification
414
- Advanced Atlas Search features support with CLI and YAML interfaces
15+
16+
### Changed
17+
- Removed Go module caching from CI pipeline to resolve "Cannot open: File exists" errors on main branch builds
518
- Search Index Analyzers configuration and management
619
- Faceted Search functionality for string, number, and date facets
720
- Autocomplete functionality with fuzzy matching support

0 commit comments

Comments
 (0)