-
Notifications
You must be signed in to change notification settings - Fork 10
Expose WebSocket connection count as prometheus metrics and some refactors #337
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
Changes from all commits
32fc48d
1d69fc6
cad1187
1877417
339b35e
c38b316
3c69b8a
f64b49a
938536b
552c03a
2e99a3f
cd06b8f
d24e0c5
48797c6
06f85b3
e3f5584
ea076f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ There are 3 folders in `src`, corresponding to the 3 processes that the VHS runs | |
* `/`: Information about the endpoints. | ||
* `v1` | ||
* `/health`: A health check for the VHS. Returns the number of nodes that it is connected to. | ||
* `/metrics`: A health check for the VHS. Returns the number of connected nodes for each network in prometheus exposition format. | ||
Comment on lines
14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. how come we are keeping both endpoints? It seems like the new metrics endpoint is a more detailed version of the same info the health endpoint has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new metrics endpoint returns data in prometheus exposition format and the /health returns data in JSON format. Since, it was public endpoint users of VHS might be consuming it. No harm in keeping both. |
||
* `/networks`: Returns the list of all networks on VHS database. | ||
* `/network/validator_reports`: Returns scores for the nodes that it has crawled in the last day. | ||
* `/network/topology`: Returns information about all the nodes that the crawler has crawled in the last hour. | ||
|
@@ -42,8 +43,6 @@ This table keeps track of the nodes in the network, which it finds via crawling | |
| `complete_shards` |The [history shards](https://xrpl.org/history-sharding.html) the node keeps track of.| | ||
| `ip` |The IP address of the node. | | ||
| `port` |The peer port of the node. | | ||
| `ws_url` |The WS URL of the node. Optional. | | ||
| `connected` |This appears to be false for every node. | | ||
| `networks` |The network(s) that the node belongs to. | | ||
| `type` |Whether the TCP connection to the peer is incoming or outgoing. | | ||
| `uptime` |The uptime of the node. | | ||
|
@@ -186,5 +185,18 @@ This table keeps track of the validators on the networks. | |
| `agreement_24hour` |Data about the reliability of the validator over the last 24 hours.| | ||
| `agreement_30day` |Data about the reliability of the validator over the 30 days. | | ||
|
||
|
||
### `connection_health` | ||
|
||
This table keeps track of the WebSocket connection status for all networks. | ||
|
||
| Key | Definition | | ||
|----------------------|-------------------------------------------------------------------| | ||
| `ws_url` |The connection websocket url. | | ||
| `public_key ` |The public key of the node. | | ||
| `network` |The network that the node belongs to. | | ||
| `connected` |Boolean denoting websocket connection status. | | ||
| `status_update_time` |Time when the connected column was updated. | | ||
|
||
*Partial validations are not meant to vote for any particular ledger. A partial validation indicates that the validator is still online but not keeping up with consensus. | ||
**A chain is a group of validators validating the same set of ledgers. `main`, `test`, and `dev` represent the validated versions of mainnet, testnet, and devnet respectively. Validators on a fork/validating an alternate version of the ledger will have a different value, usually of the form `chain.[num]`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,17 @@ const info = { | |
example: | ||
'https://data.xrpl.org/v1/network/amendments/vote/{network}/{identifier}', | ||
}, | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is for internal use I don't think we need to expose it in info There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if its for internal use, I feel a good documentation is helpful for future development. @pdp2121 Are there any concerns about privacy/security? Are there are disadvantages to exposing it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I meant we don't show it in the info when users hit https://data.xrpl.org, but still keep it within architecture document |
||
action: 'Get total number of connected rippled nodes.', | ||
route: '/v1/health', | ||
example: 'https://data.xrpl.org/v1/health', | ||
}, | ||
{ | ||
action: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
'Get total number of connected rippled nodes for each network in prometheus exposition format.', | ||
route: '/v1/metrics', | ||
example: 'https://data.xrpl.org/v1/metrics', | ||
}, | ||
], | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.