Skip to content

Comments

feat: Add prometheus.createSilence and prometheus.expireSilence#3219

Open
samuel-asleep wants to merge 2 commits intosuperplanehq:mainfrom
samuel-asleep:1/2-prometheus
Open

feat: Add prometheus.createSilence and prometheus.expireSilence#3219
samuel-asleep wants to merge 2 commits intosuperplanehq:mainfrom
samuel-asleep:1/2-prometheus

Conversation

@samuel-asleep
Copy link
Contributor

@samuel-asleep samuel-asleep commented Feb 22, 2026

Implements two new Prometheus Alertmanager action components for managing silences in workflows.

Backend (pkg/integrations/prometheus/)

  • client.go: Added CreateSilence(SilencePayload) (string, error) (POST /api/v2/silences) and ExpireSilence(silenceID string) error (DELETE /api/v2/silence/{silenceID}). Refactored execRequest to delegate to new execRequestWithBody which sets Content-Type: application/json for requests with a body. Added Matcher, SilencePayload, and silenceResponse structs aligned with the Alertmanager OpenAPI spec (isRegex required, isEqual optional with default true).
  • create_silence.go: Validates matchers (non-empty, name+value required), parses duration via time.ParseDuration, computes startsAt = now / endsAt = now + duration in RFC3339, emits prometheus.silence payload, stores CreateSilenceNodeMetadata{SilenceID}.
  • expire_silence.go: Accepts silenceID (supports expressions for workflow chaining), calls ExpireSilence, emits prometheus.silence.expired payload, stores ExpireSilenceNodeMetadata{SilenceID}.
  • prometheus.go: Registered both components in Components().
  • example.go + JSON files: Added embedded example outputs for both components.

Frontend (web_src/src/pages/workflowv2/mappers/prometheus/)

  • create_silence.ts: Node metadata shows silence ID (bell-off) and matcher count; execution details show full silence info.
  • expire_silence.ts: Node metadata shows silence ID (bell); execution details show ID and status.
  • index.ts: Registered both mappers and added eventStateRegistry entries ("created", "expired").
  • types.ts: Added CreateSilenceConfiguration, ExpireSilenceConfiguration, PrometheusSilencePayload, and PrometheusMatcher interfaces.

Demo Video

2026-02-22.12-59-59.mp4

partially implements #3083 will create a second pr to complete it

samuel-asleep and others added 2 commits February 22, 2026 13:09
Signed-off-by: Akinniranye Samuel Tomiwa <benneu40@gmail.com>
Signed-off-by: Akinniranye Samuel Tomiwa <bennueu40@gmail.com>
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.

1 participant