Comments (3)
There is currently no alerting, but it is definitely something to consider.
Before we build alerting, we will need to build a way to authorize heartbeats, and only authorized heartbeats will generate alerts. Otherwise we will be opening doors to spam.
from documentation.
This is what I did. I ran a cron every 1min in my linux server and get emails alerts:
#!/bin/sh
emailto="[email protected]"
subject="HEARTBEAT"
json=$(
curl -X GET 'https://yourdomain.heartbeat.sh/heartbeats' \
--compressed \
-s
)
errors=`echo -n $json | grep -o '"Status":"ERROR"' | wc -l | awk '{print $1}'`;
echo ERRORS: $errors
if [ $errors != 0 ]; then
msgsubj="$subject ERRORS: $errors"
echo $json | mail -s "${msgsubj}" ${emailto}
fi
from documentation.
@arieroos if you implement alerts, I think alerting only on the "falling edge" of the signal (i.e. transition from green to orange/red) is much more useful than alerting repeatedly alerting like the above example. In my experience, if I can't address an issue immediately, the flood of e-mails makes me counter-productive.
A client-side-only way of doing this would be to make the web interface into a PWA, which makes it installable, and provides a service worker. Then the service worker kan show notifications. https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification Depending on the device, the notifications might not work when the app is put to sleep (e.g. most Androids) but it still has some use, and does not require you to push anything from a server, keeping the implementation simple.
from documentation.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documentation.