-
Notifications
You must be signed in to change notification settings - Fork 91
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
Goaccess log reporting #167
base: master
Are you sure you want to change the base?
Conversation
Thanks for the PR! Very exciting! 😍 This looks like a series of "snapshot" graphs - which while useful - is not really aligned with everything else in CapRover which is realtime. If I am reading the implementation correctly, even the "current" link is not realtime and it uses a 10 snapshots, right? Here is what I recommend:
There is a bunch of other suggestions that I have - but first let's get the core right, then we get to the beautification of it :) |
The snapshot reports will only be generated for whatever the log rotation the users set in the settings (defaulting to once a month) only for the app/domain combo's that get any traffic in that period. You can set GoAccess to serve a real time report with the So in lieu of that, I went with the simpler solution to just have a catch up log that's updated more frequently (default every 10 minutes) than the monthly rotation. There's only one catch up report per app/domain combo that gets updated each time it runs. It would be nice to update that only when a request is made for the report, but that is dependent on the app handling the request to then be able to kick off a container to update the report as part of the request lifecycle. For that, let's try to figure out a way in the backend PR. I do think some more tooltips / messaging would be helpful around the settings to explain some of this but did want to get further in the process before adding those in case anything changes :) |
Agreed.
Yes, ideally on the "GET" path, we can generate the report. If that's too difficult to implement, we can have a "Generate Report" button with a new endpoint that kicks off the "catch-up" process. That way, you can update your report on demand if you need to see the last few minutes when catchupLog hasn't caught up yet. Some more questions: |
Yeah GoAccess reports are static once they're generated (it's just a standalone html file) with no ability to change the date range which is why we have to do this extra work to give some options on the granularity. Q1 - Yes, if set to monthly they'll only contain one months worth of data. If we didn't do the log rotation then it would be cumulative. Q2 - The catchup log is whatever the whole access log has in it since the last log rotation. So if the user has it set to monthly, it will be logs from the 1st of the month till the current day of the month. However if they've disabled log rotation (with a really long custom cron period) then they'll be the whole cumulative logs. Q3 - Since they're static this is what the whole setting for "Log Rotation and Report Generation Frequency" is for. We can easily add some more presets there. Of course, having that frequency be short means there will be a bunch of reports generated (especially with a CapRover instance with lots of apps and domains) over a long period of time. So this is where the catch up log comes in. |
Ok I've updated it to dynamically build the live report and also pull them through the API. Since the API requires auth of course you can't just go to the page since the auth token will be missing so I'm pulling the reports through the API and then displaying the contents in a modal with an iframe. Thinking of adding a refresh button in the modal for the live one but wanted to check in here and see what you think Screen.Recording.2024-11-08.at.9.51.18.AM.mov |
iframe solution looks surprisingly great! I'll test out soon. PS: |
Frontend side of the goaccess log reporting.
Allows you to
caprover/caprover#2182
First of all, thank you for your contribution! 😄
Please make sure you have read contribution guidelines.
Most important items
These rules are strictly enforced to make sure that we can maintain the project moving forward.