Live data from Hacker News

Ask HN: How to do simple heartbeat monitoring?

news.ycombinator.com

61–70 of 86 posts

Re: Ask HN: How to do simple heartbeat monitoring?

#61

You're looking for a dead man's switch. https://deadmanssnitch.com is a good hosted service or Uptime Kuma ( https://github.com/louislam/uptime-kuma ) can be configured to do the same thing.

+1 for Deadman's Snitch. We use that at work. It's groovy.

Re: Ask HN: How to do simple heartbeat monitoring?

#62
post #19

I clicked to say something about Instrumentation Amplifiers or interfacing with chest straps ;) You might want to use a different service for monitoring your stack just to make sure you have some redundancy there. Seems like you got an answer for how to do this with Signoz but if that is down then you won't know.

Same, honestly, though not specifically about chest straps. Extremely primitive but effective heartbeat monitoring can be done with a cheap SpO2 monitor from Amazon and reverse engineering the Bluetooth LE signal. You won't get a true beat, but one that's more of an approximation. I know I have some C++ code lying around somewhere for this.

Even full-blown OEM heartrate monitors seem to be relatively ineffective (at least, in my experience this is true when talking about watches specifically). I can't imagine this would do a great job, would it?

Re: Ask HN: How to do simple heartbeat monitoring?

#63

I had a similar concern about a custom monitoring script that was regularly writing out a metrics file in Prometheus format to be picked up by the Prometheus node monitor. What if the script breaks? So I set the script to also write out a metric that was just the time stamp the metrics were last updated. Then it was simple to set up an alert in Prometheus - I can't access the config now so you'll have to look it up y…

I've been using it for some time and it works well.

Re: Ask HN: How to do simple heartbeat monitoring?

#64
post #31

If you want super minimal, something like this might work? #!/bin/bash # Add this script to cron to run at whatever duration you desire. # URL to be checked URL="https://example.com/test.php" # Email for alerts EMAIL="root@example.com" # Perform the HTTP request and extract the status code with 10 second timeout. STATUS=$(curl -o /dev/null -s -w "%{http_code}\n" --max-time 10 $URL) # Check if the status code is not 2…

As a slight variation, you could send an alert to the PagerDuty API by replacing “Send email alert” with something like: # Send PagerDuty alert curl -X POST https://events.pagerduty.com/...

Or apprise for a whole bunch of notifications.

https://github.com/caronc/apprise

Re: Ask HN: How to do simple heartbeat monitoring?

#65
This is normal website monitoring. There are a billion services that do this. The cloud providers have them. I use Oh Dear.

Something that can happen is that your alerting system stops working. I wrote alertmanager-status to bridge Alertmanager to these website uptime checkers: https://github.com/jrockway/alertmanager-status Basically, Alertmanager gives it a fake alert every so often. If that arrives, then alertmanager-status reports healthy to your website upness checker. If it doesn't arrive in a given time window, then that reports unhealthy, and you'll get an alert that alerts don't work. I use this for my personal stuff and at work and ... Alertmanager has never broken, so it was a waste of time to write ;)

Re: Ask HN: How to do simple heartbeat monitoring?

#67

Earlier quoted context omitted.

ah, this is the answer I was hoping for. thank you!

on second read, this is something that is set up on the service-side. I.e. if our service goes down, we would also stop sending data to Signoz Cloud. We wouldn't be able to run a status check, let alone send it to signoz cloud.

you can add https://github.com/open-telemetry/opentelemetry-collector-co... at signoz's otel-collector which will scrape your service's endpoint periodically. If your service is down, this will give 5xx error and you can set an alert on that.

Another alternative is to use an alert to notify on a metric being absent for sometime. Both of these should work

Re: Ask HN: How to do simple heartbeat monitoring?

#69
Update:

Thanks for your recommendations everyone! We decided to go the route of measuring successful hits on the endpoint associated with our docs (inside our monitoring service). That's the default health check associated with our load balancer, so it gets hit periodically (built-in cron job). We just added a signoz alert that is triggered if the sum of those successful calls over the past X seconds falls below a threshold.

Re: Ask HN: How to do simple heartbeat monitoring?

#70
post #19

I clicked to say something about Instrumentation Amplifiers or interfacing with chest straps ;) You might want to use a different service for monitoring your stack just to make sure you have some redundancy there. Seems like you got an answer for how to do this with Signoz but if that is down then you won't know.

Same, honestly, though not specifically about chest straps. Extremely primitive but effective heartbeat monitoring can be done with a cheap SpO2 monitor from Amazon and reverse engineering the Bluetooth LE signal. You won't get a true beat, but one that's more of an approximation. I know I have some C++ code lying around somewhere for this.

Could be done with a webcam even. It's known that facial skin color is affected subtly by pulses. There are plenty Python codes for that on GitHub.
Post reply on HN