Open tarnas14 opened 2 years ago
internal discussion:
1. what are the "type" and "localisation" filters for logs? other dropdowns are explained in figma
2. do I understand correctly that "current session" means current launchpad session and we need to include logs from all containers that were ever started during that session? answer: "current session" is the time since launchpad application was started
3. there is an "all history" option in logs period option, but settings have something like: what should happen when we reach 50MB ? should we remove oldest logs? how do we make the decision which logs to remove? answer: if max file size is reached, logs should be deleted day by day, starting from the oldest
update - have done some research on the logs implementation I'm creating an issue for a loki-oriented spike, will see how hard it is to set it up for our docker-compose, will give it one day
assume that logs data is 'sever state' and make it queryable and cache'able on frontend we can use something like react-query to assign cache keys to specific container types etc then you can add logic to invalidate specific cache keys on log events as they come from the server to achieve "tail"
make launchpad responsible for persisting logs save each log on callback to a sqlite database (we can use this tauri plugin) or an indexeddb if there are performance issues, we can save logs to db through a dedicated web worker
save the logs on backend into a SQLite db, which frontend could query directly (db as a point of integration, but this is not the worst in this case, I think)
use Grafana Loki to collect and query data:
we should show tari logs from tari processes the logs are available in different paths based on OS:
~/Library/Caches/tari/tmp/{network}/{service}/log/
~/.cache/tari/tmp/{network}/{service}/log/
logs taken from these files should be rendered with grafana then we embed grafana on the logs page, maybe with some additional styling to be closer in the color scheme to figma
for more info see the discussion in #206