feat: default list_alerts to active alerts only
Change list_alerts (MCP tool) and alerts (CLI command) to show only active (non-silenced, non-inhibited) alerts by default. Add state=all option and --all CLI flag to show all alerts when needed. - MCP: list_alerts with no state param now returns active alerts only - MCP: list_alerts with state=all returns all alerts (previous default) - CLI: alerts command defaults to active, --all shows everything - Add tests for new default behavior and state=all option - Update README with new CLI examples - Bump version to 0.3.0 - Clarify version bumping rules in CLAUDE.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -244,9 +244,10 @@ hm-options get programs.git.enable
|
||||
**Lab Monitoring CLI:**
|
||||
|
||||
```bash
|
||||
# List alerts
|
||||
# List alerts (defaults to active only)
|
||||
lab-monitoring alerts
|
||||
lab-monitoring alerts --state active
|
||||
lab-monitoring alerts --all # Include silenced/inhibited alerts
|
||||
lab-monitoring alerts --state all # Same as --all
|
||||
lab-monitoring alerts --severity critical
|
||||
|
||||
# Execute PromQL queries
|
||||
@@ -341,7 +342,7 @@ hm-options -d "sqlite://my.db" index hm-unstable
|
||||
|
||||
| Tool | Description |
|
||||
|------|-------------|
|
||||
| `list_alerts` | List alerts with optional filters (state, severity, receiver) |
|
||||
| `list_alerts` | List alerts with optional filters (state, severity, receiver). Defaults to active alerts only; use state=all to include silenced/inhibited |
|
||||
| `get_alert` | Get full details for a specific alert by fingerprint |
|
||||
| `search_metrics` | Search metric names with substring filter, enriched with metadata |
|
||||
| `get_metric_metadata` | Get type, help text, and unit for a specific metric |
|
||||
|
||||
Reference in New Issue
Block a user