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 Alerting menu in getPanelMenu #76618

Merged
merged 13 commits into from
Oct 18, 2023

Conversation

soniaAguilarPeiron
Copy link
Member

@soniaAguilarPeiron soniaAguilarPeiron commented Oct 16, 2023

What is this feature?

When it comes to exploration, creating an alert rule from a panel can be quite challenging to find and use.

This PR adds the capability to create an alert from a dashboard Panel, allowing it to be done from the ...More subMenu.

The logic to render or not this menu will be having unified alerting enabled in config and the right permissions to update alerts.

It will be possible to create an alert from any panel type. BUT we only allow creating an alert from any type of panel. So , users can re-use a panel query for creating an alert.

Panel Behavior Remains Unchanged:

It's important to note that this change does not alter the behavior of the panels themselves. Panels continue to operate in their usual way, and this feature merely extends the alerting capabilities, making it easier for users to set up alerts directly from their dashboard.

This feature will provide greater flexibility to users. It allows the creation of alerts from any type of panel, enabling users to leverage existing panel queries to set up alerting.

Why do we need this feature?

Users need to easily create an alert from any panel.

Who is this feature for?

All users.

Which issue(s) does this PR fix?:

Fixes https://github.com/grafana/alerting-squad/issues/638

Special notes for your reviewer:

alert-from.-panel-7.mp4

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@soniaAguilarPeiron soniaAguilarPeiron added this to the 10.2.x milestone Oct 16, 2023
@soniaAguilarPeiron soniaAguilarPeiron requested a review from a team October 16, 2023 11:49
@soniaAguilarPeiron soniaAguilarPeiron self-assigned this Oct 16, 2023
@soniaAguilarPeiron soniaAguilarPeiron requested a review from a team as a code owner October 16, 2023 11:49
@soniaAguilarPeiron soniaAguilarPeiron requested review from dprokop and kaydelaney and removed request for a team October 16, 2023 11:49
@soniaAguilarPeiron soniaAguilarPeiron modified the milestones: 10.2.x, 10.3.x Oct 16, 2023
@soniaAguilarPeiron
Copy link
Member Author

/deploy-to-hg

@ephemeral-instances-bot
Copy link

  • Preparing your instance. A comment containing your instance's url will be added to this PR when the instance is ready.
  • Your instance will be ready in ~10 minutes.
  • Check the GitHub actions tab to follow the workflow progress
  • Slack channel: #proj-ephemeral-hg-instances
  • Building instance with alerting/add-alerting-in-panel-menu oss branch and main enterprise branch. How to choose a branch

@soniaAguilarPeiron soniaAguilarPeiron force-pushed the alerting/add-alerting-in-panel-menu branch 2 times, most recently from f65674f to 30451b6 Compare October 16, 2023 12:03
@ephemeral-instances-bot
Copy link

@soniaAguilarPeiron soniaAguilarPeiron requested a review from a team as a code owner October 16, 2023 13:06
@soniaAguilarPeiron soniaAguilarPeiron requested review from Clarity-89 and JoaoSilvaGrafana and removed request for a team October 16, 2023 13:06
@grafana grafana deleted a comment from ephemeral-instances-bot bot Oct 16, 2023
@grafana grafana deleted a comment from ephemeral-instances-bot bot Oct 16, 2023
@soniaAguilarPeiron soniaAguilarPeiron force-pushed the alerting/add-alerting-in-panel-menu branch from dc3b979 to 2f8c051 Compare October 17, 2023 08:24
@soniaAguilarPeiron soniaAguilarPeiron requested a review from a team as a code owner October 17, 2023 11:12
@soniaAguilarPeiron soniaAguilarPeiron force-pushed the alerting/add-alerting-in-panel-menu branch 2 times, most recently from 6e8e7a8 to 0e3ba6b Compare October 17, 2023 17:47
@soniaAguilarPeiron soniaAguilarPeiron force-pushed the alerting/add-alerting-in-panel-menu branch from 0e3ba6b to 39fc333 Compare October 18, 2023 06:38
soniaAguilarPeiron and others added 2 commits October 18, 2023 13:19
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
…r and rename it to getCreateAlertInMenuAvailability
@soniaAguilarPeiron soniaAguilarPeiron enabled auto-merge (squash) October 18, 2023 12:10
@soniaAguilarPeiron soniaAguilarPeiron merged commit 1de65bb into main Oct 18, 2023
15 checks passed
@soniaAguilarPeiron soniaAguilarPeiron deleted the alerting/add-alerting-in-panel-menu branch October 18, 2023 12:13
@mckn
Copy link
Contributor

mckn commented Oct 19, 2023

This would have been a perfect use case for UI extensions. We could have added it by adding a configuration for the panel menu item extension. See example on how explore does it.

https://github.com/grafana/grafana/blob/main/public/app/features/plugins/extensions/getCoreExtensionConfigurations.ts#L4C1-L4C1

The benefits of doing it this way is that you get a clean contract between the dashboard and alert domain. The extending part (Alerting in this case) can decide when the extension should be visible by registering a configuration function.

Please see this documentation for more information: https://grafana.com/developers/plugin-tools/ui-extensions/

@soniaAguilarPeiron
Copy link
Member Author

Thank you, @mckn, for your suggestion. We aim to enable users to create alerts from any panel, allowing them to reuse queries.
Your idea could be valuable when we consider incorporating these alerts into specific panel visualizations.

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