Add geo_primary_replication_events to usage data
What does this MR do?
Implements tracking for geo_primary_replication_events
in the usage ping. As described in https://gitlab.com/gitlab-data/analytics/-/issues/4460, we wish to track the total number of replication events on primary instances as one of Geo's "North Star Metrics".
Since Geo event_log records are regularly pruned, we are relying on the maximum id
of the geo_event_log
records instead of performing a count of records.
Query
SQL Query:
SELECT MAX("geo_event_log"."id") FROM "geo_event_log"
Plan from database lab:
Result (cost=0.20..0.21 rows=1 width=8) (actual time=0.027..0.027 rows=1 loops=1)
Buffers: shared hit=1
InitPlan 1 (returns $0)
-> Limit (cost=0.15..0.20 rows=1 width=8) (actual time=0.025..0.025 rows=0 loops=1)
Buffers: shared hit=1
-> Index Only Scan using geo_event_log_pkey on public.geo_event_log (cost=0.15..25.87 rows=527 width=8) (actual time=0.024..0.024 rows=0 loops=1)
Index Cond: (geo_event_log.id IS NOT NULL)
Heap Fetches: 0
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Nick Nguyen