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

[FEATURE request] Play Sound on alert activation #6778

Closed
7lives83 opened this issue Dec 1, 2016 · 121 comments
Closed

[FEATURE request] Play Sound on alert activation #6778

7lives83 opened this issue Dec 1, 2016 · 121 comments

Comments

@7lives83
Copy link

7lives83 commented Dec 1, 2016

Hello,

it would be great if there is an option to play a sound after a alerting rules activate.
Maybe an activation field in the alter tab, where you can choose between 2 or 3 sounds?

think this would be a great feature :)

Greets,
Max

Edit 07/11/2019: Viniston and I wrote a function to alert ( look in comments: #6778 (comment) )

Thank you very much to Viniston :-)

@flyersa
Copy link

flyersa commented Dec 1, 2016

where is the problem? Just add yourself a webhook to play the sound using the webhook alerting feature ;)

@7lives83
Copy link
Author

7lives83 commented Dec 2, 2016

@flyersa

hey fly,
never worked with webhooks before. any suggestion where to start? :)

@b22sk2
Copy link

b22sk2 commented May 15, 2017

pls show me some example if you played sound

@bluefish6
Copy link

+1 for out of the box functionality for sound on new alert in the browser

@JohnHaan
Copy link

JohnHaan commented Aug 2, 2017

+1 I hope so too

@diegocanton
Copy link

+1

@noger-one
Copy link

It will be very helpfull

@buiductri
Copy link

I think it will be a good function too. Since I am really needing it right now. 🤣 🤣 🤣

@kelvinzhaohr
Copy link

has play sound function been implement?

@maresende
Copy link

Please implement this!!!!!

@movergan
Copy link

+1

1 similar comment
@PaulF1nch
Copy link

+1

@HairyDuck
Copy link

+1

1 similar comment
@rafaelquiintella
Copy link

+1

@bergquist
Copy link
Contributor

After some internal discussions, we agreed that this is not something we want to support in core Grafana. But since Grafana has support for panel plugins it's possible to develop a new plugin that extends the alert list panel or a new plugin for playing alert sounds.

@HairyDuck
Copy link

But you support Alerts! How hard is it to play a .wav when the panel is flashing?

@buiductri
Copy link

buiductri commented Sep 11, 2018

I think he has the point, it should be supported in the panel, and I think that is what we asked for, not the Grafana core but the panels one. Most of us are using the default panels anyway.

@movergan
Copy link

We need it too! +1

@RestfulBlue
Copy link

@bergquist how about alerting using desktop notification when?

@HairyDuck
Copy link

REOPEN Feature request. A new year, fresh eyes. Please.

@haooliveira84
Copy link

+1

2 similar comments
@jeromesangelee
Copy link

+1

@petrasl1976
Copy link

+1

@marcin-jedynski
Copy link

+1
definitely wanted feature,
maybe extension of Grafana Alerting API with combination of POST webhook would be a good aproach ?

@lucavignali
Copy link

+1
When the Grafana dashboard is projected in a Control Room, NOC, SOC.... together with other Monitors, it is valuable to have sounds when Grafana alert occurs.

@ghost
Copy link

ghost commented Jan 18, 2022

Hi, @viniston. I found the issue. In my grafana 8.2.7 there is still div in alert class, not section.

@viniston
Copy link

@vitalii-ludanenkov I am glad you found the issue and were able to activate the sound alert. I hope it helps.

@iimamudd
Copy link

iimamudd commented Feb 28, 2022

Can someone please help me with the latest index.html file which can be supported in Grafana v8.2.7. Also, Can we use this functionality in Grafana Open source as well or it is just for Enterprise version. Thanks !!

@lptarik
Copy link

lptarik commented Mar 22, 2022

Hello I am using Grafana v8.3.3 . How can i understand that i am using section or div class and how can i test it ? I click on sounds but i don't hear anything. Also In Grafana I should create alert rules for that right?
Thanks

@viniston
Copy link

@lptarik Yes, alerts must be configured. If you need assistance with this, please feel free to contact me by email. I can assist you.

@viniston
Copy link

@iimamudd The hack is only possible with the enterprise edition of Grafana.

@lptarik
Copy link

lptarik commented Mar 22, 2022

@viniston Thank you but we are using community edition.Probably that's why It's not working. But why it must be enterpise edition?:)

@elderwann
Copy link

elderwann commented Apr 19, 2023

Hello, I tried to implement this update to the grafana 9.2.4 version (entreprise edition for Debian 11) , /usr/share/grafana/public/views is stored the index.html file. But concerning the module.ts file ?
I was into /usr/share/grafana/public/app/plugins/panel/alertlist/ and module file is not a .ts file but a .tsx file.

@MatheusMayor
Copy link

Hello friends, I have a dasbord that integrates with a zabbix API. I need to have sound alerts on the browser page of this dasbord.
This script that you put here, do I change it in the entire JSON?
Is it possible to implement this sound alert in Grafana open source?

@grobinson-grafana
Copy link
Contributor

Hi! 👋

This is an interesting request as in newer versions of Grafana, Grafana Managed Alerts separates the evaluation of alert rules from the grouping and notification of alerts into two separate systems. These are usually referred to as the Alert Generator and the Alert Receiver. In Grafana, the Alert Generator evaluates alert rules and determines which alert rules are firing and which are not, while the Alert Receiver is an embedded version of the Prometheus Alertmanager that decides grouping and the sending of notifications.

If we were to play sounds in Grafana when the alert is fired, it would happen at different times from notifications, as the Alertmanager has it's own grouping and timing rules based around notification policies. I'm not sure having sounds play at different times from notifications is desirable behavior.

The other question I have is how many of you are asking for a sound notification because you show Grafana on a big screen? And if you aren't showing Grafana on a big screen, have you considered using paging systems such as Grafana on-call, Pagerduty or something else? If so, what was wrong with those? If you haven't considered using such a system could you maybe share why so I can better understand all of the relevant use cases?

Thanks!

@MatheusMayor
Copy link

But it would be very interesting if there was a SOUND ALERT.
Today there is no such thing.
Is it too impossible to make this real?
This port is from 2016 and since then the GRAFANA team did not come up with plausible arguments for not having this tool.
Communication asks for this in time :(

@grobinson-grafana
Copy link
Contributor

In general it's much better to use incident response like Grafana OnCall or Pagerduty (other vendors are available too, and most vendors offer free tiers too). You'll be able to get a call, push notification or SMS to your cell phone whenever an alert fires. All of these vendors go to great effort to make sure that you receive every call, push notification and SMS message.

If using incident response is not viable for whatever reason, and there is still a lot of demand for this feature, it seems like it would be best built as a community panel plugin that keeps track of alerts in the browser and plays a sound whenever it sees a new alert. I'm afraid it doesn't make much sense for it to be a core Grafana feature as it doesn't fit well with how alert notifications work in Alertmanager.

@antdef
Copy link

antdef commented Oct 19, 2023

how many of you are asking for a sound notification because you show Grafana on a big screen ?

We do.

And surely a sound alert would be the perfect moment to congrats each member of the team for a great collective achievement, not only visible on our huge screen, but also audible.
A typical use case would be to make everybody in the room aware (and happy) that our intraday activity (monitored with grafana) has reached a given target level.
We would not achieve that with various personal devices receiving notification at random times ...

@grobinson-grafana
Copy link
Contributor

We do.

And surely a sound alert would be the perfect moment to congrats each member of the team for a great collective achievement, not only visible on our huge screen, but also audible. A typical use case would be to make everybody in the room aware (and happy) that our intraday activity (monitored with grafana) has reached a given target level. We would not achieve that with various personal devices receiving notification at random times ...

Thanks for sharing your use case! It's very interesting to hear that you are using Grafana Alerting to alert on positive data (i.e. hitting a sales target or something like it). I would love to know how many other people are also using Grafana Alerting in this way, as typically Grafana Alerting is used to alert on problems that require some remediation action to be taken by an individual (such as an engineer on-call).

@viniston
Copy link

🎉 Exciting news - SonarG - Grafana Sound Alerts Extension is currently being reviewed by Google! 🎉

Hello Grafana Community!

Great news! SonarG is currently being reviewed by Google in order to be published on the Chrome Web Store. Using this extension, you will be able to receive customized sound alerts for critical Grafana events, enhancing your monitoring experience.

In the past, I provided a workaround for the sound alert, and many of you have utilized it. Later, I realized that this was a kind of customisation that most of you are not able to make for some reason, and are very interested in receiving sound alerts for critical Grafana alerts. No doubt I am not the only one who has been awaiting the launch of this feature with great anticipation. Rather than waiting, I decided to develop an extension to address this issue. That is how SonarG was born.

✨ Key Features:

  • Audio alerts
  • Customization options
  • Interval settings
  • Class Selector for Tailored Alerts
  • There are many more in the pipeline

Please let me know your thoughts on this. I look forward to hearing from you about any additional features you would like to see. Upon completion of the review and publication of the extension, I will notify you. Happy dashboarding with SonarG! 🚀

SonarG_Sound_Alerts

@viniston
Copy link

viniston commented Dec 4, 2023

🎉SonarG has been published on the Chrome Web Store and I am pleased to announce its availability. Install the extension from the Chrome Web Store. If you have any feedback or suggestions for improvements, please let me know.

@shadowjjackson
Copy link

@viniston Hi! Is it working with Grafana 10.1.1?
Dont see on that version any div with class .panel-alert-state--alerting on panel with alert or alert list even when alert is triggered.

@viniston
Copy link

viniston commented Dec 13, 2023

@shadowjjackson It appears that the structure of the Grafana dashboard has changed, and the class we were using to trigger the alert (panel-container panel-has-alert panel-alert-state--alerting) is no longer available. Grafana now renders graphs using canvas elements.

It will be necessary for me to find a new way of detecting when an alert is triggered in order to adapt to the changes. I will update our extension as soon as possible.

@viniston
Copy link

viniston commented Dec 13, 2023

@shadowjjackson Good news! As of now, it has been handled by adding a few configurations, including alert detection methods and SVG path selectors. You can activate the SVG path selector in the latest Grafana version and leave it with its default settings until you need to change them if the default value does not work. This configuration has been tested in Grafana v10.3.0 and SonarG sound alerts are working as expected.

SonarG V1.1 is currently being reviewed by Google webstore and will be updated as soon as it is available.

New Features: Alert Detection Method and SVG Path Selector

Alert Detection Method

SonarG now offers two methods to detect alerts:

1. Class Selector: Continue using the familiar method by identifying the class attribute associated with the alert element.

To find the Class Selector, right-click on the alert element in the Grafana dashboard, select 'Inspect' or 'Inspect Element,' and identify the class attribute in the HTML code. Copy the class value associated with the alert element.

Note: Default value is: .panel-alert-state--alerting

2. SVG Path Selector: Utilize a new method based on the SVG path of the alert icon.

To obtain the SVG Path, right-click on the alert icon in the Grafana dashboard, select 'Inspect' or 'Inspect Element,' locate the SVG element, and copy the entire 'd' attribute value. SonarG uses the entire 'd' attribute value for alert detection.
image

Note: The initial few values of the 'd' attribute are sufficient, as SonarG performs an includes check. The default value is M18.17 1.85A6.25 6.25

Selecting Your Alert Detection Method
When setting up SonarG, you can choose between the Class Selector and SVG Path Selector. Here's how:

Class Selector: Choose this option if you are familiar with the class attribute associated with the alert element. Enter the initial part of the class name in the provided field.

SVG Path Selector: Opt for this method if you want to use the SVG path of the alert icon for detection. Copy and paste the initial values of the 'd' attribute in the dedicated field.

image

@viniston
Copy link

@shadowjjackson SonarG v1.1 is now available, and please confirm whether alerts are working with the Grafana 10.1.1 version or not. Once you have tested it, please provide your comments.

@shadowjjackson
Copy link

@viniston Hello! Yes, its works! Thank u very much!
I tried to change the sound triggering to the "pending" step, so that the sound doesn't play indefinitely while the alert is hanging. But the SVG Path of the icon in the panel for OK and Pending stages is the same, it differs only in color.
So I had to specify SVG Path of the icon in the alert list (M18.9917,21.002h-1V19.335a5.00057,5.00057).

@viniston
Copy link

viniston commented Dec 14, 2023

@shadowjjackson I am glad to hear that it is working for you. It is possible to set the interval to every five minutes or even more than that if you wish to limit the number of times the alert is played indefinitely. In this way, you can easily control it without having to target other class names. To target the pending state, you need to change the alert detection method to the class selector and target the css-imo0wd-panel-header-item which is displayed for the pending state.

Would you be able to share your overall experience with this extension? If you have any use cases we should add to our extension, please let me know.
image

@gelicia
Copy link
Contributor

gelicia commented Feb 28, 2024

It looks like this is implemented. If you have questions about your specific configuration not working, please check with the Grafana community forum. Feel free to create a feature request or bug ticket if your needs aren't being met. Thank you!

@gelicia gelicia closed this as completed Feb 28, 2024
@antdef
Copy link

antdef commented Feb 28, 2024

@gelicia Why are you saying this is implemented ? Which version of Grafana ?

If you are refering to SonarG, from @viniston, it can't be considered as Sound alert beeing implemented within Grafana.
It is a workaround only suitable for some cases. This issue should not be closed because of that.

Particularly, the code from @viniston is resorting to parse the final DOM produced by grafana, to search for a specific chain within it, and this is not at all equivalent to having the feature implement in Grafana, and future proof.

Please re-open, or otherwise state it is NOT implemented.

@gelicia gelicia reopened this Feb 28, 2024
@gelicia
Copy link
Contributor

gelicia commented Feb 28, 2024

@antdef my mistake! reopening and ensuring the right team sees it.

@ryanhamilton
Copy link

FYI Pulse enables this out of the box:
timestored/pulseui#180

@JohnnyQQQQ
Copy link
Member

We decided to close this for now, as we won't implement it in the near future. The provided third-party plugin seems to be a workaround for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests