-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adding counters to the state for metrics #96
Comments
Is this something @hritique can help with - assuming he has bandwidth beyond the frontend? |
I don’t know, but everything that needs to happen for this would be written in Rust and live either in the on-chain program or in a small daemon that can deserialize the on-chain state and expose a Once we can expose the metrics, we need to scrape them, and then graph them. I am familiar with Prometheus and Grafana, but other options exist. @joe-bowman is this something that the platforms team could help with? I’d be happy to explore this myself too if you can point me in the right direction. If we also want to show these metrics over time on the Lido page, and not just on an internal dashboard, then we would need a way to expose the historical data over http, and a way to graph it in the frontend. I think @hritique could help with that, but as a first step, I was only proposing this for internal use so we have some insight into what’s going on. |
He already have the full prometheus, grafana and alert manager stack set up; provide us something with a /metrics endpoint and we'll get this deployed and hooked up to prometheus. |
@RishiSid this seems related to the discussion we had with Xavier last regarding the analytics. |
I’m going to increase the scope of this issue a bit to be about metrics in general, not just those that we need to embed counters in the state for. One thing that would be nice to track for the maintenance bot:
Then we get a handle on how much it costs to operate the bot, even if the cost is expected to be low. |
I just had a call with @hritique, about the data that should go on the widget, and in addition to the exchange rate, we want the following data on there as well:
The widget needs to get this data from somewhere, and we agreed that it is easiest to get this from the Solido state, if it is available there. This aligns nicely with the plan above about keeping the counters in the state. The maintenance bot can extract the data and make it available to Prometheus, and the widget can extract the data and display it on the website. I already proposed
|
After #213, it should be very easy to add new metrics to the state and expose them:
I think it would be nice to track amount of SOL deposited as a histogram. (Maybe with buckets from le=0.001 SOL up to le=1000.0 SOL in 10× increments, that would cost us 8 |
I’ll start with this now, as all of the more important issues for the v1 milestone are done. |
It would be nice if we could eventually expose some metrics and graph them, perhaps through a little daemon that queries the Solana RPC for the Lido state, and exposes it in Prometheus format.
A few metrics that would be nice to have are
solido_deposited_lamports_total
, sum of of all deposit ever. From this we can compute e.g. amount staked per day.solido_withdrawn_lamports_total
, sum of all withdrawals ever.solido_deposits_total
, monotonically increasing counter of the number of deposits since inception, so we can compute e.g. number of deposits per day.solido_withdrawals_total
, monotonically increasing counter of the number of withdrawals since inception, so we can compute e.g. number of withdrawals per day.solido_fee_st_sol_total
, the total fees paid since inception, possibly split out by post into treasury, insurance, validation fees, etc.Aside from this we would want the current pool balance and such, but these we can just query from the Lido state already, we do not need to add counters to the state for this.
A note about why to track withdrawals and deposits separately: without this, if you see the pool balance increase by 10 SOL, you can’t distinguish between a single 10 SOL deposit, and a 1000 SOL withdrawal + a 1010 SOL deposit.
The text was updated successfully, but these errors were encountered: