Product Analytics Usage Quota MVC
<!-- This template is a great use for issues that are feature::additions or technical tasks for larger issues.--> ## Problem * As the person writing the check for Product Analytics, I want to see the projects contributing to the bill, so I can verify/feel good about what we're paying for. ## Proposal * Implementation of MVC as determined by the USM exercise. * Use the same SSOT that gathers events for billing - https://gitlab.com/gitlab-org/gitlab/-/issues/419408+ ### Design/Wireframe ![Product_Analytics_Usage_Quota_MVC_rough_wire_frame](/uploads/63de314e07443265c073f2a5d323c105/Product_Analytics_Usage_Quota_MVC_rough_wire_frame.png) Example design for a usage page: https://gitlab.com/gitlab-org/gitlab/-/issues/355976+s ### User Personas * Group Admins who have received a bill or will receive a bill for Product Analytics at the end of the month and want to see which projects are using the managed service. ### Use Cases to support in the MVC **Release/Iteration 1** * View each project's usage for the previous + current billing period to date on the group usage quota page - [Table issue](https://gitlab.com/gitlab-org/gitlab/-/issues/424152) - [Visualization Issue](https://gitlab.com/gitlab-org/gitlab/-/issues/424151) * Show the tab even if they do not have Product Analytics enabled for the project * Discussed using the boring solution of just show the tab and no data/CTA to enable Product Analytics in the 2023-10-18 PM/UX sync and the MR. - @jheimbuck_gl 2023-10-20 * [Richer empty state issue](https://gitlab.com/gitlab-org/gitlab/-/issues/428708) **Release/Iteration 2** * View total group usage for the previous + current billing periods to date - [Visualization issue](https://gitlab.com/gitlab-org/gitlab/-/issues/424153) * View the total group usage for the last year - [Full years usage issue](https://gitlab.com/gitlab-org/gitlab/-/issues/429312) ### Future use cases/validated in Solution Validation * Usage data on the project's usage quota page * Compare this billing period's usage to date to last billing period's to date for the group - For Example, by day 14 of the billing period are we at, ahead or below last billing period's usage? * Compare this billing period's usage to date to last billing period's to date for a specific project ### Assumptions made 1. The user who gets a bill has access to the Usage Quota page / knows where to find the page to see group/project usage. 2. The SSOT for Data will be Gitlab.com 3. It is easier/faster to get individual project data than sum up for the group 4. Historic data will be slow to query / may require additional database fields in the GitLab database ### Open Questions 1. Product - Where should this live? - Group -> Usage quota. This is where SaaS Admins look for things like Storage, CI Minutes, etc. which are generally allocated to Groups. 1. Technical - Can the data from each project be queried in a single group view? - If the usage is stored against the project then we should be able to do a relatively simple model call `Namespace > Projects > Product Analytics Usage` within the GraphQL resolver. - from [this comment](https://gitlab.com/gitlab-org/gitlab/-/issues/419407#note_1539621159) 1. Technical - Can historic project usage be queried in a single group view? - As long as we restrict the history usage to the previous billing period or another fixed time period such as `per year` this should make this query very possible and quick to do :thumbsup: - From this [comment](https://gitlab.com/gitlab-org/gitlab/-/issues/419407#note_1539621159) 1. Technical - How often does the event total need to be updated in GitLab.com from the Product Analytics Stack? 1. Product - How long is data being retained? 1. Product - When do billing months start? Is it the same for all users or unique based on purchase date? ## How will we measure success ### Feature Tracking 1. Add instrumentation for total unique users who view the usage quota page -> Product Analytics tab ### Measures of success This will be successful if 1. The graphs on the page can be rendered within 2 seconds of data selection (eg; which month to get data for) 2. 4 out of 5 customers can complete the following micro jobs in Usability testing - Figure out how many events have been processed so far this billing period - Figure out if that number is more or less than this time last billing period. - Determine how many more projects are using Product Analytics this month than last month. ### Decisions made 1. Events counted will be good events, eg; those stored in Clickhouse. Bad or discarded events will not be part of the Usage Quota screen for the MVC. <!-- Use this section to explain the feature and how it will work. It can be helpful to add technical details, design proposals, and links to related epics or issues. --> <!-- Consider adding related issues and epics to this issue. You can also reference the Feature Proposal Template (https://gitlab.com/gitlab-org/gitlab/-/blob/master/.gitlab/issue_templates/Feature%20proposal%20-%20detailed.md) for additional details to consider adding to this issue. Additionally, as a data oriented organization, when your feature exits planning breakdown, consider adding the `What does success look like, and how can we measure that?` section. --> <!-- Label reminders Use the following resources to find the appropriate labels: - Use only one tier label choosing the lowest tier this is intended for - https://gitlab.com/gitlab-org/gitlab/-/labels - https://about.gitlab.com/handbook/product/categories/features/ -->
epic