Skip to content

feat(atlas): implement comprehensive MongoDB Atlas alerting system#3

Merged
d-teller merged 2 commits into
mainfrom
feat/alerting
Aug 30, 2025
Merged

feat(atlas): implement comprehensive MongoDB Atlas alerting system#3
d-teller merged 2 commits into
mainfrom
feat/alerting

Conversation

@d-teller
Copy link
Copy Markdown
Contributor

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

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
@d-teller d-teller merged commit e500d2b into main Aug 30, 2025
17 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants