Skip to content

feat: migrate Prometheus plugin from Alertmanager API v1 to v2 - #420

Merged
satterly merged 7 commits into
masterfrom
feat/prometheus-api-v2
Mar 29, 2026
Merged

satterly merged 7 commits into
masterfrom
feat/prometheus-api-v2

Conversation

@satterly

Copy link
Copy Markdown
Member

Summary

  • Replace all /api/v1/ endpoints with /api/v2/ (silences, alerts, silence delete)
  • Add required isRegex field to silence matchers (v2 API requires this)
  • Fix silence response parsing for v2 format ({"silenceID": "..."} at top level instead of {"status":"success","data":{"silenceId":...}})

Alertmanager deprecated API v1 in 0.16.0 and removed it entirely in 0.28.0, returning HTTP 410 for all v1 requests.

Fixes #407
Supersedes #410

Test plan

  • Verify ack creates a silence via /api/v2/silences
  • Verify unack deletes a silence via /api/v2/silence/<id>
  • Verify close expires alert via /api/v2/alerts
  • Verify silenceId is correctly parsed from v2 response and stored in alert attributes

🤖 Generated with Claude Code

satterly and others added 7 commits March 29, 2026 18:21
- Replace all /api/v1/ endpoints with /api/v2/
- Add required isRegex field to silence matchers
- Fix silence response parsing for v2 format (silenceID at top level)

Fixes #407

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify API v2 endpoints, request/response formats, silence lifecycle,
and parse_duration helper. Response formats based on Alertmanager
OpenAPI spec: https://github.com/prometheus/alertmanager/blob/main/api/v2/openapi.yaml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Note API v2 requirement and Alertmanager version compatibility
- Add settings table with all configuration options
- Update troubleshooting logs to show v2 response format
- Update references to include OpenAPI spec
- Clean up clustered Alertmanager documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Breaking change: requires Alertmanager >= 0.16.0 (API v2).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove os.environ setup before imports and patch module-level
ALERTMANAGER_SILENCE_FROM_ACK in the test instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@satterly
satterly merged commit 07dc883 into master Mar 29, 2026
8 checks passed
@satterly satterly mentioned this pull request Mar 29, 2026
5 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alertmanager - API v2

1 participant