Skip to content
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

Unify query patterns around bucketing session stats #198

Open
f0ssel opened this issue Nov 4, 2024 · 0 comments
Open

Unify query patterns around bucketing session stats #198

f0ssel opened this issue Nov 4, 2024 · 0 comments

Comments

@f0ssel
Copy link

f0ssel commented Nov 4, 2024

Currently session stats are written into the database via the agent or via the connecting clients reporting workspace usage. This data is partitioned by a usage flag on the table and subsequently the database queries use this flag to get the correct data depending on if the workspace-activity experiment is enabled or not.

Then this data is read from on different intervals and bucketed into different tables. The way we collect the data, count the unique number of sessions per timeframe, and filter certain data points out are all ad hoc and a little different depending on the query. Because this data is used by the workspace API, autostart and autostop, template insights, deployment stats, and prometheus metrics you often end up with slightly different numbers based on which feature you look at and what queries that feature is using.

Now that the spaghetti is starting to be fully understood and the code is being unified into less paths and branches, we should take the time to unify our query logic so it's easier for developers to understand in the future and make the data across the platform more consistent.

@f0ssel f0ssel added this to the Workspace Activity Refactor milestone Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant