Add usage data for the Network Policy UI
Problem to solve
As part of the removal of one-click apps (&4280), we stopped updating the associated database records. This inadvertently broke a piece of Cilium's usage metrics that relied the presence of Cilium's application record to measure usage. We need a replacement.
Details
From this discussion (internal link), the desired outcome is
[measuring] the number of clusters that are managing their Network Policies through GitLab regardless of how Cilium was installed
GitLab offers two ways to manage (Cilium) Network Policies:
- Auto DevOps, and
- A UI based policy editor
This issue is about tracking (2). Work on (1) is being tracked in #334469 (closed)
Proposal
Use redis-based usage data counters to measure usage in NetworkPoliciesController (see how we did it for Terraform states !50224 (merged))
Measure: Number of unique clusters using the page per week and per month.
- Since all interactions require loading the page, only count the page load action.
- To avoid false positives, only count if the cluster has policies.