20 ms·
Monitoring tiny web services
- pkrumins 4y agoIf you have a popular service, then one of the best approaches is to have your users notify you when something is down or is broken. This pattern follows the famous quote: “Given enough eyeballs all bugs are shallow.” I have employed this approach to great success and haven’t had a need for any monitoring services.
- redleader55 4y agoIf users see the problem it is too late. You will be seen as unable to keep the service up and the service will be seen as flaky. Also, the Holly grail of monitoring is to be able to remediate the problem automatically - this is pretty hard when users are reporting it.
- jewel 4y agoAnother approach that has been working great for me: https://www.webalert.me https://www.webalert.me. This app runs on your phone, you can configure it to check once an hour if any content on a page changes.
- xrd 4y agoI installed Uptime Kuma (https://github.com/louislam/uptime-kuma https://github.com/louislam/uptime-kuma) on my dokku paas to monitor my dokku apps. It works great. It is great for pure HTTP services, but it can be used against things like RTMP servers because it also permits configuration of a health check with TCP pings. It gives me an email when things are down, and supports retry, heartbeat intervals, and can validate a string in the HTML retrieved. I love it.
- jslakro 4y agoI considerated this option but then realized that both sides, the api/services and the uptime checker will be in the same server then any problem impacting the server itself will leave offline the monitoring
- pronoiac 4y agoI think two would cover it: * an uptime checker, in a container, running against however many services or sites * uptime robot or whatever, against the local uptime checker
- daverobbins1 4y agoSince everyone is posting their favorite free-tier monitoring products - does anyone have a recommendation for a cloud product that will allow us to create a group of ping monitors and alert only if all monitors in the group are down for N minutes?
- prakashn27 4y agoI am curious for the use case of it. What group of servers do you want to monitor?
- daverobbins1 4y agoWe have dual internet connections coming into a satellite office and we only want to be alerted if both are down.
- mgbmtl 4y agoWith icinga2 (or any nagios successor) you could write a custom check command that does a ping check on both IPs (and return an error status only if both are down).
- machinerychorus 4y agoYou could hack that together with huginn pretty easily https://github.com/huginn/huginn https://github.com/huginn/huginn
- zoover2020 4y ago> [...] recommend a cloud product Hacker mentality never left this site since inception :)
- FridgeSeal 4y agoI’ll double check when they’re online, but I’m pretty sure BitPing can do stuff like this. They farm the actual checks out to actual users devices across a whole stack of geographies, you can customise regions, rates, etc. https://www.bitping.com/ https://www.bitping.com/ Full disclosure: my friends business
- dimitar 4y agoIf I have to do one thing to monitor a simple website I'm probably going to use something that takes a screenshot periodically and checks it for changes. There are open source solutions but I just prefer to pay a bit for a managed service to do it. I think it covers quite a lot of things - the servers are up, DNS is OK, assets are OK. It can also be a safety net in case of other, more sophisticated monitoring fails to detect an unusual state. This doesn't work well for website with too much javascript, ads or widgets.
- radus 4y agoWhat are the OSS solutions for this?
- wswope 4y agoSelenium is the first one that comes to mind. I think most of the big browser automation toolkits should have the ability to do screenshots in some capacity.
- radus 4y agoYes you’re definitely right - I’ve recently started using SeleniumBase for Python which includes a few extra niceties. I was more asking about the part where you compare between releases (or test suite runs) to see if anything changed. I suppose you can just use compare hashes, but I could imagine also having some feature that highlights changes on the screenshot. SeleniumBase has a feature that looks at markup and which stores screenshots for visual comparison to a set baseline: https://seleniumbase.io/examples/visual_testing/ReadMe/ https://seleniumbase.io/examples/visual_testing/ReadMe/ Found this blog describing use of SeleniumBase for that and OpenCV for screenshot comparison as another layer: https://blog.streamlit.io/testing-streamlit-apps-using-seleniumbase/ https://blog.streamlit.io/testing-streamlit-apps-using-selen...
- mekster 4y agoYou want to update your tools with Puppeteer or Playwright.
- 4y ago
- mro_name 4y agoI like monitored cgi shell script endpoints a lot, e.g. the one behind https://updown.io/44q5 https://updown.io/44q5 is https://codeberg.org/mro/internet-radio-recorder/src/branch/master/pages/app/monitor.cgi https://codeberg.org/mro/internet-radio-recorder/src/branch/...
- sassy_quat 4y agoSeems like a trivial service to make. Reddit has RSS, Twitter has webhooks, there are so many ways to monitor. Hopefully if the service is worth reading, your customers will go and politely inform you. It is nice to have your work acknowledged.
- KingOfCoders 4y agoHealth checks should include a read from the database(s).
- pronik 4y agoAnyone still remember Steve Yegge's platforms rant? One particular point from it has stuck with me, because it's so obviously correct and so obviously difficult to implement in small scale: "Monitoring and QA are the same thing". This is probably my internal OCD not being able to cope with sub-100% solutions, but every time I see a healthcheck endpoint doing basically a ping-pong response or maybe check the database connection I can't help but think about what it doesn't do and that's basically everything up until integrations test's "works correctly". It's fascinating but at the same time horrible to know how much of "works fine so far" in our industry is circumstantial and good-will optimistic judgement, but not knowledge. "If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization" indeed.
- dafelst 4y agoI like this apparent shift back to "small is okay" where not every service has to be an overengineered allegedly hyper-scalable distributed mess of five nines uptime with enterprise logging, alerting and monitoring. Those things are nice when you have a bazillion users and downtime means hordes of unhappy users and dollars flushing away at insane rates, but for the vast majority of hobby projects and even mid stage startups, what is described in this article is plenty good enough.
- bdd 4y agoYou can get free uptime monitoring from Google Cloud. The limit is 100 uptime checks per monitoring scope, which may mean either a project or an organization based on how you configure IIUC. https://cloud.google.com/monitoring/uptime-checks https://cloud.google.com/monitoring/uptime-checks. The checks are ran from 6 locations around the world, so you can also catch network issues, that you likely cannot do much about when you're running a tiny service. My uptime checks show the probes come from: usa-{virginia,oregon,iowa}, eur-belgium, apac-singapore, sa-brazil-sao_paulo Another neat monitoring thing I rely on is https://healthchecks.io https://healthchecks.io. Anything that needs to run periodically checks in with the API at the start and the end of execution so you can be sure they are running as they should, on time, and without errors. Its free tier allows 20 checks.
- jacooper 4y agoWhat is the interval for the checks ? Its written that its 100 per metric scope, but I don't know what that means really.(2) Also there seems to be no status monitor page ? 2- https://cloud.google.com/monitoring/uptime-checks https://cloud.google.com/monitoring/uptime-checks
- bdd 4y agoMetrics scope is the logical grouping of assets you are monitoring. Explained in detail here https://cloud.google.com/monitoring/settings https://cloud.google.com/monitoring/settings along with a video. Web console allows check intervals of 1, 5, 10, or 15 minutes.
- tedmiston 4y agoNew Relic also offers a similar uptime monitoring with a generous free tier via their Synthetics service. https://newrelic.com/platform/synthetics https://newrelic.com/platform/synthetics
- packetslave 4y agoI wish New Relic would support plain old ICMP ping. That would be nice. You used to be able to implement it using their Scripted API thing (which is just sandboxed Node), but at some point they broke raw socket support, which broke every ping NPM in existence. I think you can still make it work if you run a private minion, but that's more effort than I want to spend.
- rozenmd 4y agoMy particular favourite is how GraphQL servers respond with "200 OK" and the errors will be sent in a key called "errors". Makes regular healthchecks almost useless. I ended up writing my own service[0] to detect problems with graphql responses, before expanding it to cover websites and web apps too. -[0]: https://onlineornot.com https://onlineornot.com
- OJFord 4y agoI honestly hate that so much, it's a relief to read someone saying the same. I sort of almost made myself feel a bit better about it by thinking 'no, it's not REST, we have reached the graphql server successfully and got a .. "successful" response from it, it's sort of a "Layer 8" on top of HTTP'. The problem is that none of the bloody tooling is 'Layer 8', so you end up in browser dev tools with all these 200 responses and no idea which ones are errorful. If any.
- Spivak 4y agoI actually think I agree with your former self, how do you tell the difference between a server and an application error? How do you tell the difference between "record not found" and "there is no GraphQL endpoint here at all"? Or "you are not allowed to access GraphQL" and "you are not allowed to access the server." Especially because error responses from your web server layer are usually really different than errors from your backends.
- remram 4y ago> How do you tell the difference between "record not found" and "there is no GraphQL endpoint here at all"? The standard 503 and 404 codes?
- Spivak 4y ago503 doesn’t map well to me meaning “you performed a successful GraphQL query but the result is that the thing you tried to query is missing.”
- blondin 4y agohave to say, this is exactly what kubernetes was designed to solve. but the focus was on microservices and containers. and things also got out of hands.
- dinvlad 4y agoI really wish managed Kubernetes offerings remained "free" for small use, and would only expose "empty" nodes ready for full utilization by end-user containers. The reality however is that every managed node (like on GKE) uses quite a lot of CPU and memory out of the box, for which the user pays. On top of that there're cluster fees, just for having it around. This makes it completely unfriendly to hobbyist projects, unless one is ready to pay dozens of $s just to have Kubernetes (prior to deploying any apps to it). (And sure, there're free tiers here and there, but they never solve this problem completely on any of the big cloud providers, at least) Compare that to managed "serverless" offerings (even pseudo-compatible with K8s API like Cloud Run), which eliminate the management fees, but impose a tax with latency. Oh well.
- epelesis 4y agoOne reason this is not feasible is that K8s is not designed for secure multitenancy, so for every tenant, you'll need to spin up an entire K8s control plane, which includes a database and several services - this is what's driving the cluster fees. Keep in mind that customers also expect managed K8s to be highly available, so this cost is also going into things like replicating data, setting up load balancers, etc... Compare this to a serverless offering that is multitenant by design, the control plane is shared making the overhead cost of an extra user is basically zero, which is why they don't charge you a fee like this. IMO if you're a hobbyist interested in K8s, your best way to go is to install K3s, which is a lightweight, API compatible K8s alternative that runs on a single node. It's pretty nice if you don't care about fault tolerance or High Availability. https://k3s.io/ https://k3s.io/
- dinvlad 4y agoI'm not so sure about the economics of what you describe. I think it could very well be that small customers don't really consume that much "bandwidth" that their resource requirements could be subsumed entirely by larger uses. It doesn't make much sense that both large and small customers have to pay the same cluster fee, for example - it would be much more fair to charge more the more you use, and approach "near zero" the lesser you use it. At the end of the day, all resources are run by the cloud provider on KVMs sharing the same physical machines anyways, so it's up to them how much to charge. The fact that both small and large customers get to pay for the same amount of resources allocated for them, only means these resources are not allocated in the most efficient manner. So a cloud provider could fix this. We should also not discount the net positive effect of attracting more hobbyists and startups to your platform. That's how AWS and GCP started, for example, but now they're just focusing on more enterprise business so smaller ones mean less to them (although AWS arguably less so). But we shouldn't forget that while they don't contribute as much to the revenue, they're essentially a free advertising resource that make your platform stay "relevant" (and especially more so for burgeoning startups that could grow to bring more revenue in the future!). The moment they leave, the platform just becomes another IBM that's bound to die, for better or worse. On top of that, the anti-analogy with serverless for control plane breaks down, because one could always run it on the same shared pool of resources in gVisor or Firecracker, just like with serverless.
- KronisLV 4y agoCurrently got the cheapest VPS that I could (in my case from Time4VPS, some others might prefer Hetzner, or Scaleway Stardust instances), setup Uptime Kuma on it (https://github.com/louislam/uptime-kuma https://github.com/louislam/uptime-kuma), now have checks every 5 minutes against 30+ URLs (could easily do each minute, but don't need that sort of resolution yet). It's integrated with Mattermost currently, seems to work pretty well. Could also set it up on another VPS, for example on Hetzner (which also has excellent pricing), could also integrate another alerting method such as sending e-mails, or anything else that's supported out of the box: https://github.com/louislam/uptime-kuma/issues/284 https://github.com/louislam/uptime-kuma/issues/284 Oh, also Zabbix for the servers themselves. Honestly, if things are as simple to setup as nowadays and you have about 50 EUR per year per node that you want (1 is usually enough, 2 is better from a redundancy standpoint, since then it becomes feasible to monitor the monitoring, others might go for 3 nodes for important things etc.), you don't even need to look for cloud services or complex systems out there. Of course, if someone knows of some affordable options for cloud services, feel free to share! I briefly checked the prices for a few and most of them are a little bit more expensive than just getting a VPS, setting up sshd to only use key based auth, throwing Let's Encrypt in front of the web UI (or maybe additional auth, or making it accessible only through VPN, whatever you want), adding fail2ban and unattended updates, and doing some other basic configuration that you probably have automated anyways. The good news is that if you prefer cloud services and would rather have that piece of your setup be someone else's problem, they're not even an order of magnitude off in most cases - though I'm yet to see how Uptime Kuma in particular scales once I'll get to 100 endpoints. Seems like at a certain scale it's a bit cheaper to run your own monitoring, but at that point you might still find it easier to just pay a vendor. At the end of the day, there's lots of great options out there, both cloud based and self-hosted, whichever is your personal preference.
- jacooper 4y agoYou can get a free 4vcpu 24gb ram 200gb storage VPS with oracle cloud Free tier.
- 5d8767c68926 4y ago
- tatoalo 4y agoI have been using cronitor[0] for a few months now and I have been really satisfied with them so far! [0]: https://cronitor.io https://cronitor.io