Skip to content

feat: add grafana alert control#3897

Merged
forestileao merged 21 commits intosuperplanehq:mainfrom
WashingtonKK:feat/grafana-alert-control
Apr 13, 2026
Merged

feat: add grafana alert control#3897
forestileao merged 21 commits intosuperplanehq:mainfrom
WashingtonKK:feat/grafana-alert-control

Conversation

@WashingtonKK
Copy link
Copy Markdown
Collaborator

@WashingtonKK WashingtonKK commented Apr 1, 2026

Closes: #3885

This expands the Grafana integration by adding the following alert control components:

  • grafana.listSilences (Action)
  • grafana.getSilence (Action)
  • grafana.createSilence (Action)
  • grafana.deleteSilence (Action)

Demo Video


Note

Medium Risk
Adds new Grafana Alertmanager silence CRUD capabilities (create/list/get/delete) across backend client, workflow components, resource listing, and UI mappers; main risk is correctness of new API interactions/time parsing and resource selection metadata.

Overview
Adds first-class Grafana Alertmanager silence control to workflows: new grafana.createSilence, grafana.listSilences, grafana.getSilence, and grafana.deleteSilence actions, plus resource-picker support via a new silence integration resource type.

Extends the Grafana HTTP client with silence models and ListSilences/GetSilence/CreateSilence/DeleteSilence calls (including robust create-response ID parsing), and wires these into execution outputs/events and setup-time metadata (including building Grafana UI URLs and a sanitized createdBy).

Updates the workflow UI mappers/state badges to render silence actions (and refactors shared Grafana base props), adds examples/tests, and expands docs/components/Grafana.mdx to document the new silence actions.

Reviewed by Cursor Bugbot for commit 827ebc2. Bugbot is set up for automated code reviews on this repo. Configure here.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/client.go Outdated
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/create_silence.ts
Comment thread pkg/integrations/grafana/grafana.go
…es and removing redundant code

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
… specifications and enhancing metadata resolution

- Updated Setup methods in DeleteSilence and GetSilence to validate specifications before resolving metadata.
- Enhanced delete_silence and get_silence mappers to include silence selection metadata.
- Modified list_silences mapper to incorporate filter metadata for improved functionality.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
…ypes

- Changed the 'startsAt' and 'endsAt' fields from string to expression types for better flexibility.
- Updated default values and placeholders to use dynamic expressions.
- Simplified descriptions for clarity.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
…and output fields

- Added support for evaluating bare and template expressions for 'startsAt' and 'endsAt' in silence creation.
- Updated CreateSilenceOutput to include 'startsAt' and 'endsAt' fields in the response.
- Modified mappers to display 'startsAt' and 'endsAt' in the output details.
- Improved the configuration descriptions for better clarity on accepted formats.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
… fields

- Changed 'startsAt' and 'endsAt' fields in the silence creation configuration from expression types to string types for improved clarity and usability.
- Updated the response structure to include 'startsAt' and 'endsAt' timestamps in the silence creation output.
- Added tests to ensure proper handling of time string inputs and validate configuration field types.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@AleksandarCole AleksandarCole added the pr:stage-3/3 Ready for full, in-depth, review label Apr 9, 2026
- Introduced helper functions to build and apply silence details, improving code readability and maintainability.
- Consolidated logic for handling timestamps and output fields, ensuring consistent formatting and configuration handling.
- Removed redundant code and improved the structure of the getExecutionDetails method.

Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread pkg/integrations/grafana/client.go
Comment thread pkg/integrations/grafana/client.go
Comment thread pkg/integrations/grafana/delete_silence.go Outdated
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Comment thread web_src/src/pages/workflowv2/mappers/grafana/query_data_source.ts
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9982573. Configure here.

Comment thread pkg/integrations/grafana/query_data_source.go
Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
@forestileao forestileao merged commit 41ef849 into superplanehq:main Apr 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:stage-3/3 Ready for full, in-depth, review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Grafana] Expand - Alert Control

3 participants