-
Notifications
You must be signed in to change notification settings - Fork 166
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
Add online and offline sessions metrics #150
base: master
Are you sure you want to change the base?
Conversation
b4fb253
to
e2abc49
Compare
@OleksandrMishchuk Is this PR still relevant? |
TBH, we are not using these metrics anymore on a project as we moved fully to online sessions, but I believe it could be pretty handy for those who use mixed sessions. I can fix merge conflicts when have a spare minute |
@OleksandrMishchuk Check out the conversation at #74 if you haven't seen it yet. Have you taken into account the wishes and suggestions expressed there? |
e2abc49
to
198ebe6
Compare
Checked that now and I'm a bit confused with implementation - in that PR we do a lot of redundant work of processing sessions that are not related to current event. Basically, we go through all online and offline sessions and update all gauges, while we can only update one related to current event. Maybe I didn't fully get the logic, idk. I have now updated PR, so you are free to decide on what to do with it 😄 |
Wow, super! Thank you so much for your work! |
+1, this would be a nice feature! 🌟 |
@pb82 could you accept this pr? |
Motivation
There's no metrics exported for online and offline sessions in KC currently and that is pretty needed by business
What
Two gauges were added for onlineSessionCount and offlineSessionCount. Updates are done when LOGIN or LOGOUT events are catch and only for client where event happened, which reduces load on the system
Why
There's already one PR, which does the same, but from my point of view capturing of sessions is done incorrectly there and will definitely add extra load on a server as metrics are pushed on each event.
How
When LOGIN, CLIENT_LOGIN or LOGOUT event is catch we retrieve info of event's client sessions and push out metrics.
Verification Steps
Checklist:
Progress
Additional Notes