-
Notifications
You must be signed in to change notification settings - Fork 83
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
ASB Metrics #448
Comments
Rust-libp2p is exploring OpenMetrics: libp2p/rust-libp2p#2063 Don't have much experience but this OpenMetrics sounds like a useful standard that we could follow here where we don't have to reinvent the wheel and make it easy for the user to later tap into a wider ecosystem of monitoring. |
OpenMetrics (same for Prometheus) does not seem to be suitable for our needs. It is designed to monitor services from a data perspective:
Examples range from CPU utilization and I/O load to service response times. The continue with :
The latter one is more what we need, i.e. record and collect events. It gets more clear that OpenMetrics does not fit when reading through the defined metric types. It defines:
|
I propose to follow a store-and-log approach instead:
|
What I would like to see (the format of the log does not matter atm):
|
In general: Yeah, what you describe has nothing to do with To be more concrete: What you outline above as
Only once we analyze multiple of these swaps and we would actually have Metrics as in "5 out of 10 swaps finished successfully with state ...". I am fine with recording more swap details in the Sled DB in separate trees for a "quick solution" - but if we plan for the long run it would be better to do what I outline below. I had the alternative idea to improve the logs and let an external software handle our "Metrics" through the logs. We already use swap and peer-id contexts within the logging and could easily extract swap / peer information using log frameworks such as vector Advantages:
Disadvantage:
|
Sad that OpenMetrics doesn't support more complex things that than. The big advantage would have been that we don't need to store this data. An ever-growing database is not particularly ideal and metrics / logs are things that you usually don't care about past a certain point in time. If we store things in a database, can we use this an opportunity to start migrating to SQLite? The actual extraction of metrics could then be as simple as loading the database into any SQL tool and running a couple of queries against it. That should reduce the required development effort significantly. Also, if we create a separate reporting database, deleting that one is safe if the user ever wants to clean up storage space. |
That's a good summary :) I had a quick look into Vector as well. It's a log analyzer, maybe comparable to LogStash:
It even has an export feature to send data to prometheus (which afaik is in OpenMetrics format). If we want to go this way, we can ignore the DB and print more details into the logs. @thomaseizinger : what do you think? |
I think it boils down to either using a relational DB and then use some tools on top of the relational DB for analyzis OR ignore the DB and go with the logs. I am not sure what is the better approach, but I think the log approach would give us faster results. |
After quick chat with @da-kami:
Conclusion: Because of 1. + 2. best is to add more information into our logs. These can then be analyzed using tools like Vector or LogStash+Elastic or other tools. |
474: Add more log details r=bonomat a=bonomat Resolves #448 1. The first commit adds an additional log statement of the exchange rate for each state-update. This is useful because it allows us to measure profitability easily, i.e. by knowing what was the exchange rate when the swap was started and what was it when it was finalized. 2. The second commit changes a bunch of log messages. 3. The third commit is adds a new commandline flag to toggle json format. Co-authored-by: Philipp Hoenisch <[email protected]> Co-authored-by: Philipp Hoenisch <[email protected]>
As a maker I would like a cli command to see for all swaps:
Hint: currently old states are overwritten in the DB. We could just add a new DB entry for each event including details.
The text was updated successfully, but these errors were encountered: