[SPIKE] Evaluate deprecation of project statistics increment in Git operations
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=473689) </details> <!--IssueSummary end--> ## Context The [Project statistics API](https://docs.gitlab.com/ee/api/project_statistics.html) retrieves the number of times the project is either cloned or pulled with the HTTP methods (SSH fetches are not included). Internally, every Git clone/pull operation increments the project statistics fetch counter. ## Problem Due to performance issues, the `Projects::FetchStatisticsIncrementService` was executed in every `git-upload-pack`, [leading to significant drops in the `workhorse_auth_api` Apdex](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/883). To address this, the `disable_git_http_fetch_writes` FF was created and enabled in production. However, this solution does not apply to Dedicated instances, [as feature flags are not supported on GitLab Dedicated](https://docs.gitlab.com/ee/development/enabling_features_on_dedicated.html#feature-flags). ### Incidents - https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/883 - https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/issues/2856 - https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/incident-management/-/issues/302 - https://gitlab.com/gitlab-org/gitlab/-/issues/426270 (Improve increments of `project_daily_statistics`) ## Proposal We must reevaluate the current implementation and find a solution that doesn't involve writing to the database during Git operations. Validate with the product team how relevant this API is for our users and customers. If this is still relevant: 1. As described [in this comment](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/883#note_509353562). Evaluate if we can use historical log data to return this counter instead of using our primary OLTP database as a time-series database. 2. Evaluate if we should include missing SSH fetches in the statistics. 3. What other approaches should we consider? If this is not relevant: 1. Identify how many references we have for the `ProjectDailyStatistic` model. 2. Check if this model's removal/deprecation is feasible and define the following steps needed. 3. Define the following steps to deprecate the Project statistics API. Reference: https://docs.gitlab.com/ee/development/documentation/restful_api_styleguide.html#deprecations
issue