Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alerting: Add alert instance picker #67138

Merged
merged 51 commits into from
Apr 28, 2023

Conversation

VikaCep
Copy link
Contributor

@VikaCep VikaCep commented Apr 24, 2023

What is this feature?

Adds an instance picker to allow users to select active alerts to add to their template payload.

Why do we need this feature?

To provide ease of use when creating new templates.

Who is this feature for?

All users

2023-04-26 16 39 10

@VikaCep VikaCep self-assigned this Apr 24, 2023
@soniaAguilarPeiron soniaAguilarPeiron force-pushed the alerting/templates-preview branch 2 times, most recently from 15696fd to b50bdb4 Compare April 25, 2023 10:25
@VikaCep VikaCep force-pushed the alerting/templates-preview-instance-picker branch 2 times, most recently from 129ada7 to 183ede6 Compare April 25, 2023 22:01
@VikaCep VikaCep marked this pull request as ready for review April 25, 2023 22:03
@VikaCep VikaCep requested a review from a team as a code owner April 25, 2023 22:03
@soniaAguilarPeiron
Copy link
Member

soniaAguilarPeiron commented Apr 26, 2023

I reviewed and tested locally and it looks great @VikaCep ! 🙌

@VikaCep VikaCep force-pushed the alerting/templates-preview-instance-picker branch from 2f9e51e to 93f0f3d Compare April 26, 2023 20:02
@VikaCep VikaCep added this to the 10.0.0 milestone Apr 26, 2023
@VikaCep VikaCep added no-backport Skip backport of PR no-changelog Skip including change in changelog/release notes labels Apr 26, 2023
@soniaAguilarPeiron soniaAguilarPeiron force-pushed the alerting/templates-preview branch 2 times, most recently from 5f4463c to 6c9206c Compare April 27, 2023 13:39
@soniaAguilarPeiron soniaAguilarPeiron requested review from a team as code owners April 27, 2023 13:39
@VikaCep VikaCep force-pushed the alerting/templates-preview-instance-picker branch from 93f0f3d to 0ae8c93 Compare April 27, 2023 13:45
@VikaCep VikaCep requested review from konrad147 and removed request for a team April 27, 2023 19:25
Copy link
Member

@soniaAguilarPeiron soniaAguilarPeiron left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀🎉

Copy link
Contributor

@konrad147 konrad147 left a comment

Choose a reason for hiding this comment

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

Nice! 🚀 I left one non-blocking nit

@VikaCep VikaCep force-pushed the alerting/templates-preview-instance-picker branch from 5020065 to c38de10 Compare April 28, 2023 12:24
Base automatically changed from alerting/templates-preview to main April 28, 2023 15:05
@VikaCep VikaCep added add to changelog add to what's new and removed no-changelog Skip including change in changelog/release notes labels Apr 28, 2023
@VikaCep VikaCep merged commit 7338164 into main Apr 28, 2023
12 checks passed
@VikaCep VikaCep deleted the alerting/templates-preview-instance-picker branch April 28, 2023 15:58
ryantxu pushed a commit that referenced this pull request May 3, 2023
* Add Preview template and payload editor to templates form

* Add TemplatePreview test and update css

* Preview errors for each template that is wrong

* Enable preview templating only for Grafana Alert Manager

* Use harcoded default payload instead of requesting it to the backend

* Update error response in the api definition

* Add spinner when loading result for preview

* Update api request followind DD changes

* Use pre instead of TextArea to render the preview

* Fix tests

* Add alert list editor

* Add start and end time for alert generator

* Add preview for data list added in the modal

* Update copies and move submit button in alert generator to the bottom

* Copy updates

* Refactor

* Use tab instead of button to preview

* Move payload editor next to the content

* Copy update

* Refactor

* Adress PR review comments

* Fix wrong json format throwing an exception when adding more data

* Use monaco editor for payload

* Only show text 'Preview for...'  when we have more than one define

* Fix some errors

* Update CollapseSection style

* Add tooltip for the Payload info icon explaining the available list of alert data fields in preview

* Set payload as invalid if it's not an array

* Fix test

* Update text in AlertTemplateDataTable

* Add separators to distinguish lines that belong to the preview

* Use harcoded default payload instead of requesting it to the backend

* Add alert instance picker

* Add rule search capability and cleanup

* Display alert instance extra information on hover

* Rebase and integrate with existing view

* Display folder under rule name

* Display unique labels for alert instances

* Remove unneeded interface

* Reset state after closing the modal

* Refactor useEffect and useMemo

* Move common code to variable

* Refactor to avoid setting filtered rules as state

* Disable instance selector button when there are errors in the payload

* Validate payload on button click

* Change warning text

* Add support for state filters in alertmanager alerts request

* Use RTK Query to fetch alert instances

* Address review comments

* Fix lint

---------

Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
@zerok zerok modified the milestones: 10.0.0, 10.0.0-preview May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants