This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
Add utility script to monitor the public dashboard and alert someone if the data seems frozen #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, given this is a temporary plug for an unidentified problem, there are two ideas here:
As I don't know the details of your environment there are still some finishing touches needed on your part. I have tested each separate feature myself though. Running it is simply
node scripts/alertStaleDashboard.mjs
.This script will periodically request
https://defi.delphidigital.io/chaosnet/thorchain/lastblock
, which is something that should be changing every few seconds, and if it's not changing and we're getting identical responses for five minutes straight, we send an alert. Should the endponit later resume normal operation, we send another notification. For completeness if the script fails to reach the endpoint (for any reason, not necessarily a problem with the endpoint), we also send an alert (this would still be an issue that requires investigation after all)The reason I'm running three checks,
thorchain/lastblock
,v1/network
, andint/extra
, is because I've noticed that the ultimate data source for each is different (thorchain node, midgard api, and cache server respectively). This should help increase the chances of detecting the problem and pinpointing where it happens. I have commented out some extra lines for user convenience - running the same checks against the data sources directly, and running them against youryarn develop
server for debugging.Those two other checks are also constantly changing every few seconds, whether on "Pool Overview" or "Network & Nodes" pages, making this selection a decent proxy for overall dashboard data responsiveness.
There are three ways you can choose to receive this alert:
I've provided all three and commented out the
import
/yarn add
statements to use for the one you wish to enable. Feel free to choose one and edit the other ones out.Let me know if there's anything else to add in!